- Issue created by @laetitia_al
- π«π·France Grimreaper France π«π·
On Section Library 1.2.2.
In app/modules/contrib/section_library/src/DeepCloningTrait.php:
protected function cloneReferencedEntities($entity) { ... // The general rule for any entity. if ($entity_field->getName() != 'type' && isset($value[0]['target_id'])) {
The problem is that UI Icons field https://git.drupalcode.org/project/ui_icons/-/blob/1.1.x/modules/ui_icon... has a target_id:
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition): array { $properties = []; $properties['target_id'] = DataDefinition::create('string')
Without being an entity reference field.
So Section Library detection if a field is an entity reference field may be lurred into error.
- Merge request !44Issue #3507229 by laetitia_al, grimreaper: Incompatibility between UI Icons and Section Library β (Merged) created by Grimreaper
- π«π·France Grimreaper France π«π·
I made a simple fix.
But I think after π Error after importing section/template that contains blocks with paragraphs without available source content Active will be merged, cloneReferencedEntities and cloneReferencedParagraphsEntities could be simplified.
- π«π·France Grimreaper France π«π·
MR updated with a cleanup proposal of the cloning logic.
Not tested, so if too risky, let's only keep the first commit to avoid fatal error with UI Icons.
- πΊπΈUnited States jastraat
I tested this and had no issues with cloning and inserting blocks with paragraph fields, media fields, node reference fields, or icon fields. I'd love to know more about the UI icons module; that looks very interesting.
- π«π·France Grimreaper France π«π·
Thanks :)
There are plenty explanations and links to examples on the project page https://www.drupal.org/project/ui_icons β
https://project.pages.drupalcode.org/ui_icons/
https://www.drupal.org/docs/develop/drupal-apis/icon-api βUsing it in https://www.drupal.org/project/sobki_profile_bootstrap β
- πΊπΈUnited States jastraat
Thanks! :)
Would you mind rebasing your branch/MR? Unfortunately there are some merge conflicts.
-
jastraat β
committed c18fa6c4 on 1.2.x authored by
grimreaper β
Issue #3507229 by grimreaper: Incompatibility between UI Icons and...
-
jastraat β
committed c18fa6c4 on 1.2.x authored by
grimreaper β
-
jastraat β
committed c18fa6c4 on 2.0.x authored by
grimreaper β
Issue #3507229 by grimreaper: Incompatibility between UI Icons and...
-
jastraat β
committed c18fa6c4 on 2.0.x authored by
grimreaper β