The MR above is not correct because the annotation to suppress the message applies at the class level, not at the function level, and it's being applied to the wrong class. I attach a patch that works for me with PHP 8.2.
alfaguru → created an issue.
If you want another use-case for this, parent-child relationships in taxonomy terms, which get exported as IDs not UUIDs. These also present a second challenge because the parent may not be imported before the child. I currently solve this by importing terms twice, which resolves the issue.
Patch attached.
@drunken-monkey, I was just looking at this and most of the time I would imagine that the nested properties in question are defined as fields in their own right, so once the properties have been gathered in the first pass, something like this should do the trick:
<?php
foreach ($index->getFields() as $field) {
if (!isset($form['fields'][$field->getCombinedPropertyPath()])) {
$field_options[$field->getCombinedPropertyPath()] = $field->getLabel();
}
}
?>
Then the hack to avoid removing nested fields can be dropped.
I am sure there are some subtleties to be observed but it seems to meet the immediate needs for my project.
alfaguru → created an issue.