Closed (cannot reproduce)
Project:
Acidfree Albums
Version:
6.x-1.0-beta4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2011 at 07:53 UTC
Updated:
20 Sep 2011 at 15:15 UTC
Jump to comment: Most recent file
Comments
Comment #1
rhylos commentedThis issue affects the "Add an image" link in the "Add Acidfree items" block as well.
Comment #2
mwheinz commentedConfirmed. I should have expected this, actually... the taxonomy doesn't get set up if the taxonomy selector isn't there.
Comment #3
mwheinz commentedFixed.
I changed the code to hide the taxonomy selector, using display:none instead of removing it.
Comment #4
ringomassa commentedActually, in the second patch i submitted this problem was handled in the code:
Comment #5
mwheinz commentedThe main problem I have with how you did your patch, Ringo is that you're doing extra database queries that we can avoid by folding the changes into existing functions. Since acidfree_image_form_alter() is already being called anyway, we can save time by putting the code there.
But, yes, making that change would also work - and I do appreciate the work you've done. You figured out how to do it, I just tweaked it for performance.
Comment #6
mwheinz commentedComment #7
ringomassa commentedI see your point about the extra query, and didn't realise which existing function you were referring to. However, i don't think it's a good idea to use display CSS to hide data you don't want in the output anyway. Also, this way the taxonomy form will have to be parsed after being submitted which will also reduce performance.
So i looked at the code again and have created two patches that should both be clear and help performance.
* Oops, found that this enables bypassing the checking of permission to upload to an album. Still believe this is the right way to go so i'll look at checking this without performance impact *
Comment #8
ringomassa commentedPermission checking is now enabled. Does require some extra code but no DB queries and i suspect the performance loss of the extra code will be offset by less form validation.
Comment #9
mwheinz commentedRe-opening this till I test Ringo's latest patches.
Comment #10
mwheinz commentedRingo,
I'm getting errors with this approach on a couple of edge conditions (and I also found problems with my own patch).
If you try to create an album as user #1 (i.e., the web master), or try to edit any album as user #1, you get this error:
I printed out the arguments for the function, and I got this:
I have a patch for that, and some minor tweaks - your patch didn't let the user set the parent album for albums created through Create Content->Album, because Taxonomy was still setting a "default value" for those albums.
The new version parses the drupal path used the create the form. If the last part is a number, we assume that the content is being created via one of the acidfree quick links.
I think a similar problem may exist with images. I'm looking at that next.
Comment #11
mwheinz commentedOkay - there were two problems with the image handler.
1. It wasn't filtering the taxonomy when using Create Content.
2. The patch that makes the album name not required was causing a bug in acidfree.module itself.
Both are fixed.
Ringo, check these patches out and see they're good to check in.
Comment #12
ringomassa commentedWas not able to check it for a few days but i see you've checked it in. Seems to work very well.
I won't have a lot of time to assist for the next two weeks.
Comment #13
mwheinz commentedComment #15
rhylos commentedWhile no error messages are presented, on a near production system the images are no longer uploading to the album using the quick links. The image uploads but its not listed in any album, right now the images appear as standalone image nodes.
Possibly related but when Disable album selection for quick links is uncheck the album selector does not show. When checked it does show the name of the intended album but as stated the image is not associated with the album. If this portion is unrelated then it will need to be added to the issue tracker seperately.
Comment #16
mwheinz commentedI've just double checked and quick links are working fine.
Possibly related but when Disable album selection for quick links is uncheck the album selector does not show.
You've broken the taxonomy settings for your site.