I'm not sure where to submit this issue, maybe you can point me in the right direction

I've exported the variable language_default with features but everytime I clear cache the variable is changed and the feature is overriden but is not really a change in configuration.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

naxoc’s picture

I can confirm this. It is because core will change the hash-path to the js-folder, so I don't think there is much we can do about it.

For explanation, here is a diff from drush (ignore the weights - that is not the issue). This without having touched anything in the database - just installing the site on a dev-server.

Component: variable
        'native' => 'Dansk',
        'direction' => '0',
<       'enabled' => '1',
---
>       'enabled' => 1,
        'plurals' => '2',
        'formula' => '($n!=1)',
        'domain' => '',
        'prefix' => 'da',
<       'weight' => '0',
<       'javascript' => 'mhFow6dgFBt17me4dafXJDVhrVfrl49sR6eraXUh27I',
---
>       'weight' => '-10',
>       'javascript' => 'gJ4hsl8l8JpjUuR4Uok6D60HeSJxjUs6PL49w9LuM7w',
      ),
    ),
thamas’s picture

Issue summary: View changes

Is there a way to exclude the javascript hash-path?

estoyausente’s picture

Same problem, but I don't know the solution...

ovidenov’s picture

Same problem, anyone knows a solution ?

rodrigoaguilera’s picture

Status: Active » Closed (works as designed)

I ended up not exporting that variable, set it on install if you are installing a profile or do a hook_update_N function to set it to the desired value.

estoyausente’s picture

@rodrigoaguilera We configure the language in the install using profiling but anyway this is a bug (or maybe a feature request).

stefan.r’s picture

Category: Support request » Feature request
Status: Closed (works as designed) » Active

This may be a nice to have.

claudiu.cristea’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Active » Needs review
Issue tags: +API change
FileSize
2.24 KB

I see no solution other than intercepting the variables before they are rendered for export. But this means an API change. Now Strongarm allows this by implementing hook_strongarm_export_render_alter().

claudiu.cristea’s picture

FileSize
1001 bytes
2.25 KB

Oops! When such a variable is reverted using #8 I'm getting:

Notice: Undefined property: stdClass::$javascript in _locale_rebuild_js() (line 2042 of includes/locale.inc).

That means we still have to keep the javascript key in the object but export it everytime as empty string.

dmsmidt’s picture

#9: Nice, works for me

claudiu.cristea’s picture

Great. Then why not RTBC? :)

dmsmidt’s picture

Status: Needs review » Needs work

Almost RTBC :-)

  1. +++ b/strongarm.api.php
    @@ -0,0 +1,38 @@
    +/**
    + * @addtogroup hooks
    + * @{
    + */
    

    Nice, just reading up on: https://www.drupal.org/coding-standards/docs#defgroup
    So this is for http://www.drupalcontrib.org?

  2. +++ b/strongarm.api.php
    @@ -0,0 +1,38 @@
    + * Allows modules to act just before a variable value is rendered for export/
    

    Add dot behind the tekst instead of /.

claudiu.cristea’s picture

FileSize
2.25 KB
431 bytes

@dmsmidt,

Nice, just reading up on: https://www.drupal.org/coding-standards/docs#defgroup
So this is for http://www.drupalcontrib.org?

That is used by the API module. To group various functions and classes as topics. http://www.drupalcontrib.org uses the API module so it will benefit from this docs definition but only if Strongarm module is included there. But right now is not there.

claudiu.cristea’s picture

Status: Needs work » Needs review
Dane Powell’s picture

Status: Needs review » Reviewed & tested by the community

Works great for me.

vasike’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

I can confirm the solution from #13.

claudiu.cristea’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

Then we need to let it as RTBC... maybe the module maintainer will finally commit this :)

gaydamaka’s picture

+++ b/strongarm.module
@@ -223,3 +225,18 @@ function strongarm_features_pipe_node_alter(&$pipe, $data, $export) {
+      return;

Where return is not necessary, it is better to add a break.

Renrhaf’s picture

Any news about this patch being merged ?