I've got a custom install profile that includes exported CER definitions. When I install a fresh copy of my site (using 'drush site-install'), install fails and I get this error:
PHP Fatal error: Cannot redeclare cer_features_export() (previously declared in /narya/www/analytical/www/sites/all/modules/contrib/features/includes/features.ctools.inc(32) : eval()'d code:1) in /narya/www/analytical/www/sites/all/modules/contrib/cer/cer.features.inc on line 26
I was experiencing this on 7.x-3.x-alpha3, then I upgraded to 7.x-3.x-dev (latest snapshot as of right now), problem is exactly the same on both these versions.
I fixed it by putting this at the top of my cer.module file:
include_once dirname(__FILE__) . '/cer.features.inc';
(it's a hack, I know, but I'm not a features / ctools / cer expert - so, whoever has a more "correct" fix, feel free to submit a patch here for it).
Obviously the cer.features.inc file isn't getting included early enough (i.e. not until after ctools_features_declare_functions() has been called). Someone please take it from here.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | cer-2238213-features-include-3.patch | 2.5 KB | Jaza |
| #2 | cer-2238213-features-include-2.patch | 1.38 KB | phenaproxima |
Comments
Comment #1
phenaproximaRight now, CER puts its global includes at the bottom of cer.module. I see no reason why they shouldn't be moved to the top of the module. Patch attached.
EDIT: If that doesn't fix it, another possibility is that the call to
module_exists()to check for Features' presence is failing during installation. If that's the case, I'll re-roll the patch to make the include unconditional.Comment #2
phenaproximaYou know what, on second thought I think that moving the contents of cer.features.inc to cer.module is a better fix.
Comment #3
Jaza commentedSorry, but that patch still didn't do it for me, got the same error on fresh site-install.
Attached is an updated patch which does the job for me:
cer_features_export()to the top ofcer.module(apparently necessary!)cer.features.inc(no longer needed)cer.features.incincer_features_api()Hope that helps.
Comment #5
phenaproximaI reached the same conclusion -- the patch I posted in #2 does most of the same stuff, although I forgot to fix
cer_features_api().I concur that cer.features.inc is pretty much unnecessary. Patch committed and pushed.
Comment #6
Jaza commentedCool - looking better.
Thanks for the very prompt response and commit - already updated my local codebase with latest dev version, no hacks in sight!
Comment #7
phenaproximaYou're quite welcome - thanks for the detailed bug report and fix! When it comes to my maintainer duties, I don't mess around :)
Comment #8
phenaproximaFixed in dev; the patch in #3 is for 7.x-3.0-alpha3.
Comment #9
phenaproximaFixed in 7.x-3.0-alpha4.