Doesn't work with Entity Share module

Created on 23 February 2021, almost 4 years ago
Updated 15 December 2024, 3 days ago

Problem/Motivation

I'm trying to copy over Custom Token entities via the Entity Share module.

Steps to reproduce

- Enable the Entity Share module and configure it to sync Custom Token entities, then try to pull a Custom Token entity from a Entity Share Client site.

Proposed resolution

- The Entity Share module only supports entities that have a UUID, so I added an extra entity key "uuid" = "uuid" to TokenCustom and expanded the base field definitions with

$fields['uuid'] = BaseFieldDefinition::create('uuid')
            ->setLabel(t('UUID'))
            ->setDescription(t('The token UUID.'))
            ->setReadOnly(TRUE);

We will also need an update hook to update the data model with this new field.

- TokenCustom also doesn't declare their data table, so I added that:

data_table = "token_custom_field_data",

This enables the Entity Share Pull Form to show syncable entities, but actually syncing them doesn't work yet: extracting the entity from the JSON that Entity Share uses to encode entities fails in Entity Share's ImportService at the following line

$remote_entity = $this->jsonapiHelper->extractEntity($entity_data);

I haven't had the chance to dig deeper than that. In any case, an entity with no values is created so saving it fails.

🐛 Bug report
Status

Closed: duplicate

Version

1.0

Component

Code

Created by

🇧🇪Belgium beerendlauwers

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024