Problem/Motivation

Some styling on the page may have to be adjusted if the environment indicator is turned on. Therefore, a class in the body element would help.

CommentFileSizeAuthor
#2 3320061-2.patch977 bytesjurgenhaas

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review
StatusFileSize
new977 bytes
e0ipso’s picture

This looks good! I like this feature.

Is there a chance that $variables['attributes']['class'][] = 'environment-indicator'; fails because $variables['attributes'] or $variables['attributes']['class'] are not defined?

jurgenhaas’s picture

That's a great question. I just looked through core and many contrib modules, all seem to be doing the same as the patch above and none is checking for the existence of the arrays. TBH, the body always has some classes, and therefore it seems to be a safe assumption that those components really exist.

e0ipso’s picture

Status: Needs review » Fixed

I made some small fixes on commit.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jurgenhaas’s picture

@e0ipso looks like this is not in the latest release anymore. Have we lost this by accident?

jurgenhaas’s picture

In fact it looks as if the commit never landet in the code base.

e0ipso’s picture

You are correct! Thanks for noticing.

I can't remember what the changes were, so I committed your patch directly. Hopefully all is good now.

jurgenhaas’s picture

This is great, thank you.

justcaldwell’s picture

This is a great addition! Is there a reason we don't add the class if toolbar integration is enabled?

if (_environment_indicator_external_integration_is_enabled('toolbar')) {
  return;
}
justcaldwell’s picture

Disregard. I can see now how there might need to be adjustments only when toolbar integration isn't enabled.

I'll handle my use case with custom code. Thanks!