If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121.
Created attachment 56999 [details] [review] Bug 17522 - opac-user.pl gives error of OpacRenewalAllowed is enabled If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. Test Plan: 1) Check out an item for a patron 2) Enable OpacRenewalAllowed 3) Log in as that patron, go to opac-user.pl 4) Note the error 5) Apply this patch 6) Reload opac-user.pl 7) Page should now load!
*** Bug 17517 has been marked as a duplicate of this bug. ***
I think the patch is not correct: [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && Koha.Preference('BlockExpiredPatronOpacActions') ) ) %] will only check the preference, but this works differently. The preference is only the default, that can be overwritten by patron category.
Created attachment 57047 [details] [review] Bug 17522 - opac-user.pl gives error of OpacRenewalAllowed is enabled If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. Test Plan: 1) Check out an item for a patron 2) Enable OpacRenewalAllowed 3) Log in as that patron, go to opac-user.pl 4) Note the error 5) Apply this patch 6) Reload opac-user.pl 7) Page should now load!
Created attachment 57048 [details] [review] Bug 17522 - opac-user.pl gives error of OpacRenewalAllowed is enabled If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. Test Plan: 1) Check out an item for a patron 2) Enable OpacRenewalAllowed 3) Log in as that patron, go to opac-user.pl 4) Note the error 5) Apply this patch 6) Reload opac-user.pl 7) Page should now load!
Comment on attachment 57048 [details] [review] Bug 17522 - opac-user.pl gives error of OpacRenewalAllowed is enabled Review of attachment 57048 [details] [review]: ----------------------------------------------------------------- ::: Koha/Patron.pm @@ +467,5 @@ > +=head3 should_block_expired_patron_opac_actions > + > +=cut > + > +sub should_block_expired_patron_opac_actions { It sounds to me that this method should actually override Koha::Patron::Category->BlockExpiredPatronOpacActions, don't you think?
Created attachment 57102 [details] [review] Bug 17522 - opac-user.pl gives error of OpacRenewalAllowed is enabled If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. Test Plan: 1) Check out an item for a patron 2) Enable OpacRenewalAllowed 3) Log in as that patron, go to opac-user.pl 4) Note the error 5) Apply this patch 6) Reload opac-user.pl 7) Page should now load! Problem reproduced, patch fixes it. Signing off to move it forward. However see comment #6 for QA Signed-off-by: Marc Véron <veron@veron.ch>
(In reply to Jonathan Druart from comment #6) > Comment on attachment 57048 [details] [review] [review] > Bug 17522 - opac-user.pl gives error of OpacRenewalAllowed is enabled > > Review of attachment 57048 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: Koha/Patron.pm > @@ +467,5 @@ > > +=head3 should_block_expired_patron_opac_actions > > + > > +=cut > > + > > +sub should_block_expired_patron_opac_actions { > > It sounds to me that this method should actually override > Koha::Patron::Category->BlockExpiredPatronOpacActions, don't you think? This is waiting for an answer.
Also note that Koha::Patron->is_expired is added by bug 17579. It is much more robust and covered by tests than the one provided in this patch.
(In reply to Jonathan Druart from comment #8) > (In reply to Jonathan Druart from comment #6) > > It sounds to me that this method should actually override > > Koha::Patron::Category->BlockExpiredPatronOpacActions, don't you think? > > This is waiting for an answer. This has been done on bug 17578.
Jonathan, what are your suggested next steps? Not sure I understand the different dependencies.
Caused by bug 14610. I am going to propose a way to fix this.
Created attachment 57414 [details] [review] Bug 17522: Fix opac-user.pl if OpacRenewalAllowed is set This patch fixes a bug added by commit 81a04af27804621609004dc370284413baa5caa2 Bug 14610 - Add and update scripts If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. The is_expired and BlockExpiredPatronOpacActions methods did not exist for the Koha::Patron object. These 2 values were returned by GetMemberDetails. To fix this, we need bug 17579 which introduces the Koha::Patron->is_expired method and also bug 17604 for the Koha::Patron->effective_BlockExpiredPatronOpacActions. Test Plan: 1) Check out an item for a patron 2) Enable OpacRenewalAllowed 3) Log in as that patron, go to opac-user.pl 4) Note the error 5) Apply this patch 6) Reload opac-user.pl 7) Page should now load!
% git log --oneline 25b6a92 Bug 17522: Fix opac-user.pl if OpacRenewalAllowed is set 2da5f21 Bug 17604: GetMemberDetails - Add Koha::Patron::Category->effective_BlockExpiredPatronOpacActions 2c69552 Bug 17555: Add Koha::Patron->category aafa890 Bug 17579: Make sure we are testing the real life ea99ecd Bug 17579: Add the Koha::Patron->is_expired 56baeb1 Bug 17594: Make Koha::Object->discard_changes available
Koha::Patron->effective_BlockExpiredPatronOpacActions ? Nice ;)
Created attachment 57415 [details] [review] Bug 17522: Fix opac-user.pl if OpacRenewalAllowed is set This patch fixes a bug added by commit 81a04af27804621609004dc370284413baa5caa2 Bug 14610 - Add and update scripts If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. The is_expired and BlockExpiredPatronOpacActions methods did not exist for the Koha::Patron object. These 2 values were returned by GetMemberDetails. To fix this, we need bug 17579 which introduces the Koha::Patron->is_expired method and also bug 17604 for the Koha::Patron->effective_BlockExpiredPatronOpacActions. Test Plan: 1) Check out an item for a patron 2) Enable OpacRenewalAllowed 3) Log in as that patron, go to opac-user.pl 4) Note the error 5) Apply this patch 6) Reload opac-user.pl 7) Page should now load!
(In reply to Marcel de Rooy from comment #15) > Koha::Patron->effective_BlockExpiredPatronOpacActions ? > Nice ;) Oops, it's Koha::Patron::Category->effective_BlockExpiredPatronOpacActions indeed. I am tired of dependencies...
Created attachment 57478 [details] [review] [SIGNED-OFF] Bug 17522: Fix opac-user.pl if OpacRenewalAllowed is set This patch fixes a bug added by commit 81a04af27804621609004dc370284413baa5caa2 Bug 14610 - Add and update scripts If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. The is_expired and BlockExpiredPatronOpacActions methods did not exist for the Koha::Patron object. These 2 values were returned by GetMemberDetails. To fix this, we need bug 17579 which introduces the Koha::Patron->is_expired method and also bug 17604 for the Koha::Patron->effective_BlockExpiredPatronOpacActions. Test Plan: 1) Check out an item for a patron 2) Enable OpacRenewalAllowed 3) Log in as that patron, go to opac-user.pl 4) Note the error 5) Apply this patch 6) Reload opac-user.pl 7) Page should now load! Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 57505 [details] [review] Bug 17522: Fix opac-user.pl if OpacRenewalAllowed is set This patch fixes a bug added by commit 81a04af27804621609004dc370284413baa5caa2 Bug 14610 - Add and update scripts If OpacRenewalAllowed is enabled, the following error message is displayed: Template process failed: undef error - The method is_expired is not covered by tests! at /home/vagrant/kohaclone/C4/Templates.pm line 121. The is_expired and BlockExpiredPatronOpacActions methods did not exist for the Koha::Patron object. These 2 values were returned by GetMemberDetails. To fix this, we need bug 17579 which introduces the Koha::Patron->is_expired method and also bug 17604 for the Koha::Patron->effective_BlockExpiredPatronOpacActions. Test Plan: 1) Check out an item for a patron 2) Enable OpacRenewalAllowed 3) Log in as that patron, go to opac-user.pl 4) Note the error 5) Apply this patch 6) Reload opac-user.pl 7) Page should now load! Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 16.11, thanks Jonathan!
Blocked by new-feature, skipping for 16.05.x