[Koha-bugs] [Bug 31383] Additional contents: We need a parent and child table

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 4 14:00:59 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31383

--- Comment #58 from Jonathan Druart <jonathan.druart+koha at 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.


More information about the Koha-bugs mailing list