See https://www.drupal.org/pift-ci-job/1669105.

Help from any front-end folks would be appreciated.

CommentFileSizeAuthor
#5 interdiff-2-4.txt772 bytesnuez
#4 3134183-4.patch4.51 KBnuez
#2 3134183-2.patch4.51 KBnuez

Comments

colan created an issue. See original summary.

nuez’s picture

StatusFileSize
new4.51 KB

The failing of the tests has multiple reasons:

  1. In ConditionalFieldDateTimeTest::testVisibleValueWidget the date filled in is Y-m-d while the date field requires d-m-Y format in the POST request. The actual date for the widget wasn't actually set in the component edit form. Changing this to d-m-Y fixes it.

    However when later setting the widget in ::changeField this is done with jQuery which requires 'Y-m-d' format. So we do need 'Y-m-d' format there.

  2. ConditionalFieldTextTextareaTests::testVisibleValueXor and ConditionalFieldTextTextareaTests::testVisibleValueAnd are failing randomly because $this->randomString() is used which generates characters that randomly conflict with the jQuery code being executed (missing closing brackets etc). Obviously this could be escaped correctly, but I thought it would be easier to use $this->randomMachineName() instead.
  3. I also discovered that tests are showing strict schema checking exceptions (see image), which in itself don't break any tests but i discovered that there is something wrong with the configuration schema.
        value_form:
          type: sequence
          label: 'Values from widget'
          sequence:
            # Since it sub-config of field.widget.third_party, get there.
            type: field.value.[%parent.%parent.%parent.%parent.%parent.%parent.type]
            label: 'Value from widget'
    

    The type refers to the widget type, not the field type. The widget type doesn't hold the schema of the field properties. We need the field type for that. Possibly this used to work, but stopped working after this patch was committed: https://www.drupal.org/project/drupal/issues/2370305#comment-9371075

    The actual field type is actually nowhere available in the configuration tree, and needs to be added to the conditional fields configuration. I'll create a follow up.

For some reason it doesn't seem to be possible to upload anything right now on drupal.org. I'll try again later with the patch
It did work with the form submit. Just the Ajax seemed to be broken.

nuez’s picture

Status: Active » Needs review
nuez’s picture

StatusFileSize
new4.51 KB

This is working locally. The only thing I can think of is that this isn't working because the testbot is set to use the American date format m-d-Y.

nuez’s picture

StatusFileSize
new772 bytes
nuez’s picture

colan’s picture

The actual field type is actually nowhere available in the configuration tree, and needs to be added to the conditional fields configuration. I'll create a follow up.

This is more generally being discussed in #2948786: Fix config schema for value_form component. Does it make sense to work on this in that issue, or do we need another follow-up?

  • colan committed cba240b on 8.x-1.x authored by nuez
    Issue #3134183 by nuez: Fixed broken tests.
    
colan’s picture

@nuez: Would you be able to create a follow-up for converting everything to YYYY-MM-DD as you have a good understanding of the issue? I'd rather use the international standard date format, if possible.

Let's see if the branch now passes as I just committed your patch.

colan’s picture

Status: Needs review » Fixed

Looks like it's green now. Thanks!

Status: Fixed » Closed (fixed)

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