I was previously using Image Assist’s taxonomy features, but then decided I didn't need taxonomy for a site I was developing. But when I disable taxonomy and then try to insert an image into a page, I get the following error:

Fatal error: Call to undefined function: taxonomy_get_vocabulary() in /path/to/www/sites/all/modules/img_assist/img_assist.module on line 541

It appears img_assist is retrieving a value for variable_get('img_assist_vocabs', array(), but then calls taxonomy_get_vocabulary without checking to see if the taxonomy module is enabled.

CommentFileSizeAuthor
#2 img_assist-DRUPAL-5.taxonomy.patch2.76 KBsun

Comments

zoo33’s picture

Version: 5.x-1.5 » 5.x-1.x-dev
Priority: Critical » Normal

Good point. We should either state that Image assist requires Taxonomy or add checks in the code to see if it is active. I see no problem with the second option, and that would probably be the preferred solution. Patch anyone?

Setting to Normal as this is probably a very rare problem.

sun’s picture

Status: Active » Needs review
StatusFileSize
new2.76 KB

I bet writing those lines took you longer than me to fix it :-P

@JohnAlbin: Please report back, if this patch works out for you.

zoo33’s picture

Haven't you heard: code is silver, talk is gold! :)
Seriously, it's been a while since I touched the actual code so I don't have a fresh checkout handy. Yes... bad excuse.

Patch looks good, but someone should test how things are working when Taxonomy is disabled. Does the select field simply disappear in a clean way? (Yes, I could just test it myself. Sorry, not right now.)

sun’s picture

Version: 5.x-1.x-dev » 5.x-1.5
Status: Needs review » Fixed

The select field is still shown, because a user is able to choose between all images and her own images.

Tested patch by myself - committed. :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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