fix: #3621969 Warn when overriding a display option un-defaults grouped siblings

Summary

Also found by the same independent code review as the expose partial- merge fix, this time checking the overrideOption() fix for edge cases. Views' own DisplayPluginBase::defaultableSections() groups several display options together (use_more/use_more_always/use_more_text; link_display/link_url; style/row; filters/filter_groups), and overrideOption() un-defaults the whole group, not just the option requested - copying each sibling's currently-inherited value into the target display and permanently severing its inheritance from the default display too. That side effect matches Views UI's own behavior, so it isn't a logic error, but nothing told the caller it happened.

Changes

  • src/Plugin/AiFunctionCall/UpdateViewPlugins.php: computes the affected sibling options via defaultableSections() before the override, and appends a note to the tool's own success message naming them, whenever this occurs on a non-default display.
  • tests/src/Kernel/Plugin/AiFunctionCall/UpdateViewPluginsTest.php: added testGroupedOptionOverrideWarnsAboutSiblings() and testUngroupedOptionOverrideHasNoSiblingWarning().

Test plan

  • testGroupedOptionOverrideWarnsAboutSiblings confirmed failing before the fix (no note, but siblings genuinely frozen anyway) and passing after.
  • testUngroupedOptionOverrideHasNoSiblingWarning confirms no false-positive note for an option with no grouped siblings.
  • Full suite passes on this branch in isolation: 18/18 tests, 212 assertions across UpdateViewPluginsTest and the base branch's two Integration tests, no failures.
  • phpcs --standard=Drupal,DrupalPractice and phpstan analyse (module config, level 1) clean on both changed PHP files.

Closes #3621969

AI-Generated: Yes (Used Claude Code to find this defect via an independent code review of the module's own recently-merged changes, confirm the grouping behavior against Drupal core Views source, implement the fix, and write both regression tests.)

Merge request reports

Loading