[SOLVED] Unable to add new content
Posted: Wed Sep 03, 2014 2:15 pm
I upgraded to the latest (at the time) 1.11.10 version of CMSMS several months ago, also migrating from PostgreSQL to the required MySQL. At the time I'd thought everything was working, but I guess nobody had attempted to add new content until now.
ETA: I should mention that modifying existing content works flawlessly.
Anyway, the first attempt to add new content seems to be successful in the UI, but the content doesn't show up in either the admin interface or on the site. Any subsequent attempts to add content result in a "Duplicate entry '0' for key 'PRIMARY'" error.
I had a look at the MySQL table, and there is a new row in cms_content with the data as entered, but it has content_id set to 0 which seems odd to me. I would have expected inserting a row with content_id 0 to auto-increment the primary key. Interestingly, when I dump the schema for a newly auto-created database, one of the lines is...
... which seems to indicate that auto-increment on zero is disabled, in which case I would expect CMSMS to insert NULL into the PK field so that auto_increment works.
I also attempted to reset the auto-increment index on the content_id field using:
but that made no difference.
I'm pretty sure something is munged as a result of my migration/upgrade process, but I'm not quite sure where to start looking...
ETA: I should mention that modifying existing content works flawlessly.
Anyway, the first attempt to add new content seems to be successful in the UI, but the content doesn't show up in either the admin interface or on the site. Any subsequent attempts to add content result in a "Duplicate entry '0' for key 'PRIMARY'" error.
I had a look at the MySQL table, and there is a new row in cms_content with the data as entered, but it has content_id set to 0 which seems odd to me. I would have expected inserting a row with content_id 0 to auto-increment the primary key. Interestingly, when I dump the schema for a newly auto-created database, one of the lines is...
Code: Select all
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
I also attempted to reset the auto-increment index on the content_id field using:
Code: Select all
ALTER TABLE cms_content AUTO_INCREMENT = [nn]
I'm pretty sure something is munged as a result of my migration/upgrade process, but I'm not quite sure where to start looking...