On the site I'm rowking on when running drush @dev fra the function drush_features_revert() is being passed a nested array of module overridden / needs review feature names...
function drush_features_revert() {
if ($args = func_get_args()) {
var_dump($args);
returns:
array(1) {
[0]=>
array(4) {
[0]=>
string(8) "feature1"
[1]=>
string(8) "feature2"
[2]=>
string(8) "feature3"
[3]=>
string(8) "feature4"
}
}
However, the code appears to require an array of strings, so it errors as follows:
explode() expects parameter 2 to be string, array given features.drush.inc:674 [warning]
array_shift() expects parameter 1 to be array, null given features.drush.inc:675 [warning]
array_shift() expects parameter 1 to be array, null given features.drush.inc:676 [warning]
Going back though debug_backtrace()'s output, it looks like the nested stucture is created in drush_features_revert_all() and passed to drush_invoke('features-revert', $features_to_revert);. I compared this function with the 1.x branch and noticed that that function basically replaces the following:
foreach ($features_to_revert as $module) {
drush_invoke_process(drush_sitealias_get_record('@self'), 'features-revert', array($module), array('force' => $force, '#integrate' => TRUE));
}
This looks like it was changed in https://drupal.org/comment/7784057#comment-7784057 .
Changing back to the 1.x version of the code fixes the issue for me. Apologies if this turns out to be an issue on my end and should be tagged as support instead of a bug report.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | drush-fra-issue-2210291-6.patch | 667 bytes | misc |
| #2 | drush-fra-issue-2210291-2.patch | 973 bytes | pq |
Comments
Comment #1
incaic commentedThis is a bug I am experiencing as well and came out with the same conclusion.
(wish I would've found this issue post before debugging)
Here's the exact commit that introduced this bug.
http://drupalcode.org/project/features.git/blobdiff/676484f9c84f4e33327d...
commit 7d56c4fb629c8ea6df0ca9fa9a6227ea0aca2d90
Author: Mike Potter
Date: Wed Oct 2 10:28:47 2013 -0400
Issue #2071859 by q0rban: Improve the performance and output of drush commands for sites with lots of features.
>git log --tags --simplify-by-decoration --pretty="format:%ai %d"
...
2013-10-02 12:58:10 -0400 (tag: 7.x-2.0-rc4)
2013-08-26 13:58:38 -0400 (tag: 7.x-2.0-rc3)
...
I think version 7.x-2.0-rc4 was when it was introduced.
Comment #2
pq commentedHi @incaic, I was beginning to think that I was the only one who was experiencing the issue, so thanks for letting us know.
If it helps, here's a simple patch that reverses the breakage, however I imagine there is probably a better fix that maintains the performance optimisation while allowing drush fra to succeed.
Comment #4
pq commented2: drush-fra-issue-2210291-2.patch queued for re-testing.
Comment #6
misc commentedDont know why the patch failed the test, attached new version.
Comment #7
misc commentedComment #9
misc commentedAha, now I see why it fails, figures :-)
Comment #10
pq commentedHi @MiSc,
Thanks for looking into it... I must admin, I had pretty much given up on trying to get the patch to pass. I haven't encountered the issue on any other projects since this so I'm not sure if it's been resolved in another update to features since then.
Comment #11
hefox commentedGotta run against 2.x-dev
Comment #12
misc commented6: drush-fra-issue-2210291-6.patch queued for re-testing.
Comment #13
hefox commentedWhat version of drush is encounter issues?
Drush 4 and under and under are not supported anymore
Comment #14
pq commentedHi,
The site in question was on Acquia cloud (developer tier). Currently it's running Drush 6.3.0, but looking back through the Acquia change history, it looks like it was upgraded from 4 to 6 on March 17th, 12 days after I raised this issue so it was quite likely to have been 4 at the time (see https://docs.acquia.com/cloud/release-notes#release-16311).
Comment #15
hefox commentedI'm going to close this as won't fixed under the assumption this was drush 4 -- there was another (duplicate?) features issues closed yesterday with the same reason by mpotter.
Comment #16
pq commentedThat seems fair enough. If I get the chance to work on said site again, I'll try reverting the patch and running drush fra again. If it reoccurs then I'll reopen the issue.
Thanks,
Paul.
Comment #17
leopathu commentedHi,
Thanks MiSc, #6 patch is working well..