Problem/Motivation
The protected pages listing builds its Operations column using a generic dropbutton render element. It manually renders the element before inserting the resulting markup into the table cell.
This bypasses Drupal’s normal render pipeline and does not use the operations-specific theme suggestion. Consequently, the operations button may have incorrect or inconsistent markup and styling in current administration themes.
Steps to reproduce
Visit protected pages list.
See button in the Operations column.
Before/After screenshots attached.
Proposed resolution
Use Drupal’s standard operations render element and pass the render array directly to the table cell:
$operations = [
'#type' => 'operations',
'#links' => [
// Operation links.
],
];
$row['data'][] = ['data' => $operations];
Remove the manual call to RendererInterface::render() and the controller’s now-unused renderer dependency.
The operations element extends dropbutton, attaches the necessary assets, and provides the appropriate operations-specific theme suggestion. This allows Drupal to handle rendering, attachments, and cacheability metadata correctly.
| Comment | File | Size | Author |
|---|---|---|---|
| AFTER.png | 123.03 KB | oksana-c | |
| BEFORE.png | 127.84 KB | oksana-c |
Issue fork protected_pages-3612024
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
Comment #2
oksana-c commentedhttps://git.drupalcode.org/project/protected_pages/-/merge_requests/54
Comment #4
oksana-c commented