The following error message is displayed if an image is uploaded without the acidfree image module enabled:

_acidfree_get_parent: node->type (image) is not an acidfree type
CommentFileSizeAuthor
#2 acidfree-image-taxonomy.patch938 bytesringomassa

Comments

ringomassa’s picture

Could not recreate the bug after disabling the acidfree image module but i suspect it's related to a deeper issue:
With acidfree installed a taxonomy vocabulary is created for image content types that is dedicated to acidfree. All images that are uploaded or edited from now on must be put in an acidfree album. I see a couple of options:

  • accept this situation
  • Create an extra term, e.g. 'Other images', when creating the acidfree vocabulary
  • Check which image nodes are created through acidfree and only show the acidfree vocabulary for those

I think the last one would be best.

ringomassa’s picture

Assigned: Unassigned » ringomassa
StatusFileSize
new938 bytes

I went for the last solution and now have it partially functioning. When editing or creating an image a check is made if the image belongs to an acidfree taxonomy term. When it doesn't the acidfree vocabulary term selection is removed from the form.

mwheinz’s picture

Ringo,

I haven't looked at this too closely yet, but if we're creating a new image and acidfree is installed, wouldn't we always want to add the acidfree taxonomy to the form?

In other words, why doesn't this patch do the job?

    case 'image_node_form':
         if (isset($form['#node'])) {
           $node = $form['#node'];
           $vid = acidfree_get_vocab_id();
           foreach ($node->taxonomy as $term) {
               if ($term->vid == $vid)
                  return;
           }
           unset ($form['taxonomy'][$vid]);
        }
        break;
ringomassa’s picture

Michael,

Well, not if we assume you might also be adding images to your site for other purposes than an album. Say, as inline images in page content.
The way it is now, any image that is uploaded through 'Create content'->'image' will have to have an acidfree taxonomy term associated with it and will then be placed in the corresponding acidfree album.

bkat’s picture

ringomassa is correct. I routinely use image attach to attach an image to a node and there is no need for these to be in an album.

mwheinz’s picture

Okay, but my understanding of how taxonomy works is that it is associated with node types. In practice, once the acidfree vocabulary has been associated with the image nodes, what's the work flow for creating an image that isn't associated with acidfree?

Is the correct answer here to permit the user to select a special album, called "none", or something like that, when creating an image? What I'm thinking is that "none" isn't a special album, rather it prevents the image from being added to an album.

@bkat - I enabled image attach on acidfreealbums.info, and set permissions, but I can't figure out how to attach an image to a node. What am I missing?

bkat’s picture

Did you go to Admin -> Content Types and enable image attach for the types that you want that capability?

ringomassa’s picture

Michael,

Your option is similar to my 'option 2'. I think it all depends on one crucial question:
Do you want to (should you?) be able to add images to acidfree albums through another mechanism than the acidfree add/edit mechanism? And maybe add images that you originally didn't add to an acidfree album to albums later?
If the answer is yes, i think we should go for the option of having a 'none' album. If the answer is no this would still be a possibility but there would be this 'unneccessary' album field when creating or editing any image.

mwheinz’s picture

Ringo,

What I need to understand is the workflow.

1. What are the steps to create an item that will not belong to an acidfree album?
2. What are the steps to create an item that will?

That's what I can't see - how do you know when to hide the taxonomy?

ringomassa’s picture

1. Use any functionality that will add an image (for example, but not restricted to, 'create content'->'image')
2. Check if an existing acidfree taxonomy term will be the parent of the item. This is always the case when adding images from acidfree but never in other cases

However, the more i think about it the more i'm inclined to go for the option of adding a 'none' term. This will enable you to 'change your mind' and add a non-album image to an album at a later stage or remove images from albums while still keeping them available for use in content.
We could then use the workflow determination to set the preselected album to 'none' when we are not adding an image from acidfree.

mwheinz’s picture

> 2. Check if an existing acidfree taxonomy term will be the parent of the item. This is always the case when adding images from acidfree but never in other cases

I see what your getting at - but at the moment images are only added "from acidfree" when doing a mass import - almost all my users simply use "create content" to add new images.

Now, we've also been talking about turning that new "add acidfree items" block into tabs or links at the top of album pages. If we do that then your idea would work.

> We could then use the workflow determination to set the preselected album to 'none' when we are not adding an image from acidfree.

That might still be a better approach, simply because if we do that we can allow users to remove images from all albums, and to take images that aren't in any album and move them into one if the user desires to do so.

ringomassa’s picture

Ah, now i see where the confusion was arising from. I was using the "add acidfree items" block as this, to me, seemed most transparent to end users.
Anyway, i think we now agree on the way it should be implemented so i'll be looking into coding it.

ringomassa’s picture

OK. Just found that this is really simple...
Just unset 'Required' in the acidfree vocabulary and set required to 0 in function acidfree_get_vocab_id and everything will happen automagically.
We might also add this to the update function to alter previous installations:

  if ($vid = variable_get('acidfree_vocab_id', 0)) {
    db_query ("UPDATE {vocabulary} SET required='0' WHERE vid='$vid'");
  }
mwheinz’s picture

Status: Active » Fixed

This is fixed with Ringo's taxonomy fix.

rhylos’s picture

Ringmossa and Mheinz,

I'm not sure if this should be another issue item, but the new "none" category doesn't get auto selected/highlighted when editing an image not associated with an album. Album items highlights the album it's associated with when editing letting the user know which album it was in if they forget where they were at. This highlight is useful when deciding to "move" and image.

ringomassa’s picture

This is the default Drupal behaviour. We could change it by using form_alter but that would be deviating from Drupal standard.

rhylos’s picture

I still believe it's important that this the none category is highlight/selected upon editing the image node. Try editing some image uploads that are associated with an album and then ones that are not to see if you come up with the same user experience.

Status: Fixed » Closed (fixed)

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