Problem/Motivation

When we update paragraphs with old data we get a fatal error that indicates that there are references to paragraphs (or other content) that was deleted.

Proposed resolution

Fix it.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yongt9412 created an issue. See original summary.

johnchque’s picture

Status: Active » Needs review
FileSize
706 bytes

This should fix it the ERR part.

Berdir’s picture

Status: Needs review » Needs work

Test coverage for this should be pretty easy.

In an existing test with an entity that references another, delete the referenced entity and then resave the parent, that should be enough to trigger this.

johnchque’s picture

The last submitted patch, 4: fatal_error_when_call-2706883-4-test-only.patch, failed testing.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Comment in the test is no very clear, but Miro can improve that on commit I think if he has an idea for improving it?

chr.fritsch’s picture

Status: Reviewed & tested by the community » Needs work

Using devel_generate for creating nodes with paragraphs is still borken.

Got this message:


Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'field_paragraphs_target_revision_id' cannot be null: INSERT INTO {node__field_paragraphs} (entity_id, revision_id, bundle, delta, langcode, field_paragraphs_target_id, field_paragraphs_target_revision_id) 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, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => 8 [:db_insert_placeholder_1] => 8 [:db_insert_placeholder_2] => article [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => de [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (Zeile 757 in /Users/christianfritsch/repositories/thunder/thunder-local/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Berdir’s picture

Status: Needs work » Reviewed & tested by the community

That's not the fault of this issue, if anything, we just change the error because it fails differently. ERR needs specific integration for devel_generate.

killua99’s picture

Status: Reviewed & tested by the community » Needs work

Could we add test coverage for PostgreSQL?

I open the bug about update paragraphs 8003 and we use PostgreSQL

Berdir’s picture

Status: Needs work » Reviewed & tested by the community

I added a test with PostgreSQL for the patch. This has nothing to do with the database. If it fails then HEAD very likely already fails too.

@Miro: Can you enable on commit testing for PHP7 + mysql/postgresql/sqlite on https://www.drupal.org/node/2411903/qa? just php7 for those should be enough and it's faster.

miro_dietiker’s picture

Status: Reviewed & tested by the community » Fixed

Thx, fixed.

miro_dietiker’s picture

Add missing reference.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.