Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When exporting the themekey rules the weight is not being saved - this is causing problems when re-importing as the order of the rules is crucial.
Comments
Comment #1
mkalkbrennerThat's by design.
A rule chain like the one provided by ThemeKey will never perfectly fit with Features.
We decided to not include the wights in th Features export. If we do so, it's impossible to encapsulate different rules into different Features. And a Feature will allways be overwritten if you just add a new rule to the chain (or another Feature adds a new rule).
As we introduced Features support we discussed that issue and the conclusion was that it's up to the administrator to arrange rules manually provided via different Features.
Remember, Drupal 7 and earlier never supported an export and deployment of configuration. The Features module is just a dirty hack.
If you want to deploy a complete rule chain, you should use an installation profile instead of Features.
Using implementations of hook_update_N within your installation profile it's easy to to create the required database entries for the rule chain.
Another option is to provide a patch for ThemeKey that turns the rule chain table in an array stored as drupal variable. Once that happened the complete chain could be exported via strongarm. See #2024915: rule chain storage refactoring to participate.
Comment #2
mkalkbrennerComment #3
mkalkbrenner