- First commit to issue fork.
- Merge request !219#3001867 "Custom configuration for processor" → (Open) created by christianadamski
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.
Active
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.