Skip to content
Snippets Groups Projects
Commit 95b65b49 authored by Youri van Koppen's avatar Youri van Koppen
Browse files

Fixed issues related to custom sources that have no type yet.

parent da893f2c
Branches 10.x
Tags 10.0.20 10.1.0
No related merge requests found
......@@ -87,9 +87,11 @@ class CustomSourcesListController extends ControllerBase {
continue;
}
$type = $source['type'];
$type = $source['type'] ?? 'dummy';
$custom_source_plugin = $this->customSourcePluginManager->createInstance($type);
$custom_source_plugin = $this->customSourcePluginManager->createInstance($type, [
'feed_type' => $this->feedType,
]);
$additional_columns = $custom_source_plugin->additionalColumns();
$header_middle = [];
......@@ -145,7 +147,12 @@ class CustomSourcesListController extends ControllerBase {
'#plain_text' => $source['value'],
];
$custom_source_plugin = $this->customSourcePluginManager->createInstance($source['type']);
$type = $source['type'] ?? 'dummy';
// @todo don't instantiate custom source twice. It also happens in ::page().
$custom_source_plugin = $this->customSourcePluginManager->createInstance($type, [
'feed_type' => $this->feedType,
]);
$additional_columns = $custom_source_plugin->additionalColumns($source);
foreach ($additional_columns as $key => $column) {
$row[$key] = $column['#value'];
......
......@@ -74,7 +74,8 @@ class DummySource extends CustomSourceBase {
}
public function additionalColumns($source_configuration = []) {
// TODO: Implement additionalColumns() method.
// @todo Implement additionalColumns() method.
return [];
}
}
......@@ -80,8 +80,8 @@ class CustomSourceEditForm extends FormBase {
$subform_state = SubformState::createForSubform($form['source'], $form, $form_state);
$form['source'] = $plugin->buildConfigurationForm($form['source'], $subform_state);
$form['source']['type'] = [
'#type' => 'hidden',
'#value' => $source['type'],
'#type' => 'value',
'#value' => $type,
];
$cancel_url = Url::fromRoute('entity.feeds_feed_type.sources', [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment