Last active
July 27, 2017 19:57
-
-
Save sean-e-dietrich/baf6d4039abbff086398c55da812f657 to your computer and use it in GitHub Desktop.
Drupal 8.x Rules Textarea Patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core-new_textarea_typedata-2409059-37-8.0.patch b/core-new_textarea_typedata-2409059-37-8.0.patch | |
new file mode 100644 | |
index 0000000000..e69de29bb2 | |
diff --git a/lib/Drupal/Core/TypedData/Plugin/DataType/TextAreaData.php b/lib/Drupal/Core/TypedData/Plugin/DataType/TextAreaData.php | |
new file mode 100644 | |
index 0000000000..b9177c94bd | |
--- /dev/null | |
+++ b/lib/Drupal/Core/TypedData/Plugin/DataType/TextAreaData.php | |
@@ -0,0 +1,28 @@ | |
+<?php | |
+ | |
+namespace Drupal\Core\TypedData\Plugin\DataType; | |
+ | |
+use Drupal\Core\TypedData\PrimitiveBase; | |
+use Drupal\Core\TypedData\Type\TextAreaInterface; | |
+ | |
+/** | |
+ * The textarea data type. | |
+ * | |
+ * The plain value of a string is a regular PHP string. For setting the value | |
+ * any PHP variable that casts to a string may be passed. | |
+ * | |
+ * @DataType( | |
+ * id = "textarea", | |
+ * label = @Translation("Text Area") | |
+ * ) | |
+ */ | |
+class TextAreaData extends PrimitiveBase implements TextAreaInterface { | |
+ | |
+ /** | |
+ * {@inheritdoc} | |
+ */ | |
+ public function getCastedValue() { | |
+ return $this->getString(); | |
+ } | |
+ | |
+} | |
diff --git a/lib/Drupal/Core/TypedData/Type/TextAreaInterface.php b/lib/Drupal/Core/TypedData/Type/TextAreaInterface.php | |
new file mode 100644 | |
index 0000000000..6b6d2df7cf | |
--- /dev/null | |
+++ b/lib/Drupal/Core/TypedData/Type/TextAreaInterface.php | |
@@ -0,0 +1,17 @@ | |
+<?php | |
+ | |
+namespace Drupal\Core\TypedData\Type; | |
+ | |
+use Drupal\Core\TypedData\PrimitiveInterface; | |
+ | |
+/** | |
+ * Interface for textarea. | |
+ * | |
+ * The plain value of a string is a regular PHP string. For setting the value | |
+ * any PHP variable that casts to a string may be passed. | |
+ * | |
+ * @ingroup typed_data | |
+ */ | |
+interface TextAreaInterface extends PrimitiveInterface { | |
+ | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment