Can't install - color module dependancy and an undefined func

Bevan - January 8, 2009 - 09:43
Project:Vertical Tabs
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Dependencies were introduced on color module which are not checked and a dependency on a function in the module from the install file is not supported. These errors result in vertical_tabs being impossable to install on a site that has never had it enabled before.

The attached patch moves vertical_tabs_generate_stylesheet() into an include file (attached) which is included from both vertical_tabs.module and vertical_tabs.install before calling vertical_tabs_generate_stylesheet(). It also wraps color.module-dependent code in if (module_exists('color')).

I haven't tested that this actually does the "coloring in", but it at least let me install, and should still do the coloring in on install.

AttachmentSize
vertical-tabs-install.patch3.18 KB
generate_stylesheet.inc_.txt1.44 KB

#1

quicksketch - January 11, 2009 - 01:10
Status:needs review» fixed

Thanks, I couldn't bring myself to make an include for 20 lines of code, but I committed the hook_install() fix, which is a pretty bad bug. I'll get out a new release shortly.

#2

Bevan - January 11, 2009 - 21:42
Status:fixed» postponed (maintainer needs more info)

On install of vertical tabs (with color.module enabled) I get fatal error vertical_tabs_generate_stylesheet() does not exist. vertical_tabs.module has not loaded when hook_intsall() is invoked. This is why I put the function in an include. Alternatively you could load vertical_tabs.module. However this may have undesirable side effects.

Vertical Tabs installs fine if color module is disabled.

#3

Bevan - January 12, 2009 - 22:24

Rerolled the patch. the include is the same.

AttachmentSize
355938.patch 2.95 KB
generate_stylesheet.inc_.txt 1.44 KB

#4

domesticat - January 14, 2009 - 16:17
Status:postponed (maintainer needs more info)» needs review

Patch applies cleanly for me, and allowed me to install vertical tabs on a site that's 1) never had vertical_tabs installed before and 2) had the color module enabled.

Seems clean to me.

#5

matthew petty - January 14, 2009 - 21:52

Patch in the original post works for me.

355938.patch does not.

#6

Bevan - January 14, 2009 - 22:51

#5, Matthew, What was the error?

#7

radj - January 28, 2009 - 16:02

Tested the patches and they worked for me.

#8

philsward - January 29, 2009 - 05:03

I am guessing the install problem I am having is related to this?

Fatal error: Call to undefined function vertical_tabs_generate_stylesheet() in /home/myaccount/public_html/t/sandbox/sandbox6/sites/default/modules/testing/vertical_tabs/vertical_tabs.install on line 41

Drupal: 6.9
Color: Installed
Theme: Garland
Vertical Tabs: 6.x-1.x-dev-[2009-01-28]

Dunno if the patch was released in the 2009-01-28 version or not...

Update:
Changing to bluemarine, installing vertical tabs then switching back to garland let me install without a problem...

#9

Bevan - January 29, 2009 - 10:28

@ philsward #8. Yes, this patch fixes that bug

#10

ChrisBryant - February 11, 2009 - 19:03
Status:needs review» reviewed & tested by the community

I had the same error on install when using the current version of Vertical Tabs. Patch in #3 worked nicely for me.

#11

whatdoesitwant - March 9, 2009 - 09:28

Patching is to difficult for me.

#12

blakehall - March 10, 2009 - 15:20

Patch in #3 works here too. Thanks!

#13

rsvelko - April 2, 2009 - 12:00

Guys - lets fix this simple issue!

I've tested the current dev and beta1 versions:
1. dev installs and enables when color is disabled
2. beta1 does not enable/install no matter if color en/disabled

(the problem comes from a function used in the .install but defined in the .module file which is not yet loaded on install time. ..)

the diff betwen dev and beta1 show that only the "if (module_exists("color"))" is new in the install - which causes the difference between 1 and 2 above...

So people who have reviewed the above patches - which is the best to commit?
And maintainers - commit please :)

#14

rsvelko - April 2, 2009 - 12:17

for a fast-hack to solve this problem - just comment out the 11th line in the install - you''ll lose the interaction with color module...

#15

ChrisBryant - April 3, 2009 - 00:18
Priority:normal» critical

Updating to critical since this prevents the module from being installed for a lot of people.

#16

rsvelko - April 3, 2009 - 00:26
Title:Can't install» Can't install - color module dependancy and an undefined func

title refreshment

#17

quicksketch - April 3, 2009 - 06:56
Status:reviewed & tested by the community» fixed

I've committed the attached patch to fix this problem. Sorry about the serious delay folks.

AttachmentSize
vertical_tabs_install_load.patch 626 bytes

#18

System Message - April 17, 2009 - 07:00
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.