Problem/Motivation

2 little issue found while working on other tasks.

Instance::$pathindex protected property is never used. Can we remove it?

In ProfileViewBuilder, html_tag render element accept only render array as children, but a string scalar is sometimes injected, triggering a renderer's fatal error:

      $title = '';
      $panes[$island_id] = [
        '#type' => 'html_tag',
        '#tag' => $tag,
        'title' => $title,

Proposed resolution

Fix them.

Other tasks

HtmxEvent::onClickDelete() has been changed from HTTP DELETE to HTTP POST in #3576683: [meta] UX refresh. I didn't revert to DELETE because I don't know if it was a mistake or done in purpose.

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

pdureau created an issue. See original summary.

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Active » Needs review
pdureau’s picture

Little Sunday task :)

I can also for the HtmxEvent::onClickDelete() change if you confirm it mus t be done.

mogtofu33’s picture

The POST instead of delete is on purpose:

1. The contextual menu is one shared DOM element reused for every right-click, so node_id is not known when the menu item is rendered. HtmxEvents::onClickDelete() builds the URL with only the instance ID.
2. node_id is injected at request time via htmx:configRequest → event.detail.parameters (contextual_menu.js:620, :658), which htmx sends as a form-encoded body for any non-GET verb.
3. The controller reads it with $request->request->get('node_id') (ApiContextualMenuController.php:67). PHP only populates $_POST (hence Symfony's request bag) for POST with a form content type. A DELETE body is never parsed, so node_id would be empty and remove('') a no-op.

It also lines up with its siblings: paste, duplicate, save_as_preset, paste-styles, delete-styles are all POST with the same hx-vals pattern. Reverting to DELETE would need the placeholder back in the path, which the shared-menu design cannot supply.

pdureau’s picture

Ok, thanks for the explanation.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

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.

  • mogtofu33 committed f42b819b on 1.0.x authored by pdureau
    task: #3615691 Remove Instance::pathindex and fix ProfileViewBuilder...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.