Problem/Motivation

When we try to validate the review of a deep nested field in JobItemForm, it dosen't work properly, it will try to find the field directly, like it was not nested.

Proposed resolution

Make it validate the nested field properly.

Remaining tasks

create a patch, add tests, review and commit.

User interface changes

API changes

Data model changes

Original report by

CommentFileSizeAuthor
#2 wrong_deep_nesting-2594841-2.patch1.09 KBedurenye

Comments

edurenye created an issue. See original summary.

edurenye’s picture

Status: Active » Needs review
StatusFileSize
new1.09 KB

The deep nesting works fine, I added tests.

miro_dietiker’s picture

Status: Needs review » Needs work
+++ b/src/Tests/TMGMTUiTest.php
@@ -532,16 +532,29 @@ class TMGMTUiTest extends TMGMTTestBase {
     $this->assertText(t('The field has @size characters while the limit is @limit.', [
       '@size' => strlen($text),
       '@limit' => 10,
...
+    $this->assertText(t('The field has @size characters while the limit is @limit.', [
+      '@size' => strlen($text),
+      '@limit' => 20,

The two asserts read too much identical to me and the location of the message is not asserted.
How about adding a new method like assertFieldError($field_key, $message, $param) that we will apply to all contextual errors?

edurenye’s picture

Status: Needs work » Needs review

I can not validate the position, it's a side effect of using AJAX, both messages appears in the top as Drupal doesn't have anymore the inline errors for field validation.
The difference is in length and limit, so it's enough I think.

berdir’s picture

Title: Wrong deep nesting validation for JobItem reviews » Tests for deep nested validation for JobItem reviews
Status: Needs review » Fixed

As discussed, this looks fine to me.

  • Berdir committed bed7faf on 8.x-1.x authored by edurenye
    Issue #2594841 by edurenye: Tests for deep nested validation for JobItem...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.