Bug 31259: Escape infinite loop when lime cannot wrap enough
authorNick Clemens <nick@bywatersolutions.com>
Mon, 23 Jan 2023 12:51:48 +0000 (12:51 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 31 Mar 2023 11:13:39 +0000 (13:13 +0200)
commita18f65cdcc51571bc9eae1e903a6b7b676e6a89e
treeb6cfb9d6f907955d2c10d33a204c8bfa594a561f
parent3db7173dde0c8221c3628a0624c45f08d3f256fe
Bug 31259: Escape infinite loop when lime cannot wrap enough

It seems the wrapping here works with words, not characters. If a line is too long,
or too far over, we can't trim it enough. We need to escape if successive loops are
not changing the line

To test:
 1 - Using sample data, edit the layout to match picture in comment 9
 2 - Add some borrowers to a batch
 3 - Attempt to export batch and save PDF
 4 - Staff client waits
 5 - ps aux | grep card
 6 - Note the job keeps running
 7 - Kill it
 8 - Apply patch
 9 - Restart_all
10 - Export batch again
11 - Success, you get a badly formatted PDF, rather than nothing
12 - Note the PDF does not show "Yakama Nation Library"
13 - Edit layout, male "Lower left X" 20 instead of 220
14 - Export again and note text field 1 shows correctly

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Patroncards/Patroncard.pm