We have had 2 reports about this on the mailing list from 3 different people so far. It was not possible yet to determine the cause: https://lists.katipo.co.nz/pipermail/koha/2021-December/057161.html https://lists.katipo.co.nz/pipermail/koha/2021-December/057186.html I've tried to replicate on master, but no luck so far.
I have managed to find the steps to make this bug visible: 1) Install an additional language, like de-DE 2) Activate language 3) Add a new HTML customization entry * Fill in default and Englis * Fill in the additional installed language * Save 4) Verify the contents show as they should 5) Delete the entry 6) Verify the content remain for the additional language This can also be verified by running: select * from additional_contents; In my case I deleted everything else and now only this entry remains that is not visible from the GUI: +-------+---------------------+---------------------+-------------------+------------+-------+---------+-------+--------------+---------------------+----------------+--------+----------------+ | idnew | category | code | location | branchcode | title | content | lang | published_on | updated_on | expirationdate | number | borrowernumber | +-------+---------------------+---------------------+-------------------+------------+-------+---------+-------+--------------+---------------------+----------------+--------+----------------+ | 7 | html_customizations | OpacMainUserBlock_6 | OpacMainUserBlock | NULL | test | test | de-DE | 2022-01-02 | 2022-01-02 01:46:58 | NULL | NULL | 51 | +-------+---------------------+---------------------+-------------------+------------+-------+---------+-------+--------------+---------------------+----------------+--------+----------------+ Updating severity as this means people have no way to change or remove unwanted content - we need to fix this and also include a database update.
Created attachment 128957 [details] [review] Bug 29778: Prevent orphan additional contents When deleting a content, only the main one (lang="default") is removed, which leads to orphan contents in the DB that are still displayed on the UI. Test plan: 0. Don't apply this patch 1. Create some contents, translate them in different languages 2. Delete some of them => Note that they are still displayed on the UI and that the entries with lang!="default" are still in the DB 3. Apply this patch 4. Repeat 1 5. Run updatedatabase 6. Delete from of the contents => Note that the orphan entries created before you applied the patch have been removed and that the "delete" behaviour is now working correnctly.
I'm getting this error when running updatedatabase: ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Table 'additional_contents' is specified twice, both as a target for 'DELETE' and as a separate source for data at /kohadevbox/koha/C4/Installer.pm line 738 My "About" page says: MySQL version: mysql Ver 15.1 Distrib 10.3.31-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Created attachment 129038 [details] [review] Bug 29778: Remove DBMS error ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Table 'additional_contents' is specified twice, both as a target for 'DELETE' and as a separate source for data at /kohadevbox/koha/C4/Installer.pm line 738 Happened on MariaDB 10.1 and 10.3, not 10.6
Created attachment 129040 [details] [review] Bug 29778: Prevent orphan additional contents When deleting a content, only the main one (lang="default") is removed, which leads to orphan contents in the DB that are still displayed on the UI. Test plan: 0. Don't apply this patch 1. Create some contents, translate them in different languages 2. Delete some of them => Note that they are still displayed on the UI and that the entries with lang!="default" are still in the DB 3. Apply this patch 4. Repeat 1 5. Run updatedatabase 6. Delete from of the contents => Note that the orphan entries created before you applied the patch have been removed and that the "delete" behaviour is now working correnctly. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 129041 [details] [review] Bug 29778: Remove DBMS error ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Table 'additional_contents' is specified twice, both as a target for 'DELETE' and as a separate source for data at /kohadevbox/koha/C4/Installer.pm line 738 Happened on MariaDB 10.1 and 10.3, not 10.6 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 129218 [details] [review] Bug 29778: Prevent orphan additional contents When deleting a content, only the main one (lang="default") is removed, which leads to orphan contents in the DB that are still displayed on the UI. Test plan: 0. Don't apply this patch 1. Create some contents, translate them in different languages 2. Delete some of them => Note that they are still displayed on the UI and that the entries with lang!="default" are still in the DB 3. Apply this patch 4. Repeat 1 5. Run updatedatabase 6. Delete from of the contents => Note that the orphan entries created before you applied the patch have been removed and that the "delete" behaviour is now working correnctly. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 129219 [details] [review] Bug 29778: Remove DBMS error ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Table 'additional_contents' is specified twice, both as a target for 'DELETE' and as a separate source for data at /kohadevbox/koha/C4/Installer.pm line 738 Happened on MariaDB 10.1 and 10.3, not 10.6 Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 29828 shows another vector of creating database entries for additional contents that are not visible in the GUI - ideally we should have fixes for both in the next releases!
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
(In reply to Katrin Fischer from comment #9) > Bug 29828 shows another vector of creating database entries for additional > contents that are not visible in the GUI - ideally we should have fixes for > both in the next releases! Please backport with this comment in mind!
Pushed to 21.11.x for 21.11.02
Missing dependency, not backported to 21.05
Just mentioning that this dbrev can be quite nasty for people having some custom records in the former news table.