Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context variable in hook_preprocess_pattern_PATTERN_NAME proper ? #312

Open
GiorgosK opened this issue Oct 8, 2020 · 0 comments
Open

context variable in hook_preprocess_pattern_PATTERN_NAME proper ? #312

GiorgosK opened this issue Oct 8, 2020 · 0 comments

Comments

@GiorgosK
Copy link

GiorgosK commented Oct 8, 2020

when inspecting variables in a pattern preprocess the context key context is holding an object of type Drupal\ui_patterns\Element\PatternContext which might go against this change record

This does destroy any context one might try to set on any parent preprocessors.

Even if I try to use the ui_patterns context and do something like this

function THEME_preprocess_pattern_PATTERNNAME(&$variables) {
  $variables["context"]->setProperty('variable1', 'value1');
}

variable1 gets destroyed and does not appear on the next preprocessor functions down the line

Does this need a 2nd thought ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant