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)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 24 Apr 2023 17:31:02 +0000 (17:31 +0000)
commitdda7ff90bdc768e5558c0958d937789b2b834502
tree4776e4cb5922af4331e59545156b4771d5f572ab
parent9fb9e29c1e6e5dde0a0caace536daf73441519cf
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>
(cherry picked from commit a18f65cdcc51571bc9eae1e903a6b7b676e6a89e)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
(cherry picked from commit f1010ee062263c84be1cf8f9117730c536f9c8f5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Patroncards/Patroncard.pm