• Resolved jonwild

    (@jonwild)


    I recently moved the entire website to another cPanel. Now trying to add a new project. I can save the project but when trying to assign editors get ‘The editors could not be updated’ when attempting to save and so can not get any further with the project. Any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author ccprog

    (@ccprog)

    If you have the possibility to do temporary tests, you could set

    define('WP_DEBUG', true);

    in the wp-config.php to get more meaningfull debug messages. (Do not forget to remove that entry afterwards.)

    The error can have several causes. My first guess would be that in moving the site some user accounts got new id numbers and somehow you now get inconsistencies between names and ids. But then, I can’t see how such a scenario can happen when you add a new project.

    Plugin Author ccprog

    (@ccprog)

    Another easy thing to check: do all editors you try to add have a role that is listed as having full editor rights?

    Thread Starter jonwild

    (@jonwild)

    Cannot add or update a child row: a foreign key constraint fails (rcc.wpzy_crw_editors, CONSTRAINT wp0e_project_editors FOREIGN KEY (project) REFERENCES wp0e_crw_projects (project) ON DELETE CASCADE ON UPDATE CASCADE)
    INSERT INTO wpzy_crw_editors (project, user_id) VALUES (‘Test Project’, 2),(‘Test Project’, 1)

    It’s because the database prefix has changed. Not sure how to fix.

    Plugin Author ccprog

    (@ccprog)

    If you feel you know how to you could try to remove the foreign key constraints on both database tables wpzy_crw_editors and wpzy_crw_crosswords by hand (I understand that are the current table names). They should be recreated with the new table names if you deactivate and activate the plugin again.

    Check if they are present afterwards, and if not, the SQL commands creating them would be

    `
    ALTER TABLE wpzy_crw_crosswords
    ADD CONSTRAINT wpzy_project_crossword FOREIGN KEY (project)
    REFERENCES wpzy_crw_projects (project)
    ON UPDATE CASCADE
    `

    and

    `
    ALTER TABLE wpzy_crw_editors
    ADD CONSTRAINT wpzy_project_editors FOREIGN KEY (project)
    REFERENCES wpzy_crw_projects (project)
    ON DELETE CASCADE
    ON UPDATE CASCADE
    `

    Thread Starter jonwild

    (@jonwild)

    Many thanks I will try.

    On looking at the two tables in the relation view there are two constraints one for the old prefix and one for the new. I tried to drop the old with the wpoe prefix but it wont work. I’m guessing this needs to removed before trying what you suggest. I’m working on a local copy and so not an issue if go wrong.

    Thread Starter jonwild

    (@jonwild)

    I’ve managed to drop the foreign key constraints now and deactivated and reactivated the plugin. All back to normal.

    Thanks for your help.

    Plugin Author ccprog

    (@ccprog)

    As said above, make sure the foreign keys with the new table names exist. Otherwise, you will get into trouble the next time you try to rename or delete a project.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘The editors could not be updated’ is closed to new replies.