Adaptive Theme does not generate the dynamic .css files on the installation of a sub-theme.

When enabling a distributed sub-theme the following error message is displayed:

One or more CSS files were not found or does not exist: /{theme name}.default.layout.css. Did you delete the public files directory or change a file name?
You probably need to save the theme settings to generate the files. Please view the online documentation."

Following the error message suggestion and going to the sub-theme configuration and pressing save (without changing any settings) generates the files and fixes the broken CSS.

My question, however, is why would this step be necessary? Shouldn't these files be generated when the theme is enabled?

Thank you for your assistance.

Comments

Jeff Burnz’s picture

Category: bug » feature
Status: Active » Closed (won't fix)

My question, however, is why would this step be necessary? Shouldn't these files be generated when the theme is enabled?

Nope, Drupal does not have a proper installation routine for themes, instead it just "enables" them, we have been fighting for such a thing (real install/uninstall) for YEARS but this has never happened. I have worked with a bunch of developers to try and build such a feature but its nearly impossible to do in a theme (frankly I think it is impossible), you need a module to extend core - which is kind of stupid -install a module so you can install a theme (doesn't really make sense eh?).

This should really be "can't fix".

sheldon rampton’s picture

Status: Closed (won't fix) » Active

I'm reopening this issue because it pertains to a problem I'm experiencing. If you think I should file a separate ticket, please let me know and I will.

I'm building a Drupal distribution that uses an Adaptive sub-theme I've developed. After site installation, however, I'm getting the "One or more CSS files were not found" until I manually save the theme settings.

I've tried a test install of the OpenOutreach distro, which includes a number of Adaptive-based themes, and it appears that OpenOutreach does not generate the dynamic CSS files either until I manually save the theme settings, but it doesn't display the error messages either. Can you at least explain why the error messages don't appear in OpenOutreach, or what I can do to prevent the error messages from appearing in the distro that I'm creating?

Jeff Burnz’s picture

The distro to look at is Commons, they did it somehow but I can't recall exactly how right at this moment.

EDIT: I mean I am pretty sure Commons actually generates the files, you would want to be using the DEV version of Adaptivetheme, I did a lot of work with Acquia and the Commons team to make things work.

From what I see in commons.install http://drupalcode.org/project/commons.git/blob/refs/heads/7.x-3.x:/commo...

// AdaptiveTheme requires that the system theme settings form
 102   // be submitted in order for its themes' settings to be properly set
 103   // and the resulting css files generated.
 104   // For more background, see http://drupal.org/node/1776730.
 105   module_load_include('inc', 'system', 'system.admin');
 106   foreach (array('adaptivetheme', 'commons_origins') as $theme_name) {
 107     $form_state = form_state_defaults();
 108     $form_state['build_info']['args'][0] = $theme_name;
 109     $form_state['values'] = array();
 110     drupal_form_submit('system_theme_settings', $form_state);
 111   }
 112 }
Jeff Burnz’s picture

Issue summary: View changes

Fixed gramatical mistake.

Jeff Burnz’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

Assume fixed?