I installed bootstrap for d8 out of curiosity and the first thing I noticed is this.

For example the buttons for preview or save a comment don't have any text.

Comments

rodrigoaguilera created an issue. See original summary.

rodrigoaguilera’s picture

Status: Active » Needs review
StatusFileSize
new383 bytes

I worked around calling the the old preprocess function from the new one.

markhalliwell’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#2557881: Call to undefined function drupal_group_functions_by_prefix()

Pretty sure this is a duplicate of this related issue.

rodrigoaguilera’s picture

I still don't see any text inside the button element with the latest commit.
I tested on my site and a quick https://simplytest.me/ instance.

markhalliwell’s picture

Status: Closed (duplicate) » Needs work
Related issues: +#939462: Specific preprocess functions for theme hook suggestions are not invoked

Hm. Ok. It still sounds like it's related to this D8 issue though.

I'll have to step through the registry/theme invocation in more detail. It may be an issue with the registry alter (not picking up the file for preprocess suggestions?).

The ultimate reason I closed this is because the patch in #2 should not be necessary. Preprocess functions are accumulative (meaning the base preprocess should always run first) and this patch would essentially "double" preprocess a button.

markhalliwell’s picture

Essentially, the majority of _bootstrap_process_theme_registry_suggestions() needs to come out... or at the very least severely refactored so just adds in the discovered base theme hook files.

edit: also, please keep in mind that the code in registry.inc is still heavily based on 7.x.

neardark’s picture

Status: Needs work » Fixed

I was seeing this also, so I've merged this which does fix the issue. Guess that preprocess wasn't being fired in the past...

  • neardark committed 5bacc09 on 8.x-3.x
    Revert "Issue #2558257 by rodrigoaguilera: Buttons don't have any text...
neardark’s picture

Status: Fixed » Needs work

Reverting this commit until the issue that caused button labels can be addressed.

markhalliwell’s picture

Title: Buttons don't have any text » Theme hook suggestions are not inheriting base hook preprocess functions
Component: Templates » Code
Assigned: Unassigned » markhalliwell

I will try and cleanup the registry.inc file this weekend.

marcingy’s picture

Status: Needs work » Needs review
StatusFileSize
new4.5 KB

I have traced the issue and have suggesting working once again there maybe some clean up we could do the issue was introduced by #939462: Specific preprocess functions for theme hook suggestions are not invoked because of changes to how the registry is build. The fix just updates the bootstrap module but I was able to also fix it by changing

// Discover and add all preprocess functions for theme hook suggestions.
$this->postProcessExtension($cache, $this->theme);

// Let modules and themes alter the registry.
$this->moduleHandler->alter('theme_registry', $cache);
$this->themeManager->alterForTheme($this->theme, 'theme_registry', $cache);

Too

// Let modules and themes alter the registry.
$this->moduleHandler->alter('theme_registry', $cache);
$this->themeManager->alterForTheme($this->theme, 'theme_registry', $cache);

// Discover and add all preprocess functions for theme hook suggestions.
$this->postProcessExtension($cache, $this->theme);

This off course means that we lose the ability fully alter the registry and brings into question do we need an alter.

slashrsm’s picture

Solution looks OK and it seems to fix the issue. When reviewing this I thought how much nicer would this be if we'd extent core's registry service and add bootstrap's stuff there. This will give us access to protected functions like postProcessExtension() etc.

I am aware this is module material, but so complex registry alter probably belongs there anyway.

marcingy’s picture

StatusFileSize
new4.58 KB

Fixes a notice at install time

  • neardark committed 8c30107 on 8.x-3.x authored by marcingy
    Issue #2558257 by marcingy, rodrigoaguilera: Theme hook suggestions are...
neardark’s picture

Assigned: markhalliwell » Unassigned
Status: Needs review » Fixed

Merged.

Status: Fixed » Closed (fixed)

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