- Issue created by @HeavyStoneHead
- π«π·France lazzyvn paris
in version 2 it supports rest and json api. you can use entity object (not number with tid) but i would try with number like version 1
- π«π·France lazzyvn paris
Test with devel PHP it works fine. I didn't check your module but i think there are small problem with your code
use Drupal\node\Entity\Node; $node = Node::create(['type' => 'page','title' => 'Test Import ']); $field_value = [ ['taxo' => 1,'tex' => 'test id 1'], ['taxo' => 1,'tex' => 'test id 2'] ]; $node->set('field_information', $field_value); $node->save();
- π©πͺGermany HeavyStoneHead
I have a complex converter that imports individual records from an old database as Drupal content. This worked fine until the update to version 2. I tried to determine what the problem was and wrote the module so that it could be narrowed down. The problem is as described. So when you create and save again, the first data record is correct again. The βformβ contains static data, so itβs not actually possible to say that something is going wrong. I have it on 2 different Drupal instances with the same effect.
- π«π·France lazzyvn paris
what version of Drupal are you using? since 10.2.x the field storage structure has changed in core, I need to change the definitions if you want to debug, see in \datafield\src\Plugin\Field\FieldType\DataField::propertyDefinitions and \datafield\src\Plugin\DataType\DataFieldEntityData.php
it's different between 1.x and 2.x
Have you tried Data Field dev version, maybe it has been fixed? - π©πͺGermany HeavyStoneHead
I'm using Drupal version: 10.2.5
Yes, Dev works fine in the test instance. I'm not sure if I should test this again in the production version (backup). When would the next release be?In any case, I'm glad I could use dev if needed
By the way, thanks for integrating it with JSON API
- π«π·France lazzyvn paris
I haven't finished new features search for entities reference yet. You can check the new optional "Reference field" in dev version. you will see a new magnifying glass icon, it will allow to select multiple entities like module entity browser
I also want to support graphql in the next version. If you can help me I can release a new version very soon. - π©πͺGermany HeavyStoneHead
My skills are very manageable and probably wouldn't be any help.
Thank you for the time you sacrificed for the great module.
- Status changed to Closed: outdated
7 months ago 7:07pm 13 April 2024 - π©πͺGermany HeavyStoneHead
Version 2.0.2 is different from the developer. Same problem, only this time completely confusing.
see screenshots
old dev works fine, now its broken again and different.
- Status changed to Needs work
7 months ago 10:14am 15 April 2024 - π«π·France lazzyvn paris
I don't understand much, could you explain in more detail
- π©πͺGermany HeavyStoneHead
It is exactly the same as before that the 1st entry is not correct. Previously the taxonomy ID-1 appeared to have been inserted, but now it feels partly arbitrary. For the most part I have the feeling that it filters the type and takes the 1st ID of the vocabulary, on the other hand it is e.g. for country and city still incorrect vocabulary and with the ID 1.
I suspect that he sets the first datafield with id 1, filters all the others by vocabulary and uses its first sorted ID. It's confusing and currently incomprehensible to me.
I still have a backup of the working dev, is there any way to show what's different? I'll add that.
- π©πͺGermany HeavyStoneHead
I think I found the part
\datafield-2.0.2\datafield\src\Plugin\Field\FieldType\DataField.php
Line: 608
Missing:if ($item['type'] == 'entity_reference' && empty($value)) { return TRUE; }
After I added the part to the current one, everything worked perfectly again.
- f422c34e committed on 2.x
Issue #3439931: can't create 1st referenced data with Node::creat
- f422c34e committed on 2.x
- Status changed to Fixed
7 months ago 2:14pm 17 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.