thexerteproject / xerteonlinetoolkits

Xerte Online Toolkits
www.xerte.org.uk
Apache License 2.0
62 stars 61 forks source link

Folder creation partially fails with db prefix #1164

Open JustinGeorgi opened 1 year ago

JustinGeorgi commented 1 year ago

I installed 3.11 toolkit a few days ago on a test server and did not add a database prefix. All folder functions worked.

I installed the same version yesterday on a production server and added a database prefix during setup. After setup completion I could not add folders to the workspace. The popup box always resulted in "Error creating folder".

Folder information is properly added to the folderdetails table, but nothing is added to the folderrights table.

Turns out, folder_library.php is attempting to insert into a folderrights table with the database prefix:

$query = "INSERT INTO {$prefix}folderrights (folder_id, login_id, folder_parent, role) values (?,?,?,?)";

but basic.sql is creating the folderrights table without the prefix:

CREATE TABLE `folderrights` (

Changing the name of folderrights table in the schema to include the prefix fixes the problem with folder creation and display, but of course, I don't know if it has any negative downstream effects.

torinfo commented 1 year ago

Thank you. The proper fix is indeed making sure the prefix is used on the folderrights table as well.

I'll fix the basic.sql table.