I don't think this is the same as this issue http://drupal.org/node/444108#comment-1547764 but it is a problem.

To reproduce:
1. Install Drupal 6.
2. Install image and image_gallery.
3. Go to create an image node.
4. There is no gallery drop-down!

Several things appear to trigger the creation of the vocab:
- going to admin/content/taxonomy
- going to admin/content/image

We should be creating it in the install process. forum.module does this in hook_enable which looks like a good example to follow.

CommentFileSizeAuthor
#1 image_gallery_hook_enable.patch1.47 KBjoachim

Comments

joachim’s picture

Status: Active » Needs review
StatusFileSize
new1.47 KB

I'm guessing this part of the code dates from 4.7, which is before the existence of hook_enable.

This guarantees the vocab is created on module install, but it's still possible for users to delete the vocab -- so should we keep the checking code in _image_gallery_get_vid?
Alternatively, we could follow forum module again and prevent deletion of the gallery vocab. That would allow us to kill off _image_gallery_get_vid as it becomes just a call to variable_get.
But that's perhaps for another issue and another patch.

joachim’s picture

Status: Needs review » Closed (duplicate)

Going to say this is a duplicate of http://drupal.org/node/470720