After installing the module, i was unable to get the theme list of the CiviCRM Administration theme : and CiviCRM User theme :
After investigation, i did changed the function civicrmtheme_form_alter(&$form, $form_state, $form_id)
and changed the '#options' line to:
'#options' => $form['theme']['admin_theme']['#options'],
to make it work.

Hope that helps.

Comments

meecect’s picture

StatusFileSize
new1.29 KB

verified on up-to-date modules. I also reported this issue here:

http://drupal.org/node/568710#comment-3043222

I have attached a patch to fix.

julien’s picture

Excellent :) Will update the module. thanks Meecect

bcobin’s picture

I can confirm this patch is necessary to get the module to work. Thanks a ton!

kurund’s picture

Assigned: Unassigned » kurund

I am getting list of themes for CiviCRM Administration theme and CiviCRM User theme. In fact above patch breaks the selects.

bcobin’s picture

That's odd, Kurund - in my case (which was a fresh install), the original module (release version, not dev) produced "stub" dropdowns with nothing in them. It was only after I applied the patch that the themes appeared at all.

This is with Civi 3.3.0 and Drupal 6.19. Strange...

meecect’s picture

It all depends on which version of the admin theme module you are running. Civicrm_theme interfaces with admin_theme, and admin_theme altered their form elements at some point, so when civicrm_theme attempts to alter the theme options on the admin_theme settings page, it works for some versions and not for others. I can modify the patch to change behavior based on the admin_theme version installed. Stay tuned.

stoob’s picture

As of April 2011, version 1.4 module doesn't work with the current (1.3) version of Administration Theme module. This is using CiviCRM 3.3.6. The patch in this post does work to fix the problem. thank you for the patch

bcobin’s picture

Thanks for the report, Stoob - and, of course, meecect for the patch. Much appreciated!

bcobin’s picture

Version: 6.x-1.4 » 6.x-1.x-dev

I can confirm the patch is also necessary for the .dev version of civicrm_theme as of 5/16/11. Changing the version on this thread to .dev insofar as it's already documented that the patch is required for the release version.

Thanks again for this! Marvelous...

agileware’s picture

Title: Options of select theme form » civicrm_theme is incompatible with the admin_theme module
StatusFileSize
new2.07 KB

To sum up:
The problem is that *some versions* of the Administration Theme module move the admin_theme element into a fieldset element named 'theme', which breaks the options list for the fields that this module provides. It also breaks the positioning of the fields that this module provides as they also rely on that form element.

This problem causes this error:

warning: Invalid argument supplied for foreach() in MYSITE/includes/form.inc on line 1436.

The patch in #1 fixes the problem for newer versions of admin_theme but breaks the existing fucntionality of this module when admin_theme is not installed.

This patch should fix the problem so the module works regardless of what version of admin_theme you have installed or if you don't have it installed at all.

Created against latest git, which I think is the same as 6.x-1.4.

agileware’s picture

Status: Active » Needs review
mrfelton’s picture

Patch in #10 works for me with admin_theme 6.x-1.3 (latest stable release). Someone needs to test this with latest -dev release of admin_theme to confirm it also fixes the issue there.