[6.x] Fix Replicator field labels hidden when nested in Grid#14987
Conversation
|
@jasonvarga CI just went green on this one, so it's ready for a look whenever you get a chance. |
jasonvarga
left a comment
There was a problem hiding this comment.
I ran an AI review on this. Havent't had a chance to actually test this out myself yet. Wasn't going to drop a review until then but since you've pinged...
Added CSS override may re-reveal labels in deeper nesting it shouldn't
The new selector matches [data-ui-field-header] /etc. as a descendant of .replicator-fieldtype / .bard-fieldtype / .group-fieldtype at any depth, not just direct fields of that container. Scenario: outer Grid → Replicator (in a cell) → an inner Grid field → the inner grid's own cell direct-child label. That inner label is still a descendant of .grid-cell :is(.replicator-fieldtype ...) , so the override rule (higher specificity) wins over the inner grid-cell's own "hide direct labels" rule, un-hiding a label that should stay hidden per the original grid-cell design. This is a plausible (if narrow/rare) regression for Grid-inside-Replicator-inside-Grid nesting. Not covered by any test. Worth a quick manual check in the browser before merge, but likely acceptable given how narrow the case is.
The PHPUnit test adds nothing
The fix is a CSS thing. Adding PHP coverage does nothing here and would pass even before this PR. Please remove.
…, drop non-functional test
|
Good catch on both. On the nesting one, you're right: I traced the specificity, and the override rule doesn't tell "directly inside this container" apart from "nested another Grid level deeper." So a Replicator/Bard/Group's un-hide rule beats an inner Grid cell's own hide rule no matter how deep it goes. I added a third rule that re-hides labels once they're inside another Also pulled the PHPUnit test. You're right that it wasn't covering anything: it passes the same with or without the CSS change, confirmed by reverting just the CSS and rerunning it. Pushed both fixes. |
Fixes issue #14049 where Replicator field labels were hidden when the Replicator was nested inside a Grid field.
The CSS rule in grid.css that hides field labels for direct grid cell children was too broad and also hiding labels for fields inside nested container fieldtypes like Replicator, Bard, and Group. This fix uses a counter-rule to make labels visible again inside these container fieldtypes.
Fixes #14049