[Bug 31383] New: Additional contents: We need a parent and child table
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Bug ID: 31383 Summary: Additional contents: We need a parent and child table Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show (imo) that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing all language related stuff. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz, | |jonathan.druart+koha@gmail. | |com, oleonard@myacpl.org, | |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=15326 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- For a less radical engineering change, we could just add a parent_id column to the existing table. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Kyle M Hall from comment #1)
For a less radical engineering change, we could just add a parent_id column to the existing table.
Reading the bug description, that was my first thought too, but I think Marcel didn't mean having a main page and parent pages, but something different. We'd have one main entry for the type of customization in the 'parent' table, like "OpacNav". Then the second table would be an 1:n relationship having the translations. We see a lot of bugs because the current structure requires a "default" entry to exist and things like that. I also think we might need to rethink the structure, but it will be a bigger change. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> ---
Then the second table would be an 1:n relationship having the translations.
... and the default and basically all the content. That about right, Marcel? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #3)
Then the second table would be an 1:n relationship having the translations.
... and the default and basically all the content.
That about right, Marcel?
Yes as mentioned in description. The tables change, the interface is not drastically changed. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #2)
(In reply to Kyle M Hall from comment #1)
For a less radical engineering change, we could just add a parent_id column to the existing table.
Reading the bug description, that was my first thought too, but I think Marcel didn't mean having a main page and parent pages, but something different.
We'd have one main entry for the type of customization in the 'parent' table, like "OpacNav".
Then the second table would be an 1:n relationship having the translations.
We see a lot of bugs because the current structure requires a "default" entry to exist and things like that. I also think we might need to rethink the structure, but it will be a bigger change.
Ah, thanks for the clarity Katrin! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Change sponsored?|--- |Sponsored Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147891 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147891&action=edit Bug 31383: Create a parent-child DB relation for additional content In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang. Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come. What is this patchset doing? * DB changes - Rename additional_contents.idnew with id - Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents - Move the content to this new table - Remove title, content and lang columns from additional_contents - Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist. * CRUD - We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple. - No changes expected for "NewsLog" logging - Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language. Test plan: 0. Preparation steps, use master a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us. b. Create several news, additional contents, pages. Some with translated contents, some without. c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here d. Turn on NewsLogs 1. Apply the patches, restart_all, updatedatabase => Confirm that the new table is created and filled with the contents you had prior to the update => Confirm that additional_contents_localizations.updated_on has been kept to the previous values => Confirm that ISSUESLIP has been replaced properly => Confirm that you get a warning about the additional_contents 2. Create, update, delete news, html customs, pages => Confirm that the additional_contents_localizations.updated_on is only adjusted when required => Confirm that the logs are correctly created when NewsLogs is on 3. Check some items out, generate a slip => Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted 4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages => Confirm that the default values is displayed when you are using the interface in a language without translation => Confirm that the translated version is picked when it exists Notes for QA: * I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP. Shouldn't it hurt? * There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability? Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147892 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147892&action=edit Bug 31383: Adjust and add tests Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147893 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147893&action=edit Bug 31383: DB changes Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147894 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147894&action=edit Bug 31383: DBIC changes Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147895 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147895&action=edit Bug 31383: DBIC specific Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147896 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147896&action=edit Bug 31383: Restore updated_on for individual content Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- This is ready for testing! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Looking here. Rebased conflict with new WRAPPER in koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FAIL Koha/Schema/Result/AdditionalContentsLocalization.pm FAIL pod coverage POD is missing for koha_object_class POD is missing for koha_objects_class FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt FAIL valid_template DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.id' in 'field list' at /usr/share/koha/Koha/Objects.pm line 421 FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt FAIL valid_template DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.id' in 'field list' at /usr/share/koha/Koha/Objects.pm line 421 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- perl installer/data/mysql/updatedatabase.pl DEV atomic update /usr/share/koha/installer/data/mysql/atomicupdate/bug_31383.pl [13:36:56]: Bug 31383 - Split the additional_contents table Renamed additional_contents.idnew with 'id' Added new table 'additional_contents_localizations' Removed 'title', 'content', 'lang' columns from additional_contents ERROR - {UNKNOWN}: Not a HASH reference at /usr/share/koha/installer/data/mysql/atomicupdate/bug_31383.pl line 71. at /usr/share/koha/C4/Installer.pm line 743 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147891|0 |1 is obsolete| | Attachment #147892|0 |1 is obsolete| | Attachment #147893|0 |1 is obsolete| | Attachment #147894|0 |1 is obsolete| | Attachment #147895|0 |1 is obsolete| | Attachment #147896|0 |1 is obsolete| | --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149813&action=edit Bug 31383: Create a parent-child DB relation for additional content In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang. Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come. What is this patchset doing? * DB changes - Rename additional_contents.idnew with id - Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents - Move the content to this new table - Remove title, content and lang columns from additional_contents - Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist. * CRUD - We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple. - No changes expected for "NewsLog" logging - Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language. Test plan: 0. Preparation steps, use master a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us. b. Create several news, additional contents, pages. Some with translated contents, some without. c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here d. Turn on NewsLogs 1. Apply the patches, restart_all, updatedatabase => Confirm that the new table is created and filled with the contents you had prior to the update => Confirm that additional_contents_localizations.updated_on has been kept to the previous values => Confirm that ISSUESLIP has been replaced properly => Confirm that you get a warning about the additional_contents 2. Create, update, delete news, html customs, pages => Confirm that the additional_contents_localizations.updated_on is only adjusted when required => Confirm that the logs are correctly created when NewsLogs is on 3. Check some items out, generate a slip => Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted 4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages => Confirm that the default values is displayed when you are using the interface in a language without translation => Confirm that the translated version is picked when it exists Notes for QA: * I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP. Shouldn't it hurt? * There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability? Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #17 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149814 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149814&action=edit Bug 31383: Adjust and add tests Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #18 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149815 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149815&action=edit Bug 31383: DB changes Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #19 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149816 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149816&action=edit Bug 31383: DBIC changes Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #20 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149817 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149817&action=edit Bug 31383: DBIC specific Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #21 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 149818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149818&action=edit Bug 31383: Restore updated_on for individual content Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #22 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #13)
Looking here.
Rebased conflict with new WRAPPER in koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt
Done. (In reply to Marcel de Rooy from comment #14)
FAIL Koha/Schema/Result/AdditionalContentsLocalization.pm FAIL pod coverage POD is missing for koha_object_class POD is missing for koha_objects_class
We don't require POD for those subroutines.
FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt FAIL valid_template DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.id' in 'field list' at /usr/share/koha/Koha/Objects.pm line 421
FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt FAIL valid_template DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.id' in 'field list' at /usr/share/koha/Koha/Objects.pm line 421
Once you run the atomic update this will be fixed. (In reply to Marcel de Rooy from comment #15)
perl installer/data/mysql/updatedatabase.pl DEV atomic update /usr/share/koha/installer/data/mysql/atomicupdate/bug_31383.pl [13:36:56]: Bug 31383 - Split the additional_contents table Renamed additional_contents.idnew with 'id' Added new table 'additional_contents_localizations' Removed 'title', 'content', 'lang' columns from additional_contents ERROR - {UNKNOWN}: Not a HASH reference at /usr/share/koha/installer/data/mysql/atomicupdate/bug_31383.pl line 71. at /usr/share/koha/C4/Installer.pm line 743
Fixed, sorry about that! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #23 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #22)
(In reply to Marcel de Rooy from comment #13)
FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt FAIL valid_template DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.id' in 'field list' at /usr/share/koha/Koha/Objects.pm line 421
FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt FAIL valid_template DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.id' in 'field list' at /usr/share/koha/Koha/Objects.pm line 421
Once you run the atomic update this will be fixed.
Note that they are still failing with an other error: DBIx::Class::Schema::source(): Can't find source for AdditionalContentsLocalization at /kohadevbox/koha/Koha/Objects.pm line 524 I think it's a false positive, it happens occasionally with valid_template. t/db_dependent/TestBuilder.t is passing so I think we are safe. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149813|0 |1 is obsolete| | --- Comment #24 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152423 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152423&action=edit Bug 31383: Create a parent-child DB relation for additional content In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang. Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come. What is this patchset doing? * DB changes - Rename additional_contents.idnew with id - Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents - Move the content to this new table - Remove title, content and lang columns from additional_contents - Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist. * CRUD - We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple. - No changes expected for "NewsLog" logging - Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language. Test plan: 0. Preparation steps, use master a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us. b. Create several news, additional contents, pages. Some with translated contents, some without. c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here d. Turn on NewsLogs 1. Apply the patches, restart_all, updatedatabase => Confirm that the new table is created and filled with the contents you had prior to the update => Confirm that additional_contents_localizations.updated_on has been kept to the previous values => Confirm that ISSUESLIP has been replaced properly => Confirm that you get a warning about the additional_contents 2. Create, update, delete news, html customs, pages => Confirm that the additional_contents_localizations.updated_on is only adjusted when required => Confirm that the logs are correctly created when NewsLogs is on 3. Check some items out, generate a slip => Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted 4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages => Confirm that the default values is displayed when you are using the interface in a language without translation => Confirm that the translated version is picked when it exists Notes for QA: * I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP. Shouldn't it hurt? * There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability? Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149814|0 |1 is obsolete| | --- Comment #25 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152424 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152424&action=edit Bug 31383: Adjust and add tests Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149815|0 |1 is obsolete| | --- Comment #26 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152425 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152425&action=edit Bug 31383: DB changes Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149816|0 |1 is obsolete| | --- Comment #27 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152426 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152426&action=edit Bug 31383: DBIC changes Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149817|0 |1 is obsolete| | --- Comment #28 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152427 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152427&action=edit Bug 31383: DBIC specific Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149818|0 |1 is obsolete| | --- Comment #29 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152428 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152428&action=edit Bug 31383: Restore updated_on for individual content Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #30 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Patches rebased against master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #31 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt FAIL valid_template DBIx::Class::Schema::source(): Can't find source for AdditionalContentsLocalization at /usr/share/koha/Koha/Objects.pm line 524 FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt FAIL valid_template DBIx::Class::Schema::source(): Can't find source for AdditionalContentsLocalization at /usr/share/koha/Koha/Objects.pm line 524 Can't explain this warning. Should expect a wrong pointer somewhere to Koha/Schema/Result but everything seems fine. Note: Already ran dbrev. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #32 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #31)
FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt FAIL valid_template DBIx::Class::Schema::source(): Can't find source for AdditionalContentsLocalization at /usr/share/koha/Koha/Objects.pm line 524
FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt FAIL valid_template DBIx::Class::Schema::source(): Can't find source for AdditionalContentsLocalization at /usr/share/koha/Koha/Objects.pm line 524
Can't explain this warning. Should expect a wrong pointer somewhere to Koha/Schema/Result but everything seems fine. Note: Already ran dbrev.
See comment 23. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |BLOCKED --- Comment #33 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Working here. Moving it to BLOCKED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #34 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Will add a follow-up for this bug. We need to check $lang before searching translated content. And which was very bad, we do not need to search for additional_content_id in the wrong column. diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm index 0555ddc6d1..7d5e877d0f 100644 --- a/Koha/AdditionalContents.pm +++ b/Koha/AdditionalContents.pm @@ -85,9 +85,9 @@ sub search_for_display { my $contents = $self->SUPER::search( $search_params, { order_by => 'number' } ); my @all_content_id = $contents->get_column('id'); - my @translated_content_id; - if ( $params->{lang} ) { - my $translated_contents = Koha::AdditionalContentsLocalizations->search( + my ( $translated_contents, @translated_content_id ); + if ( $params->{lang} && $params->{lang} ne 'default' ) { + $translated_contents = Koha::AdditionalContentsLocalizations->search( { additional_content_id => [$contents->get_column('id')], lang => $params->{lang}, @@ -105,7 +105,7 @@ sub search_for_display { return Koha::AdditionalContentsLocalizations->search( { - id => [@translated_content_id, $default_contents->get_column('id')] + id => [ $translated_contents ? $translated_contents->get_column('id') : (), $default_contents->get_column('id') ] }, ); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #35 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- I might have one query for the whole thing in search_for_display instead of four. But I am not sure if we really gain performance. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #36 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152545 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152545&action=edit Bug 31383: (QA follow-up) Do not return 0 in ->get The last statement evaluated is the if( $content->count ). If that evaluates to false, the false expression value is returned. In this case that is 0. We should just return undef or empty list (scalar/list context). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #37 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152546 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152546&action=edit Bug 31383: Check lang and use right column in search_for_display We should check if $lang equals default before looking for translated contents. And note that @translated_content_id contains additional_content_id not id, so cannot be used in the last query. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #38 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152547 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152547&action=edit Bug 31383: Use one query in search_for_display instead of four Benchmarking does however not show real performance gain. But it might be considered as a code improvement? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #39 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- What do you think of the last patch, Jonathan? We are actually cheating in search_for_display since we return localizations in the main object? Should we move it? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32245 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32245 [Bug 32245] Deleting news entries from Koha's staff start page is broken -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #40 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152566 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152566&action=edit Bug 31383: Fix URLs on staff AC detail view No real need anymore for showing a Default and Current language link. They could be made with the language parameter (not lang), but just changing the language allows you to test easily. Would you really like to see Default when you added content for all enabled languages? You can still add language=default to the URL. Test plan: Test the page URLs. Experiment with changing language in the regular way and via URL parameter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #41 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Main thing I still want to do, is test the dbrev a bit better than I did at first. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|32245 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32245 [Bug 32245] Deleting news entries from Koha's staff start page is broken -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |32245 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32245 [Bug 32245] Deleting news entries from Koha's staff start page is broken -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #42 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #41)
Main thing I still want to do, is test the dbrev a bit better than I did at first.
First test crashes: Added new table 'additional_contents_localizations' ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry 'pages-staff_only_7-CPL' for key 'additional_contents_uniq' at /usr/share/koha/C4/Installer.pm line 741 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #43 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #42)
(In reply to Marcel de Rooy from comment #41)
Main thing I still want to do, is test the dbrev a bit better than I did at first.
First test crashes: Added new table 'additional_contents_localizations' ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry 'pages-staff_only_7-CPL' for key 'additional_contents_uniq' at /usr/share/koha/C4/Installer.pm line 741
I would suggest to put the logic in a txn_do because I ended up now with a half conversion of data. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #44 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This was my add contents test table: | news | News_1 | NULL | | news | News_2 | NULL | | html_customizations | CatalogConcernHelp_1 | NULL | | html_customizations | CatalogConcernTemplate_1 | NULL | | pages | opac_only_5 | NULL | | pages | opac_only_5 | NULL | | pages | staff_only_7 | CPL | | pages | staff_only_7 | CPL | | pages | staff_only_7 | CPL | | news | News_1 | NULL | | news | News_2 | NULL | | news | News_2 | NULL | | news | News_13 | CPL | | news | News_13 | CPL | | html_customizations | CatalogConcernTemplate_1 | NULL | After all contents has been copied to localization, you try to add UNIQUE constraint on the above data. Which obviously does not work. Since you did not delete the double entries in additional_contents. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152423|0 |1 is obsolete| | --- Comment #45 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152660 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152660&action=edit Bug 31383: Create a parent-child DB relation for additional content In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang. Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come. What is this patchset doing? * DB changes - Rename additional_contents.idnew with id - Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents - Move the content to this new table - Remove title, content and lang columns from additional_contents - Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist. * CRUD - We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple. - No changes expected for "NewsLog" logging - Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language. Test plan: 0. Preparation steps, use master a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us. b. Create several news, additional contents, pages. Some with translated contents, some without. c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here d. Turn on NewsLogs 1. Apply the patches, restart_all, updatedatabase => Confirm that the new table is created and filled with the contents you had prior to the update => Confirm that additional_contents_localizations.updated_on has been kept to the previous values => Confirm that ISSUESLIP has been replaced properly => Confirm that you get a warning about the additional_contents 2. Create, update, delete news, html customs, pages => Confirm that the additional_contents_localizations.updated_on is only adjusted when required => Confirm that the logs are correctly created when NewsLogs is on 3. Check some items out, generate a slip => Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted 4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages => Confirm that the default values is displayed when you are using the interface in a language without translation => Confirm that the translated version is picked when it exists Notes for QA: * I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP. Shouldn't it hurt? * There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability? Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152424|0 |1 is obsolete| | --- Comment #46 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152661 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152661&action=edit Bug 31383: Adjust and add tests Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152425|0 |1 is obsolete| | --- Comment #47 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152662 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152662&action=edit Bug 31383: DB changes Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152426|0 |1 is obsolete| | --- Comment #48 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152663 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152663&action=edit Bug 31383: DBIC changes Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152427|0 |1 is obsolete| | --- Comment #49 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152664 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152664&action=edit Bug 31383: DBIC specific Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152428|0 |1 is obsolete| | --- Comment #50 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152665 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152665&action=edit Bug 31383: Restore updated_on for individual content Sponsored-by: Rijksmuseum, Netherlands -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152545|0 |1 is obsolete| | --- Comment #51 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152666 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152666&action=edit Bug 31383: (QA follow-up) Do not return 0 in ->get The last statement evaluated is the if( $content->count ). If that evaluates to false, the false expression value is returned. In this case that is 0. We should just return undef or empty list (scalar/list context). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152546|0 |1 is obsolete| | --- Comment #52 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152667 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152667&action=edit Bug 31383: Check lang and use right column in search_for_display We should check if $lang equals default before looking for translated contents. And note that @translated_content_id contains additional_content_id not id, so cannot be used in the last query. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152547|0 |1 is obsolete| | --- Comment #53 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152668 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152668&action=edit Bug 31383: Use one query in search_for_display instead of four Benchmarking does however not show real performance gain. But it might be considered as a code improvement? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152566|0 |1 is obsolete| | --- Comment #54 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152669 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152669&action=edit Bug 31383: Fix URLs on staff AC detail view No real need anymore for showing a Default and Current language link. They could be made with the language parameter (not lang), but just changing the language allows you to test easily. Would you really like to see Default when you added content for all enabled languages? You can still add language=default to the URL. Test plan: Test the page URLs. Experiment with changing language in the regular way and via URL parameter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Failed QA --- Comment #55 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Rebased, few follow-ups. Dbrev needs attention. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #56 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #53)
Created attachment 152668 [details] [review] Bug 31383: Use one query in search_for_display instead of four
Benchmarking does however not show real performance gain. But it might be considered as a code improvement?
I am expecting faster results without this patch. If we want to keep it we need to remove the following statement: use Array::Utils qw( array_minus ); (In reply to Marcel de Rooy from comment #54)
Created attachment 152669 [details] [review] Bug 31383: Fix URLs on staff AC detail view
IMO we should move this to its own bug report as it's a behaviour change. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #57 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153013 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153013&action=edit Bug 31383: Fix dbrevs We need to remove duplicate entries. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #58 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #44)
This was my add contents test table:
| news | News_1 | NULL | | news | News_2 | NULL | | html_customizations | CatalogConcernHelp_1 | NULL | | html_customizations | CatalogConcernTemplate_1 | NULL | | pages | opac_only_5 | NULL | | pages | opac_only_5 | NULL | | pages | staff_only_7 | CPL | | pages | staff_only_7 | CPL | | pages | staff_only_7 | CPL | | news | News_1 | NULL | | news | News_2 | NULL | | news | News_2 | NULL | | news | News_13 | CPL | | news | News_13 | CPL | | html_customizations | CatalogConcernTemplate_1 | NULL |
After all contents has been copied to localization, you try to add UNIQUE constraint on the above data. Which obviously does not work. Since you did not delete the double entries in additional_contents.
Should be fixed in the last patch. Didn't catch it because I was no using a specific branchcode I guess (NULL). (In reply to Marcel de Rooy from comment #43)
(In reply to Marcel de Rooy from comment #42)
(In reply to Marcel de Rooy from comment #41)
Main thing I still want to do, is test the dbrev a bit better than I did at first.
First test crashes: Added new table 'additional_contents_localizations' ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry 'pages-staff_only_7-CPL' for key 'additional_contents_uniq' at /usr/share/koha/C4/Installer.pm line 741
I would suggest to put the logic in a txn_do because I ended up now with a half conversion of data.
We run dbrevs in a transaction already but the DBMS will implicitly commit for CREATE/ALTER/DROP/etc statements (yes, that's bad). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #59 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- dbrev does no longer crash, still checking results DEV atomic update /usr/share/koha/installer/data/mysql/atomicupdate/bug_31383.pl [14:29:24]: Bug 31383 - Split the additional_contents table Renamed additional_contents.idnew with 'id' Added new table 'additional_contents_localizations' Removed 'title', 'content', 'lang' columns from additional_contents Adjusted notice template 'ISSUESLIP' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #60 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Needed small rebase on fa pencil stuff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152660|0 |1 is obsolete| | --- Comment #61 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153666 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153666&action=edit Bug 31383: Create a parent-child DB relation for additional content In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang. Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come. What is this patchset doing? * DB changes - Rename additional_contents.idnew with id - Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents - Move the content to this new table - Remove title, content and lang columns from additional_contents - Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist. * CRUD - We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple. - No changes expected for "NewsLog" logging - Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language. Test plan: 0. Preparation steps, use master a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us. b. Create several news, additional contents, pages. Some with translated contents, some without. c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here d. Turn on NewsLogs 1. Apply the patches, restart_all, updatedatabase => Confirm that the new table is created and filled with the contents you had prior to the update => Confirm that additional_contents_localizations.updated_on has been kept to the previous values => Confirm that ISSUESLIP has been replaced properly => Confirm that you get a warning about the additional_contents 2. Create, update, delete news, html customs, pages => Confirm that the additional_contents_localizations.updated_on is only adjusted when required => Confirm that the logs are correctly created when NewsLogs is on 3. Check some items out, generate a slip => Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted 4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages => Confirm that the default values is displayed when you are using the interface in a language without translation => Confirm that the translated version is picked when it exists Notes for QA: * I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP. Shouldn't it hurt? * There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability? Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152661|0 |1 is obsolete| | --- Comment #62 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153667 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153667&action=edit Bug 31383: Adjust and add tests Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152662|0 |1 is obsolete| | --- Comment #63 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153668 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153668&action=edit Bug 31383: DB changes Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152663|0 |1 is obsolete| | --- Comment #64 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153669 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153669&action=edit Bug 31383: DBIC changes Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152664|0 |1 is obsolete| | --- Comment #65 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153670 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153670&action=edit Bug 31383: DBIC specific Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152665|0 |1 is obsolete| | --- Comment #66 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153671 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153671&action=edit Bug 31383: Restore updated_on for individual content Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152666|0 |1 is obsolete| | --- Comment #67 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153672 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153672&action=edit Bug 31383: (QA follow-up) Do not return 0 in ->get The last statement evaluated is the if( $content->count ). If that evaluates to false, the false expression value is returned. In this case that is 0. We should just return undef or empty list (scalar/list context). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152667|0 |1 is obsolete| | --- Comment #68 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153673 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153673&action=edit Bug 31383: Check lang and use right column in search_for_display We should check if $lang equals default before looking for translated contents. And note that @translated_content_id contains additional_content_id not id, so cannot be used in the last query. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152668|0 |1 is obsolete| | --- Comment #69 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153674 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153674&action=edit Bug 31383: Use one query in search_for_display instead of four Benchmarking does however not show real performance gain. But it might be considered as a code improvement? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152669|0 |1 is obsolete| | --- Comment #70 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153675 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153675&action=edit Bug 31383: Fix URLs on staff AC detail view No real need anymore for showing a Default and Current language link. They could be made with the language parameter (not lang), but just changing the language allows you to test easily. Would you really like to see Default when you added content for all enabled languages? You can still add language=default to the URL. Test plan: Test the page URLs. Experiment with changing language in the regular way and via URL parameter. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153013|0 |1 is obsolete| | --- Comment #71 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 153676 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153676&action=edit Bug 31383: Fix dbrevs We need to remove duplicate entries. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153666|0 |1 is obsolete| | Attachment #153667|0 |1 is obsolete| | Attachment #153668|0 |1 is obsolete| | Attachment #153669|0 |1 is obsolete| | Attachment #153670|0 |1 is obsolete| | Attachment #153671|0 |1 is obsolete| | Attachment #153672|0 |1 is obsolete| | Attachment #153673|0 |1 is obsolete| | Attachment #153674|0 |1 is obsolete| | Attachment #153675|0 |1 is obsolete| | Attachment #153676|0 |1 is obsolete| | --- Comment #72 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156048 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156048&action=edit Bug 31383: Create a parent-child DB relation for additional content In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang. Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come. What is this patchset doing? * DB changes - Rename additional_contents.idnew with id - Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents - Move the content to this new table - Remove title, content and lang columns from additional_contents - Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist. * CRUD - We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple. - No changes expected for "NewsLog" logging - Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language. Test plan: 0. Preparation steps, use master a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us. b. Create several news, additional contents, pages. Some with translated contents, some without. c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here d. Turn on NewsLogs 1. Apply the patches, restart_all, updatedatabase => Confirm that the new table is created and filled with the contents you had prior to the update => Confirm that additional_contents_localizations.updated_on has been kept to the previous values => Confirm that ISSUESLIP has been replaced properly => Confirm that you get a warning about the additional_contents 2. Create, update, delete news, html customs, pages => Confirm that the additional_contents_localizations.updated_on is only adjusted when required => Confirm that the logs are correctly created when NewsLogs is on 3. Check some items out, generate a slip => Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted 4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages => Confirm that the default values is displayed when you are using the interface in a language without translation => Confirm that the translated version is picked when it exists Notes for QA: * I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP. Shouldn't it hurt? * There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability? Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #73 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156049 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156049&action=edit Bug 31383: Adjust and add tests Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #74 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156050 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156050&action=edit Bug 31383: DB changes Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #75 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156051 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156051&action=edit Bug 31383: DBIC changes Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #76 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156052&action=edit Bug 31383: DBIC specific Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #77 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156053 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156053&action=edit Bug 31383: Restore updated_on for individual content Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #78 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156054 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156054&action=edit Bug 31383: (QA follow-up) Do not return 0 in ->get The last statement evaluated is the if( $content->count ). If that evaluates to false, the false expression value is returned. In this case that is 0. We should just return undef or empty list (scalar/list context). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #79 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156055 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156055&action=edit Bug 31383: Check lang and use right column in search_for_display We should check if $lang equals default before looking for translated contents. And note that @translated_content_id contains additional_content_id not id, so cannot be used in the last query. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #80 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156056 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156056&action=edit Bug 31383: Use one query in search_for_display instead of four Benchmarking does however not show real performance gain. But it might be considered as a code improvement? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #81 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156057 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156057&action=edit Bug 31383: Fix URLs on staff AC detail view No real need anymore for showing a Default and Current language link. They could be made with the language parameter (not lang), but just changing the language allows you to test easily. Would you really like to see Default when you added content for all enabled languages? You can still add language=default to the URL. Test plan: Test the page URLs. Experiment with changing language in the regular way and via URL parameter. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #82 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 156058 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156058&action=edit Bug 31383: Fix dbrevs We need to remove duplicate entries. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #83 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Trivial rebase. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Failed QA --- Comment #84 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Generally, this all looks like an improvement.. but the QA script throws up something a bit odd that I've not got to the bottom of yet. In the valid template tests I get a couple of occurrences of `DBIx::Class::Schema::source(): Can't find source for AdditionalContentsLocalization at /kohadevbox/koha/Koha/Objects.pm line 524` and a subsequent test fail. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #85 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Martin Renvoize from comment #84)
Generally, this all looks like an improvement.. but the QA script throws up something a bit odd that I've not got to the bottom of yet.
In the valid template tests I get a couple of occurrences of `DBIx::Class::Schema::source(): Can't find source for AdditionalContentsLocalization at /kohadevbox/koha/Koha/Objects.pm line 524` and a subsequent test fail.
See comment 23 :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #86 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Awesome, thanks Jonathan, if missed that comment. This all seems good to me, I could find any regressions. I'll upload the designed patches in the morning and amend to PQA. Thanks for the with here -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156048|0 |1 is obsolete| | --- Comment #87 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156265 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156265&action=edit Bug 31383: Create a parent-child DB relation for additional content In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang. Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come. What is this patchset doing? * DB changes - Rename additional_contents.idnew with id - Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents - Move the content to this new table - Remove title, content and lang columns from additional_contents - Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist. * CRUD - We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple. - No changes expected for "NewsLog" logging - Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language. Test plan: 0. Preparation steps, use master a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us. b. Create several news, additional contents, pages. Some with translated contents, some without. c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here d. Turn on NewsLogs 1. Apply the patches, restart_all, updatedatabase => Confirm that the new table is created and filled with the contents you had prior to the update => Confirm that additional_contents_localizations.updated_on has been kept to the previous values => Confirm that ISSUESLIP has been replaced properly => Confirm that you get a warning about the additional_contents 2. Create, update, delete news, html customs, pages => Confirm that the additional_contents_localizations.updated_on is only adjusted when required => Confirm that the logs are correctly created when NewsLogs is on 3. Check some items out, generate a slip => Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted 4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages => Confirm that the default values is displayed when you are using the interface in a language without translation => Confirm that the translated version is picked when it exists Notes for QA: * I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP. Shouldn't it hurt? * There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability? Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156049|0 |1 is obsolete| | --- Comment #88 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156266 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156266&action=edit Bug 31383: Adjust and add tests Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156050|0 |1 is obsolete| | --- Comment #89 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156267 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156267&action=edit Bug 31383: DB changes Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156051|0 |1 is obsolete| | --- Comment #90 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156268 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156268&action=edit Bug 31383: DBIC changes Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156052|0 |1 is obsolete| | --- Comment #91 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156269 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156269&action=edit Bug 31383: DBIC specific Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156053|0 |1 is obsolete| | --- Comment #92 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156270 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156270&action=edit Bug 31383: Restore updated_on for individual content Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156054|0 |1 is obsolete| | --- Comment #93 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156271 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156271&action=edit Bug 31383: (QA follow-up) Do not return 0 in ->get The last statement evaluated is the if( $content->count ). If that evaluates to false, the false expression value is returned. In this case that is 0. We should just return undef or empty list (scalar/list context). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156055|0 |1 is obsolete| | --- Comment #94 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156272 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156272&action=edit Bug 31383: Check lang and use right column in search_for_display We should check if $lang equals default before looking for translated contents. And note that @translated_content_id contains additional_content_id not id, so cannot be used in the last query. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156056|0 |1 is obsolete| | --- Comment #95 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156273 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156273&action=edit Bug 31383: Use one query in search_for_display instead of four Benchmarking does however not show real performance gain. But it might be considered as a code improvement? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156057|0 |1 is obsolete| | --- Comment #96 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156274 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156274&action=edit Bug 31383: Fix URLs on staff AC detail view No real need anymore for showing a Default and Current language link. They could be made with the language parameter (not lang), but just changing the language allows you to test easily. Would you really like to see Default when you added content for all enabled languages? You can still add language=default to the URL. Test plan: Test the page URLs. Experiment with changing language in the regular way and via URL parameter. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156058|0 |1 is obsolete| | --- Comment #97 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156275 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156275&action=edit Bug 31383: Fix dbrevs We need to remove duplicate entries. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #98 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 156276 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=156276&action=edit Bug 31383: (QA follow-up) Tidy Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #99 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- No regressions found, QA scripts pretty much happy and this is a solid improvement in our foundations, hopefully meaning we can move forward with further enhancements to this area of Koha. Great work all involved, thank you. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34482 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34482 [Bug 34482] Improve MARC21 7xx linking fields in bibliographic records [Omnibus] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|34482 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34482 [Bug 34482] Improve MARC21 7xx linking fields in bibliographic records [Omnibus] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply --- Comment #100 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Small rebase required. Please do ASAP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #156265|0 |1 is obsolete| | Attachment #156266|0 |1 is obsolete| | Attachment #156267|0 |1 is obsolete| | Attachment #156268|0 |1 is obsolete| | Attachment #156269|0 |1 is obsolete| | Attachment #156270|0 |1 is obsolete| | Attachment #156271|0 |1 is obsolete| | Attachment #156272|0 |1 is obsolete| | Attachment #156273|0 |1 is obsolete| | Attachment #156274|0 |1 is obsolete| | Attachment #156275|0 |1 is obsolete| | Attachment #156276|0 |1 is obsolete| | --- Comment #101 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157539 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157539&action=edit Bug 31383: Create a parent-child DB relation for additional content In the design of additional contents the idea of a parent-child relation is implicitly present. You have a default page and translations. But we do this in one table coming from the old news items. Several reports show that we would be better off creating a parent table listing the main news items, CMS pages or HTML content. And a child table containing the title, content and lang. Note that this first step is a prelimenary step to clean this area and make it more robust and extensible. More enhancements to come. What is this patchset doing? * DB changes - Rename additional_contents.idnew with id - Create a new table additional_contents_localizations(id, additional_content_id, title, content, lang) that will contain the translated contents - Move the content to this new table - Remove title, content and lang columns from additional_contents - Replace the notice templates that are using ''<news>" (should only be ISSUESLIP) and remove support for this syntax. Also add a warning in case other occurrences of uses of the old syntax exist. * CRUD - We add a new Koha::AdditionalContentsLocalization[s] couple, and move some logic from Koha::AdditionalContent[s] to there. Note that, to prevent too much drastic changes in notice templates, and to make them easy to use, the different attributes of the content object is accessible from the translated content object (ie. Koha::AdditionalContentsLocatlization->library is available and return $self->additional_content->library). I think it's an elegant way to keep things simple. - No changes expected for "NewsLog" logging - Little behaviour changes for pages, see tools/page.pl changes. We are now passing the id of the content, and the desired language, instead of the mix of "page_id" or code and lang. Note that here we certainly need to rename "language" query param to not change the full interface language. Test plan: 0. Preparation steps, use master a. Create notice templates that are using "<< additional_contents.code >>". This won't be replaced, but we want the update process to alert us. b. Create several news, additional contents, pages. Some with translated contents, some without. c. Make sure ISSUESLIP has the "<news>" section. If you are using the sample data there is nothing to do here d. Turn on NewsLogs 1. Apply the patches, restart_all, updatedatabase => Confirm that the new table is created and filled with the contents you had prior to the update => Confirm that additional_contents_localizations.updated_on has been kept to the previous values => Confirm that ISSUESLIP has been replaced properly => Confirm that you get a warning about the additional_contents 2. Create, update, delete news, html customs, pages => Confirm that the additional_contents_localizations.updated_on is only adjusted when required => Confirm that the logs are correctly created when NewsLogs is on 3. Check some items out, generate a slip => Confirm that the news are displayed at the bottom of the slip, and that the publication date is correctly formatted 4. Have several HTML customizations (like OpacNav, opacheader), in translated in different languages => Confirm that the default values is displayed when you are using the interface in a language without translation => Confirm that the translated version is picked when it exists Notes for QA: * I am not sure we really need the alert during the update DB process about the additional_contents leftover. We should not have them outside of ISSUESLIP. Shouldn't it hurt? * There is something ugly in sample_news.yml, the id is hardcoded. But how do we prevent that and keep translatability? Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #102 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157540 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157540&action=edit Bug 31383: Adjust and add tests Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #103 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157541 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157541&action=edit Bug 31383: DB changes Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #104 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157542 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157542&action=edit Bug 31383: DBIC changes Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #105 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157543 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157543&action=edit Bug 31383: DBIC specific Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #106 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157544 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157544&action=edit Bug 31383: Restore updated_on for individual content Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #107 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157545 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157545&action=edit Bug 31383: (QA follow-up) Do not return 0 in ->get The last statement evaluated is the if( $content->count ). If that evaluates to false, the false expression value is returned. In this case that is 0. We should just return undef or empty list (scalar/list context). Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #108 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157546 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157546&action=edit Bug 31383: Check lang and use right column in search_for_display We should check if $lang equals default before looking for translated contents. And note that @translated_content_id contains additional_content_id not id, so cannot be used in the last query. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #109 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157547 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157547&action=edit Bug 31383: Use one query in search_for_display instead of four Benchmarking does however not show real performance gain. But it might be considered as a code improvement? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #110 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157548 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157548&action=edit Bug 31383: Fix URLs on staff AC detail view No real need anymore for showing a Default and Current language link. They could be made with the language parameter (not lang), but just changing the language allows you to test easily. Would you really like to see Default when you added content for all enabled languages? You can still add language=default to the URL. Test plan: Test the page URLs. Experiment with changing language in the regular way and via URL parameter. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #111 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157549 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157549&action=edit Bug 31383: Fix dbrevs We need to remove duplicate entries. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #112 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157550 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157550&action=edit Bug 31383: (QA follow-up) Tidy Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #113 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34889 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34889 [Bug 34889] Convert PatronSelfRegistrationAdditionalInstructions system preference to HTML customization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34869 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34869 [Bug 34869] Convert OPACResultsSidebar system preference to HTML customization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #114 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This breaks Koha_Master, which tries to re-apply all the updates in an attempt to test db_revs to be idempotent. https://jenkins.koha-community.org/job/Koha_Master/2692/console We could add a check for the existence of the table, and use different queries. Do you agree? Is it worth the trouble? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #115 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 157580 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157580&action=edit Bug 31383: Fix kohastructure.sql Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #116 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #114)
This breaks Koha_Master, which tries to re-apply all the updates in an attempt to test db_revs to be idempotent.
https://jenkins.koha-community.org/job/Koha_Master/2692/console
We could add a check for the existence of the table, and use different queries. Do you agree? Is it worth the trouble?
No, I don't think so. I am about to provide a patch to make the test passes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #117 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157585 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157585&action=edit Bug 31383: Fix the DB upgrade process This patch fixes misc4dev/run_tests.pl --run-db-upgrade-only We need to make sure the column exists before running the query. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #118 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #117)
Created attachment 157585 [details] [review] Bug 31383: Fix the DB upgrade process
This patch fixes misc4dev/run_tests.pl --run-db-upgrade-only
We need to make sure the column exists before running the query.
Patch pushed to master. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #119 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157640 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157640&action=edit Bug 31383: (bug 29691 follow-up) Remove get_opac_news_by_id We can simply use get here -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed CC| |nick@bywatersolutions.com --- Comment #120 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Nick, could you have a look at this patch please? Would it work for you (as the author of bug 29691)? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #121 from Owen Leonard <oleonard@myacpl.org> --- I'm getting an error from updatedatabase: ERROR - {UNKNOWN}: Not a HASH reference at /kohadevbox/koha/installer/data/mysql/db_revs/230600041.pl line 130. at /kohadevbox/koha/C4/Installer.pm line 741 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #122 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Did not see it myself: Upgrade to 23.06.00.041 [11:42:55]: Bug 31383 - Split the additional_contents table Renamed additional_contents.idnew with 'id' Added new table 'additional_contents_localizations' Removed 'title', 'content', 'lang' columns from additional_contents Adjusted notice template 'ISSUESLIP' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #123 from Owen Leonard <oleonard@myacpl.org> --- If I delete any notices which have a branchcode from the letters table before I run the database update the update runs without error. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #124 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Owen Leonard from comment #123)
If I delete any notices which have a branchcode from the letters table before I run the database update the update runs without error.
So, before upgrade, we need to add a couple branch-specific news. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #125 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This should not work either I guess? sub get_opac_news_by_id { my ( $self, $params ) = @_; my $news_id = $params->{news_id}; my $content = Koha::AdditionalContents->search( { location => ['opac_only', 'staff_and_opac'], idnew => $news_id, category => 'news', } ); because of `idnew`. Used in the OPAC's main page: $ git grep get_opac_news_by_id opac-tmpl/bootstrap/en/modules/opac-main.tt: [% SET koha_news = AdditionalContents.get_opac_news_by_id( news_id => news_id ) %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #126 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Owen Leonard from comment #123)
If I delete any notices which have a branchcode from the letters table before I run the database update the update runs without error.
I think I was testing this incorrectly, so ignore me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #127 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #125)
This should not work either I guess?
sub get_opac_news_by_id { my ( $self, $params ) = @_;
my $news_id = $params->{news_id};
my $content = Koha::AdditionalContents->search( { location => ['opac_only', 'staff_and_opac'], idnew => $news_id, category => 'news', } );
because of `idnew`.
Used in the OPAC's main page: $ git grep get_opac_news_by_id opac-tmpl/bootstrap/en/modules/opac-main.tt: [% SET koha_news = AdditionalContents.get_opac_news_by_id( news_id => news_id ) %]
Please see last latch! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #128 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #119)
Created attachment 157640 [details] [review] Bug 31383: (bug 29691 follow-up) Remove get_opac_news_by_id
We can simply use get here
Pushed to master. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35136 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35136 [Bug 35136] Error during database update after Bug 31383 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #129 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 157741 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157741&action=edit Bug 31383: (follow-up) Remove get_opac_news_by_id Keep the same behaviour, but wondering why we don't return 'content' when there is no match. ie. + is( $additional_contents, undef ); should certainly be + is( $additional_contents->{content}->count, 0 ); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #130 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Please wait for Nick's comment this time ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157741|0 |1 is obsolete| | --- Comment #131 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 157742 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157742&action=edit Bug 31383: (follow-up) Remove get_opac_news_by_id Keep the same behaviour, but wondering why we don't return 'content' when there is no match. ie. + is( $additional_contents, undef ); should certainly be + is( $additional_contents->{content}->count, 0 ); WNC amended patch - tidied Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34894 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34894 [Bug 34894] Convert OpacSuppressionMessage system preference to HTML customization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35048 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35048 [Bug 35048] Convert SCOMainUserBlock system preference to HTML customization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35063 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35063 [Bug 35063] Convert SelfCheckInMainUserBlock system preference to HTML customization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35065 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35065 [Bug 35065] Convert SelfCheckHelpMessage system preference to HTML customization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35151 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35151 [Bug 35151] Convert ILLModuleCopyrightClearance system preference to additional contents -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35152 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35152 [Bug 35152] Convert RoutingListNote system preference to additional contents -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35153 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35153 [Bug 35153] Convert IntranetmainUserblock system preference to additional contents -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35154 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35154 [Bug 35154] Convert StaffLoginInstructions system preference to additional contents -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 --- Comment #132 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #130)
Please wait for Nick's comment this time ;)
Please mark it as BLOCKED in such situations. Sometimes I already went through a bug and already have it on my local branch for a day or two. It would be better to have the koha-push script complain about wrong status on the bug instead of having to revisit if there are new comments on each already pushed bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36875 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|35154 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35154 [Bug 35154] Convert StaffLoginInstructions system preference to additional contents -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37628 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37628 [Bug 37628] (Bug 31383 follow-up) Last patch from bug was not applied -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37684 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37684 [Bug 37684] Direct links to expired news are broken -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|37684 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37684 [Bug 37684] Direct links to expired news are broken -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 holly@bywatersolutions.com changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38626 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38626 [Bug 38626] additional_contents_localizations not available in ISSUESSLIP -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31509 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED Resolution|--- |FIXED CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #133 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43019 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org