Problem/Motivation

The Display Builder delete confirmation for a Views display does not match the core Views delete page. It shows the raw instance ID instead of a label, and uses different wording for the title, button and breadcrumb.

Core Views delete Display Builder Views delete
Title Are you sure you want to delete the view Content? Do you want to delete views__frontpage__page_1?
Button Delete Confirm
Breadcrumb Delete View Confirm Deletion

Steps to reproduce

  1. Enable display_builder_views and enable Display Builder on a Views page display (e.g. frontpage / page_1).
  2. Go to /admin/structure/views/display-builder and click Delete on that row.
  3. Compare with /admin/structure/views/view/content/delete.

Delete page
Delete page from core

Proposed resolution

In ConfirmViewsBuilderDeleteForm, align with core:

  • getQuestion(): use the view and display labels instead of $this->builderId.
  • getConfirmText(): return "Delete".
  • Route _title in display_builder_views.routing.yml: match the page title instead of "Confirm deletion".

Remaining tasks

  • Agree on the wording.
  • MR.

User interface changes

The delete confirmation title, button and breadcrumb change. Screenshots of the current state are attached (core Views delete and Display Builder Views delete).

API changes

None.

Data model changes

None.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

csakiistvan created an issue. See original summary.

csakiistvan’s picture

Issue summary: View changes
csakiistvan’s picture

Issue summary: View changes

csakiistvan’s picture

Status: Active » Needs review
csakiistvan’s picture

StatusFileSize
new197.46 KB

Please check the related MR, title should fix:

3633406 after

pdureau’s picture

Thanks. Bugs (except some very specific exceptions) must be in the beta scope, and resolved before RC1.

This one is not a really a bug, it is more a task, but small enough to also be added to the scope.

pdureau’s picture

Category: Bug report » Task

Just thinking aloud... Why not simply using the one from Views? So we already have the expected wording without adding any more code.

However, those 2 delete forms are not equivalent:

Path /admin/structure/views/view/{view}/delete /admin/structure/views/display-builder/{builder_id}/delete
Route entity.view.delete_form display_builder_views.views.delete
Form Drupal\Core\Entity\EntityDeleteForm Drupal\display_builder_views\Form\ConfirmViewsBuilderDeleteForm
Action Delete the all View entity Delete only the builder instance.

So, it raises another question, why ConfirmViewsBuilderDeleteForm ? Why deleting an instance here, knowing we don't delete manually any instance elsewhere? Knowing instance are automatically recreated? Can we just drop this form?

csakiistvan’s picture

I checked the code. The form is not a plain instance delete:

  • The only entry point is the Delete operation in /admin/structure/views/display-builder (ViewsManagementController::getOperationLinks()).
  • ConfirmViewsBuilderDeleteForm::submitForm() deletes the instance and clears the profile on the display (unsetDisplayBuilder()), so Display Builder is disabled for that display. The instance is not recreated until a profile is selected again.
  • The same result already exists in Views UI: Change profile with an empty profile deletes the instance in DisplayExtender::submitOptionsForm(), through a regular View save instead of writing the display config directly.

So reusing the core Views delete form is not an option: it would delete the whole View.

Two options:

  1. Drop the form (route, form class, Delete operation) and rely on Change profile. Less code, and no direct config write.
  2. Keep it, but word it as what it does, e.g. title "Disable Display Builder on Content: Page?", button "Disable", operation "Disable".

I would go with option 1. If you agree, I'll update the MR and the issue title.

pdureau’s picture

Drop the form (route, form class, Delete operation) and rely on Change profile. Less code, and no direct config write.

This form is here from day one: https://git.drupalcode.org/project/display_builder/-/blob/70f9cfc44b1534...

And got its last real change in July 2025 #3534215: Implement WithDisplayBuilderInterface in Views

So, I believe it was a bit "forgotten" when we were doing the big structural changes (buildable plugins, instance entity, auto-generation of instances, display_builder_ui revamp...).

Let's see the opinion of Jean (@mogtofu33) when he will review the RTBC, but I believe it can be dropped now.

I'll update the MR and the issue title.

Yes, please, also update the issue title.

csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned

@pdureau Updated MR !525 as agreed: dropped ConfirmViewsBuilderDeleteForm, the display_builder_views.views.delete route and the Delete operation in /admin/structure/views/display-builder. Disabling Display Builder on a display now goes through Change profile with no profile selected; docs/with-views.md and agents/views.md are updated accordingly. The display_builder_views kernel tests pass locally. Also updated the issue title.

csakiistvan’s picture

Title: Align the Views builder delete confirmation with the core Views delete page » Drop the Views builder delete confirmation form
pdureau’s picture

Assigned: Unassigned » mogtofu33
Status: Needs review » Reviewed & tested by the community

Thanks. MR looks good to me.

mogtofu33 made their first commit to this issue’s fork.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Reviewed & tested by the community » Fixed

Thanks a lot!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

pdureau’s picture

Status: Fixed » Closed (fixed)

Shipped in beta10 release.