When deleting a content type it throws the following issue:
ERROR: invalid syntax for integer: «node.contenido_de_prueba.default» en carácter 111
2017-01-18 14:51:50 CET [9613-2] SENTENCE: DELETE FROM simple_sitemap_entity_overrides
WHERE (entity_type = 'entity_view_display') AND (entity_id IN ('node.contenido_de_prueba.default'))
Digging in the code table is defined as:
'entity_id' => [
'description' => 'ID of the overriding entity.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
],
It is called on function:
public function removeEntityInstanceSettings($entity_type_id, $entity_ids = NULL)
Triggered by:
removeEntityInstanceSettings($entity->getEntityTypeId(), $entity->id());
According to API:
/**
* Gets the identifier.
*
* @return string|int|null
* The entity identifier, or NULL if the object does not yet have an
* identifier.
*/
public function id();
This function can answer string or integer, the easiest way of fixing it would be changing field type to varchar
Comment | File | Size | Author |
---|---|---|---|
#10 | bundle_delete.diff | 954 bytes | lamigo |
Comments
Comment #2
gbyte CreditAttribution: gbyte commentedHi there! Why would you post an issue against a module version that is over 7 months old? I would advise to use the most recent stable version for production, but make sure to test the dev version before submitting issues. If you can reproduce the problem on dev, please update this issue accordingly.
Comment #3
lamigo CreditAttribution: lamigo as a volunteer commentedSorry, it was a select box mistake, it's 8.x-2.8
Comment #4
lamigo CreditAttribution: lamigo as a volunteer commentedCurrent dev is 8.x-2.7+9-dev and I diffed them with no changes on this issue
Comment #5
gbyte CreditAttribution: gbyte commentedThanks for reporting. As mentioned, anything that needs fixing needs to be tracked for the dev version.
removeEntityInstanceSettings()
is called in hook_entity_delete. I have just deleted a content type (a node bundle) and have not encountered this error. It appears from your error that the removal of an entity_view_display is responsible. Can you please try and reproduce this error on a fresh drupal instance? If you succeed, would you mind providing your server configuration?Comment #6
lamigo CreditAttribution: lamigo as a volunteer commentedHello,
I will make a fresh install and let you know, but it's worth mentioning it's on a postgresql 9.4 install, postgres uses to be a lot more strict than Mysql, I see tests are run on mysql, have you tried it on postgres?
Best Regards
Comment #7
lamigo CreditAttribution: lamigo as a volunteer commentedMade a new machine and a fresh new install 8.2.5 , default install, database postgres 9.4, nothing changed, installed simple_sitemap_8.x.2.x-dev created a dummy content type and while trying to delete:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "node.blabla.default" LINE 2: ...type = 'entity_view_display') AND (entity_id IN ('node.blab... ^: DELETE FROM {simple_sitemap_entity_overrides} WHERE (entity_type = :db_condition_placeholder_0) AND (entity_id IN (:db_condition_placeholder_1)); Array ( [:db_condition_placeholder_0] => entity_view_display [:db_condition_placeholder_1] => node.blabla.default ) en Drupal\simple_sitemap\Simplesitemap->removeEntityInstanceSettings() (linea 325 de /var/www/drupal/modules/simple_sitemap/src/Simplesitemap.php).
Again, entity_id IN (:db_condition_placeholder_1) but [:db_condition_placeholder_1] => node.blabla.default while the field is defined as integer, maybe mysql does not complain on you trying to compare a string with an integer but this field must be defined as a varchar.
Comment #8
gbyte CreditAttribution: gbyte as a volunteer and commentedFor the third time: This issue needs to be set for the dev version of the module (in this case 8.x-2.x-dev). Please do not change the version. Also, why did you change 'Status' to 'postponed'?
Anyhow I'm sure you are right as it makes perfect sense that postgre triggers the error. Will look into it soon.
Comment #9
ma10 CreditAttribution: ma10 commentedJust FYI, I'm seeing the same error, with PostgreSQL 9.6.1.
Comment #10
lamigo CreditAttribution: lamigo as a volunteer commentedI uploaded the file with the changes I made myself, it was committed with git too but unsure if it worked.
Comment #12
gbyte CreditAttribution: gbyte as a volunteer and commented@lamigo Thanks for the patch, I fixed your update hook as it failed and used a non-deprecated method. Pushed to the development version.