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.
We have a failing test in Devel Generate: http://qa.drupal.org/pifr/test/137984
Marking critical because it blocks testing.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1957864-5.patch | 1.06 KB | amateescu |
#3 | 1957864-fix_devel_generate_comments-3.patch | 1.83 KB | pcambra |
Comments
Comment #1
pcambraMight be related to #1955698: Generated content throws an InvalidArgumentException on render ?
I'll take a look
Comment #2
pcambraIdentified the issue when you set comments for content.
Drupal\Core\Entity\EntityStorageException: Unable to set a value with a non-numeric delta in a list. in Drupal\Core\Entity\DatabaseStorageControllerNG->save() (line 342 of /webs/contrib/drupal8/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php).
Comment #3
pcambraLooking to this closer it seems to me we're in the middle of a big entity conversion, being users and nodes treated in a different way that the rest of entities, found this class "EntityBCDecorator" that nodes are using and it seems it will eventually go away. Users seem to share the same pattern.
Comments, and other entities are treated the "right" way. See below.
Old fashioned way:
$object->{$field_name}[$language->langcode] = $object_field;
New way
$object->{$field_name}->value = $value;
Here's a patch covering both ways, not pretty, but I think there's little we can do short term for this and we need the tests back in green.
Comment #4
salvisThank you for investigating and fixing!
I don't have time to review this properly now and no one else has jumped in, but since we're currently broken, we can only get better. :-)
Please push your patch and trigger a re-test of HEAD.
(The patch has no chance to turn green — that's OK in this exceptional situation.)
Comment #5
amateescu CreditAttribution: amateescu commentedThis one should be cleaner :)
Comment #6
pcambraAmazing Andrei, thanks a lot
Comment #8
forestmars CreditAttribution: forestmars commentedBefore opening a new issue thought I would check in here. Current version of Devel can't generate articles and is returning the following error:
Drupal\Core\Entity\EntityStorageException: 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); Array ( [:db_insert_placeholder_0] => 14 [:db_insert_placeholder_1] => 14 [:db_insert_placeholder_2] => article [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => en [:db_insert_placeholder_5] => ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 934 of /Users/forestmars/ht/Drupal/d8b7/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
This exception is thrown regardless whether number of comments is set to 0 or not, and regardless whether comments are set to closed on article content type.
Comment #9
willzyx CreditAttribution: willzyx commented@forestmars
This is an old post. See #2422101: CommentItem should override the generateSampleValue method and provide sample values and #2422013: Integrity constraint violation - Column 'comment_status' cannot be null