Timeline for programmatically get child nodes referencing parent by entity reference uuid, using loadByProperties & entityTypeManager or other way without views
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 19, 2022 at 22:14 | comment | added | therobyouknow | looks like it is a confusion of mine between the value of the data in an ordinary field and uuid. so your answer is valid and I agree should work. I will write up some further info later. | |
Apr 14, 2022 at 14:35 | comment | added | therobyouknow |
+1 thank you yes, @4uk4 and example uuid in my case for that is BMSSYS0000051988 . I've updated my question also, with turther information as to what I'm tryng. Thank you for all your help.
|
|
Apr 14, 2022 at 14:21 | comment | added | 4uk4 |
$uuid = $node->uuid();
|
|
Apr 14, 2022 at 13:45 | comment | added | therobyouknow | I think I need to work out how to get a node's uuid to help me understand. | |
Apr 14, 2022 at 13:24 | comment | added | therobyouknow | Noted thank you @4uk4 . My setup seems strange. Looking at the entity reference uuid field in the node, it is a string, the value of which is from a field that was imported from a CSV. In edit mode display that field shows as the parent node title with its node id in brackets. At the moment, I'm puzzled how that string value can reference the parent node.Looking at the Entity Reference UUID module, I haven't found any config nor in the field that gives a clue. I don't know which field is designated as the UUID. Some missing pieces of the puzzle for me. | |
Apr 14, 2022 at 12:08 | comment | added | 4uk4 | b) as a work around I wouldn't generate extra data. I would write low level SQL instead. This is also a good test whether the UUID you are querying really exists. Low level this is a simple query on one table. | |
Apr 14, 2022 at 11:42 | comment | added | 4uk4 | Is there a way to reproduce the issue on a fresh install? I couldn't. For me it works with and without the appended property name. | |
Apr 14, 2022 at 10:59 | comment | added | therobyouknow |
On basis that condition approach boils down to the same query engine, I would be inclined to not try that also, anticipating same issue instead do 2 things a) raise bug on drupal.org/project/entity_reference_uuid and b) implement a work around, create a new field in my content type which is a plain old entity reference (not with uuid), populate with a reference to a node and test the code again. If works, write script to populate rest of the nodes (there are 100K of them though). The populating will use the existing entity ref uuid field value to find the node for the new field.
|
|
Apr 14, 2022 at 10:20 | comment | added | therobyouknow | Unlucky I'm afraid. Array returned still empty. | |
Apr 14, 2022 at 9:31 | comment | added | therobyouknow | I will try this out, this morning and get back to you - thank you so far. | |
Apr 14, 2022 at 7:00 | history | answered | 4uk4 | CC BY-SA 4.0 |