- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
As the current implementation in twig_tweak is quite simple (render array), we'd have to duplicate some of the logic to explode
$id
by "|" and ":" so it's to be discussed, if it wouldn't be even better to add that check to core to safeguard the render array in general, even if used somewhere else.Current twig_tweak implementation:
/** * Builds contextual links. * * @param string $id * A serialized representation of a #contextual_links property value array. * * @return array * A renderable array representing contextual links. * * @see https://www.drupal.org/node/2133283 */ public static function drupalContextualLinks(string $id): array { $build['#cache']['contexts'] = ['user.permissions']; if (\Drupal::currentUser()->hasPermission('access contextual links')) { $build['#type'] = 'contextual_links_placeholder'; $build['#id'] = $id; } return $build; }
- Merge request !44Implemented a E_USER_WARNING if wrong parameter count in drupalContextualLinks() → (Open) created by Anybody
- last update
about 1 year ago 10 pass, 2 fail - last update
about 1 year ago PHPLint Failed - last update
about 1 year ago PHPLint Failed - Status changed to Needs review
about 1 year ago 12:01pm 26 February 2024 - 🇩🇪Germany Anybody Porta Westfalica
Okay this works, but it would be great to track this down to the twig code / file where this is wrong. Any chance for that? Ideas?
- last update
about 1 year ago 10 pass, 2 fail - Status changed to Closed: won't fix
7 months ago 10:40am 24 September 2024 - 🇩🇪Germany Anybody Porta Westfalica
Let's better fix this in core: 📌 Validate string given to _contextual_id_to_links() Active so not only twig_tweak benefits from the improved validation or handling.