- Issue created by @karlshea
- Merge request !152Change feeds_clean_list entity_id column to varchar → (Merged) created by karlshea
- last update
about 1 year ago 714 pass, 4 fail - last update
about 1 year ago 716 pass - last update
about 1 year ago 716 pass - Status changed to Needs review
about 1 year ago 12:18am 15 January 2024 - Status changed to RTBC
10 months ago 11:16am 8 May 2024 - 🇧🇪Belgium kevinvb
I can confirm that this fixes the issue "Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'xxx': DELETE FROM feeds_clean_list..."
I had to be able to import & update from a CSV into custom tokens ( https://www.drupal.org/project/token_custom → )
This module provides a content entity which has a machine name (string) as id.
Just importing didn't trigger the error but once you want to update an existing item it fails to import and gives that nasty error.With the patch the module is able to perform the import & update.
- 🇯🇵Japan ptmkenny
This is tricky because an entity id should be an int but it might be a string. Adding one of the main core issues about this topic for reference.
- 🇺🇸United States karlshea Minneapolis 🇺🇸
I'm not sure that core issue is a good one for reference because it's talking about a case where the id should be an int for those entity types but isn't, e.g. the database column is an
int
but due to some circumstance a string is returned ("1"
instead of1
).However
EntityInterface
does not limit the id to an int, the typehint isstring|int|null
so the statement "an entity id should be an int" is not true for all Drupal Entity types.This issue is trying to fix the case where the entity id is intentionally a string (and the database column backing it is a
varchar
). Think about a table of US states where the id is the two-letter acronym—we're not trying to coerce"1"
to1
, but instead trying to store the value"NY"
as an int which is impossible.I don't think
EntityInterface
supporting this is widely known so it's been catching out some other module assumptions (like Dynamic Entity Reference → which has some weird release versions to fix the same issue).Check out the
EntityTestStringId
content entity type in core which tests this, and the issue that created it: #2205215: {comment} and {comment_entity_statistics} only support integer entity ids → , or the issue also using that same type to test core's Entity Reference field type making the same assumption: #2107249: Don't assume that content entities have numeric IDs in EntityReferenceItem → . - last update
10 months ago 717 pass - 🇳🇱Netherlands megachriz
It would be good to have an automated test that tests importing and logging entities with a non-numerical ID. In core, in the test module "entity_test", there is a content entity type called "entity_test_string_id" (\Drupal\entity_test\Entity\EntityTestStringId). That entity type would probably be suitable for such a test. Do you want to write tests for this issue, @KarlShea?
- last update
10 months ago 721 pass - Status changed to Needs review
10 months ago 10:42pm 20 May 2024 - 🇺🇸United States karlshea Minneapolis 🇺🇸
@MegaChriz I added a test but I'm not sure that it's in the right spot, or that I'm putting a test for feeds_log outside of the submodule. I can make any changes here you'd like, just let me know the direction you're thinking.
When I remove the schema change for
feeds_import_log_entry
, the assertion fails checking for the log entry count, and when I remove the schema change forfeeds_clean_list
the test fails with an "Incorrect integer value for column" error. - last update
10 months ago 721 pass - last update
10 months ago 721 pass - last update
10 months ago 721 pass - Status changed to RTBC
10 months ago 8:51am 30 May 2024 - 🇮🇳India ankitv18
For next minor PHPunit is failing: https://git.drupalcode.org/issue/feeds-3414632/-/jobs/1639583#L460
We can log a separate issue to fix this and the changes looks fine hence marking this RTBC - 🇳🇱Netherlands megachriz
@KarlShea
I think it would be good to have one test focussed on Feeds Log, in feeds/modules/log/tests/Kernel. I think the other one could be added to the existing \Drupal\Tests\feeds\Kernel\UpdateNonExistentTest test class. - Assigned to megachriz
- 🇳🇱Netherlands megachriz
I think I'll give this a go myself, so I can hopefully merge this for the upcoming release.
- last update
9 months ago 715 pass, 1 fail - last update
9 months ago 715 pass, 2 fail - last update
9 months ago 716 pass, 1 fail - last update
9 months ago 715 pass, 3 fail - last update
9 months ago 725 pass - last update
9 months ago 717 pass, 3 fail - last update
9 months ago 725 pass -
MegaChriz →
committed 57feee24 on 8.x-3.x authored by
KarlShea →
Issue #3414632 by KarlShea, MegaChriz: Entity ID can be a string,...
-
MegaChriz →
committed 57feee24 on 8.x-3.x authored by
KarlShea →
- Status changed to Fixed
9 months ago 7:07am 10 June 2024 -
MegaChriz →
committed dc354618 on 8.x-3.x
Issue #3414632 by MegaChriz: feeds_import_log_entry.entity_id is allowed...
-
MegaChriz →
committed dc354618 on 8.x-3.x
- 🇳🇱Netherlands megachriz
I got one issue when updating a site:
Data truncated for column 'entity_id' at row 789
feeds_import_log_entry.entity_id is allowed to be NULL.
Fixed that on commit.
- 🇳🇱Netherlands megachriz
@KarlShea
The database updatefeeds_update_8007()
caused an error on MySQL 8.0:SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'existing primary key drop without adding a new primary key. In @@sql_generate_invisible_primary_key=ON mode table should have a primary key. Please add a new primary key to be able to drop existing primary key.': ALTER TABLE "feeds_clean_list" DROP PRIMARY KEY; Array
It looks like to have something to do with the MySQL setting "sql_generate_invisible_primary_key". It is said that if that setting is turned off, the error should disappear.
Do you know if the database update could be rewritten in a way that it doesn't cause an error when the MySQL setting "sql_generate_invisible_primary_key" is turned on?
See 🐛 SQL error after upgrading to 8.x-3.0-beta5 Active
- 🇺🇸United States karlshea Minneapolis 🇺🇸
Hmm my understanding is the only way to change a primary key is to drop it first and then recreate it. I asked in #contribute on Slack, let's see if anything comes from that.
Automatically closed - issue fixed for 2 weeks with no activity.