Bug 10222 - Error when saving Demco label templates
Summary: Error when saving Demco label templates
Status: Pushed to Master
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: M. Tompsett
QA Contact: Nick Clemens
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-09 12:33 UTC by Owen Leonard
Modified: 2017-12-07 12:39 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 10222 - Error when saving Demco label templates (2.01 KB, patch)
2015-04-16 16:12 UTC, Chris Nighswonger
Details | Diff | Splinter Review
Bug 10222 - Error when saving Demco label templates (2.18 KB, patch)
2017-10-23 14:24 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 10222: Correct and expand to other languages (6.89 KB, patch)
2017-10-23 14:24 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 10222 - Error when saving Demco label templates (2.24 KB, patch)
2017-10-28 11:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10222: Correct and expand to other languages (6.95 KB, patch)
2017-10-28 11:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 10222 - Error when saving Demco label templates (2.29 KB, patch)
2017-11-13 17:33 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 10222: Correct and expand to other languages (7.01 KB, patch)
2017-11-13 17:33 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2013-05-09 12:33:35 UTC
If you open either of the Demco label templates (loaded by the sample data) and click "save" without making any changes you will get an error:

Can't bless non-reference value at C4/Creators/Profile.pm line 92.
Comment 1 Jonathan Druart 2015-04-14 15:06:13 UTC
Confirmed, it comes from installer/data/mysql/en/optional/sample_creator_data.sql

It inserts a row into creator_templates with profile_id=13, but no printers_profile is inserted with this profile_id.

Chris, could you have a look please?
Comment 2 Chris Nighswonger 2015-04-16 16:12:09 UTC
Created attachment 37976 [details] [review]
Bug 10222 - Error when saving Demco label templates

This patch fixes a bug whereby if you open either of the
Demco label templates (loaded by the sample data) and
click "save" without making any changes you will get an
error:

Can't bless non-reference value at C4/Creators/Profile.pm
line 92.

It also fixes another minor bug in the creator sample data.

To test:

1. Install all sample data in a clean database.
2. In the label tool, edit either of the Demco label templates.
3. Save the template and observe the error mentioned above.
4. Drop and recreate the database.
5. Apply the patch.
6. Repeate steps 1-3 and note the successful save.
Comment 3 M. Tompsett 2015-04-22 03:20:56 UTC
Comment on attachment 37976 [details] [review]
Bug 10222 - Error when saving Demco label templates

Review of attachment 37976 [details] [review]:
-----------------------------------------------------------------

::: installer/data/mysql/en/optional/sample_creator_data.sql
@@ +27,4 @@
>  
>  LOCK TABLES `printers_profile` WRITE;
>  /*!40000 ALTER TABLE `printers_profile` DISABLE KEYS */;
> +INSERT INTO `printers_profile` VALUES (1,'Library Laser',1,'Bypass',-2,9,3,0,'POINT','Labels'),(13,'Library Laser',7,'Tray 1',0,0,0,0,'POINT','Labels'),(14,'Library Laser',12,'Tray 2',0,0,0,0,'POINT','Labels'),(16,'Test Printer 01',23,'Test Bin',0,0,0,0,'POINT','Patroncards'),(22,'Library Laser',0,'Tray 3',0,0,0,0,'POINT','Labels');

