Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using: /admin/config/development/generate/content
Generating default Article nodes, you will see drupal die, and then find this in the log:
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'comment_status' cannot be null: INSERT INTO {node__comment} (entity_id, revision_id, bundle, delta, langcode, comment_status) VALUES (:db_insert_placeholder_0...
No content gets generated.
Workaround: Remove the comment field from the content type.
Comment | File | Size | Author |
---|---|---|---|
#15 | Schermafbeelding 2015-04-13 om 16.40.35.png | 68.78 KB | valgibson |
#7 | devel-generate-comment-failure-2422013-7.patch | 1.04 KB | willzyx |
Comments
Comment #1
penyaskitoThis looks like a problem in core. Failing test here first.
Comment #3
willzyx CreditAttribution: willzyx commentedThanks for reporting this and for open the core issue #2422101: CommentItem should override the generateSampleValue method and provide sample values .
@penyaskito
I think the patch should be changed as per #2357199: Consider CommentManagerInterface::addDefaultField() as deprecated and remove in favour of CommentTestTrait. New patch attached
Comment #4
penyaskitoComment #6
andypostthe proper fix is #2422101-7: CommentItem should override the generateSampleValue method and provide sample values
Comment #7
willzyx CreditAttribution: willzyx commentedRerolled patch from #3
Comment #8
willzyx CreditAttribution: willzyx commentedComment #10
andypostneeds fixed first #2422101: CommentItem should override the generateSampleValue method and provide sample values
Comment #11
Manuel Garcia CreditAttribution: Manuel Garcia commented#2422101: CommentItem should override the generateSampleValue method and provide sample values is in now yay!
Comment #14
willzyx CreditAttribution: willzyx commentedCommitted/pushed to the 8.x version. Thanks
Comment #15
valgibson CreditAttribution: valgibson commentedProblem/Motivation
Reopening this issue as I'm still encountering the same problem as originally stated. Steps I undertook to reproduce the issue:
Error appears (view attachment).
Message from my php error log:
"SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'comment_status' cannot be null: INSERT INTO {node__comment} (entity_id, revision_id, bundle, delta, langcode, comment_status) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5);
Note: this only happens when creating content from the Article content type. Basic page is creating content as expected.
Comment #16
clemens.tolboom@valgibson you need to use drupal head for this to test. The core issue is resolved on 2015-Apr-8 while beta 9 is from 2015-Mar-25
Comment #17
willzyx CreditAttribution: willzyx commented@valgibson this issue has been fixed in core (see #2422101: CommentItem should override the generateSampleValue method and provide sample values for more details) on April 8, 2015 at 1:41pm.
Make sure to use the HEAD version of drupal 8 or at least a version released after the fix.
Feel free to open onother issue if you think that this problem still exists.
Thanks