In this patch:
- New permission: "attach existing images". In addition to the global "Enable Attach Existing" setting, this permission must be for each role that should be able to attach existing images.
- hook_update for backwards compatibility: Since there was previously no distinction between "attach images" and "attach existing images", this hook_update adds "attach existing images" permission to every role that already has "attach images". This will create an uninterrupted update experience for image_attach users.
See [#72579] for some more background.
Comments
Comment #2
aaronbaumanNow with updated tests.
Comment #4
aaronbaumangetting closer...
Comment #6
joachim commentedI'm trying to wrap my head round the permissions this results in....
we have:
- 'attach images' -- functions like a master switch, controls access to the whole image attach fieldset
-- 'create images' -- controls access to uploading a new image
-- 'attach existing images' -- controls access to the select list of currently selected & existing image nodes
So I'm wondering whether someone might say we should have a 'attach new images' permissions instead of only relying in the one from image module, or whether that's just silly.
Comment #7
aaronbaumanthe use case for "attach new images" would be a user who could *only* attach existing images?
Comment #8
joachim commentedWell you'd always want to check 'create images' before creating an image node.
But you might want users who can create single image nodes but can't use the upload image attach thing? Though as I think about it, really, why? You could bypass that by creating it first and then attaching it as an existing one...
Ok. So the perms are fine as the patch changes them :)
Comment #9
aaronbaumantry try again...
Comment #10
jan_v commentedI've took a look at this patch, and it's so close to what i'm looking for but not in total. I'm working on a large site where upload existing images is disabled, because it would be an endless list of unclear image titles. I was looking for a functionality where unauthorized users can attach an image to a specific node type that hasn't got an attached image.
Is this possible with image_attach? Because it seems to be something really specific to search for, and i keep ending up on this issue.
I also didn't know where to post this, so my apologies if this doens't apply to this issue.
Comment #11
joachim commented> I'm working on a large site where upload existing images is disabled, because it would be an endless list of unclear image titles. I was looking for a functionality where unauthorized users can attach an image to a specific node type that hasn't got an attached image.
I'm not entirely sure what you mean, but yes, you can disable attach existing and allow just upload of a single image per node.
Comment #12
jan_v commentedSorry if my explanation wasn't clear :p (and my english poor).
My site has "places" on it. each "place" has an owner who can edit (thus attach images to it).
I need a functionality where a visitor (not owner, unauthorized, no editting rights) can attach an image to this "place".
An unauthorized user needs some kind of permission to ONLY attach images to the node, and nothing else.
Is that possible with image attach? Because i haven't figured that out.
Comment #13
joachim commentedNot entirely sure I understand -- could you either file a support request or better still, post on the forum where more people will see it?
I think the answer is no, as you still need to edit the node to attach.
Comment #14
Scott J commentedre #12
Jan, you need editablefields module, along with ImageField, ImageCache and other related projects.
Comment #15
joachim commentedI've rerolled this for whitespace and fuzz, but I've spotted this problem:
What if the 'attach images' permission is first or last in the stored list?
Core does this using regexps on the retrieved permission string -- we should follow that example.
Comment #16
joachim commentedOops. Here's the rerolled patch.
Comment #17
tubby commentedthe patch in #9 worked.
the problem is, i have allowed users to attach up to 3 images. prior to applying the patch, only 1 image was shown on og/all.
after applying the patch, all attached images show. is there any way to fix this?
Comment #18
joachim commentedI can't see how that could happen. The patch doesn't change anything to do with output. Theme functions have changed recently though, so it could be that.
Patch still needs work per my comments in #17.
Comment #19
tubby commentedwell don't know what to tell you other than it now displays all 3 images on the homepage instead of limiting to one.
Comment #20
joachim commentedThe patch REALLY doesn't change anything to do with output. And I've just checked it on my test site. There's something happening in your theme; as I said, the theme functions changed at the last beta.
Comment #21
tubby commentedyeah uhm...whatever. my theme is fine.
if anyone has any other suggestions that would be great.
i haven't attempted to reproduce it in other areas but right now, i'm having this issue with the organic groups module where more than one image attachment is shown on the /og page after applying the patch in #9 in drupal 6.15
Comment #22
sunThis looks much more complex than the existing image_update_6103() -- let's use the same code and adapt it for this update.
What's the purpose of the variable now that we have the permission?
Trailing white-space.
Powered by Dreditor.
Comment #23
joachim commented> What's the purpose of the variable now that we have the permission?
Turn the entire feature on or off -- if we didn't have the variable, then uid 1 would always see the existing images option even on a site where it wasn't required.
Comment #24
mattwmc commented#9 works for me.
Thanks.