Closed (fixed)
Project:
Conditional Fields
Version:
8.x-1.x-dev
Component:
Javascript
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 May 2020 at 16:01 UTC
Updated:
10 Jun 2020 at 14:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nuezThe failing of the tests has multiple reasons:
ConditionalFieldDateTimeTest::testVisibleValueWidgetthe 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
::changeFieldthis is done with jQuery which requires 'Y-m-d' format. So we do need 'Y-m-d' format there.ConditionalFieldTextTextareaTests::testVisibleValueXorandConditionalFieldTextTextareaTests::testVisibleValueAndare 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.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 patchIt did work with the form submit. Just the Ajax seemed to be broken.
Comment #3
nuezComment #4
nuezThis 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.
Comment #5
nuezComment #6
nuezComment #7
colanThis 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?
Comment #9
colan@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.
Comment #10
colanLooks like it's green now. Thanks!