Why remove 11? 
Why are the columns not explicitly named?
Also, perhaps splitting lines for human readability might be an idea.
And maybe INSERT IGNORE?
Comment 4 Chris Nighswonger 2015-04-22 10:26:17 UTC
(In reply to M. Tompsett from comment #3)

> Why remove 11? 

Because it was a mistake from the beginning. (I wrote the original, btw.)

> Why are the columns not explicitly named?

Why should they be named?

> And maybe INSERT IGNORE?

No need. This is only executed upon a fresh install.

Why switch this back to "Needs Signoff?" Did you test it and have it fail?
Comment 5 Jonathan Druart 2015-04-29 09:36:18 UTC
1/ The change should be done for all languages.

2/ I also think it could be better to name the column, to prevent further changes to this table (add new column?)

Marked as Failed QA for 1.
Comment 6 M. Tompsett 2017-10-23 13:29:37 UTC
Confirmed issue still exists.
Comment 7 M. Tompsett 2017-10-23 14:24:33 UTC
Created attachment 68410 [details] [review]
Bug 10222 - Error when saving Demco label templates

This patch fixes a bug whereby if you open either of the
Demco label templates (loaded by the sample data) and
click "save" without making any changes you will get an
error:

Can't bless non-reference value at C4/Creators/Profile.pm
line 92.

It also fixes another minor bug in the creator sample data.

To test:

1. Install all sample data in a clean database.
2. In the label tool, edit either of the Demco label templates.
3. Save the template and observe the error mentioned above.
4. Drop and recreate the database.
5. Apply the patch.
6. Repeate steps 1-3 and note the successful save.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 8 M. Tompsett 2017-10-23 14:24:36 UTC
Created attachment 68411 [details] [review]
Bug 10222: Correct and expand to other languages

This added column names, and reformated to be a bit more readable.
This also adds this change to de-DE, es-ES, fr-CA, and nb-NO.
While there was printer_profiles for it-IT, the Italian file seems
to not use the same numbers, and does not visibly look like it needs
these changes.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 9 Katrin Fischer 2017-10-28 11:53:21 UTC
Signing off on these, noticing that ru-RU and uk-UA are missing. There don't seem to be any printer definitions in those files. Shall I fill a separate bug?
Comment 10 Katrin Fischer 2017-10-28 11:53:54 UTC
Created attachment 68801 [details] [review]
Bug 10222 - Error when saving Demco label templates

This patch fixes a bug whereby if you open either of the
Demco label templates (loaded by the sample data) and
click "save" without making any changes you will get an
error:

Can't bless non-reference value at C4/Creators/Profile.pm
line 92.

It also fixes another minor bug in the creator sample data.

To test:

1. Install all sample data in a clean database.
2. In the label tool, edit either of the Demco label templates.
3. Save the template and observe the error mentioned above.
4. Drop and recreate the database.
5. Apply the patch.
6. Repeate steps 1-3 and note the successful save.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2017-10-28 11:53:58 UTC
Created attachment 68802 [details] [review]
Bug 10222: Correct and expand to other languages

This added column names, and reformated to be a bit more readable.
This also adds this change to de-DE, es-ES, fr-CA, and nb-NO.
While there was printer_profiles for it-IT, the Italian file seems
to not use the same numbers, and does not visibly look like it needs
these changes.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 M. Tompsett 2017-10-28 21:28:20 UTC
(In reply to Katrin Fischer from comment #9)
> Signing off on these, noticing that ru-RU and uk-UA are missing. There don't
> seem to be any printer definitions in those files. Shall I fill a separate
> bug?

A separate bug yes. But I am not sure whether you need to file one. Considering, wouldn't people using those languages have complained about it, if they used them?
Comment 13 Katrin Fischer 2017-10-28 21:29:11 UTC
I think that's a false logic and at least one of those languages had a recent update.
Comment 14 Nick Clemens 2017-11-13 17:33:51 UTC
Created attachment 69133 [details] [review]
Bug 10222 - Error when saving Demco label templates

This patch fixes a bug whereby if you open either of the
Demco label templates (loaded by the sample data) and
click "save" without making any changes you will get an
error:

Can't bless non-reference value at C4/Creators/Profile.pm
line 92.

It also fixes another minor bug in the creator sample data.

To test:

1. Install all sample data in a clean database.
2. In the label tool, edit either of the Demco label templates.
3. Save the template and observe the error mentioned above.
4. Drop and recreate the database.
5. Apply the patch.
6. Repeate steps 1-3 and note the successful save.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 15 Nick Clemens 2017-11-13 17:33:54 UTC
Created attachment 69134 [details] [review]
Bug 10222: Correct and expand to other languages

This added column names, and reformated to be a bit more readable.
This also adds this change to de-DE, es-ES, fr-CA, and nb-NO.
While there was printer_profiles for it-IT, the Italian file seems
to not use the same numbers, and does not visibly look like it needs
these changes.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Jonathan Druart 2017-12-07 12:39:34 UTC
Pushed to master for 18.05, thanks to everybody involved!