Project:OG Contact
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The contact form should use the group theme.

Comments

#1

Status:active» postponed (maintainer needs more info)

This is a good idea, and it certainly makes sense to have a group contact form match the theme of the group.

I do need more information on what you are using to do the individual group themes, so that I can reproduce this issue, and code the right solution.

As a note, the priority of this request will be determined by the difficulty of its implementation, since I think that completing view integration is a more crucial feature.

#2

When a node is a 'group node' then it has a selector for the 'Theme configuration' on the edit page for the node. There is a variable go_theme on the node.

#3

Category:feature request» bug report
Status:postponed (maintainer needs more info)» active

I'm changing this to a bug report, because I actually think that not respecting og_theme for the contact form is a bug.

I just committed code that addresses the contact form itself, but not the individual form administration pages (should be packaged in a new -dev release whenever the packaging script runs next). The contact form itself should use the og_theme.

I haven't decided yet if its even possible to respect og_theme on single contact form admin pages as well as respect the sitewide or administrative theme of a site if the forms are being accessed from outside the specific group context. I'm going to leave this issue open until I'm satisfied with an answer to this issue.

#4

I've looked into it, and it actually pretty easy to have the module recognize if you are editing the contact form settings from clicking the link on the form itself, or gaining access through the admin page. This code will be part of my next commit.

#5

Your code seems to get to the right theme.

Not sure if this counts as a feature request. Would it be possible to keep the group variables available to the theme template code. I use og_groups_both in the theme's page.tpl.php to get the group name into the template. I can't spot anything holding that in the contact page.

#6

I don't know if it solve this problem, but in my particuliar case, i have some block displaying only on certains groups. It worked except in the contact page. It seems that there is a context problem. I have done a patch which solve this problem.

AttachmentSize
og_contact_605242_6.patch 515 bytes

#7

The July 11 code appears to have the patch incorporated.

That version selects the right theme, but the theme cannot use og_get_group_context() to get the group variables. I think this is because the node is not loaded.

#8

Found the problem. Between 5.x and 6.x the function og_set_theme stopped returning a node (it just sets the theme and returns nothing).

So in og_contact.pages.inc the code:

  // use a different theme if the group has one
  $theme_node = og_set_theme($gid);
  og_set_group_context($theme_node);

should be changed to:
  // use a different theme if the group has one
  $theme_node = node_load($gid);
  og_set_theme($theme_node);
  og_set_group_context($theme_node);

#9

Status:active» closed (fixed)

Thanks for the fix! Sorry it took so long for me to include it.

It is part of this commit and the new D6 release.

#10

Version:6.x-1.x-dev» 6.x-1.0