Pkp-lib: Cannot delete Journal sections

Created on 14 Apr 2020  路  9Comments  路  Source: pkp/pkp-lib

Hi @asmecher,
I am using OJS 3.2.0-1 and every time I try to delete a journal section I get this error:

PHP Fatal error:  Uncaught Exception: DB Error: ERROR:  column "sectionId" does not exist
LINE 1: DELETE FROM publication_settings WHERE setting_name = "sectionId...
                                                             ^ Query: DELETE FROM publication_settings WHERE setting_name = "sectionId" AND setting_value = ? in /var/www/html/lib/pkp/classes/db/DAO.inc.php:703

I have tried the latest version 3.2.0-2 as well and still getting the same problem.
The page in Settings > Journal > Sections Tab > delete section

Thanks
Salman

All 9 comments

Thanks for reporting, @salmanm2003; this is caused by SQL quoting that isn't PostgreSQL-compatible (and affects only PostgreSQL users). You can fix it by applying these changes, relative to the OJS install directory:
https://github.com/pkp/ojs/commit/881ca98eea6feb56b292b3aa171d10b264b7755d
https://github.com/pkp/ojs/commit/7eeb3f275f879bf0ddadcaf82bf8c7ae281343fa
...and these ones, relative to the lib/pkp subdirectory:
https://github.com/pkp/pkp-lib/commit/c7f7aca2cfe42c1d445044964220c3716cfd7bf7

Perfect!
Thanks @asmecher

(Note that I just added an additional change to the list, to correct a typo and fix a missed case)

Hi @asmecher thank you so much for looking at this so quickly. Just one minor note (that might be totally wrong): according to the logs, we are seeing an SQL query that is trying to perform an action on a table that has a column named sectionId, while the actual column in the DB is section_id. Hope this helps :)

@fradeve, starting with OJS 3.2, the data has actually moved into the setting_value column of the publication_settings table.

HI @asmecher,
As I can see in the DB that the Sections data been stored in section_settings not in publication_settings and for some reasons the system is trying to check the value sectionId in setting_value which is not there.

The query you're looking at is trying to determine what the section ID is for the publication you're looking at; this will be stored in publication_settings. If the entry in publication_settings with setting_name='sectionId' is missing, it means that publication is not designated against a section yet.

It makes sense now.
thanks a lot.

I am sure this is not needed, but we just tested this on OJS 3.2.0-3 and we can confirm that the fix works :+1: Thanks!

Was this page helpful?
0 / 5 - 0 ratings