I had a feature that I needed to add a script to, so I added the following to mymodule.info:

script[] = "mymodule.js"

The next time I exported the feature via the admin it got changed to:

script[mymodule.js] = "sites/all/modules/features/mymodule/mymodule.js"

so that when the site next tried to load the script it tried to load:

<script type="text/javascript" src="http://mysite.local/sites/all/modules/features/mymodule/sites/all/modules/features/mymodule/mymodule.js?ljv59j"></script>

Comments

damienmckenna’s picture

I've confirmed that the drush fu command does this too.

febbraro’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0-beta3
Assigned: Unassigned » febbraro

This is a problem for stylesheets too. Will look at this later this week, unless you can work up a patch.

derhasi’s picture

We also stumpled upon this error. I had a short look in the code. The problem seems to be that, the conversion of the path information by _system_rebuild_module_data() during building the module info array (that is used in features_get_info() ) is not reverted in the feature update process.

I'm not sure, what will be the best way to tackle this. Maybe we simply do a string replace from the module's path. Additionally the key should be removed, for readability, or?

aschiwi’s picture

subscribe (sorry)

febbraro’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

osopolar’s picture

mstef’s picture

Status: Closed (fixed) » Needs work

This change results in:

scripts[] = 1
scripts[] = 2

Etc..

Also getting nothing for stylesheets.

damienmckenna’s picture

Status: Needs work » Closed (fixed)

This is working fine in 7.x-2.x, you might try upgrading.

mstef’s picture

I can't right now, and it's still broken in 1.x (that's what this issue is about).

mstef’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Status: Closed (fixed) » Needs work
mstef’s picture

The data from features_get_info() is fine, but the resulting .info file is far from.

mstef’s picture

Okay, so features_get_info() is fine, UNTIL the module is rebuild and downloaded from the admin UI. Then, the data goes back to arrays with just numbers for the scripts, stylesheets, etc (and is cached).

mstef’s picture

damienmckenna’s picture

@mstef: Have you at least updated to the latest 7.x-1.x-dev?

mstef’s picture

Yes. I went back to 1.0 because dev didn't work, nor did the patch for dev in the issue linked above.

  • febbraro committed b2316cd on 8.x-3.x
    Issue #1131062: scripts/stylesheets manually added to info file have the...