Custom configuration for a processor

Created on 24 September 2018, almost 7 years ago
Updated 13 August 2025, 7 days ago

Hi,

This is probably a Drupal 8 coding question, but someone might know and can help me.

I'm implementing a custom processor and I would like to add a custom configuration to it. I could manage the form by using the following in the annotation:

/**
 * Defines a custom processor.
 *
 * @FeedsProcessor(
 *   id = "entity:node_with_group",
 *   title = @Translation("Custom"),
 *   description = @Translation("Custom description for processor"),
 *   entity_type = "node",
 *   arguments = {
 *     "@entity_type.manager",
 *     "@entity.query",
 *     "@entity_type.bundle.info",
 *   },
 *   form = {
 *     "configuration" = "Drupal\custom_module\Feeds\Processor\Form\CustomProcessorForm",
 *     "option" = "Drupal\custom_module\Feeds\Processor\Form\CustomProcessorOptionForm",
 *   },
 * )
 */

In the CustomProcessorForm I have the following code:

<?php

class CustomProcessorForm extends DefaultEntityProcessorForm {

 public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildConfigurationForm($form, $form_state);

    $form['custom_config'] = [
      '#type' => 'textfield',
      '#title' => $this->t('Custom config'),
      '#default_value' => $this->plugin->getConfiguration('custom_config'),
    ];

    return $form;
  }
}
?>

I can see in the database that the processor configuration is stored as a row in the config table.

How can I alter the type feeds.processor.entity defined in the feeds.schema.yml in order to have the following:

feeds.processor.entity:
  type: mapping
  label: 'Entity processor settings'
  mapping:
    values:
      type: sequence
      sequence:
        type: ignore
    update_existing:
      type: integer
    update_non_existent:
      type: string
    skip_hash_check:
      type: boolean
    authorize:
      type: boolean
    expire:
      type: integer
    owner_feed_author:
      type: boolean
    owner_id:
      type: integer
    custom_config:
      type: string

Thank you.

💬 Support request
Status

Active

Version

3.0

Component

Code

Created by

🇧🇷Brazil carolpettirossi Campinas - SP

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

Merge Requests

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