Extend Documentation for export custom field types

Created on 28 July 2024, 5 months ago
Updated 1 August 2024, 5 months ago

Problem/Motivation

I'm struggling to implement my own SingleContentSyncFieldProcessor, the Documentation says the examples are straight forward, but I don't think they are. E.g. Do I have to setup a custom Deriver for my custom field as well? I guess I have to create my own custom module and create some files in the exact same directories and namespaces, but I get an error message deriver does not exists. So i guess I am doing something wrong and the documentation might not be complete.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

1.4

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany cnfl

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

Comments & Activities

  • Issue created by @cnfl
  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    Hi cnfl,

    Plugin derivatives are not a single_content_sync specific feature; they are a Drupal way to use the same class for multiple plugins. You can learn more about derivatives in Drupal development docs. Due to this reason, it's not documented in the module.

    We're using derivatives to use the same class for multiple field types plugins; e.g. it would be stupid to have separate classes, say, for string and number field types if their code would be 100% identical.

    You don't necessarily need to use derivatives for your plugin; that depends on your the field type(s) you're working on. Is it a custom field type or something from Drupal.org ?

  • πŸ‡©πŸ‡ͺGermany cnfl

    Hi abramm,

    thanks for your quick answer and thanks for pointing me to derivatives. I guess it would be a solution to create a patch, cos in my case it would be just adding my field type to the already existing list in the SimpleFieldDeriver - like I saw in similar cases in this issue board. But a patch seems like an unstable solution to a permanent need, so I created a custom module with another plugin. So that works and again, thanks for pointing me to the right direction. I still think though that this could be made more clear in the documentation.

  • πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

    Well, if the field type comes from something that's published on Drupal.org and is maintained, we could easily merge in the patch. Everybody wins.

Production build 0.71.5 2024