Problem/Motivation

Currently the values used for theme_hook_suggestions in template_preprocess_authcache_p13n_fragment(), template_preprocess_authcache_p13n_setting(), template_preprocess_authcache_p13n_assembly(), template_preprocess_authcache_p13n_partial() aren't normalized.
This leads to weird, and I have to assume invalid, entries in the theme_hook_suggestions.

Proposed resolution

Remove everything that's not valid as function name from the values used to build the suggestions.

Remaining tasks

Reviews needed.

User interface changes

None.

API changes

I'm afraid that it could break existing theme_hook_suggestions but I'm not sure if the "broken" suggestions could even used in any way.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

das-peter created an issue. See original summary.

znerol’s picture

Oh! Do you have an example of such a broken theme suggestion?

das-peter’s picture

Sorry for the delay.
I think one of the easiest examples comes from authcache_block_authcache_p13n_fragment() which uses this pattern to create the fragement ID: $fragment_id = 'block/' . $block_id;.
This ID seems to be used as $fragment in the above mentioned template preprocessors.
So we can end up with something like the following as theme suggestion: authcache_p13n_fragment__ajax__block/system-powered-by
That doesn't seem right.

znerol’s picture

Oh, right that cannot work. What if we just remove the suggestion and let people add their own if necessary? This is obviously not a feature which is widely used.

pribeh’s picture

For themers it helps to have documented examples :). Just my two cents.

  • znerol committed c58b0d5 on 7.x-2.x authored by das-peter
    Issue #2904004 by das-peter: Normalize theme_hook_suggestions in p13n...
znerol’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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