Summary: | Some modules do not return 1 | ||
---|---|---|---|
Product: | Koha | Reporter: | Marcel de Rooy <m.de.rooy> |
Component: | Architecture, internals, and plumbing | Assignee: | James O'Keeffe <jamespfk> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | aleisha, andrew, david, dcook, fridolin.somers, jamespfk, jonathan.druart |
Version: | Main | Keywords: | Academy |
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00,20.11.05
|
|
Circulation function: | |||
Attachments: |
Bug 24000: Koha::Item::Search::Field does not return 1
Bug 24000: Some modules do not return 1 Bug 24000: Koha::Item::Search::Field does not return 1 Bug 24000: Some modules do not return 1 Bug 24000: Koha::Item::Search::Field does not return 1 Bug 24000: Some modules do not return 1 |
Description
Marcel de Rooy
2019-11-08 11:03:33 UTC
Created attachment 95199 [details] [review] Bug 24000: Koha::Item::Search::Field does not return 1 Test plan: Run t/db_dependent/Koha/Item/Search/Field.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Super trivial, signing off Is it the only one? (In reply to Jonathan Druart from comment #3) > Is it the only one? IIRC you fixed several ones a few years ago? I didnt look for it now. Just came across this one. % perl -0777 -nlwE 'say $ARGV if !/\n1/i' **/*.pm Koha/Filter/MARC/EmbedItemsAvailability.pm Koha/Filter/MARC/EmbedSeeFromHeadings.pm Koha/Filter/MARC/Null.pm Koha/Item/Search/Field.pm Koha/SearchEngine.pm misc/translator/VerboseWarnings.pm t/lib/Koha/Plugin/Test.pm I think we should fix them all in one go. For the sake of learning and documentation, it'd be awesome to note here why it's important for modules to return 1 :) (In reply to Aleisha Amohia from comment #6) > For the sake of learning and documentation, it'd be awesome to note here why > it's important for modules to return 1 :) https://perldoc.perl.org/functions/require "The file must return true as the last statement to indicate successful execution of any initialization code, so it's customary to end such a file with 1; unless you're sure it'll return true otherwise. But it's better just to put the 1;, in case you add more statements." (In reply to Aleisha Amohia from comment #6) > For the sake of learning and documentation, it'd be awesome to note here why > it's important for modules to return 1 :) +1 :) Thx for asking the question! Created attachment 115290 [details] [review] Bug 24000: Some modules do not return 1 This patch adds "1;" to the end of the following perl files: Koha/Filter/MARC/EmbedItemsAvailability.pm Koha/Filter/MARC/EmbedSeeFromHeadings.pm Koha/Filter/MARC/Null.pm Koha/Item/Search/Field.pm Koha/SearchEngine.pm misc/translator/VerboseWarnings.pm t/lib/Koha/Plugin/Test.pm This indicates the succesful execution of the initialization code. Test plan: Ensure that there are no other perl files that need "1;", but dont have it. Created attachment 118877 [details] [review] Bug 24000: Koha::Item::Search::Field does not return 1 Test plan: Run t/db_dependent/Koha/Item/Search/Field.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Created attachment 118878 [details] [review] Bug 24000: Some modules do not return 1 This patch adds "1;" to the end of the following perl files: Koha/Filter/MARC/EmbedItemsAvailability.pm Koha/Filter/MARC/EmbedSeeFromHeadings.pm Koha/Filter/MARC/Null.pm Koha/Item/Search/Field.pm Koha/SearchEngine.pm misc/translator/VerboseWarnings.pm t/lib/Koha/Plugin/Test.pm This indicates the succesful execution of the initialization code. Test plan: Ensure that there are no other perl files that need "1;", but dont have it. Signed-off-by: David Nind <david@davidnind.com> Tested by running prove t/db_dependent/Koha/Item/Search/Field.t before and after applying patches. Hope that is sufficient. Created attachment 118891 [details] [review] Bug 24000: Koha::Item::Search::Field does not return 1 Test plan: Run t/db_dependent/Koha/Item/Search/Field.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 118892 [details] [review] Bug 24000: Some modules do not return 1 This patch adds "1;" to the end of the following perl files: Koha/Filter/MARC/EmbedItemsAvailability.pm Koha/Filter/MARC/EmbedSeeFromHeadings.pm Koha/Filter/MARC/Null.pm Koha/Item/Search/Field.pm Koha/SearchEngine.pm misc/translator/VerboseWarnings.pm t/lib/Koha/Plugin/Test.pm This indicates the succesful execution of the initialization code. Test plan: Ensure that there are no other perl files that need "1;", but dont have it. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.05 I'm getting a QA error with these patches for 20.05: Processing files after patches |========================>| 7 / 7 (100.00%) OK Koha/Filter/MARC/EmbedItemsAvailability.pm FAIL Koha/Filter/MARC/EmbedSeeFromHeadings.pm FAIL pod *** WARNING: empty section in previous paragraph in file Koha/Filter/MARC/EmbedSeeFromHeadings.pm *** ERROR: Spurious text after =cut in file Koha/Filter/MARC/EmbedSeeFromHeadings.pm FAIL Koha/Filter/MARC/Null.pm FAIL pod *** WARNING: empty section in previous paragraph in file Koha/Filter/MARC/Null.pm *** ERROR: Spurious text after =cut in file Koha/Filter/MARC/Null.pm Please address this for backport. Thanks! |