Problem/Motivation
- outside_in_contextual_links_view_alter() has this code:
if (isset($element['#links']['outside-inblock-configure'])) { $element['#links']['outside-inblock-configure']['attributes'] = [
'outside-inblock-configure'
seems like a strange name, especially without a hyphen between 'in' and 'block'. Searching the codebase for that string doesn't uncover where it comes from. Where it comes from is thatoutside_in.links.contextual.yml
definesoutside_in.block_configure
, the keys of $element['#links'] in the above function are generated via Html::getClass() of the YML-defined link identifiers, and Html::getClass() converts '.' to empty string rather than hyphen.
Proposed resolution
Option 1:
Change the outside_in_contextual_links_view_alter() code to something like:
$link_class = Html::getClass('outside_in.block_configure');
if (isset($element['#links'][$link_class])) {
$element['#links'][$link_class]['attributes'] = [
That's fine for the PHP side. However, what about JS code such as $(e.target).find('li.outside-inblock-configure a')
?
Option 2:
Is there an option 2?