diff --git a/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php b/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php index 31d8302..d62184a 100644 --- a/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php +++ b/core/lib/Drupal/Core/Entity/Display/EntityFormDisplayInterface.php @@ -126,8 +126,9 @@ public function extractFormValues(FieldableEntityInterface $entity, array &$form * Validates submitted widget values and sets the corresponding form errors. * * This method invokes entity validation and takes care of flagging them on - * the form. This method is in particular useful if the form consists of the - * form display only. + * the form. This is particularly useful when all elements on the form are + * managed by the form display + * * As an alternative, entity validation can be invoked separately such that * some violations can be flagged manually. In that case * \Drupal\Core\Entity\Display\EntityFormDisplayInterface::flagViolations() @@ -159,12 +160,12 @@ public function validateFormValues(FieldableEntityInterface $entity, array &$for /** * Flags entity validation violations as form errors. * - * This method processes all violations passed, thus any violations that it - * should not handle should be processed before this method is invoked. + * This method processes all violations passed, thus any violations, that it + * does not handle, should be processed before this method is invoked * * The method flags constraint violations related to fields shown on the * form as form errors on the correct form elements. Possibly pre-existing - * violations of hidden fields (= fields not appearing in the display) are + * violations of hidden fields (so fields not appearing in the display) are * ignored. Other, non-field related violations are passed through and set as * form errors according to the property path of the violations. * diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php index 7a68785..2f98790 100644 --- a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php +++ b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php @@ -246,12 +246,12 @@ public function flagViolations(EntityConstraintViolationListInterface $violation foreach ($violations->getViolatedFieldNames() as $field_name) { $field_violations = $this->movePropertyPathViolationsRelativeToField($field_name, $violations->filterByField($field_name)); // Only show violations for fields that actually appear in the form, and - // let the widget assign the violations to the right form elements. + // let the widget assign the violations to the correct form elements. if ($widget = $this->getRenderer($field_name)) { $widget->flagErrors($entity->get($field_name), $field_violations, $form, $form_state); } } - // Flag all remaining violations; e.g., entity level violations. + // Flag all remaining violations; e.g. entity level violations. foreach ($violations as $violation) { $form_state->setErrorByName(str_replace('.', '][', $violation->getPropertyPath()), $violation); } @@ -273,7 +273,7 @@ protected function movePropertyPathViolationsRelativeToField($field_name, Constr foreach ($violations as $violation) { // All this code below is done in order to change the property path of the // violations to be relative to the item list, so like title.0.value gets - // changed to 0.value. Sadly constrains in symfony don't have setters so + // changed to 0.value. Sadly constraints in symfony don't have setters so // we have to create new objects. On top of that, the interface is missing // getConstraint() and getCause(), so we have to rely on a specific // constraint implementation. diff --git a/core/lib/Drupal/Core/Entity/EntityConstraintViolationListInterface.php b/core/lib/Drupal/Core/Entity/EntityConstraintViolationListInterface.php index 1644e99..38ae270 100644 --- a/core/lib/Drupal/Core/Entity/EntityConstraintViolationListInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityConstraintViolationListInterface.php @@ -50,8 +50,7 @@ public function filterByFields(array $field_names); /** * Filters the violations of inaccessible fields. * - * Any violations for fields that are not accessible are removed and returned - * for further processing. + * Any violations for fields that are not accessible are removed. * * @param \Drupal\Core\Session\AccountInterface $account * (optional) The user for which to check access, or NULL to check access diff --git a/core/modules/content_translation/src/ContentTranslationHandlerInterface.php b/core/modules/content_translation/src/ContentTranslationHandlerInterface.php index b776efe..12f59c1 100644 --- a/core/modules/content_translation/src/ContentTranslationHandlerInterface.php +++ b/core/modules/content_translation/src/ContentTranslationHandlerInterface.php @@ -8,7 +8,6 @@ namespace Drupal\content_translation; use Drupal\Core\Entity\EntityInterface; -use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Form\FormStateInterface; /** diff --git a/core/modules/search/src/Tests/SearchTestBase.php b/core/modules/search/src/Tests/SearchTestBase.php index ad7762a..1469828 100644 --- a/core/modules/search/src/Tests/SearchTestBase.php +++ b/core/modules/search/src/Tests/SearchTestBase.php @@ -7,7 +7,6 @@ namespace Drupal\search\Tests; -use Drupal\Core\Url; use Drupal\simpletest\WebTestBase; use Drupal\Component\Utility\SafeMarkup;