Skip to content
Snippets Groups Projects

Issue #3450375: Prevent repeated form errors on child inline items from parent form element

Issue #3450375: Prevent repeated form errors on child inline items from parent form element

Closes #3450375

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
80 $this->assertSame($element_only_error, $form_state->getError($element, FALSE));
81 81 }
82 82
83 83 public static function providerTestGetError() {
84 return [
85 [[], ['foo']],
86 [['foo][bar' => 'Fail'], []],
87 [['foo][bar' => 'Fail'], ['foo']],
88 [['foo][bar' => 'Fail'], ['bar']],
89 [['foo][bar' => 'Fail'], ['baz']],
90 [['foo][bar' => 'Fail'], ['foo', 'bar'], 'Fail'],
91 [['foo][bar' => 'Fail'], ['foo', 'bar', 'baz'], 'Fail'],
92 [['foo][bar' => 'Fail 2'], ['foo']],
93 [['foo' => 'Fail 1', 'foo][bar' => 'Fail 2'], ['foo'], 'Fail 1'],
94 [['foo' => 'Fail 1', 'foo][bar' => 'Fail 2'], ['foo', 'bar'], 'Fail 1'],
84 $data = [];
  • 1168 1168 /**
    1169 1169 * {@inheritdoc}
    1170 1170 */
    1171 public function getError(array $element) {
    1171 public function getError(array $element, $traverse_parents = TRUE) {
  • 576 576 *
    577 577 * @param array $element
    578 578 * The form element to check for errors.
    579 * @param bool $traverse_parents
    580 * If FALSE, an error will only be returned if it was explicitly for this
    581 * element. If TRUE, an error will be returned if this element or any of its
    582 * parents have an error set. Defaults to TRUE.
    579 583 *
    580 584 * @return string|null
    581 585 * Either the error message for this element or NULL if there are no errors.
    582 586 */
    583 public function getError(array $element);
    587 public function getError(array $element, $traverse_parents = TRUE);
  • 576 576 *
    577 577 * @param array $element
    578 578 * The form element to check for errors.
    579 * @param bool $traverse_parents
    580 * If FALSE, an error will only be returned if it was explicitly for this
    581 * element. If TRUE, an error will be returned if this element or any of its
    Please register or sign in to reply
    Loading