Since system_theme_default() isn't a form, we can't get at it with a hook_form_alter(). The only other option is to basically replicate the guts of system_theme_default() in a hook_init -- which is of course pretty ugly. But this certainly seems like a legitimately important action into which drupal should hook. Patch forthcoming ...

Comments

crookednumber’s picture

This is my first hook-related patch, so I had a few questions about comments, the location of the sample hook (just added to the bottom of the api file), any recs for the sample hook (e.g., how trivial and/or playful should it be?), so feel free to dig in. Thanks.

crookednumber’s picture

Status: Active » Needs review

Changing status.

crookednumber’s picture

Status: Needs review » Needs work
Issue tags: +DX (Developer Experience)

The last submitted patch, add-hook-to-system_theme_default-1243004.patch, failed testing.

crookednumber’s picture

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

Re-rolling for architecture change of 11/1/2011.

http://groups.drupal.org/node/179649

valthebald’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

What use case do you see in altering system_theme_default()? It almost doesn't contain own logic, just a set of API calls, that you can reuse in your own callback.

internetdevels’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.25 KB

Re-rolling for #5

valthebald’s picture

Still no answer what could be the use case for that hook...

crookednumber’s picture

It's been a while, but I believe the use-case was a fairly customized need. E.g., if the theme is set to X, then disable this block, move this block to the top of a region, etc.

Re-reading #6, it seems that there might be some confusion. I'm not trying to alter the function or the default theme being set.

It's just a regular hook. When X happens, I'd like to do Y. A good comparison would be the way most people use hook_modules_enabled.

Status: Needs review » Needs work
mgifford’s picture

Assigned: crookednumber » Unassigned

Unassigning so someone else can take it on.

joelpittet’s picture

Status: Needs work » Closed (won't fix)

Doesn't seem that it's got a strong case for this feature. Closing for D8 rc triage.