Problem/Motivation

The currently used #prefix and #suffix at the $build[$region] should be avoided. This practice has the possibility that something goes wrong (mistyped/accidentally missing opening or closing tags) and it's impossible to add new attributes (even classes) to the wrapper element without setting #prefix again. If somebody doesn't need the wrapper, he/she has to unset #prefix and suffix too.

Proposed resolution

Use #theme_wrappers instead of the current solution

Remaining tasks

Provide a patch.

User interface changes

Nothing.

API changes

Nothing.

Data model changes

Nothing.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

huzooka created an issue. See original summary.

huzooka’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new844 bytes

Patch attached.

Status: Needs review » Needs work

The last submitted patch, 2: page_manager-avoid_prefix_suffix-2756613-2.patch, failed testing.

sneha_surve’s picture

Assigned: Unassigned » sneha_surve
hardikpandya’s picture

Assigned: sneha_surve » Unassigned
Status: Needs work » Needs review
StatusFileSize
new723 bytes

Added patch.

joville’s picture

I found this following issue which means that there is a plan to remove #theme_wrappers in core: https://www.drupal.org/node/2714509

Status: Needs review » Needs work

The last submitted patch, 5: use_theme_wrapper-2756613-5.patch, failed testing.

huzooka’s picture

Status: Needs work » Needs review
StatusFileSize
new1.25 KB

Tests fails happen because of the xPath() except only the "block-region-top" CSS class.

My problem is about that I should be able to alter the wrapper (or remove it completely if I want to). With this patch, the regions of the PageBlockDisplayVariant would get "real" regions, which means that e.g. they get pre-processable by template_preprocess_hook(). But that also means that they get further classes (region and region-top) and the xPath() wont found what it searches for.

So, because of that, I'd change xPaths to cssSelects.

Do you have any kind of feedback what should I do?

Status: Needs review » Needs work

The last submitted patch, 8: page_manager-avoid_prefix_suffix-2756613-8.patch, failed testing.

kostyashupenko’s picture

kostyashupenko’s picture

I removed hardcoded wrappers