UpdateViewPlugins: display option updates on non-default displays do not override defaults inheritance
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3582781. --> Reported by: [abhisekmazumdar](https://www.drupal.org/user/3557964) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When the Views agent calls <code>UpdateViewPlugins</code> to update a display option (e.g. <code>title</code>, <code>path</code>, <code>style</code>) on a non-default display such as <code>page_1</code>, the value is saved to the config array but the <code>defaults</code> flag for that option is never cleared on the display. At runtime, Views checks <code>defaults[title] === true</code> and still serves the default display's value instead of the one that was just written.</p> <p>This means a user prompt like <em>"Update the title of the page display to Article Listing"</em> appears to succeed but has no visible effect on the page display output.</p> <h3>Steps to reproduce</h3> <ol> <li>Create a view with a default display and a page display.</li> <li>Use the Views Agent to update the title on the page display: <em>"Set the title of the page display of my [view] view to Article Listing"</em>.</li> <li>The agent calls <code>UpdateViewPlugins</code> with <code>display_id: page_1</code>, <code>display_option: title</code>, <code>config: Article Listing</code>.</li> <li>Visit the page display URL &mdash; the original default display title is shown, not the new one.</li> <li>Inspect the view config: the page display has the new title value in <code>display_options</code> but <code>display_options.defaults.title</code> is still <code>true</code>.</li> </ol> <h3>Root cause</h3> <p><code>UpdateViewPlugins::execute()</code> writes the new value directly to the display options array without calling <code>$display_handler-&gt;overrideOption()</code> first. When <code>defaults[option]</code> remains <code>true</code>, Views ignores the display-level value at runtime and falls back to the default display.</p> <p>The handler plugins (<code>CreateViewHandler</code>, <code>RemoveViewHandler</code>, <code>UpdateViewHandlerOptions</code>) already handle this correctly by calling <code>isDefaulted()</code> and <code>overrideOption()</code> before making changes. <code>UpdateViewPlugins</code> needs the same treatment.</p> <h3>Proposed resolution</h3> <p>Before writing the display option in <code>UpdateViewPlugins::execute()</code>, check if the target display is non-default and the option is currently inherited. If so, call <code>$display_handler-&gt;overrideOption($display_option, $current_value)</code> to break inheritance first, then apply the new value.</p> <h3 id="summary-ai-usage">AI usage (if applicable)</h3> <p>[ x ] AI Assisted Issue<br> This issue was generated with AI assistance, but was reviewed and refined by the creator.</p> > Related issue: [Issue #3542457](https://www.drupal.org/node/3542457)
issue