Problem/Motivation

When using a viewsreference field in a paragraph the field is nested in the parent form through a subform. The parents are not correctly used when defining the form field, which breaks the #states settings on the options and the display_id fields.

Proposed resolution

Properly use the #parents of the form field.

Remaining tasks

User interface changes

-

API changes

-

Data model changes

-

Comments

seanB created an issue. See original summary.

  • seanB committed 8770a63 on 8.x-2.x
    Issue #2897999: Form field/option visibility through #states doesn't...
seanb’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
Status: Active » Needs work

Added this issue as a reference since it is also broken in the 1.x branch. Committed in 2.x. Changing the version as well. Take a look at http://cgit.drupalcode.org/viewsreference/commit/?id=8770a63

While doing this refactored a bit since some code was pretty hard to wrap my head around. It could be done a bit easier with less code. The diffstat is pretty nice: 1 files changed, 32 insertions, 93 deletions.

  • seanB committed 0da0594 on 8.x-2.x
    Issue #2897999: Form field/option visibility through #states doesn't...
seanb’s picture

Forgot to delete a method that was no longer used. Removing another 20 lines of code. Yay!

  • New Zeal committed cb86907 on 8.x-1.x
    Issue #2897999: Form field/option visibility through #states doesn't...
NewZeal’s picture

I've added this patch to 8.x-1 and pushed to dev. This will need some testing since the patch did not fit and had to be added manually.

keopx’s picture

Any update?

jasonawant’s picture

Status: Needs work » Fixed

I'm marking this as fixed. I presume this issue has been fixed.

The 1.x commit was included in the 8.x-1.1 release, see CHANGELOG.md here

Status: Fixed » Closed (fixed)

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