Needs work
Project:
Features
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Apr 2011 at 20:00 UTC
Updated:
12 Mar 2015 at 19:05 UTC
Jump to comment: Most recent
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
Comment #1
damienmckennaI've confirmed that the drush fu command does this too.
Comment #2
febbraro commentedThis is a problem for stylesheets too. Will look at this later this week, unless you can work up a patch.
Comment #3
derhasi commentedWe 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?
Comment #4
aschiwi commentedsubscribe (sorry)
Comment #5
febbraro commentedFixed, finally.
http://drupalcode.org/project/features.git/commit/b2316cd
Comment #7
osopolarDoes not work for export using the UI. See issue: #1335634: Style sheets (stylesheets[...][]) and Scripts (scripts[]) in .info file lost when recreating feature
Comment #8
mstef commentedThis change results in:
Etc..
Also getting nothing for stylesheets.
Comment #9
damienmckennaThis is working fine in 7.x-2.x, you might try upgrading.
Comment #10
mstef commentedI can't right now, and it's still broken in 1.x (that's what this issue is about).
Comment #11
mstef commentedComment #12
mstef commentedThe data from features_get_info() is fine, but the resulting .info file is far from.
Comment #13
mstef commentedOkay, 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).
Comment #14
mstef commentedThis issue seems to crossover with #1335634: Style sheets (stylesheets[...][]) and Scripts (scripts[]) in .info file lost when recreating feature.
See my last comment for status: http://drupal.org/node/1335634#comment-7144744
Comment #15
damienmckenna@mstef: Have you at least updated to the latest 7.x-1.x-dev?
Comment #16
mstef commentedYes. I went back to 1.0 because dev didn't work, nor did the patch for dev in the issue linked above.