If specific theme hook suggestions [pre]process functions existed, the hook specified in $variables['theme_hook_suggestion'] would be unset and the template wouldn't be invoked.

Comments

  • Commit 0390173 on 7.x-3.x by Mark Carver:
    Issue #2228943 by Mark Carver: [REGRESSION] Template suggestions not...
markhalliwell’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Assigned: Unassigned » ryan.armstrong
Status: Active » Needs review

  • Commit 0390173 on 7.x-3.x, 8.x-3.x by Mark Carver:
    Issue #2228943 by Mark Carver: [REGRESSION] Template suggestions not...
claudiu.cristea’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev
Status: Needs review » Needs work

I updated to latest from 3.x by cloning with Git. After the update my template preprocess suggestion from a custom module, mymodule_preprocess_message(), is no more invoked. It's true that I altered the registry and removed the 'base hook' from 'message' so that I cann provide the above suggestion but it worked till now with a Bootstrap build from February 2014. Now it's broken.

shaundychko’s picture

To get a theme suggestion working for a node template I had to set $variables['theme_suggestion'] = 'node__type__viewmode'; in THEME_preprocess_node(&$variables).
$variables['theme_suggestions'][] = 'whatever'; is ignored.
Then, in THEME_preprocess_node__type__viewmode it's necessary to set $variables['theme_suggestions'][] = 'node__type__viewmode'.

  • Mark Carver committed 0390173 on 8.x-3.x.x
    Issue #2228943 by Mark Carver: [REGRESSION] Template suggestions not...
heylookalive’s picture

Hey Mark! +1 on this, I've got a custom template (harmony-post.tpl.php) in a module which has it's own preprocess (template_preprocess_harmony_post) and it's not being called. It only happens when I bring in a custom template into my bootstrap subtheme, weird! The template is used but the preprocess function doesn't get called. Weird! I think this is potentially related though could end up it's own issue.

markhalliwell’s picture

I'm not entirely sure, but I think this is a dup of this related issue. Regardless, I know there is some weird stuff going on with that one, of which I am having a hard time reproducing out of the box. I've asked @ryan.armstrong to help in trying to track this down or at least provide some steps to reproduce. Maybe try 7.x-3.1-beta2?

heylookalive’s picture

Me neither now, I'm roaming around in entity api so am far away from specific themes so may have been a red herring. Once fixed will update but I'm thinking bootstrap isn't the problem!

heylookalive’s picture

Yep ignore me, apologies. My issue was caused by Entity API stuff.

mosesdog’s picture

I'm having a similar issue with trying to do a page.tpl.php override by content type. I've put the appropriate preprocess_page code in the template.php file in the subtheme and added the page--contenttype.tpl.php file. Cleared the cache. It's not being called. Other things are being called from the template.php correctly. Any thoughts?

  • markcarver committed 0390173 on 7.x-4.x
    Issue #2228943 by Mark Carver: [REGRESSION] Template suggestions not...
markhalliwell’s picture

Assigned: ryan.armstrong » Unassigned
Status: Needs work » Closed (fixed)

This was fixed in 7.x. I had moved it to 8.x for porting, but that has been done as well already.

Do not re-open this issue, create a new one (if a valid bug) with clear steps on how to reproduce from stock core/bootstrap.

Re #11:
Pages do not have content type suggestions out of the box. #2128129: Provide setting to change sidebar/content widths attempted to add this capability, but was reverted and postponed for a later major.