I have done searches on this but cannot find anything relevant to this issue.

There appears to be a bug or an unexpected side effect of the way LDAP OG's are mapped to OG's.

E.g.

Say you have an OG mapping like this:
CN=Group1,OU=MyOU,DC=domain,DC=local|node:1:1

and you have an OG with the following:

OG - Title : Group1
OG - nid/gid: 1

and you have the following node:

Node - Title: 1
Node - nid: 60

What happens is instead of returning nid/gid 1 it reutrns nid 60.

If you then add a second node with the same title as the one that caused the problem (i.e. 1) then it works as expected and returns the correct nid of 1 (I believe this is reverting back to nid because it returned multiple results).

As a work around I changed the code so it no longer searches titles buy changing the following:

ldap_authorization_og.module:
function ldap_authorization_og2_get_group_from_name:
-  $query->entityCondition('entity_type', $entity_type)
-    ->propertyCondition('title', $group_name);

+  $query->entityCondition('entity_type', $entity_type)
+    ->propertyCondition('nid', $group_name);

Almost certainly not the best solution but it worked for me. Hopefully someone who knows how to properly code Drupal modules can fix it!

Comments

grahl’s picture

Status: Active » Needs work
Issue tags: -LDAP OG MAPPING TITLE NODEID +OG

Hi

Thanks for the detailed bug report, sorry that no one looked at it.

Are you still experiencing this issue with a current DEV version? Are you still using the patch you indicated above?

I don't have an OG setup to verify your problem but your description makes sense, the ldap_authorization_og2_get_group_from_name() function is just a bit obtuse here in terms of what it actually wants to accomplish so I'm refraining from just committing your fix.

grahl’s picture

Status: Needs work » Closed (outdated)

Closing issue as outdated due to no further development on 7.x, if you feel this issue is still relevant and you are willing to work on a patch and/or debug the problem, please reopen.