The current bug is that any user with "create acidfree photos" (for example) can specify any album as the parent, whether they created the album or not. However, if a user is browsing an album that he has not created, he is not presented with the option to add nodes to that album. This is inconsistent behavior.
The patch I am providing will define a new permission: 'can upload to any album'
_acidfree_parent_select() has also been modified to use this permission to filter out albums the user did not create (unless they have been granted the proper permission, of course).
There is a third change necessary in the class_album.inc file, but that must be listed separately. It is one-line change that will allow the "add a img", etc. links to display if the user has been granted the 'can upload to any album' permission, and not only to the creator of the album.
Overall, I see this as a great feature for Acidfree: the ability to restrict users to their own albums, while at the same time granting others broader privileges.
Comments, anyone?
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | album_options-r347.patch.txt | 26.13 KB | vhmauery |
| #11 | acidfree.module.rej | 4.53 KB | Mojah |
| #10 | album_options-r343.patch.txt | 25.42 KB | vhmauery |
| #7 | acidfree.module.patch.01.applied | 101.4 KB | coreyp_1 |
| acidfree.module.patch.01 | 1.22 KB | coreyp_1 |
Comments
Comment #1
a.k.karthikeyan commentedgr8 patch thanx
Comment #2
Lityi commentedThis is more than a brilliant idea! I just need this feature!
Could you please provide us a patched module?
Secondly: it is possible to show only the user's albums' list in the Albums: pulldown when they want to upload images?
Comment #3
coreyp_1 commentedYes, this patch will filter the "Parent" listbox so as to only show albums created by the user (if the option is selected, that is).
As for the patch, it is attached to the first post. Now, we're just waiting for others to review it, post their comments, and make any modifications.
I'll be out of town for a few days, so this is my last post until Saturday.
-Corey
Comment #4
jgavin commentedSorry for the lame question, but how do i install the patch? (where does it go, etc.?) The idea sounds great and is exactly what im looking for.
Comment #5
Lityi commentedafter taking out the C:\... windows paths from the patch I tried to use it:
patch -p0 < acidfree.module.patch.01
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- acidfree.module.bak Tue Apr 25 10:01:04 2006
|+++ acidfree.module Tue May 30 15:29:51 2006
--------------------------
Patching file acidfree.module using Plan A...
Hunk #1 failed at 495.
Hunk #2 failed at 1778.
2 out of 2 hunks failed--saving rejects to acidfree.module.rej
done
any ideas are appreciated :/
Comment #6
Lityi commentedeh, sorry:
Comment #7
coreyp_1 commentedOK, here is a patched module. Maybe someone else who has more experience making patches can provide an "official" working patch.
For everyone else, you can see the end result here.
Comment #8
sanduhrsYour patch applied fine for me.
That is exactly the funcionality I've been searching for, thanks.
Did you post this third change necessary in the class_album.inc file anywhere?
vg
Comment #9
coreyp_1 commentedThe change necessary in
class_album.incis on line 162, in thetheme_acidfree_print_full_album($node)function.Replace
With this (comment included to show my logic):
I hope that makes sense...
-Corey
Comment #10
vhmauery commentedAfter many hours of coding, I have incorporated this patch into a larger patch of my own. The resulting patch is available for testing now. Note that the patch is not fully functional and will not be committed to CVS yet, but I would like some feedback before spending more time in this area.
The patch adds some features:
Try the patch out on a developement machine and tell me what you think.
Comment #11
Mojah commentedThank you for the patch. I tried applying it on cygwin and got the message that 5 out of 33 hunks failed.
I've attached the failed hunks.
Comment #12
Mojah commentedFrom searching the forums and reading user submitted comments, it appears that your patch will be very much appreciated by the community. We are currently working on a student social networking site which allows users to have their own user gallery and cannot find a clear cut way to achieve this within Drupal.
I noticed you have shared albums...it would be cool to include the following as well..
* Allow user to mark the album accessible by anonymous or authenticated users and other role types
* Turn off comments on a photo
Comment #13
vhmauery commentedThe patch probably won't apply unless you grab the latest and greatest Acidfree tarball. I committed some changes yesterday that would make the patch not apply. So grab the latest and try it out. (really it should work even with those five chunks not applied.)
Mojah,
As for your feedback, your two feature requests are both already available in drupal. The first is done with a node_access module (e.g. simple access, or organic groups). The second is done by allowing the user the appropriate access right in admin/access.
Comment #14
Mojah commentedHi, the patch you made updated perfectly without any failed hunks (just like you said) when I used the cvs web interface to download the acidfree.module file. The tarbell on the modules download page for cvs version does not contain the latest acidfree.module file (I think it takes 24-48hrs to update) and strangely the web cvs viewer shows that the the module file was updated 3 weeks ago. Yet when I click to view the module, the comments indicate that it was updated 17hrs ago. Weird.
I'll test it out and let you know how it goes. Thanks.
Comment #15
Mojah commentedHi,
I patched the module files and uploaded. Ran update.php and found that no database updates were requried.
...replaced line 1399 with this from the previous version...
...logged in as an authenticated user and created an album. Worked fine. Uploaded a picture which worked fine except for the following error...
Is this something to do with my mysql version or php version?
The pic was uploaded to the correct album and it worked fine except for the above....
Are there anyplans for the the ajax functionality like the file attachments on nodes?
Multiple photo upload for users...maybe it could work just like the node attachments and automatically assign each picture to a node which the user could then edit or add description to.
One Love
Comment #16
vhmauery commentedComment #17
vhmauery commentedthanks for finding the sql error -- looks like a bit of legacy code from my original patch that sneaked in the back door.
I am still working to test that all the features promised actually do work (this includes figuring out how the database updates work.)
It still might be a while since work is a little crazy at the moment.
Comment #18
vhmauery commentedHere is what I think is the final version of the patch. I figured out the database updates stuff. All the features promised are working.
I need some people to test this out. Until this gets tested, I don't feel good releasing it. Please note that this patch was made against the latest and greatest acidfree from my svn tree -- it should apply cleanly to the latest 4.7 branch of CVS. Please test it out!
Comment #19
muddy commentedHi,
Having patched the acidfree module, I'm getting this error when I try to create acidfree content.
Of course, I could be doing many things wrong. I'm new to this.
drupal 4.7.3
acidfree.module (August 10, 2006 - 19:46)
patch: album_options-r347.patch.txt
thanks.
-michael miller (michael@muddys.net)
Comment #20
vhmauery commentedmuddy,
You need to run update.php after patching acidfree -- in the patch are some changes to the database's acidfree table.
Thanks for testing this out.
Comment #21
muddy commentedAfter running the update.php script, here's the error message I get:
Thanks for your attention!
Comment #22
vhmauery commentedmuddy,
On the update.php page, there is a link to 'run the database upgrade script', which you should click on. Then, it will give you a form that has a collapsed 'Select Versions' fieldset. Make sure '2' is selected in the Acidfree Module selector. Hit the Update button and it should take you to the results page. On results page, it should tell you it successfully executed this query:
Comment #23
muddy commentedvhmauery,
that did resolve the issue. the upgrade script ran well - after i edited my file permissions.
thank you for your patient support.
Comment #24
Mojah commentedQuick report on patch...
Hi Vernon,
Thank you for the gr8 work. I downloaded your latest and gr8est from the web cvs directory (cvs tarbell appears outdated) and updated all the 4.7 branch files then applied your patch.
I'm getting this error when trying to create an acid free photo.
Running 4.73 on mysql 4.1x
One Love
Comment #25
vhmauery commentedMojah, contrary to popular belief, the HEAD branch of CVS is not the latest and greatest. Eventually, I will merge my changes and fixes into HEAD and then do the necessary 4.8 updates before I branch it again. The 4.7 tarball is what you want to be running. If you want to use CVS, make sure you are using the DRUPAL-4-7 branch (that is what the 4.7 tarball is generated from every 12 hours or so).
Comment #26
Mojah commentedThanks for explanation on HEAD and CVS. 4.7 tarbell works. Patch applied without any errors. I have installed category module and views with the aim of presenting user galleries and allowing users to tag their pics and albums.
So far I noticed these while testing...
I remember seeing something related to
Missing argument 1 for _acidfree_content_sort_clause() in /home/khanyi/domains/mydomain.net/public_html/test/modules/acidfree/acidfree.module on line 2702.error. I'll list it here just in case it's not been mentioned elsewhere, but will post back if I find anything.The above appeared when creating an album as an authenticated user.
May not be related to the acidfree module, but I found it strange, when submitting an image with file size of 500kb I got insufficient memory errors. I reset php.ini to 25M and seem to get this error every now then. Could be related to my vps account.
Comment #27
vhmauery commentedI seem to forever be plagued with the in_array/array_keys errors. I can't seem to get acidfree_types initialized correctly, it seems.
As for the unknown column 'share', error, that is caused because you haven't run the drupal update.php script. This patch adds a new column to the acidfree table.
A 500KB image very well may be too big. Jpeg compression makes the image small on disk, but when doing the actualy image manipulation, the image has to be decompressed into something like 3 or 4 bytes per pixel (depending on various parameters). This makes a 1600x1200 image a cool 7.5MB in memory. And this doesn't take into account that usually with image manipulation, we end up with several different images as stages in memory before finally writing out the final image to disk. That same 1600x1200 image might be 128kB on disk. The file size is not what is important, it is the image resolution.
And finally, I have heard reports that the Drupal GD image toolkit uses more memory per image than the Imagick image toolkit that I have supplied with the Acidfree distribution. However, this requires the php-imagick php extension to work, which not everyone has access to (I use debian and found someone that had already built it into a package, while others might have to build it from source.)
Comment #28
vhmauery commentedI have committed this patch to CVS DRUPAL-4-7 branch. Make sure that after you download the latest version of acidfree, you run the database update script. This should be available in 12 hours or so as version 1.62.2.43.
Comment #29
vhmauery commented