Problem/Motivation
Steps to reproduce
- Create contents from other entity types than node (e.g. term, media), without the serial field
- 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().
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3058900-bundle-key-2.patch | 863 bytes | colorfield |
Comments
Comment #2
colorfieldComment #3
dan2k3k4 commentedTested by adding a Taxonomy term then adding Serial field and configuring it to Start on Existing entities. Works fine now.
Comment #5
colorfieldThank you @dan2k3k4!