Revert "Add redirect feeds patch"

This reverts commit c4cec23377.
This commit is contained in:
Oliver Davies 2024-07-18 18:39:38 +01:00
parent c4cec23377
commit 8f4bfe24b5
3 changed files with 1 additions and 49 deletions

View file

@ -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
View file

@ -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",

View file

@ -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