Problem/Motivation

Steps to reproduce

  1. Create contents from other entity types than node (e.g. term, media), without the serial field
  2. Add a serial field and set Start on existing entities to Yes

Throws

<em class="placeholder">Drupal\Core\Entity\Query\QueryException</em>: type not found in <em class="placeholder">Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable()</em> (line <em class="placeholder">367</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/Query/Sql/Tables.php</em>). <pre class="backtrace">Drupal\Core\Entity\Query\Sql\Tables->addField(type, INNER, NULL) (Line: 52)
Drupal\Core\Entity\Query\Sql\Condition->compile(Object) (Line: 172)
Drupal\Core\Entity\Query\Sql\Query->compile() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 109)
Drupal\serial\Plugin\Field\FieldType\SerialItem->initializeEntitiesCallback(Array, Object)
call_user_func_array(Array, Array) (Line: 82)

Proposed resolution

Do not hardcode the bundle key to type on initializeEntitiesCallback().

CommentFileSizeAuthor
#2 3058900-bundle-key-2.patch863 bytescolorfield

Comments

colorfield created an issue. See original summary.

colorfield’s picture

Status: Active » Needs review
StatusFileSize
new863 bytes
dan2k3k4’s picture

Status: Needs review » Reviewed & tested by the community

Tested by adding a Taxonomy term then adding Serial field and configuring it to Start on Existing entities. Works fine now.

  • colorfield committed 94074ac on 8.x-1.x
    Issue #3058900 by colorfield, dan2k3k4: Initialize values on existing...
colorfield’s picture

Status: Reviewed & tested by the community » Fixed

Thank you @dan2k3k4!

Status: Fixed » Closed (fixed)

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