Later than I'd planned, but here is a directory-level patch (and the module itself for those who don't want to patch) for a beta of further enhancements to the gallery.module.

Major new features: (See CHANGELOG.txt)
- add group support
- add photo frames and link target
- Allow order change of photos in the sidebar
- Add debugging options
- Add user view (display G2 and Drupal user IDs, show if there are any differences in the user info, display number of items a user has and link to their albums...) This will not be a comprehensive user sync page (yet).
- Updated help and INSTALL.txt

Enhancements:
- Incorporate (modified) depdev patches for language selection and G2 path.
- Random password for blocked users (right now they can login via G2 (not Drupal) and add photos)
- better config page for full name (checkbox and name of field). Auto-detect if profile.module is installed.

Bug fixes:
- Fixed bug in menu item "gallery" -- needs a title field. Also changed to MENU_NORMAL_ITEM so that it will appear without the admin needing to set it.
- Fixed bug in search where extra & breaks links when clean_urls are not used.

WARNING. This is a beta and will definitely have bugs. Backup your Drupal and Gallery2 databases before using it, and do not use it on a production site. This is not just the standard warning -- this has the potential to totally mess up for G2 installation. On one occasion during writing this, it managed to delete my G2 Site Admins group (as there is no checking in G2 embed code) which required a total reinstall of my G2 database.

Take a look and let me know your comments and bugs you find. Thanks.

CommentFileSizeAuthor
gallery_kiz0987_1.21.tar.gz42.49 KBkiz_0987

Comments

michelle’s picture

"it managed to delete my G2 Site Admins group"

Yikes! Normally I would just install this even though it's beta because my sites are really low traffic and can withstand being down a bit for a bug. But I don't want to risk having to redo the database. Please let us know when you have a "safe" version. Not necessarily bug free but one that you feel reasonably sure won't destroy data. I'm using your original module now and would love to upgrade it but this is just a bit more risk than I'm willing to take. :)

Thanks for all your hard work. I'm impressed!

Michelle

ShavenYak’s picture

Cool! It seems to be working OK on my site. Now I can get rid of some hacks I had made to my theme to get image frames to work right. It took me a bit to figure out that I needed to go into the block config in Drupal admin to set the frames for the image block (in case anyone else misses this).

One thing... gallery_html_head() seems to be getting called twice on embedded gallery pages. I noticed this while viewing source to make sure I got my theme hacks taken out correctly.

Robert.Kock’s picture

The random image block is working good at my site. But if I select gallery from the menu and then select one of my albums I get a page not found.

details
Type page not found
Date Friday, November 4, 2005 - 21:02
User robert
Location /drupal/d/3515-2/IMG_0478.jpg?g2_GALLERYSID=796f76b58f0c38718122e2f0181bbf58
Message d/3515-2/IMG_0478.jpg not found.
Severity warning
Hostname 192.168.2.1

Robert

ShavenYak’s picture

Robert,

Go to your Gallery admin, to URL Rewrite settings. On the Rules tab, only the 'Show Item' box should be checked, and the URL pattern should be 'gallery/%path%'. No other boxes should be checked. It sounds like you might have 'Download Item' checked and Gallery is writing out a link that is invalid under Drupal gallery.module.

If that's not the case, I'm stumped.

Robert.Kock’s picture

Thank you, that was the problem. RTFM :-)

OK, gonna test some more now.

Robert

ryooki’s picture

what's group support? Is it G2 groups <-> Drupal user role? If I create a Drupal user role, will it become a G2 group? How does the group support bit work?

kiz_0987’s picture

Yes, the intent is to sync between Drupal roles and Gallery2 groups. Unfortunately there is no way I know of to hook into the role creation in Drupal, so the way the code operates is to create (or delete) the roles/groups when the user information is changed (eg after creating a role you would probably assign a user to that role) -- ie group/role sync is performed when the user information is changed.

It is supposed to deal with role creation, deletion, renaming etc.

darius’s picture

Hello everyone,

it would be nice to see these changes incorporated into gallery.module, but of course, it should be done through the standard patching process. However, it's getting hard to even figure out where to start:

1. There are two issue threads currently: this one ("Beta - new enhanced gallery.module") and the previous one: http://drupal.org/node/32393 ("Enhanced gallery.module")

I assume that the code in this current thread is most current (version 1.21). Is this right? If so, the other thread should be closed to minimize confusion.

2. We need to start producing patches (filed under separate issues) that reflect all the new changes. If needed, I can help with that.

I know these issues were already mentioned in the previous comments, but those threads became so long...

Thanks for all the new changes.

Darius

kiz_0987’s picture

The 2 versions of the enhanced gallery.module are still current. This beta version does not (yet) superceed the other one as I deem it risky, particularly as it can change the G2 database for groups etc.

I tried to split off the smaller fixes into separate patches:
http://drupal.org/node/34301
http://drupal.org/node/35148
http://drupal.org/node/35126
http://drupal.org/node/31412

But for this version the changes are so large that it's not so easy to split up. In addition, I must admit to having low motivation for doing so anyway, since even my one liner patches for simple bugs have not made it into the CVS yet. I'm open to suggestion and/or help here.

scroogie’s picture

Why are these changes withhold? Can I somehow help you?

Johnyp’s picture

Is this compatible with G2 2.0.2 and Drupal 4.7-beta-3 (both are current as of right now).

If yes, i will gladly install it and see if i can spot any bugs or provide other feedback.

kiz_0987’s picture

Not yet compatible with Drupal 4.7 beta 3, but it will be coming soon. Watch this space :-)

walkah’s picture

Status: Needs work » Closed (won't fix)

note - I would really rather see a concentrated effort on a single module. All 4 listed issues have been applied and fixed.

The CVS version of gallery.module does work with drupal 4.7-beta3 (and gallery 2.0.2 though not the unreleased gallery 2.1 -- that is in the works).

@kiz_0987 - please focus efforts on patches against the current module rather than a forked module.

karens’s picture

I have a suggestion -- what about breaking out the G2 user admin functions into a separate related module (maybe in the contrib subdirectory)? That would make the code much easier to read and debug, and allow people to enable the normal Gallery functions while deciding whether or not to add in the user admin capabilities, or maybe enable that part only in a test location until they are sure it is working.

Also, the size of the module with all these changes is getting very large so memory will be a problem for some. I've noticed that several modules have broken their code up into the basic hook functions needed in the main module itself (which gets loaded automatically in many places) while moving everything else into a separate .inc file that gets included only when needed. That really reduces the memory used. I'm one of those who is starting to run into memory issues (and G2 itself uses a lot of memory), so I would really appreciate it.

I am playing with these changes in my own installation, but am new to Drupal and am not sure I know enough about it yet to share my probably poorly written efforts with anyone else.

ajwwong’s picture

Thanks for your work on this...

I was curious as to whether or not you had considered integrating the "gallery groups" with the "organic groups" module... I don't know the details of how everything works, but this might be a natural fit.

All the best, and thanks!

Albert
www.ithou.org