I hope you don't mind another compatibility request. I think it might be simpler than the last couple you helped me out with. I really appreciate your attention to these issues I've raised lately. I'm nearing completion of version 1 of a site I've been working on for quite a while, and I'm anxious to finish.
Anyway, the minutes module (with or without og_minutes enabled) is having problems with og_user_roles. Disabling og_user_roles makes minutes work.
The way minutes works is that you cannot create it from the main menu, nor from the group context menu. You must be viewing an event content type and click on the "post minutes for this event" link. What this does is takes you to a URL such as node/add/minutes/249. With your module enabled, it gets truncated to node/add and an error message is generated and I'm dumped to the site-wide listing of available content types typical of the node/add page.
The relevant part of the function that throws the error is:
/**
* Implementation of hook_form().
*/
function minutes_form(&$node, &$param) {
// this module _must_ be accessed in such a way that there is an
// event passed to it. Right now, we will verify this using 'arg'.
// Is there a better way to do this?
if ((arg(0) == 'node') && (arg(1) == 'add') && (arg(2) == 'minutes') && is_numeric(arg(3))) {
$node->event_id = arg(3); // arg == [ node add minutes event_id ]
}
if (is_null($node->event_id)) {
drupal_set_message("You must associate minutes with an event using the calendar.", 'error');
drupal_goto("node/add");
}
Would your new exemption solve this issue? Or will you need to do something else? Looking at the og_minutes module, it is only one function long and restricts the list of possible 'attendees' to those users that are members of the group in which the minutes belong.
In other words, the minutes module behaves just like a generic content type in that it has no special OG handling of its own. Does this mean that you SHOULD us your ognodeadd wizardry instead of placing minutes on the exempt list?
Thanks. I hope I was descriptive enough this time.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | og_user_roles.module.5.x-2.6_5.patch | 7.06 KB | somebodysysop |
| #1 | og_user_roles.module.5.x-2.6_3.patch | 6.25 KB | somebodysysop |
Comments
Comment #1
somebodysysop commentedTry this patch. Again, against CLEAN 5.x-2.5 download. This patch contains all the code from previous patches since the release of 5.x-2.5.
If it works, please let me know if have the OGR "Clear the cache" setting turned on?
Comment #2
rconstantine commentedI will try it right away. I can tell you that I do have the clear cache setting ON.
Comment #3
somebodysysop commentedThe reason I asked is because you asked in a similar issue if it might not be better to use "ognodeadd" in cases like this.
The decision to hijack the default Drupal "node/add" in OG User Roles was not arbitrary nor easily taken. I spent literally months trying to figure out how NOT to do it, but could not find a solution. OGR could not reliably add nodes using "node/add", so the "ognodeadd" component was developed to assure that OGR would always correctly create group content.
That was before I discovered how to clear the user_access() cache: http://drupal.org/node/166566
You may not have noticed this, but with the ad module, and now the minutes module, OGR is now reliably creating group content using node/add. I'm not sure yet, but my suspicion is that the "clear the cache" solution also resolves the longstanding node/add problem.
We'll see. If this is true, it will make it much easier to support additional OG module contributions.
Comment #4
rconstantine commentedOh, I see. And yes, I've been using the 'clear cache' setting since the issue you name. I'm testing to see if I can add minutes now...
Um, there seems to be a problem. It may be with the theme code you added since now the ad portion doesn't work either. What is happening is that a URL such as:
http://[site name]/[subfolder where drupal is]/node/add/ad/text?gids[]=1
ends up like this:
http://[site name]/[subfolder where drupal is]/[subfolder where drupal is]/node/add/ad/text?gids[]=1
notice the duplicate folder name. In my case 'subfolder where drupal is' is 'anatolia' so that I have 'anatolia/anatolia'. The links are correct, it's just the routing that gets messed up. I think I'll comment out the new get theme function and see what happens...
BTW, it worked fine when Drupal was not in a sub-directory (test machine vs. production).
Nope. That didn't work. I'll poke around some more.
Comment #5
rconstantine commentedI'm going to try using base_path near the ltrim and pull the sub dir off of the uri. I'll post results.
Comment #6
rconstantine commentedI'm getting strange results. If I do this:
I get this:
Page not found
PATH1: /anatolia/node/add/minutes/222
PATH2: de/add/minutes/222
BASE PATH: /anatolia/
So for some reason, an additional 'no' is being taken from the front. That doesn't make sense.
Comment #7
rconstantine commentedOkay, I'm a dummy. Ltrim can't be used to trim strings. So, this works:
Similar changes to the ad portion work as well. Since base_path returns '/' if Drupal isn't installed in a sub-dir, this should work in all cases.
Comment #8
somebodysysop commentedStill getting this error:
But, OGR appaers to be creating the ad and minutes.
Here's the updated patch. Thanks for the additional code.
Comment #9
rconstantine commentedThat's funny. Where/how does that error come up? I haven't seen it.
Comment #10
rconstantine commentedWell, it all works fine for me, so I'm going to say it's good to go.
Comment #11
somebodysysop commentedCommited changes to release OGR release 2.6.
Comment #12
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.