projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull merge.
[yaffs-website]
/
web
/
core
/
lib
/
Drupal
/
Core
/
Form
/
FormErrorHandler.php
diff --git
a/web/core/lib/Drupal/Core/Form/FormErrorHandler.php
b/web/core/lib/Drupal/Core/Form/FormErrorHandler.php
index 02457ce6d665b4115e80e6977758de9543c625da..695f023a73bb3600315ee1cbcac6daf5757cbc6d 100644
(file)
--- a/
web/core/lib/Drupal/Core/Form/FormErrorHandler.php
+++ b/
web/core/lib/Drupal/Core/Form/FormErrorHandler.php
@@
-3,6
+3,7
@@
namespace Drupal\Core\Form;
use Drupal\Component\Utility\NestedArray;
namespace Drupal\Core\Form;
use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\Render\Element;
/**
use Drupal\Core\Render\Element;
/**
@@
-10,6
+11,8
@@
use Drupal\Core\Render\Element;
*/
class FormErrorHandler implements FormErrorHandlerInterface {
*/
class FormErrorHandler implements FormErrorHandlerInterface {
+ use MessengerTrait;
+
/**
* {@inheritdoc}
*/
/**
* {@inheritdoc}
*/
@@
-39,7
+42,7
@@
class FormErrorHandler implements FormErrorHandlerInterface {
// Loop through all form errors and set an error message.
foreach ($errors as $error) {
// Loop through all form errors and set an error message.
foreach ($errors as $error) {
- $this->
drupalSet
Message($error, 'error');
+ $this->
messenger()->add
Message($error, 'error');
}
}
}
}
@@
-54,6
+57,7
@@
class FormErrorHandler implements FormErrorHandlerInterface {
* Grouping example:
* Assume you have a 'street' element somewhere in a form, which is displayed
* in a details element 'address'. It might be:
* Grouping example:
* Assume you have a 'street' element somewhere in a form, which is displayed
* in a details element 'address'. It might be:
+ *
* @code
* $form['street'] = [
* '#type' => 'textfield',
* @code
* $form['street'] = [
* '#type' => 'textfield',
@@
-160,13
+164,4
@@
class FormErrorHandler implements FormErrorHandlerInterface {
$elements['#errors'] = $form_state->getError($elements);
}
$elements['#errors'] = $form_state->getError($elements);
}
- /**
- * Wraps drupal_set_message().
- *
- * @codeCoverageIgnore
- */
- protected function drupalSetMessage($message = NULL, $type = 'status', $repeat = FALSE) {
- drupal_set_message($message, $type, $repeat);
- }
-
}
}