hello

after installing the image module, i can add images to the previously defined gallery. but after few hours i cannot - the Image Galleries select html object is missing in the post image page (node/add/image). it happend to me in two installations of drupal. i have got the proper rights, so i dont know, whats the problem. any ideas? or it is a bug?

mirek

CommentFileSizeAuthor
#5 image_vocab.patch1 KBneclimdul
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bèr Kessels’s picture

Category: bug » support

Did you create the gallery containers?

kieran-1’s picture

I am having the same problem at the moment, has there been any further work on this problem? Have you solved it? If so how?

Help would be appreciated, thank you.

trauma’s picture

Category: support » bug
Priority: Normal » Critical

I have the same problem - poking around in the source didn't get me very far, but I get the impression the image_view hook doesn't get called (still investigating). I'm on current CVS for both drupal core and image module, but I made some CVS updates in between (yes, with DB updates).

Images added show up in the random image block, but not in any gallery.

trauma’s picture

OK, forget what I said about the image_view hook.

(obsolete) In current CVS in the image_form hook, where does the taxnonomy selection happen? Is it enough to have a vocabulary for the image type to trigger a selection form element? I ask because if I manually (via db admin) assign an image node to a term (= gallery) everything starts working. So something is missing here.(/obsolete)

Update: found it. vocabulary_node_type has an type of "0" for the image vocabulary (which was auto created here) but should have "image" in the db.

neclimdul’s picture

Assigned: Unassigned » neclimdul
Status: Active » Needs review
FileSize
1 KB

Almost made a new issue for this. Glad I did a search.

the node field in the vocabulary is array('image'). This causes some very strange behavior in other modules as it creates a vocabulary of type 0 which validates in weird ways. Furthermore it makes it impossible to add images to modules.

So... Here's the patch against the latest CVS.

PS. My version has more patches applied than an old bike tire... Its becoming hard to make patches without other patches.

ashtonium’s picture

Status: Needs review » Needs work

The patch above did not fix the issue for me (Drupal 4.7b6). There is still no Gallery select box on creating or editing an image node.

decafdennis’s picture

The patch does work. It only helps though when the Image Galleries vocabulary has not been created yet, so for an existing site you have to set the correct settings manually. You can do this in administer > categories, then click edit vocabulary for Image Galleries and enable it for image nodes.

neclimdul’s picture

Yeah, this patch doesn't fix the damage the bug caused. The vocabulary was being written incorrectly to the database. To fix a previous install you would have to add an update script. I don't have any experience with this and I'm not sure how far back the bug exists but I can try my hand if its deemed necessary.

neclimdul’s picture

Status: Needs work » Needs review

The update script for 4.7 would probably look like this and would be put in a image.install file in the same directory as your image.module. This query worked on mysql 4.1.18 . As for drupal 4.6, I think this issue affects it too but I don't know how to fix it other than telling you to save your image settings again.

/**
 * Update that should fix where image type was being defined as 0.
 */
function image_update_1() {
  return update_sql("UPDATE {vocabulary_node_types} AS vnt, {vocabulary} AS v SET vnt.type = 'image' WHERE v.vid = vnt.vid AND v.module = 'image'");
}
neclimdul’s picture

The update script for 4.7 would probably look like this and would be put in a image.install file in the same directory as your image.module. This query worked on mysql 4.1.18 . As for drupal 4.6, I think this issue affects it too but I don't know how to fix it other than telling you to save your image settings again.

/**
 * Update that should fix where image type was being defined as 0.
 */
function image_update_1() {
  return update_sql("UPDATE {vocabulary_node_types} AS vnt, {vocabulary} AS v SET vnt.type = 'image' WHERE v.vid = vnt.vid AND v.module = 'image'");
}
neclimdul’s picture

In review it should be

  return array(update_sql("UPDATE {vocabulary_node_types} AS vnt, {vocabulary} AS v SET vnt.type = 'image' WHERE v.vid = vnt.vid AND v.module = 'image'"));

PS. Sorry for the double post. Twitched.

ashtonium’s picture

Title: cannot asociate image to the gallery » cannot associate image to the gallery

+1's all around

After running neclimdul's SQL on my database and changing the category settings as per naquah's instructions I was able to apply Image Gallery categories to new and edited images.

I set up a fresh 4.7b6 install, and added the image module, (above patch applied) -- created a gallery, and was able to apply new images to it.

Much thanks to everyone.

decafdennis’s picture

Essentially my instructions do exactly the same as the SQL query provided by neclimdul, but then manually. IMO it is unnecessary to provide an update function in image.install for this.

walkah’s picture

Status: Needs review » Fixed

committed to HEAD.

after mulling it over, i've decided not to include an .install - as yes this is easily fixed manually (as per naquah's instructions) and since it didn't exist in an "official" release, I'm going to trust that everyone using a HEAD version can handle it. ;)

thanks for your work guys!

Anonymous’s picture

Status: Fixed » Closed (fixed)