Great work so far on og_vocab, the overall structure looks great.

In the form/query alters there are checks pulling from the menu_item directly.

Ex.

if (strpos($item['path'], 'group/') !== 0 || empty($item['map'][2])) {
    return;
  }

Do you plan on implementing this as form vars or using some other "group context", this is problematic for OpenScholar as we will load the form outside the group edit page. We get the group "context" via purl/spaces.

Thanks,
Richard Brandon

Comments

amitaibu’s picture

Hi Richard,
I better get more familiar with openScholar! :)

That's indeed a little problem, as Drupal doesn't let us easily expose metadata about the menu item. We might need to pass another variable as a page argument, just to check it exists. All solutions I can think of right now are a little hackish :/

Can you give me an example of how a URL for a "Group" tab looks like?

rbrandon’s picture

We don't rely on any specific URL pattern but rather on the active "space". We use spaces_og integration so if your forms also integrated with spaces_og that would work for us.

ex.

if(module_exists('spaces_og) && ($current_group = spaces_get_space()){
  $current_group->id;
}

If spaces integration is not available we would normally write a code snippet that gets the current group id and then passes it directly to the form.

-Richard

amitaibu’s picture

if(module_exists('spaces_og) && ($current_group = spaces_get_space()){

I think a better integration would be with OG-context

amitaibu’s picture

Status: Active » Needs work
StatusFileSize
new4.1 KB

First stab, untested yet.

amitaibu’s picture

Status: Needs work » Needs review

Correct status, to enable testbot.

amitaibu’s picture

Status: Needs review » Fixed

It runs locally. Testbot will fail here, as CTools patch wasn't committed yet. Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

amitaibu’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new441 bytes

Re-opening as calling og_context() idea was wrong, we can rely on group/... also if spaces and PURL is involved as menu_get_item() return the path without the PURL prefix.

amitaibu’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.