- πΊπΈUnited States TolstoyDotCom L.A.
AFAICT, the table is created with the whatever_target_id_int column after you submit the form where you choose the field type and enter its name. Then, when you submit the next form (where you choose the referenced types and the cardinality), a schema change results in the table being dropped and then created again, this time without the whatever_target_id_int column. This is using version 4.x-dev of the module on D10.
- π©πͺGermany stevieb
I'm seeing these errors on all my Drupal 10.1 updates
I also tried the Sandbox Module and receive the errors on a fresh install with both 3 & 4 versions.
to reproduce add sandbox with D10.1 & Dynamic Entity Reference
Activate media Module
add ref Field to Article type content type allowing Article and media image
save fieldthe error is there on both versions of the module for Drupal 10
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
I wonder if this is because of the move to READ_COMMITTED isolation level in Drupal 10.1 not recognizing Views (not Drupal views, DB Views)
- πΊπΈUnited States TolstoyDotCom L.A.
The problem is with Drupal views: the module code expects those Drupal views to have access to the whatever_target_id_int field.
If I create a field and then add a whatever_target_id_int column to the table manually, I can create a Drupal view without issue.
I *could* create a patch to add that column, but it'd be better for a maintainer to weigh in about this.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
So the module does some gymnastics to support config and content entities in a single field.
If you have both, we set the target ID as a string, but then use a DB trigger to keep an INT version in sync.
And then views does some dancing around that.
Can you share what your views data looks like for this error as well as your field definition?
Something like
drush php-eval "var_export(\Drupal::service('views.views_data')->get('YOUR TABLE NAME HERE'))";
- πΊπΈUnited States TolstoyDotCom L.A.
Before my last comment I created a field 'test' on Article nodes. I set the field to accept content, terms, and users. Then, because it didn't have the column, I ran this in the db:
alter table node__field_test add column field_test_target_id_int int not null default 0;
and likewise with node_revision__field_test.I then created a simple Drupal view to show Article nodes and added the 'test' field as one of the fields to show. That worked as expected. If I hadn't manually changed the db, I would have got the error in the first post here.
Note also that any triggers weren't created, or they were created but got wiped out when node__field_test was dropped and then recreated.
Due to all the "gymnastics" the module goes through, it'd be best if someone who's more familiar with it would weigh in. I'm also unsure on what is the expected setup: should it even have the field_test_target_id_int column? Was that being phased out but the Drupal views code just wasn't updated yet? Why did this stop working?
If no maintainers are available then I guess I could look into the module later on.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
'if no maintainers are available' - this is my fourth comment on the issue so not sure what you're expecting there.
I'll see if I can reproduce it.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Confirmed this behaviour
It also looks like the events don't fire on update either.
- πΊπΈUnited States TolstoyDotCom L.A.
Re the maintainers bit, I looked the first time not the second, so my bad. Let me know if you need help testing anything.
- Status changed to Needs review
over 1 year ago 11:11pm 29 June 2023 - Open on Drupal.org βCore: 10.1.x + Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Wondering if this is all that's needed.
In my testing, the column is added on create, but then the update event fires and core drops our column.
- πΊπΈUnited States TolstoyDotCom L.A.
I tested the change using a field 'newtest'. The tables node__field_newtest and node_revision__field_newtest had field_newtest_target_id_int columns after the first screen and after the last. I was able to reference a user and a node from that field. I created a Drupal view as I described before and there aren't any warnings. It seems to work now.
The last submitted patch, 19: 3056416.patch, failed testing. View results β
- Status changed to Needs work
over 1 year ago 1:18am 4 July 2023 - last update
over 1 year ago 72 pass - π¨π¦Canada jibran Toronto, Canada
HEAD is green now and so is the patch. Let's add some tests.
- Status changed to Needs review
over 1 year ago 5:37am 7 July 2023 - last update
over 1 year ago 62 pass, 6 fail - last update
over 1 year ago 62 pass, 6 fail The last submitted patch, 24: 3056416-fail.patch, failed testing. View results β
The last submitted patch, 24: 3056416-pass.patch, failed testing. View results β
- Status changed to Needs work
over 1 year ago 5:50am 7 July 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Hmm these pass/fail locally for me on 11.x - thoughts @jibran?
- last update
over 1 year ago 64 pass, 2 fail - last update
over 1 year ago 72 pass - Status changed to RTBC
over 1 year ago 5:40pm 8 July 2023 - π¨π¦Canada jibran Toronto, Canada
Sorry, I messed up the version check in one of the test fix but it is fixed now.
-
jibran β
committed 5011a29a on 4.x authored by
larowlan β
Issue #3056416 by larowlan, AaronBauman, TolstoyDotCom, jibran:...
-
jibran β
committed 5011a29a on 4.x authored by
larowlan β
- Status changed to Fixed
over 1 year ago 5:46pm 8 July 2023 - π¨π¦Canada jibran Toronto, Canada
Committed and pushed to 4.x. Thanks!
Automatically closed - issue fixed for 2 weeks with no activity.