Bug 37845

Summary: Remove C4::Members::DeleteExpiredOpacRegistrations
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Kyle M Hall (khall) <kyle>
Severity: enhancement    
Priority: P5 - low CC: kyle, lucas, m.de.rooy, phil, sukhmandeep.benipal
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 13049, 37844    
Bug Blocks: 16846    
Attachments: Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations
Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations
Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations
Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations

Description Jonathan Druart 2024-09-05 14:53:49 UTC

    
Comment 1 Jonathan Druart 2024-09-09 14:00:31 UTC
Created attachment 171201 [details] [review]
Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations

This patch remove the subroutine C4::Members::DeleteExpiredOpacRegistrations.
The code is moved and adjusted to Koha::Patrons.
We now have 2 new methods:
  Koha::Patrons->filter_by_expired_opac_registrations
  Koha::Patrons->filter_by_safe_to_delete

Test plan:
Run the misc/cronjobs/cleanup_database.pl script with the

Improve the output of the verbose mode
Tell if the something is wrong in the config (syspref not set)
Comment 2 Jonathan Druart 2024-09-09 14:05:02 UTC
Created attachment 171202 [details] [review]
Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations

This patch remove the subroutine C4::Members::DeleteExpiredOpacRegistrations.
The code is moved and adjusted to Koha::Patrons.
We now have 2 new methods:
  Koha::Patrons->filter_by_expired_opac_registrations
  Koha::Patrons->filter_by_safe_to_delete

Test plan:
Run the misc/cronjobs/cleanup_database.pl script with the
--del-exp-selfreg (as well as --verbose and --confirm) and confirm that
it behaves as expected

Note that it improve the output of the verbose mode and now tell if the something
is wrong with the config (syspref not set)
Comment 3 Jonathan Druart 2024-09-10 07:36:58 UTC
(In reply to Jonathan Druart from comment #2)
> Test plan:
> Run the misc/cronjobs/cleanup_database.pl script with the
> --del-exp-selfreg (as well as --verbose and --confirm) and confirm that
> it behaves as expected

I should have noted that there is a behaviour change here. Prior to this patch we only tested if the patron had checkouts and an account balance. Now we are relying on Koha::Patron->safe_to_delete that is doing much more tests (not anonymous patron, not protected, not a guarantor). That should not happen for self registration entries anyway, but this is a better test IMO.
Comment 4 Sukhmandeep 2024-09-26 17:58:37 UTC
Created attachment 171999 [details] [review]
Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations

This patch remove the subroutine C4::Members::DeleteExpiredOpacRegistrations.
The code is moved and adjusted to Koha::Patrons.
We now have 2 new methods:
  Koha::Patrons->filter_by_expired_opac_registrations
  Koha::Patrons->filter_by_safe_to_delete

Test plan:
Run the misc/cronjobs/cleanup_database.pl script with the
--del-exp-selfreg (as well as --verbose and --confirm) and confirm that
it behaves as expected

Note that it improve the output of the verbose mode and now tell if the something
is wrong with the config (syspref not set)

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Comment 5 Kyle M Hall (khall) 2024-09-26 18:46:48 UTC
Created attachment 172015 [details] [review]
Bug 37845: Remove C4::Members::DeleteExpiredOpacRegistrations

This patch remove the subroutine C4::Members::DeleteExpiredOpacRegistrations.
The code is moved and adjusted to Koha::Patrons.
We now have 2 new methods:
  Koha::Patrons->filter_by_expired_opac_registrations
  Koha::Patrons->filter_by_safe_to_delete

Test plan:
Run the misc/cronjobs/cleanup_database.pl script with the
--del-exp-selfreg (as well as --verbose and --confirm) and confirm that
it behaves as expected

Note that it improve the output of the verbose mode and now tell if the something
is wrong with the config (syspref not set)

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Katrin Fischer 2024-10-21 13:12:47 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 7 Lucas Gass (lukeg) 2024-11-18 23:02:03 UTC
Enhancement, no 24.05.x backport