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.
| Comment | File | Size | Author |
|---|---|---|---|
| authcache-p13n-normalize-theme-suggestions.patch | 2.39 KB | das-peter |
Comments
Comment #2
znerol commentedOh! Do you have an example of such a broken theme suggestion?
Comment #3
das-peter commentedSorry 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
$fragmentin 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-byThat doesn't seem right.
Comment #4
znerol commentedOh, 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.
Comment #5
pribeh commentedFor themers it helps to have documented examples :). Just my two cents.
Comment #7
znerol commented