[Bug 41020] New: Add ability to use file transports for marc ordering accounts
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Bug ID: 41020 Summary: Add ability to use file transports for marc ordering accounts Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |39190 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39190 [Bug 39190] Rework new (S)FTP classes to be polymorphic classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=38489 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187931 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187931&action=edit Bug 41020: Add ability to delete files to Koha::File::Transport and derived classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187931|0 |1 is obsolete| | --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187932 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187932&action=edit Bug 41020: Add ability to delete files to Koha::File::Transport and derived classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187933 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187933&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187934 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187934&action=edit Bug 41020: Update schema files [DO NOT PUSH] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187932|0 |1 is obsolete| | --- Comment #5 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187935 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187935&action=edit Bug 41020: Add ability to delete files to Koha::File::Transport and derived classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187935|0 |1 is obsolete| | --- Comment #6 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187936&action=edit Bug 41020: Add ability to delete files to Koha::File::Transport and derived classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187933|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187937&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187934|0 |1 is obsolete| | --- Comment #8 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187938&action=edit Bug 41020: Update schema files [DO NOT PUSH] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187936|0 |1 is obsolete| | --- Comment #9 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187939&action=edit Bug 41020: Add ability to delete files to Koha::File::Transport and derived classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187939|0 |1 is obsolete| | --- Comment #10 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187940&action=edit Bug 41020: Add ability to delete files to Koha::File::Transport and derived classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187937|0 |1 is obsolete| | --- Comment #11 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187941&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187938|0 |1 is obsolete| | --- Comment #12 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 187942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187942&action=edit Bug 41020: Update schema files [DO NOT PUSH] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #13 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Comment on attachment 187941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187941 Bug 41020: Add ability to use file transports for marc ordering accounts Review of attachment 187941: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=41020&attachment=187941) ----------------------------------------------------------------- Generally looks good, couple of minor queries of why we took a few shortcuts ;) ::: admin/marc_order_accounts.pl @@ +61,5 @@
my @matchers = C4::Matcher::GetMatcherList(); $template->param( available_matchers => \@matchers );
+ # Get available file transports for selection + my @file_transports = $schema->resultset('FileTransport')->search(
Was it intentional to use DBIC directly instead of doing a Koha::File::Transports->search() call? ::: misc/cronjobs/marc_ordering_process.pl @@ +111,5 @@
}
my $working_dir = $acct->download_directory; + + my $file_transport = $acct->file_transport_id ? Koha::File::Transports->find( $acct->file_transport_id ) : undef;
Any reason to do this here rather than introducing a 'transport' relation accessor to give you back a Koha::File::Transport object directly if one exists? i.e. why in the script not the object as a relation? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #14 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188012 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188012&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #15 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188013 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188013&action=edit Bug 41020: Update FTP.pm _abort_operation prototype to match SFTP.pm Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #16 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188014 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188014&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #17 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188015 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188015&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #18 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188016 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188016&action=edit Bug 41020: Update FTP.pm _abort_operation prototype to match SFTP.pm Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #19 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188017 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188017&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #20 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188018 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188018&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #21 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187940|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187941|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187942|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188012|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188013|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188014|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188015|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |40811 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40811 [Bug 40811] Enhance Koha::File::Transport API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #22 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188030 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188030&action=edit Bug 41020: Add ability to delete files to Koha::File::Transport and derived classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188030|0 |1 is obsolete| | --- Comment #23 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188031 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188031&action=edit Bug 41020: Add ability to delete files to Koha::File::Transport and derived classes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188016|0 |1 is obsolete| | --- Comment #24 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188032 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188032&action=edit Bug 41020: Update FTP.pm _abort_operation prototype to match SFTP.pm Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188017|0 |1 is obsolete| | --- Comment #25 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188033 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188033&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188018|0 |1 is obsolete| | --- Comment #26 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188034&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: John Doe <you@example.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41050 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41050 [Bug 41050] Add ability to archive orders processed for marc ordering accounts -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #27 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188146 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188146&action=edit Bug 41020: Add delete_file() method to file transport classes This patch adds the ability to delete files from remote servers through the file transport API. This is needed for the MARC ordering feature to clean up processed files from FTP/SFTP servers. Changes: - Added abstract delete_file() method to Koha::File::Transport base class - Implemented delete_file() in Koha::File::Transport::FTP using Net::FTP->delete() - Implemented delete_file() in Koha::File::Transport::SFTP using Net::SFTP::Foreign->remove() - Implemented delete_file() in Koha::File::Transport::Local using unlink() - All implementations follow the standard message/error handling pattern - Updated polymorphic tests to verify delete_file() capability The delete_file() method: - Takes a filename as parameter (relative to current directory) - Returns true on success, undef on failure - Adds appropriate success/error messages to the transport message queue - Follows the same pattern as existing methods (download_file, rename_file) Test plan: 1. prove t/db_dependent/Koha/File/Transports.t 2. Verify all transport types support delete_file() 3. Test with MARC ordering cronjob using --dr flag (added in main patch) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #28 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188147 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188147&action=edit Bug 41020: Standardize _abort_operation() signature in FTP transport This patch updates Koha::File::Transport::FTP::_abort_operation() to accept an optional $path parameter, matching the signature used in Koha::File::Transport::SFTP. This improves error reporting by including the path/file that caused the operation to fail in the error message payload. Previously, the FTP implementation only included the error detail and message, making it harder to debug which file or directory caused the problem. Changes: - Updated _abort_operation($operation) to _abort_operation($operation, $path) - Updated change_directory() call to pass $remote_directory to _abort_operation - Added path to error payload, using either the passed path or pwd() as fallback This standardization ensures consistent error reporting across all transport implementations and makes debugging transport issues easier. Test plan: 1. Verify FTP transport operations still work correctly 2. Check that error messages now include the path that failed 3. Confirm no regressions in existing FTP functionality Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188033|0 |1 is obsolete| | --- Comment #29 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188148 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188148&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188034|0 |1 is obsolete| | --- Comment #30 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188149 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188149&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #31 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188150 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188150&action=edit Bug 41020: (follow-up) Modernize code to use Koha objects and relationship accessors This follow-up improves the code to better follow Koha best practices: 1. Added file_transport() relationship accessor to Koha::MarcOrderAccount - Returns the correct polymorphic subclass (SFTP, FTP, or Local) - Respects prefetched relationships to avoid N+1 queries - Follows the same pattern as vendor() and budget() accessors 2. Updated admin/marc_order_accounts.pl to use Koha::File::Transports - Replaced direct DBIx::Class schema access with Koha objects - Removed unused $schema variable 3. Updated misc/cronjobs/marc_ordering_process.pl - Changed manual transport lookup to use the new relationship accessor - Cleaner code that can benefit from prefetching 4. Added unit tests (t/db_dependent/Koha/MarcOrderAccount.t) - Tests for all relationship accessors (vendor, budget, file_transport) - Verifies polymorphism works correctly for all transport types - Includes test demonstrating that prefetched relationships don't trigger additional database queries Test plan: 1. prove t/db_dependent/Koha/MarcOrderAccount.t 2. Verify all tests pass 3. Run marc_ordering_process.pl cronjob and verify it still works Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188031|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188032|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188146|0 |1 is obsolete| | --- Comment #32 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188153 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188153&action=edit Bug 41020: Add delete_file() method to file transport classes This patch adds the ability to delete files from remote servers through the file transport API. This is needed for the MARC ordering feature to clean up processed files from FTP/SFTP servers. Changes: - Added abstract delete_file() method to Koha::File::Transport base class - Implemented delete_file() in Koha::File::Transport::FTP using Net::FTP->delete() - Implemented delete_file() in Koha::File::Transport::SFTP using Net::SFTP::Foreign->remove() - Implemented delete_file() in Koha::File::Transport::Local using unlink() - All implementations follow the standard message/error handling pattern - Updated polymorphic tests to verify delete_file() capability The delete_file() method: - Takes a filename as parameter (relative to current directory) - Returns true on success, undef on failure - Adds appropriate success/error messages to the transport message queue - Follows the same pattern as existing methods (download_file, rename_file) Test plan: 1. prove t/db_dependent/Koha/File/Transports.t 2. Verify all transport types support delete_file() 3. Test with MARC ordering cronjob using --dr flag (added in main patch) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188147|0 |1 is obsolete| | --- Comment #33 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188154 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188154&action=edit Bug 41020: Standardize _abort_operation() signature in FTP transport This patch updates Koha::File::Transport::FTP::_abort_operation() to accept an optional $path parameter, matching the signature used in Koha::File::Transport::SFTP. This improves error reporting by including the path/file that caused the operation to fail in the error message payload. Previously, the FTP implementation only included the error detail and message, making it harder to debug which file or directory caused the problem. Changes: - Updated _abort_operation($operation) to _abort_operation($operation, $path) - Updated change_directory() call to pass $remote_directory to _abort_operation - Added path to error payload, using either the passed path or pwd() as fallback This standardization ensures consistent error reporting across all transport implementations and makes debugging transport issues easier. Test plan: 1. Verify FTP transport operations still work correctly 2. Check that error messages now include the path that failed 3. Confirm no regressions in existing FTP functionality Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188148|0 |1 is obsolete| | --- Comment #34 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188155 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188155&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188149|0 |1 is obsolete| | --- Comment #35 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188156&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188150|0 |1 is obsolete| | --- Comment #36 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 188157 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188157&action=edit Bug 41020: (follow-up) Modernize code to use Koha objects and relationship accessors This follow-up improves the code to better follow Koha best practices: 1. Added file_transport() relationship accessor to Koha::MarcOrderAccount - Returns the correct polymorphic subclass (SFTP, FTP, or Local) - Respects prefetched relationships to avoid N+1 queries - Follows the same pattern as vendor() and budget() accessors 2. Updated admin/marc_order_accounts.pl to use Koha::File::Transports - Replaced direct DBIx::Class schema access with Koha objects - Removed unused $schema variable 3. Updated misc/cronjobs/marc_ordering_process.pl - Changed manual transport lookup to use the new relationship accessor - Cleaner code that can benefit from prefetching 4. Added unit tests (t/db_dependent/Koha/MarcOrderAccount.t) - Tests for all relationship accessors (vendor, budget, file_transport) - Verifies polymorphism works correctly for all transport types - Includes test demonstrating that prefetched relationships don't trigger additional database queries Test plan: 1. prove t/db_dependent/Koha/MarcOrderAccount.t 2. Verify all tests pass 3. Run marc_ordering_process.pl cronjob and verify it still works Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|martin.renvoize@openfifth.c |tomascohen@gmail.com |o.uk | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add ability to use file |Add ability to use file |transports for marc |transports for MARC |ordering accounts |ordering accounts -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #37 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 1) QA checks - failing Processing additional checks * Author 'John Doe' seems invalid * Author 'John Doe' seems invalid * Email's author 'you@example.com' seems invalid * Email's author 'you@example.com' seems invalid This is not visible in git/tig as we do have mappings for John Doe to Kyle. Still might worth fixing in case it's sometime not Kyle :) Other checks and unit tests are passing. 2) Database update - missing say_success (consistency) - Doesn't use BEFORE/AFTER. It's added as last column to the end of the table and it's unlikely to be backported, so this might be a non-issue here. 3) Permission checks (question/suggestion) We could add a permission check here, but not sure if it's needed: + <div class="hint"> Select a file transport configuration for this EDI account. File transports can be managed in <a href="/cgi-bin/koha/admin/file_transports.pl">Administration › File transports</a>. </div> 3) Testing Did somewhat limited testing, but trying to give this a push. Maybe Tomas can finish off here when he is back? (see QA contact). a) Administration > MARC order accounts - OK can be saved without file transfer set - OK can be saved with file transfer set - Seems all good. b) Cron job I was wondering: When setting up the file transport you configure a path for the upload and download of files. But it looks like the MARC order accounts might not be using it. I left "Download directory" empty in the MARC order account. Test run only Fetching MARC ordering accounts Starting MARC ordering process for My Vendor Looking for new files in Can't open filepath at ./marc_ordering_process.pl line 159. Got a bit stuck here missing a file to use. If you could provide one and a bit more detailed test plan, i am happy to continue here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #38 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 195487 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195487&action=edit Bug 41020: (QA follow-up) Use say_success Patch from commit f6b3971 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #39 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 195488 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195488&action=edit Bug 41020: (QA follow-up) Use AFTER in db update Patch from commit 66abacd -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195488|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #40 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #37)
1) QA checks - failing
These don't seem to be related to this patch set!
2) Database update
- missing say_success (consistency)
Fixed
- Doesn't use BEFORE/AFTER. It's added as last column to the end of the table and it's unlikely to be backported, so this might be a non-issue here.
Appears to be fixed already
3) Permission checks (question/suggestion)
Fixed!
3) Testing
Did somewhat limited testing, but trying to give this a push. Maybe Tomas can finish off here when he is back? (see QA contact).
I also did some testing on this by installing sshd in KTD and using the sftp option.
b) Cron job
I was wondering: When setting up the file transport you configure a path for the upload and download of files. But it looks like the MARC order accounts might not be using it. I left "Download directory" empty in the MARC order account.
Download dir specifies where on the server to look for files. I will file a separate bug that enables the pre-existing Local transport option and migrates the download_directory to a local file transport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #41 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 195493 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195493&action=edit Bug 41020: (QA follow-up) Check permission, fix EDI => Marc order account Patch from commit 520e904 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42110 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42110 [Bug 42110] Migrate marc_order_accounts.download_directory to use local file transport option -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188153|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188154|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188155|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188156|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188157|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195487|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195493|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #42 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195510 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195510&action=edit Bug 41020: Add delete_file() method to file transport classes This patch adds the ability to delete files from remote servers through the file transport API. This is needed for the MARC ordering feature to clean up processed files from FTP/SFTP servers. Changes: - Added abstract delete_file() method to Koha::File::Transport base class - Implemented delete_file() in Koha::File::Transport::FTP using Net::FTP->delete() - Implemented delete_file() in Koha::File::Transport::SFTP using Net::SFTP::Foreign->remove() - Implemented delete_file() in Koha::File::Transport::Local using unlink() - All implementations follow the standard message/error handling pattern - Updated polymorphic tests to verify delete_file() capability The delete_file() method: - Takes a filename as parameter (relative to current directory) - Returns true on success, undef on failure - Adds appropriate success/error messages to the transport message queue - Follows the same pattern as existing methods (download_file, rename_file) Test plan: 1. prove t/db_dependent/Koha/File/Transports.t 2. Verify all transport types support delete_file() 3. Test with MARC ordering cronjob using --dr flag (added in main patch) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #43 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195511&action=edit Bug 41020: Standardize _abort_operation() signature in FTP transport This patch updates Koha::File::Transport::FTP::_abort_operation() to accept an optional $path parameter, matching the signature used in Koha::File::Transport::SFTP. This improves error reporting by including the path/file that caused the operation to fail in the error message payload. Previously, the FTP implementation only included the error detail and message, making it harder to debug which file or directory caused the problem. Changes: - Updated _abort_operation($operation) to _abort_operation($operation, $path) - Updated change_directory() call to pass $remote_directory to _abort_operation - Added path to error payload, using either the passed path or pwd() as fallback This standardization ensures consistent error reporting across all transport implementations and makes debugging transport issues easier. Test plan: 1. Verify FTP transport operations still work correctly 2. Check that error messages now include the path that failed 3. Confirm no regressions in existing FTP functionality Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #44 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195512 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195512&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #45 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195513 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195513&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #46 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195514 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195514&action=edit Bug 41020: (follow-up) Modernize code to use Koha objects and relationship accessors This follow-up improves the code to better follow Koha best practices: 1. Added file_transport() relationship accessor to Koha::MarcOrderAccount - Returns the correct polymorphic subclass (SFTP, FTP, or Local) - Respects prefetched relationships to avoid N+1 queries - Follows the same pattern as vendor() and budget() accessors 2. Updated admin/marc_order_accounts.pl to use Koha::File::Transports - Replaced direct DBIx::Class schema access with Koha objects - Removed unused $schema variable 3. Updated misc/cronjobs/marc_ordering_process.pl - Changed manual transport lookup to use the new relationship accessor - Cleaner code that can benefit from prefetching 4. Added unit tests (t/db_dependent/Koha/MarcOrderAccount.t) - Tests for all relationship accessors (vendor, budget, file_transport) - Verifies polymorphism works correctly for all transport types - Includes test demonstrating that prefetched relationships don't trigger additional database queries Test plan: 1. prove t/db_dependent/Koha/MarcOrderAccount.t 2. Verify all tests pass 3. Run marc_ordering_process.pl cronjob and verify it still works Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #47 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195515&action=edit Bug 41020: (QA follow-up) Use say_success Patch from commit 2ce7cac -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #48 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195516&action=edit Bug 41020: (QA follow-up) Check permission, fix EDI => Marc order account Patch from commit 2923756 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #49 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195517 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195517&action=edit Bug 41020: (QA follow-up) Fix FTP crash and guard remote ops with --confirm _abort_operation() crashed when both $path and $self->{connection} were undef (e.g. on a failed Net::FTP->new call), because the fallback expression called ->pwd on undef. Remote file transport operations (connect, download, delete/rename on remote) were not guarded by the --confirm flag, causing them to run in dry-run mode. All transport operations now require --confirm. Error/ failure messages from the transport block now also respect --verbose. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #50 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195518 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195518&action=edit Bug 41020: (QA follow-up) Fix kohastructure.sql for file_transport_id column Add missing explicit KEY index for file_transport_id, consistent with the style used for vendor_edi_accounts. Add missing COMMENT annotation for the new column, consistent with all other columns in the table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #51 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195519 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195519&action=edit Bug 41020: (QA follow-up) Fix POD errors in marc_ordering_process.pl - Fix unbalanced bracket in SYNOPSIS: [--rr|--rename-remote ext] - Fix item name typo: rename-remove => rename-remote, -rr => --rr - Update DESCRIPTION to mention local/FTP/SFTP transports, fix typo 'bilbios' => 'bibliographic records' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #52 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195520 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195520&action=edit Bug 41020: (QA follow-up) Call object_class() as a class method object_class(), _polymorphic_field() and _polymorphic_map() use no instance state, so there is no need to instantiate Koha::File::Transports just to call object_class(). Call it directly as a class method. Also update the pod to mention Local transport alongside SFTP/FTP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #53 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195521 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195521&action=edit Bug 41020: (QA follow-up) Fix same _abort_operation crash in SFTP transport Same fix as applied to FTP: guard the ->cwd fallback with a connection check so that a missing $path argument doesn't crash when $connection is undef. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195510|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195511|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195512|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195513|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195514|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195515|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195516|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195517|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195518|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195519|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195520|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195521|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #54 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195526&action=edit Bug 41020: Add delete_file() method to file transport classes This patch adds the ability to delete files from remote servers through the file transport API. This is needed for the MARC ordering feature to clean up processed files from FTP/SFTP servers. Changes: - Added abstract delete_file() method to Koha::File::Transport base class - Implemented delete_file() in Koha::File::Transport::FTP using Net::FTP->delete() - Implemented delete_file() in Koha::File::Transport::SFTP using Net::SFTP::Foreign->remove() - Implemented delete_file() in Koha::File::Transport::Local using unlink() - All implementations follow the standard message/error handling pattern - Updated polymorphic tests to verify delete_file() capability The delete_file() method: - Takes a filename as parameter (relative to current directory) - Returns true on success, undef on failure - Adds appropriate success/error messages to the transport message queue - Follows the same pattern as existing methods (download_file, rename_file) Test plan: 1. prove t/db_dependent/Koha/File/Transports.t 2. Verify all transport types support delete_file() 3. Test with MARC ordering cronjob using --dr flag (added in main patch) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #55 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195527 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195527&action=edit Bug 41020: Standardize _abort_operation() signature in FTP transport This patch updates Koha::File::Transport::FTP::_abort_operation() to accept an optional $path parameter, matching the signature used in Koha::File::Transport::SFTP. This improves error reporting by including the path/file that caused the operation to fail in the error message payload. Previously, the FTP implementation only included the error detail and message, making it harder to debug which file or directory caused the problem. Changes: - Updated _abort_operation($operation) to _abort_operation($operation, $path) - Updated change_directory() call to pass $remote_directory to _abort_operation - Added path to error payload, using either the passed path or pwd() as fallback This standardization ensures consistent error reporting across all transport implementations and makes debugging transport issues easier. Test plan: 1. Verify FTP transport operations still work correctly 2. Check that error messages now include the path that failed 3. Confirm no regressions in existing FTP functionality Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #56 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195528 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195528&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #57 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195529 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195529&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #58 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195530 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195530&action=edit Bug 41020: (follow-up) Modernize code to use Koha objects and relationship accessors This follow-up improves the code to better follow Koha best practices: 1. Added file_transport() relationship accessor to Koha::MarcOrderAccount - Returns the correct polymorphic subclass (SFTP, FTP, or Local) - Respects prefetched relationships to avoid N+1 queries - Follows the same pattern as vendor() and budget() accessors 2. Updated admin/marc_order_accounts.pl to use Koha::File::Transports - Replaced direct DBIx::Class schema access with Koha objects - Removed unused $schema variable 3. Updated misc/cronjobs/marc_ordering_process.pl - Changed manual transport lookup to use the new relationship accessor - Cleaner code that can benefit from prefetching 4. Added unit tests (t/db_dependent/Koha/MarcOrderAccount.t) - Tests for all relationship accessors (vendor, budget, file_transport) - Verifies polymorphism works correctly for all transport types - Includes test demonstrating that prefetched relationships don't trigger additional database queries Test plan: 1. prove t/db_dependent/Koha/MarcOrderAccount.t 2. Verify all tests pass 3. Run marc_ordering_process.pl cronjob and verify it still works Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #59 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195531 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195531&action=edit Bug 41020: (QA follow-up) Use say_success Patch from commit 2ce7cac -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #60 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195532 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195532&action=edit Bug 41020: (QA follow-up) Check permission, fix EDI => Marc order account Patch from commit 2923756 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #61 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195533&action=edit Bug 41020: (QA follow-up) Fix FTP crash and guard remote ops with --confirm _abort_operation() crashed when both $path and $self->{connection} were undef (e.g. on a failed Net::FTP->new call), because the fallback expression called ->pwd on undef. Remote file transport operations (connect, download, delete/rename on remote) were not guarded by the --confirm flag, causing them to run in dry-run mode. All transport operations now require --confirm. Error/ failure messages from the transport block now also respect --verbose. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #62 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195534 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195534&action=edit Bug 41020: (QA follow-up) Fix kohastructure.sql for file_transport_id column Add missing explicit KEY index for file_transport_id, consistent with the style used for vendor_edi_accounts. Add missing COMMENT annotation for the new column, consistent with all other columns in the table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #63 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195535 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195535&action=edit Bug 41020: (QA follow-up) Fix POD errors in marc_ordering_process.pl - Fix unbalanced bracket in SYNOPSIS: [--rr|--rename-remote ext] - Fix item name typo: rename-remove => rename-remote, -rr => --rr - Update DESCRIPTION to mention local/FTP/SFTP transports, fix typo 'bilbios' => 'bibliographic records' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #64 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195536 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195536&action=edit Bug 41020: (QA follow-up) Call object_class() as a class method object_class(), _polymorphic_field() and _polymorphic_map() use no instance state, so there is no need to instantiate Koha::File::Transports just to call object_class(). Call it directly as a class method. Also update the pod to mention Local transport alongside SFTP/FTP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #65 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 195537 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195537&action=edit Bug 41020: (QA follow-up) Fix same _abort_operation crash in SFTP transport Same fix as applied to FTP: guard the ->cwd fallback with a connection check so that a missing $path argument doesn't crash when $connection is undef. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195526|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195527|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195528|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195529|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195530|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195531|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195532|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195533|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195534|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195535|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195536|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195537|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #66 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199179 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199179&action=edit Bug 41020: Add delete_file() method to file transport classes This patch adds the ability to delete files from remote servers through the file transport API. This is needed for the MARC ordering feature to clean up processed files from FTP/SFTP servers. Changes: - Added abstract delete_file() method to Koha::File::Transport base class - Implemented delete_file() in Koha::File::Transport::FTP using Net::FTP->delete() - Implemented delete_file() in Koha::File::Transport::SFTP using Net::SFTP::Foreign->remove() - Implemented delete_file() in Koha::File::Transport::Local using unlink() - All implementations follow the standard message/error handling pattern - Updated polymorphic tests to verify delete_file() capability The delete_file() method: - Takes a filename as parameter (relative to current directory) - Returns true on success, undef on failure - Adds appropriate success/error messages to the transport message queue - Follows the same pattern as existing methods (download_file, rename_file) Test plan: 1. prove t/db_dependent/Koha/File/Transports.t 2. Verify all transport types support delete_file() 3. Test with MARC ordering cronjob using --dr flag (added in main patch) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #67 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199180 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199180&action=edit Bug 41020: Standardize _abort_operation() signature in FTP transport This patch updates Koha::File::Transport::FTP::_abort_operation() to accept an optional $path parameter, matching the signature used in Koha::File::Transport::SFTP. This improves error reporting by including the path/file that caused the operation to fail in the error message payload. Previously, the FTP implementation only included the error detail and message, making it harder to debug which file or directory caused the problem. Changes: - Updated _abort_operation($operation) to _abort_operation($operation, $path) - Updated change_directory() call to pass $remote_directory to _abort_operation - Added path to error payload, using either the passed path or pwd() as fallback This standardization ensures consistent error reporting across all transport implementations and makes debugging transport issues easier. Test plan: 1. Verify FTP transport operations still work correctly 2. Check that error messages now include the path that failed 3. Confirm no regressions in existing FTP functionality Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #68 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199181 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199181&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #69 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199182 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199182&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #70 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199183 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199183&action=edit Bug 41020: (follow-up) Modernize code to use Koha objects and relationship accessors This follow-up improves the code to better follow Koha best practices: 1. Added file_transport() relationship accessor to Koha::MarcOrderAccount - Returns the correct polymorphic subclass (SFTP, FTP, or Local) - Respects prefetched relationships to avoid N+1 queries - Follows the same pattern as vendor() and budget() accessors 2. Updated admin/marc_order_accounts.pl to use Koha::File::Transports - Replaced direct DBIx::Class schema access with Koha objects - Removed unused $schema variable 3. Updated misc/cronjobs/marc_ordering_process.pl - Changed manual transport lookup to use the new relationship accessor - Cleaner code that can benefit from prefetching 4. Added unit tests (t/db_dependent/Koha/MarcOrderAccount.t) - Tests for all relationship accessors (vendor, budget, file_transport) - Verifies polymorphism works correctly for all transport types - Includes test demonstrating that prefetched relationships don't trigger additional database queries Test plan: 1. prove t/db_dependent/Koha/MarcOrderAccount.t 2. Verify all tests pass 3. Run marc_ordering_process.pl cronjob and verify it still works Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #71 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199184 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199184&action=edit Bug 41020: (QA follow-up) Use say_success Patch from commit 0d22fca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #72 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199185 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199185&action=edit Bug 41020: (QA follow-up) Check permission, fix EDI => Marc order account Patch from commit fee883d -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #73 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199186 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199186&action=edit Bug 41020: (QA follow-up) Fix FTP crash and guard remote ops with --confirm _abort_operation() crashed when both $path and $self->{connection} were undef (e.g. on a failed Net::FTP->new call), because the fallback expression called ->pwd on undef. Remote file transport operations (connect, download, delete/rename on remote) were not guarded by the --confirm flag, causing them to run in dry-run mode. All transport operations now require --confirm. Error/ failure messages from the transport block now also respect --verbose. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #74 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199187 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199187&action=edit Bug 41020: (QA follow-up) Fix kohastructure.sql for file_transport_id column Add missing explicit KEY index for file_transport_id, consistent with the style used for vendor_edi_accounts. Add missing COMMENT annotation for the new column, consistent with all other columns in the table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #75 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199188 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199188&action=edit Bug 41020: (QA follow-up) Fix POD errors in marc_ordering_process.pl - Fix unbalanced bracket in SYNOPSIS: [--rr|--rename-remote ext] - Fix item name typo: rename-remove => rename-remote, -rr => --rr - Update DESCRIPTION to mention local/FTP/SFTP transports, fix typo 'bilbios' => 'bibliographic records' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #76 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199189 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199189&action=edit Bug 41020: (QA follow-up) Call object_class() as a class method object_class(), _polymorphic_field() and _polymorphic_map() use no instance state, so there is no need to instantiate Koha::File::Transports just to call object_class(). Call it directly as a class method. Also update the pod to mention Local transport alongside SFTP/FTP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #77 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 199190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199190&action=edit Bug 41020: (QA follow-up) Fix same _abort_operation crash in SFTP transport Same fix as applied to FTP: guard the ->cwd fallback with a connection check so that a missing $path argument doesn't crash when $connection is undef. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #78 from Owen Leonard <oleonard@myacpl.org> --- Rebased on top of Bug 41823 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199179|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199180|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199181|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199182|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199183|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199184|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199185|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199186|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199187|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199188|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199189|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199190|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #79 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200222 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200222&action=edit Bug 41020: Add delete_file() method to file transport classes This patch adds the ability to delete files from remote servers through the file transport API. This is needed for the MARC ordering feature to clean up processed files from FTP/SFTP servers. Changes: - Added abstract delete_file() method to Koha::File::Transport base class - Implemented delete_file() in Koha::File::Transport::FTP using Net::FTP->delete() - Implemented delete_file() in Koha::File::Transport::SFTP using Net::SFTP::Foreign->remove() - Implemented delete_file() in Koha::File::Transport::Local using unlink() - All implementations follow the standard message/error handling pattern - Updated polymorphic tests to verify delete_file() capability The delete_file() method: - Takes a filename as parameter (relative to current directory) - Returns true on success, undef on failure - Adds appropriate success/error messages to the transport message queue - Follows the same pattern as existing methods (download_file, rename_file) Test plan: 1. prove t/db_dependent/Koha/File/Transports.t 2. Verify all transport types support delete_file() 3. Test with MARC ordering cronjob using --dr flag (added in main patch) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #80 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200223 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200223&action=edit Bug 41020: Standardize _abort_operation() signature in FTP transport This patch updates Koha::File::Transport::FTP::_abort_operation() to accept an optional $path parameter, matching the signature used in Koha::File::Transport::SFTP. This improves error reporting by including the path/file that caused the operation to fail in the error message payload. Previously, the FTP implementation only included the error detail and message, making it harder to debug which file or directory caused the problem. Changes: - Updated _abort_operation($operation) to _abort_operation($operation, $path) - Updated change_directory() call to pass $remote_directory to _abort_operation - Added path to error payload, using either the passed path or pwd() as fallback This standardization ensures consistent error reporting across all transport implementations and makes debugging transport issues easier. Test plan: 1. Verify FTP transport operations still work correctly 2. Check that error messages now include the path that failed 3. Confirm no regressions in existing FTP functionality Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #81 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200224 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200224&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #82 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200225 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200225&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #83 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200226 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200226&action=edit Bug 41020: (follow-up) Modernize code to use Koha objects and relationship accessors This follow-up improves the code to better follow Koha best practices: 1. Added file_transport() relationship accessor to Koha::MarcOrderAccount - Returns the correct polymorphic subclass (SFTP, FTP, or Local) - Respects prefetched relationships to avoid N+1 queries - Follows the same pattern as vendor() and budget() accessors 2. Updated admin/marc_order_accounts.pl to use Koha::File::Transports - Replaced direct DBIx::Class schema access with Koha objects - Removed unused $schema variable 3. Updated misc/cronjobs/marc_ordering_process.pl - Changed manual transport lookup to use the new relationship accessor - Cleaner code that can benefit from prefetching 4. Added unit tests (t/db_dependent/Koha/MarcOrderAccount.t) - Tests for all relationship accessors (vendor, budget, file_transport) - Verifies polymorphism works correctly for all transport types - Includes test demonstrating that prefetched relationships don't trigger additional database queries Test plan: 1. prove t/db_dependent/Koha/MarcOrderAccount.t 2. Verify all tests pass 3. Run marc_ordering_process.pl cronjob and verify it still works Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #84 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200227 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200227&action=edit Bug 41020: (QA follow-up) Use say_success Patch from commit bffdc90 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #85 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200228 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200228&action=edit Bug 41020: (QA follow-up) Check permission, fix EDI => Marc order account Patch from commit c0f0e76 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #86 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200229 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200229&action=edit Bug 41020: (QA follow-up) Fix FTP crash and guard remote ops with --confirm _abort_operation() crashed when both $path and $self->{connection} were undef (e.g. on a failed Net::FTP->new call), because the fallback expression called ->pwd on undef. Remote file transport operations (connect, download, delete/rename on remote) were not guarded by the --confirm flag, causing them to run in dry-run mode. All transport operations now require --confirm. Error/ failure messages from the transport block now also respect --verbose. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #87 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200230 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200230&action=edit Bug 41020: (QA follow-up) Fix kohastructure.sql for file_transport_id column Add missing explicit KEY index for file_transport_id, consistent with the style used for vendor_edi_accounts. Add missing COMMENT annotation for the new column, consistent with all other columns in the table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #88 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200231 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200231&action=edit Bug 41020: (QA follow-up) Fix POD errors in marc_ordering_process.pl - Fix unbalanced bracket in SYNOPSIS: [--rr|--rename-remote ext] - Fix item name typo: rename-remove => rename-remote, -rr => --rr - Update DESCRIPTION to mention local/FTP/SFTP transports, fix typo 'bilbios' => 'bibliographic records' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #89 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200232 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200232&action=edit Bug 41020: (QA follow-up) Call object_class() as a class method object_class(), _polymorphic_field() and _polymorphic_map() use no instance state, so there is no need to instantiate Koha::File::Transports just to call object_class(). Call it directly as a class method. Also update the pod to mention Local transport alongside SFTP/FTP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #90 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200233 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200233&action=edit Bug 41020: (QA follow-up) Fix same _abort_operation crash in SFTP transport Same fix as applied to FTP: guard the ->cwd fallback with a connection check so that a missing $path argument doesn't crash when $connection is undef. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200222|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200223|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200224|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200225|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200226|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200227|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200228|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200229|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200230|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200231|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200232|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200233|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #91 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200249 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200249&action=edit Bug 41020: Add delete_file() method to file transport classes This patch adds the ability to delete files from remote servers through the file transport API. This is needed for the MARC ordering feature to clean up processed files from FTP/SFTP servers. Changes: - Added abstract delete_file() method to Koha::File::Transport base class - Implemented delete_file() in Koha::File::Transport::FTP using Net::FTP->delete() - Implemented delete_file() in Koha::File::Transport::SFTP using Net::SFTP::Foreign->remove() - Implemented delete_file() in Koha::File::Transport::Local using unlink() - All implementations follow the standard message/error handling pattern - Updated polymorphic tests to verify delete_file() capability The delete_file() method: - Takes a filename as parameter (relative to current directory) - Returns true on success, undef on failure - Adds appropriate success/error messages to the transport message queue - Follows the same pattern as existing methods (download_file, rename_file) Test plan: 1. prove t/db_dependent/Koha/File/Transports.t 2. Verify all transport types support delete_file() 3. Test with MARC ordering cronjob using --dr flag (added in main patch) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #92 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200250 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200250&action=edit Bug 41020: Standardize _abort_operation() signature in FTP transport This patch updates Koha::File::Transport::FTP::_abort_operation() to accept an optional $path parameter, matching the signature used in Koha::File::Transport::SFTP. This improves error reporting by including the path/file that caused the operation to fail in the error message payload. Previously, the FTP implementation only included the error detail and message, making it harder to debug which file or directory caused the problem. Changes: - Updated _abort_operation($operation) to _abort_operation($operation, $path) - Updated change_directory() call to pass $remote_directory to _abort_operation - Added path to error payload, using either the passed path or pwd() as fallback This standardization ensures consistent error reporting across all transport implementations and makes debugging transport issues easier. Test plan: 1. Verify FTP transport operations still work correctly 2. Check that error messages now include the path that failed 3. Confirm no regressions in existing FTP functionality Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #93 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200251 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200251&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #94 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200252 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200252&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #95 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200253&action=edit Bug 41020: (follow-up) Modernize code to use Koha objects and relationship accessors This follow-up improves the code to better follow Koha best practices: 1. Added file_transport() relationship accessor to Koha::MarcOrderAccount - Returns the correct polymorphic subclass (SFTP, FTP, or Local) - Respects prefetched relationships to avoid N+1 queries - Follows the same pattern as vendor() and budget() accessors 2. Updated admin/marc_order_accounts.pl to use Koha::File::Transports - Replaced direct DBIx::Class schema access with Koha objects - Removed unused $schema variable 3. Updated misc/cronjobs/marc_ordering_process.pl - Changed manual transport lookup to use the new relationship accessor - Cleaner code that can benefit from prefetching 4. Added unit tests (t/db_dependent/Koha/MarcOrderAccount.t) - Tests for all relationship accessors (vendor, budget, file_transport) - Verifies polymorphism works correctly for all transport types - Includes test demonstrating that prefetched relationships don't trigger additional database queries Test plan: 1. prove t/db_dependent/Koha/MarcOrderAccount.t 2. Verify all tests pass 3. Run marc_ordering_process.pl cronjob and verify it still works Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #96 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200254 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200254&action=edit Bug 41020: (QA follow-up) Use say_success Patch from commit 1dc9097 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #97 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200255 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200255&action=edit Bug 41020: (QA follow-up) Check permission, fix EDI => Marc order account Patch from commit 3a38c8e -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #98 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200256 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200256&action=edit Bug 41020: (QA follow-up) Fix FTP crash and guard remote ops with --confirm _abort_operation() crashed when both $path and $self->{connection} were undef (e.g. on a failed Net::FTP->new call), because the fallback expression called ->pwd on undef. Remote file transport operations (connect, download, delete/rename on remote) were not guarded by the --confirm flag, causing them to run in dry-run mode. All transport operations now require --confirm. Error/ failure messages from the transport block now also respect --verbose. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #99 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200257 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200257&action=edit Bug 41020: (QA follow-up) Fix kohastructure.sql for file_transport_id column Add missing explicit KEY index for file_transport_id, consistent with the style used for vendor_edi_accounts. Add missing COMMENT annotation for the new column, consistent with all other columns in the table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #100 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200258 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200258&action=edit Bug 41020: (QA follow-up) Fix POD errors in marc_ordering_process.pl - Fix unbalanced bracket in SYNOPSIS: [--rr|--rename-remote ext] - Fix item name typo: rename-remove => rename-remote, -rr => --rr - Update DESCRIPTION to mention local/FTP/SFTP transports, fix typo 'bilbios' => 'bibliographic records' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #101 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200259 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200259&action=edit Bug 41020: (QA follow-up) Call object_class() as a class method object_class(), _polymorphic_field() and _polymorphic_map() use no instance state, so there is no need to instantiate Koha::File::Transports just to call object_class(). Call it directly as a class method. Also update the pod to mention Local transport alongside SFTP/FTP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #102 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 200260 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200260&action=edit Bug 41020: (QA follow-up) Fix same _abort_operation crash in SFTP transport Same fix as applied to FTP: guard the ->cwd fallback with a connection check so that a missing $path argument doesn't crash when $connection is undef. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #103 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Fixed some John Doe author lines! No other changes to the patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200249|0 |1 is obsolete| | Attachment #200250|0 |1 is obsolete| | Attachment #200251|0 |1 is obsolete| | Attachment #200252|0 |1 is obsolete| | Attachment #200253|0 |1 is obsolete| | Attachment #200254|0 |1 is obsolete| | Attachment #200255|0 |1 is obsolete| | Attachment #200256|0 |1 is obsolete| | Attachment #200257|0 |1 is obsolete| | Attachment #200258|0 |1 is obsolete| | Attachment #200259|0 |1 is obsolete| | Attachment #200260|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #104 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200273 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200273&action=edit Bug 41020: Add delete_file() method to file transport classes This patch adds the ability to delete files from remote servers through the file transport API. This is needed for the MARC ordering feature to clean up processed files from FTP/SFTP servers. Changes: - Added abstract delete_file() method to Koha::File::Transport base class - Implemented delete_file() in Koha::File::Transport::FTP using Net::FTP->delete() - Implemented delete_file() in Koha::File::Transport::SFTP using Net::SFTP::Foreign->remove() - Implemented delete_file() in Koha::File::Transport::Local using unlink() - All implementations follow the standard message/error handling pattern - Updated polymorphic tests to verify delete_file() capability The delete_file() method: - Takes a filename as parameter (relative to current directory) - Returns true on success, undef on failure - Adds appropriate success/error messages to the transport message queue - Follows the same pattern as existing methods (download_file, rename_file) Test plan: 1. prove t/db_dependent/Koha/File/Transports.t 2. Verify all transport types support delete_file() 3. Test with MARC ordering cronjob using --dr flag (added in main patch) Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #105 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200274 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200274&action=edit Bug 41020: Standardize _abort_operation() signature in FTP transport This patch updates Koha::File::Transport::FTP::_abort_operation() to accept an optional $path parameter, matching the signature used in Koha::File::Transport::SFTP. This improves error reporting by including the path/file that caused the operation to fail in the error message payload. Previously, the FTP implementation only included the error detail and message, making it harder to debug which file or directory caused the problem. Changes: - Updated _abort_operation($operation) to _abort_operation($operation, $path) - Updated change_directory() call to pass $remote_directory to _abort_operation - Added path to error payload, using either the passed path or pwd() as fallback This standardization ensures consistent error reporting across all transport implementations and makes debugging transport issues easier. Test plan: 1. Verify FTP transport operations still work correctly 2. Check that error messages now include the path that failed 3. Confirm no regressions in existing FTP functionality Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #106 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200275 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200275&action=edit Bug 41020: Add ability to use file transports for marc ordering accounts FTP and SFTP server management was added to Koha in bug 39190. This feature should be made available to the marc order accounts feature so external processes are not needed to downloading the marc order files. Test Plan: 1) Run updatedatabase.pl 2) Restart all the things! 3) Create one or more file transports 4) Attach those transports to one or more MARC order accounts 5) Run marc_order_accounts.tt, note the files are transferred from the remove server to the "Download directory" of the MARC order account 6) Add another file to the remote server 7) Run script with "--rr dl" 8) Note the remote file has ".dl" append to the filename 9) Remove the .dl file extension from the remote file 10) Run script with "--dr" 11) Note the remote file is deleted Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #107 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200276 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200276&action=edit Bug 41020: Update schema files [DO NOT PUSH] Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #108 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200277 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200277&action=edit Bug 41020: (follow-up) Modernize code to use Koha objects and relationship accessors This follow-up improves the code to better follow Koha best practices: 1. Added file_transport() relationship accessor to Koha::MarcOrderAccount - Returns the correct polymorphic subclass (SFTP, FTP, or Local) - Respects prefetched relationships to avoid N+1 queries - Follows the same pattern as vendor() and budget() accessors 2. Updated admin/marc_order_accounts.pl to use Koha::File::Transports - Replaced direct DBIx::Class schema access with Koha objects - Removed unused $schema variable 3. Updated misc/cronjobs/marc_ordering_process.pl - Changed manual transport lookup to use the new relationship accessor - Cleaner code that can benefit from prefetching 4. Added unit tests (t/db_dependent/Koha/MarcOrderAccount.t) - Tests for all relationship accessors (vendor, budget, file_transport) - Verifies polymorphism works correctly for all transport types - Includes test demonstrating that prefetched relationships don't trigger additional database queries Test plan: 1. prove t/db_dependent/Koha/MarcOrderAccount.t 2. Verify all tests pass 3. Run marc_ordering_process.pl cronjob and verify it still works Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #109 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200279 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200279&action=edit Bug 41020: (QA follow-up) Use say_success -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #110 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200281 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200281&action=edit Bug 41020: (QA follow-up) Check permission, fix EDI => Marc order account -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #111 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200282 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200282&action=edit Bug 41020: (QA follow-up) Fix FTP crash and guard remote ops with --confirm _abort_operation() crashed when both $path and $self->{connection} were undef (e.g. on a failed Net::FTP->new call), because the fallback expression called ->pwd on undef. Remote file transport operations (connect, download, delete/rename on remote) were not guarded by the --confirm flag, causing them to run in dry-run mode. All transport operations now require --confirm. Error/ failure messages from the transport block now also respect --verbose. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #112 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200283 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200283&action=edit Bug 41020: (QA follow-up) Fix kohastructure.sql for file_transport_id column Add missing explicit KEY index for file_transport_id, consistent with the style used for vendor_edi_accounts. Add missing COMMENT annotation for the new column, consistent with all other columns in the table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #113 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200284 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200284&action=edit Bug 41020: (QA follow-up) Fix POD errors in marc_ordering_process.pl - Fix unbalanced bracket in SYNOPSIS: [--rr|--rename-remote ext] - Fix item name typo: rename-remove => rename-remote, -rr => --rr - Update DESCRIPTION to mention local/FTP/SFTP transports, fix typo 'bilbios' => 'bibliographic records' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #114 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200285&action=edit Bug 41020: (QA follow-up) Call object_class() as a class method object_class(), _polymorphic_field() and _polymorphic_map() use no instance state, so there is no need to instantiate Koha::File::Transports just to call object_class(). Call it directly as a class method. Also update the pod to mention Local transport alongside SFTP/FTP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #115 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200286 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200286&action=edit Bug 41020: (QA follow-up) Fix same _abort_operation crash in SFTP transport Same fix as applied to FTP: guard the ->cwd fallback with a connection check so that a missing $path argument doesn't crash when $connection is undef. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41020 --- Comment #116 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200287 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200287&action=edit Bug 41020: (QA follow-up) Fix error handling in transport and cronjob - Guard object_class() result in Koha::MarcOrderAccount::file_transport() to avoid crashing on undef if the transport type is unrecognised - Check return value of rename_file() and delete_file() in the cronjob transport block so failures are reported rather than silently ignored - Drop 'if $verbose' guard on the download-failure message so transport errors are always visible in --confirm cron runs - Include the actual path and $! in the opendir die message to aid debugging of misconfigured download directories -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org