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.
Comments
Comment #3
pdureau commentedComment #4
pdureau commentedLittle Sunday task :)
I can also for the
HtmxEvent::onClickDelete()change if you confirm it mus t be done.Comment #5
mogtofu33 commentedThe 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.
Comment #6
pdureau commentedOk, thanks for the explanation.
Comment #7
mogtofu33 commented