Koha/C4
Maryse Simard b5b8a7daeb
Bug 23488: Line wrapping doesn't always respect word order in Patron card creator
When wrapping long lines of text, the line is divided by removing each
word from the end of the line and putting it in a new one until the line
is the right width. When the word to be removed appears multiple time
in the line, it is not the last occurrence that is removed.

This patch changes the regular expression used to remove the part of
the text that is wrapped to a new line, making sure it removes it at
the end of the text.

Test plan:

1. Go to Tools > Patron card creator

2. Have a card template and a card batch
    -> If needs be, you can create them by using
       New > Card template or New > Card batch

3. Create a layout and use one text field containing a long text with
    at least one word which is repeated a minimum of 2 times
    (preferably towrdds the end of the text, since it has to be picked
    as one of the words to appear in the new line). You can use this:

        one two three one two three one two three one two three
        one two three one two three one two three one two three ...

4. Go to Manage > Card batches and export a batch

5. Choose the layout set up in 3.

6. Click the Export button and open the resulting pdf file

7. Notice all the repeated word have been grouped
    -> For this example : all of the ones appear first, followed by
       all the twos and only then the threes.

8. Apply patch

9. Repeat step 4 through 7
    => this time the order of the words has not changed!

Signed-off-by: Gabriel DeCarufel <gabriel@inlibro.com>
Signed-off-by: William Frazilien <william.frazilien@inlibro.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-03-02 09:49:57 +00:00
..
AuthoritiesMarc Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Barcodes Bug 21937: Syspref autoBarcode annual doesn't increment properly barcode 2019-04-19 14:32:36 +00:00
ClassSortRoutine Bug 16011: $VERSION - Remove use vars qw(); 2016-03-24 17:20:39 +00:00
ClassSplitRoutine Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Creators Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
External Bug 22010: Check preferences for ebook integration 2019-04-30 11:42:51 +00:00
Form Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2 2016-05-16 17:28:06 +00:00
Heading Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
ILSDI Bug 14711: Change prototype for AddReserve - pass a hashref 2020-02-11 14:32:47 +00:00
Installer Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Labels Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Linker Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
Members Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
OAI Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Output Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
Patroncards Bug 23488: Line wrapping doesn't always respect word order in Patron card creator 2020-03-02 09:49:57 +00:00
Reports Bug 24511: Update variable names to avoid confusion 2020-01-27 10:14:15 +00:00
Search Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Serials Bug 20144: [sql_modes] Add default value for subscription_numberpatterns.description in tests 2018-02-13 13:58:53 -03:00
SIP Bug 24629: SIP patron items contains an array of hashes 2020-02-24 13:18:36 +00:00
Utils Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Accounts.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Acquisition.pm Bug 24294: Add default value support for control fields in ACQ framework 2020-02-26 20:37:00 +00:00
Auth.pm Bug 22880: (QA follow-up) Remove opacheader from C4::Auth 2020-02-24 13:24:55 +00:00
Auth_cas_servers.yaml.sample Bug 17065 - Rename C4/Auth_cas_servers.yaml.orig 2016-08-08 13:16:36 +00:00
Auth_with_cas.pm Bug 19160: Add POD 2018-03-23 11:45:38 -03:00
Auth_with_ldap.pm Bug 16719: (QA follow-up) Remove tabs 2020-02-10 09:19:07 +00:00
Auth_with_shibboleth.pm Bug 24199: (bug 23042 follow-up) Prevent t/Auth_with_shibboleth.t to fail randomly 2019-12-10 10:43:20 +00:00
AuthoritiesMarc.pm Bug 24286: Escape forward slash in GENRE/FORM (and any authtype) 2020-01-23 09:05:08 +00:00
BackgroundJob.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Barcodes.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
Biblio.pm Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
Bookseller.pm Bug 24002: Incorrect DATE value: '' in C4/Bookseller.pm 2019-11-12 13:50:06 +00:00
Boolean.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
Breeding.pm Bug 11297: Add support for custom PQF attributes for Z39.50 server searches. 2020-02-19 16:07:59 +00:00
Budgets.pm Bug 24361: (bug 24217 follow-up) Fix several warnings in C4 modules 2020-01-07 13:59:51 +00:00
Calendar.pm Bug 14572 - insert_single_holiday() forces a value on an AUTO_INCREMENT column, during an INSERT 2017-07-06 14:29:04 -03:00
Charset.pm Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
Circulation.pm Bug 21944: Improve efficiency of code 2020-02-19 11:24:48 +00:00
ClassSortRoutine.pm Bug 16011: $VERSION - Remove comments 2016-03-24 17:20:29 +00:00
ClassSource.pm Bug 15836: Remove deprecated subroutines 2018-11-13 18:56:18 +00:00
ClassSplitRoutine.pm Bug 15836: Add the ability to defined custom methods to split call number in labels 2018-11-13 15:18:22 +00:00
Context.pm Bug 23068: Add ability for Koha to handle X-Forwarded-For headers so REMOTE_ADDR features work behind a proxy 2019-10-31 16:10:17 +00:00
Contract.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
CourseReserves.pm Bug 22142: Do not revert data if 'unchanged' was set 2019-08-13 11:22:13 +01:00
Creators.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
Debug.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
Heading.pm Bug 24269: Adjust C4::Heading to generate headings from auth tags 2020-02-19 13:33:32 +00:00
HoldsQueue.pm Bug 23934: Item level holds not checked for LocalHoldsPriority in Holds Queue 2020-01-10 16:19:40 +00:00
HTML5Media.pm Bug 21742: Fix YouTube variable propagation 2018-11-01 18:59:33 +00:00
Images.pm Revert "Bug 21987: Do not generate true color thumbnails if not needed" 2019-11-04 13:21:53 +00:00
ImportBatch.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
ImportExportFramework.pm Bug 18143: Silence ods MARC framework export flood 2019-02-19 13:52:15 +00:00
InstallAuth.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Installer.pm Bug 19735: Move Perl deps definitions into a cpanfile 2020-02-12 16:33:02 +00:00
ItemCirculationAlertPreference.pm Bug 15407: Koha::Patron::Categories - replace C4::Category->all 2016-09-08 13:29:03 +00:00
Items.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Koha.pm Bug 22302: Make ITEMTYPECAT descriptions fallback to lib description if no opac description 2020-02-05 12:35:32 +00:00
Labels.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
Languages.pm Bug 18213: Add Template plugin and fix for C4/Languages 2019-03-28 15:57:32 +00:00
Letters.pm Bug 23673: Add "Updated on" column to patron's notices 2020-02-05 14:22:43 +00:00
Linker.pm Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
Log.pm Bug 23896: logaction should pass the correct interface to Koha::Logger 2020-01-30 10:53:56 +00:00
MarcModificationTemplates.pm Bug 21831: Allow move all fields even if destination field is different 2019-05-23 14:50:57 +00:00
Matcher.pm Bug 24348: Pass marc record to _passes_required_checks 2020-01-28 14:54:29 +00:00
Members.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Message.pm Bug 21206: Replace C4::Items::GetItem 2019-02-26 13:24:07 +00:00
NewsChannels.pm Bug 24002: Incorrect DATE value: '00-00-0000' in NewsChannels.pm 2019-11-12 13:49:58 +00:00
Output.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Overdues.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Patroncards.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
Print.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Record.pm Bug 24361: (bug 24217 follow-up) Fix several warnings in C4 modules 2020-01-07 13:59:51 +00:00
Reports.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Reserves.pm Bug 21944: Improve efficiency of code 2020-02-19 11:24:48 +00:00
Ris.pm Bug 10306: Core module changes for multiple mappings 2017-12-07 14:44:15 -03:00
RotatingCollections.pm Bug 16011: $VERSION - Remove comments 2016-03-24 17:20:29 +00:00
Scheduler.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
Scrubber.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
Search.pm Bug 24367: (RM follow-up) Syntax error correction 2020-02-19 12:03:40 +00:00
Serials.pm Bug 24002: (follow-up) Incorrect DATE value: '00-00-0000' in C4/Serials.pm 2020-02-18 13:53:31 +00:00
Service.pm Bug 7550: [QA Follow-up] Resolve param warning from sco-patron-image 2017-05-08 09:00:26 -04:00
ShelfBrowser.pm Bug 22445: Custom cover images - opac shelfbrowser 2019-10-22 15:02:48 +01:00
SMS.pm Bug 19134: C4::SMS falils on long driver name 2017-08-25 10:51:24 -03:00
SocialData.pm Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
Stats.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Suggestions.pm Bug 24396: Fix Suggestions.t with MySQL 8 2020-01-10 10:54:28 +00:00
Tags.pm Bug 23084: Replace grep {^$var$} with grep {$_ eq $var} 2020-02-17 10:44:45 +00:00
Templates.pm Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere 2018-04-13 11:49:44 -03:00
TmplToken.pm Bug 16011: $VERSION - Remove the $VERSION init 2016-03-24 17:20:28 +00:00
TmplTokenType.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
TTParser.pm Bug 14383: C4: Fix some typos (mostly in comments and documentation) 2015-06-22 17:34:45 -03:00
UsageStats.pm Bug 23233: AllowItemsOnHoldCheckout is misnamed and does not indicate it is for SIP-based checkouts only 2019-12-16 11:08:52 +00:00
XISBN.pm Bug 24217: use Modern::Perl for modules when strict is missing 2020-01-03 10:45:46 +00:00
XSLT.pm Bug 7611: (follow-up) separate positive and negative statuses as in the past 2020-02-17 11:21:38 +00:00