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 that outside_in.links.contextual.yml defines outside_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?

Remaining tasks

User interface changes

API changes

Data model changes

Comments

effulgentsia created an issue. See original summary.

naveenvalecha’s picture

Component: contextual.module » outside_in.module
tkoleary’s picture

Issue tags: +JavaScript
tedbow’s picture

Status: Active » Closed (won't fix)
Related issues: +#2803375: Rename Outside-in module to "Settings Tray" for real

I say we don't worry about this because machine name of module is going to changed to settings_tray anyways so all of these will be changed.

See #2803375: Rename Outside-in module to "Settings Tray" for real

tedbow’s picture

Component: outside_in.module » settings_tray.module

Changing to new settings_tray.module component. @drpal thanks for script help! :)