- πΊπΈUnited States dww
Hi folks! Sorry I've been away from this queue / module for a while.
I'm not thrilled about putting Claro-specific classes into our markup. Frankly, I think I'd rather do #3159224: Remove entitygroupfield-dropbutton-wrapper.html.twig entirely β than this. π But I need to investigate a bit more, and now that Claro is the default core admin theme, maybe we need to do this (or something like it).
Anyway, I hope to do more testing / investigation on all this in the near future...
Thanks,
-Derek - πΊπΈUnited States dww
p.s. Now that I re-read the linked issue, I see these are actually related but different problems. We can (and probably should) do both.
- Status changed to RTBC
over 1 year ago 2:42am 28 March 2023 -
dww β
committed 2d27ea1d on 2.0.x authored by
solantoast β
Task #3183134: Broken dropbutton in Groups field when used with Claro...
-
dww β
committed 2d27ea1d on 2.0.x authored by
solantoast β
-
dww β
committed 211bc0cc on 1.0.x authored by
solantoast β
Task #3183134: Broken dropbutton in Groups field when used with Claro...
-
dww β
committed 211bc0cc on 1.0.x authored by
solantoast β
- Status changed to Fixed
over 1 year ago 10:25pm 18 June 2023 - πΊπΈUnited States dww
Thanks, folks!
Reviewing #6:
-
+++ b/css/entitygroupfield.admin.css @@ -49,3 +49,7 @@ +.field--widget-entitygroupfield-select-widget .dropbutton-action .dropbutton__items { + bottom: auto; + top: 100%; +}
Not clear why we need this or care. Seems a bit opinionated for the default module styles.
-
+++ b/src/Plugin/Field/FieldWidget/EntityGroupFieldWidgetBase.php @@ -451,7 +451,7 @@ abstract class EntityGroupFieldWidgetBase extends WidgetBase implements Containe ]; @@ -467,9 +467,27 @@ abstract class EntityGroupFieldWidgetBase extends WidgetBase implements Containe + $weights = []; + + foreach ($links as $key => $link_item) { + $weights[] = $link_item['#weight']; + } + + sort($weights); + + foreach ($links as $key => $link_item) { + if ($link_item['#weight'] === $weights[1]) { + $element['top']['links'][$key]['#prefix'] = '<li class="dropbutton__item dropbutton-action secondary-action"><ul class="dropbutton__items">' . $link_item['#prefix']; + } + + if ($link_item['#weight'] === end($weights)) { + $element['top']['links'][$key]['#suffix'] = '</li></ul></li>'; + } + } +
I'm not understanding why we want or need any of this complication. If this is actually necessary, please open a follow-up issue for it, and clearly explain (with code comments) why all this is needed.
So I manually tested with just patch #2 (which makes more sense to me), was able to reproduce the brokenness, and #2 seemed to be sufficient to solve it. So that's what I committed and pushed. Now fixed in both 2.0.x and 1.0.x branches, and will be out in the next round of releases.
@tanner.svg: Again, if #6 is necessary, please open a follow-up issue explaining the additional changes.
Thanks again!
-Derek -
Automatically closed - issue fixed for 2 weeks with no activity.