parent
c4cec23377
commit
8f4bfe24b5
|
@ -115,9 +115,6 @@
|
|||
]
|
||||
},
|
||||
"patches": {
|
||||
"drupal/feeds": {
|
||||
"Add missing redirect source": "./tools/patches/redirect/redirect-feeds-target-3046873-14.patch"
|
||||
},
|
||||
"drupal/markdown": {
|
||||
"SubformState incorrect interface error": "./tools/patches/drupal/markdown/3409277-29.diff"
|
||||
}
|
||||
|
|
2
composer.lock
generated
2
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "4175cf67867cf307323afabccb5a6283",
|
||||
"content-hash": "458c41f03ff6c768a09edf9a072f26a8",
|
||||
"packages": [
|
||||
{
|
||||
"name": "asm89/stack-cors",
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
diff --git a/src/Feeds/Target/RedirectSource.php b/src/Feeds/Target/RedirectSource.php
|
||||
new file mode 100644
|
||||
index 0000000..ff59344
|
||||
--- /dev/null
|
||||
+++ b/src/Feeds/Target/RedirectSource.php
|
||||
@@ -0,0 +1,38 @@
|
||||
+<?php
|
||||
+
|
||||
+namespace Drupal\redirect\Feeds\Target;
|
||||
+
|
||||
+use Drupal\Core\Field\FieldDefinitionInterface;
|
||||
+use Drupal\feeds\FieldTargetDefinition;
|
||||
+use Drupal\feeds\Plugin\Type\Target\FieldTargetBase;
|
||||
+
|
||||
+/**
|
||||
+ * Defines a redirect source field mapper.
|
||||
+ *
|
||||
+ * @FeedsTarget(
|
||||
+ * id = "redirect_source",
|
||||
+ * field_types = {
|
||||
+ * "redirect_source"
|
||||
+ * }
|
||||
+ * )
|
||||
+ */
|
||||
+class RedirectSource extends FieldTargetBase {
|
||||
+
|
||||
+ /**
|
||||
+ * {@inheritdoc}
|
||||
+ */
|
||||
+ protected static function prepareTarget(FieldDefinitionInterface $field_definition) {
|
||||
+ return FieldTargetDefinition::createFromFieldDefinition($field_definition)
|
||||
+ ->addProperty('path')
|
||||
+ ->addProperty('query')
|
||||
+ ->markPropertyUnique('path');
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * {@inheritdoc}
|
||||
+ */
|
||||
+ protected function prepareValue($delta, array &$values) {
|
||||
+ $values['path'] = trim($values['path']);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
\ No newline at end of file
|
Loading…
Reference in a new issue