"Units" gets saved into "layout_xml" for patroncards, but not into "units" in the `creator_layouts` table, so when you edit a layout for the patroncards, it'll always say "PostScript Points". It looks like the code could use a good clean-up... but I have a small fix which sets it right so not going to refactor unnecessarily...
Created attachment 40010 [details] [review] Bug 14366 - Units doesn't get saved usefully for patroncards This patch causes the "Units" to be saved and displayed correctly for the "Edit layout" screen in Patroncards. _TEST PLAN_ Before applying: 0) Create a new layout 1) Edit the layout, change the units, and click Save 2) Edit the layout again, and notice the units are still "PostScript Points" Apply the patch: 3) Edit the layout again, change the units, and click Save 4) Edit the layout again, note that the units have changed to your selection 5) Rejoice
Of course... I'm not sure that the actual label creator is using the different units... that's fun...
(In reply to David Cook from comment #2) > Of course... I'm not sure that the actual label creator is using the > different units... that's fun... User selected units are converted to postscript points before rendering. Postscript points are the common denominator.
*** Bug 8602 has been marked as a duplicate of this bug. ***
Created attachment 40085 [details] [review] [SIGNED OFF] Bug 14366 - Units doesn't get saved usefully for patroncards This patch causes the "Units" to be saved and displayed correctly for the "Edit layout" screen in Patroncards. _TEST PLAN_ Before applying: 0) Create a new layout 1) Edit the layout, change the units, and click Save 2) Edit the layout again, and notice the units are still "PostScript Points" Apply the patch: 3) Edit the layout again, change the units, and click Save 4) Edit the layout again, note that the units have changed to your selection 5) Rejoice Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
(In reply to Chris Nighswonger from comment #3) > (In reply to David Cook from comment #2) > > Of course... I'm not sure that the actual label creator is using the > > different units... that's fun... > > User selected units are converted to postscript points before rendering. > Postscript points are the common denominator. Are you certain? I tried changing a label by 1cm but it looks like it only changed by 1pt. I haven't had time to look into this yet, unfortunately :/.
(In reply to David Cook from comment #6) > (In reply to Chris Nighswonger from comment #3) > > (In reply to David Cook from comment #2) > > > Of course... I'm not sure that the actual label creator is using the > > > different units... that's fun... > > > > User selected units are converted to postscript points before rendering. > > Postscript points are the common denominator. > > Are you certain? I tried changing a label by 1cm but it looks like it only > changed by 1pt. > > I haven't had time to look into this yet, unfortunately :/. Point conversions are done here: http://tinyurl.com/o99ve52 This bug is addressing the fact that labels do not save the user's preferred UOM, which explains the phenomena you are describing. The real fix is for the labels code to be refactored to save templates as xml as patroncard code does. That was my long-term intention when I wrote the patroncard feature. Of course, even the best of intentions never materialize at times. :-P
Created attachment 40168 [details] [review] Bug 14366 - Units doesn't get saved usefully for patroncards This patch causes the "Units" to be saved and displayed correctly for the "Edit layout" screen in Patroncards. _TEST PLAN_ Before applying: 0) Create a new layout 1) Edit the layout, change the units, and click Save 2) Edit the layout again, and notice the units are still "PostScript Points" Apply the patch: 3) Edit the layout again, change the units, and click Save 4) Edit the layout again, note that the units have changed to your selection 5) Rejoice Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Patch pushed to master. Thanks David!
Pushed to 3.20.x will be in 3.20.2
Pushed to 3.16.x, will be in 3.16.13