Hi:
I've seen you added og galleries compatibility in the following modification
// Modified 2007-09-13 for "galleries";
But this is half the way. This covers the administration pages but og galleries uses a user configurable view to show the galleries and now those urls aren't covered.
I've write this code and have added it to the end of the og_user_roles_all_roles funtion (before the og_user_roles_gid hook):
// Galleries (view part: The view urls can have 'subdirs' so we may need to check until the nth arg)
$og_gal_parts=split('/',og_galleries_get_url());
if (!empty($og_gal_parts)) {
$is_og_gal_url=TRUE;
$arg_num=0;
foreach ($og_gal_parts as $value) {
if ($value != arg($arg_num++)) {
$is_og_gal_url=FALSE;
}
}
if ($is_og_gal_url && is_numeric(arg($arg_num))) {
$location = 18;
$gid = (int)arg($arg_num);
}
}
This code works with all the urls the user could have set in the view config.
I've tried it and works fine for me.
I can't send you a patch (I get errors with the CRs and LFs and I have a patched version of the module), sorry
Thanks.-
NOTE 1: If you or anyone else wants to test the code first it would be needed to fix some bugs in the og galleries module since it seems to be very buggy in the current release. I've sent some patches to the og_galleries issue queue:
- Patch: http://drupal.org/node/198924
- Patch: http://drupal.org/node/202866
- Patch: http://drupal.org/node/204074
NOTE 2: SomebodySysop, do you think it's better to add this in og galleries via og_user_roles_gid? If you do, I can send the patch to og_galleries but the project seems to be a little slow by today...
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | og_user_roles.module.5.x-2.7.patch | 12.43 KB | somebodysysop |
Comments
Comment #1
somebodysysop commentedThank you for the code. I know you mentioned where it is supposed to go, but I would appreciate it, for clarity's sake, if you could include the lines of code which precede and follow the snippet above. Just to make sure I put it in the correct place.
Again, thanks.
Comment #2
neurojavi commentedyes, of course.
This is the code in its context:
its's after the location=17 block and before the og_user_roles_gid hook invocation
Thanks.-
Comment #3
somebodysysop commentedNeeded to wrap this additional code in this:
Attached is patch to be applied to clean download of 2.6 release. Please let me know if it works.
Comment #4
somebodysysop commentedThis patch code now included in latest OGR release. Since I've not heard back, assuming it's fixed.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.