I have observed a rather strange behaviour when using a multi value field with option for recurring items and clicking "add another item". This leads to broken Drupal States behaviour in showing the option fields for "n times" and "end date" although "Never" is selected in the "Ends" part.

I digged into code a little and seems to me that is something about how Drupal is building the field items after "add another item" is clicked. Drupal is replacing the whole field items and not only adding a the new item. And this is all happening via Ajax, so there seems to be a break somewhere.

I think this is not a big issue, rather a small incovenience, but just wanted to share this observation.

This is a screenshot how the widget looks after adding another item and then changing the Repeats from None to Daily or something else:
Screenshot

Comments

stefan.korn created an issue. See original summary.

stefan.korn’s picture

Issue summary: View changes
stefan.korn’s picture

Priority: Normal » Minor
stefan.korn’s picture

Status: Active » Needs review
StatusFileSize
new1.39 KB

It seems that changing from using "invisble" to "visible" in the states does maybe solve this problem.

Kindly have a look on this patch.

stefan.korn’s picture

sorry, there was an issue with patch from #4, revised one here

  • mandclu committed d919d66 on 8.x-2.x authored by stefan.korn
    Issue #3150860 by stefan.korn: Multivalue field (with recur option) "add...
mandclu’s picture

Status: Needs review » Fixed

Thanks for identifying this, and for providing a patch! I was able to reproduce the issue and verify that the patch resolved it. Merged in.

Status: Fixed » Closed (fixed)

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