Hi!

For multiple fields do not hidden wrapper. See screenshot

CommentFileSizeAuthor
Без названия.jpg35.35 KBalexd73
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexd73 created an issue. See original summary.

Huelfe’s picture

I got the same problem in my field collection issue.

NickDickinsonWilde’s picture

@Huelfe. Yes, I'm thinking that now that the remaining issue for your field collection is solely this issue.

This issue is a slightly tricky one. Core doesn't give the right hook to alter that point. I'm investigating the best way to work around/fix this without kitten slaughter. I think I have a functional solution but have to do some testing.

NickDickinsonWilde’s picture

Title: Not hide wrapper for multiple fields » Wrapper for multiple value fields is not affected by states.
Assigned: Unassigned » NickDickinsonWilde
NickDickinsonWilde’s picture

Title: Wrapper for multiple value fields is not affected by states. » Wrapper for multiple value fields are not affected by states.
Status: Active » Needs work

  • NickWilde committed a1d3a11 on 8.x-1.x
    Fix: Issue #2820353 by alexd73, NickWilde: Wrapper for multiple value...
NickDickinsonWilde’s picture

Status: Needs work » Needs review

Well I've fixed it I think. Latest dev version and requires a core patch. If using composer you can easily add that to your composer.json. Otherwise manually apply the patch :(.

NickDickinsonWilde’s picture

Assigned: NickDickinsonWilde » Unassigned

Note: you can also if using composer just add "enable-patching": true to your composer.json's 'extra' key; in which case the patch will be applied by Field States UI/composer.

idebr’s picture

Composer is picking up the additional patch defined in field_states_ui/composer.json, but fails to apply the patch since it can no longer be applied. The composer project to apply patches (cweagans/composer-patches) currently has a bug where ignoring patches does not work (#112). As a result, our build server now reports the build is unsuccesful.

Can i suggest either:

  1. Remove the patch from the module's composer file and provide documentation for installing the additional patch
  2. Update the patch to a version that does apply

Considering projects can use different branches for Drupal, I would prefer option 1.

NickDickinsonWilde’s picture

Status: Needs review » Needs work

I was about to do write some tests and do a push to get that patch merged... So I go to the logical tests file and ah what?! There's a test for hook_field_widget_multivalue_form_alter. That sure didn't exist. Takes a look:
added in 8.5.x. So I've closed as duplicate my issue and will be adjusting Field States UI to work with the new hook that got added to core. (I think all I'll have to do is adjust my usage to that name, but I'll test it out).

  • NickWilde committed bd1c4d8 on 8.x-1.x
    Issue #2820353 by NickWilde: Wrapper for multiple value fields are not...
NickDickinsonWilde’s picture

Status: Needs work » Fixed

Implementation adjusted to use the new core hook.

Status: Fixed » Closed (fixed)

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