- changed status to resolved
CMS Blocks: Integrity constraint violation: 1062 Duplicate entry '0-' for key 'UNQ_page_url'
With the current form validation and unique indexing setup, it's common to receive the above confusing error message when attempting to create blocks without a page-url
Reproduction Steps.
-
Log into the admin
-
Click on
CMS -> Block
-
Click the "New CMS Block" button
-
Enter the value
bad-key-example
into the handle field and click the "save" button -
Click the "New CMS Block" button
-
Enter the value
bad-key-example2
into the handle field and click the "save" button
Expected Behavior: Should be able to save the second block
Actual Behavior: System reports a
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0-' for key 'UNQ_page_url'
error.
This appears to be due to the UNQ_page_url
key. This may be fixable by ensuring page_url
is populated as NULL
instead of an empty string when there's a blank value.
Comments (1)
-
- Log in to comment
Fixed issue
#25: CMS Blocks: Integrity constraint violation: 1062 Duplicate entry '0-' for key 'UNQ_page_url'→ <<cset e4119f9bbad4>>