Hi there,
Since this module has been almost abandoned, I've taken relay and I am now a co-maintainer of the module. I am currently rewriting the module from scratch to start over on a good basis. I have a first working version that needs a little work to be committed. It resolves the biggest issues that have been reported so far.
I will probably create a new branch and let the older branches die.
This rewrite will only concern 6.x version, and could eventually be backported if someone wants to work on a 5.x version.
This issue is here to be the main place for discussing this whole rewrite.
I'll try to commit the first version as soon as possible.
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | 652156.patch | 774 bytes | realityloop |
| #24 | Patch_og_menu.txt | 716 bytes | brim |
| #5 | og_menu.zip | 9.2 KB | jide |
| #2 | og_menu.zip | 8.6 KB | jide |
Comments
Comment #1
Frando commentedwe will need a proper og_menu very soon too. let's collaborate. care to share some code? doesn't matter if it's still broken/pre-alpha/ugly but then we can work on the same codebase.
Comment #2
jide commentedHi Frando,
Okay, so let's share our work ! Here is the module as it is currently. It's still broken/pre-alpha/ugly ;) but a much cleaner approach than the current one (i hope). Maybe the biggest question for me so far has been the possibility of using multiple menus for each group. I began working with multiple menus support, but it brings numerous problems, particularly if a menu is shared in several groups to which a user belongs and others to which he does not. So the current strategy I am thinking about is to allow a group to have multiple menus, but not allow a menu to be shared between multiple groups. What do you think ?
Let me know what you think of the current module as it is (but keep in mind it is a work in progress).
Comment #3
jide commentedI made recent changes on the permissions so the access functions need to be updated accordingly, so don't be surprised if there are weird things around permissions.
Comment #4
jide commentedHmmm, damn, i realize i made changes to the table schema so this version won't work at all... For a quick workaround, use the previous version of the og_menu.install file, it should work fine for now. Sorry for this.
Comment #5
jide commentedI worked on this, here is an updated (and, hmm, working) version.
Edit : Some more details on this version :
The ongoing refactoring has been done.
It is feature complete :
- Attach menus to group.
- Create a menu directly from the group node creation form.
- Assign content to one of the affiliated groups' menus, with dynamic menu filtering depending on the selected groups using javascript.
- Administer menus by group.
- A navigation block is provided.
It still lacks some validation routines, some permission polishing and probably has bugs here and there.
I think it is ready to be committed as a development snapshot soon.
Comment #6
jide commentedA development snapshot has been committed, it should be available soon.
Comment #7
jide commentedI worked on the module again, a new development snapshot should be available soon. Please review code, security, UI and let me know.
Comment #8
Frando commentedI skimmed the current code, and I very much like where this is going. Great work! Much cleaner than the previous version!
I'm perfectly OK with just having one menu per group. This keeps the code flow much simpler for now. In the project I need this for we won't need more than one menu per group anyway.
I will review the code more closely and actually test it tomorrow or the day after tomorrow.
Comment #9
jide commentedGlad to see we are going in the right direction !
In fact, it is possible to have multiple menus for a group. By default, when you create a group, you can also create one menu. But you can add more menus from node/[nid]/og_menu and the regular menu administration interface. What is not possible is a shared menu across multiple groups.
Comment #10
geerlingguy commentedWill there be an upgrade path from 6.x-1.x to 6.x-2.x? I have a site almost ready to go live still running 6.x-1.3, and I am a little worried about whether I'll be able to upgrade this module...
Comment #11
jide commentedThere is an upgrade path, but it still needs to be tested. If you can test this on a development server, feedback would be useful. Just visit update.php once you have updated the module. Edit : Backup before testing or do this on a dedicated testing server !
Personally, I would not have used this module as it was in 1.x version on a production site since it has so many downsides, bugs and security holes. And it would need patches to be simply usable for node types other than pages for example.
Anyway, feedback on upgrade would be appreciated.
Comment #12
jide commentedWhen upgrading, what may be problematic is if you have menus shared across multiple groups.
Comment #13
geerlingguy commentedThanks for the note - right now, menus are only used on a 1:1 basis, and they're working fine. I'll put it on my dev server and see how the upgrade works. I probably won't get around to it until late next week, though.
Comment #14
brim commentedThanks for taking over this module. I've spent a few hours testing the dev version and have the following comments:
1) It works much better than 1.3 - thanks.
2) For a user with "Administer Menu" permission, all menus on the system are shown in the "parent item" drop-box. If the user only has "Administer OG Menu" permission then they only get the correct menus for their group, but then the following message occurs when trying to create a node:
warning: Invalid argument supplied for foreach() in /var/www/vhosts/thechurchinburton.org/httpdocs/sites/all/modules/og_menu/og_menu.module on line 211.
3) The block-og_menu class is used in both the inner and outer OG menu div, making it hard to style it properly (I want to style all the menus in the inner block, such as the one with ID block-og_menu-0-menu-og-7, but can't use the ID because that varies by menu).
4) The default setting, to show all menus, displays menus with a title that can't be removed via the normal in the block title setting - the block and menu titles seem to be separate. If I change to show just one menu then I get one shown even if the group doesn't have a menu - it seems to choose a system menu instead - seconday links.
Comment #15
jide commented@brim : Thanks for the review, I'll dig into these issues when I get some time.
Could you try the latest (January the 14th) snapshot and see if 2) is resolved ?
Comment #16
geerlingguy commentedDoes your rewrite allow group members (or managers) to edit their own menus? I'm not finding a way to do that in 6.x-1.2...
If that's the case, I might be needing to use the dev version on a live site soon, which would mean I would be taking some extra time for code review :)
Comment #17
jide commented@geerlingguy : Yes it does, try the dev version on a dev site to see how it works.
Comment #18
brim commentedI've tried the 15 Jan version for point (2). I no longer get the error message but neither do I get the correct menus for the group when adding a new node. Instead, I get the menu for the first group that I created, irrespective of which group I'm adding to.
It does seem to keep the right group if I'm changing a node that already has a menu entry in place.
Comment #19
brim commented@jide I've been testing point (2) a bit more and it seems that the reason the fix doesn't work for me is that I have a Rule to hide og_nodeapi, which is where you've picked up the menus from. I'm trying to make things simple for my users, so hiding the ability to pick multiple groups seemed like a good idea. I'll try and test a bit more to see if the problem is fully fixed when the Rule is inactive.
Comment #20
brim commented@jide
Following on from #19, I've done more testing and can confirm that there is a problem even without my rule in place. It seems to be connected to the audience checkboxes (og_nodeapi).
On the Organic groups configuration page, there is an "Audience checkboxes" setting. If that is ticked then the latest dev version of OG Menu works OK. If it is unticked to simplify things for the user then it isn't possible to add new posts into the group.
Test case 1 - Organic groups configuration: Audience checkboxes unticked
When creating a new group, the audience checkboxes (og_nodeapi) are not shown, just the default group.
When trying to add a menu item, the only group menu shown is that for the first group added.
When trying to save, the following appears:
You cannot add menu items to this menu. Choose another parent menu.
Test case 2 - Organic groups configuration: Audience checkboxes unticked
when trying to edit an existing post on the group menu, the audience checkboxes appear and the correct menu is shown.
Test case 3 - Organic groups configuration: Audience checkboxes ticked
Can add OK
Test case 4 - Organic groups configuration: Audience checkboxes ticked
Can edit existing post on menu OK.
Comment #21
brim commentedPatch that seems to fix #20
--- og_menu.old/og_menu.module 2010-01-23 22:14:41.000000000 +0000
+++ og_menu/og_menu.module 2010-01-23 22:09:09.000000000 +0000
@@ -225,7 +225,13 @@
}
// Otherwise, the user may only set to one group.
elseif (!empty($form['og_nodeapi']['invisible']['og_groups'])) {
- $groups[] = $form['og_nodeapi']['invisible']['og_groups']['#value'];
+ $groups1 = $form['og_nodeapi']['invisible']['og_groups']['#value'];
+ if (is_array($groups1)) {
+ $groups[] = array_shift(array_keys($groups1));
+ }
+ else {
+ $groups[] = $groups1;
+ }
}
$list = array();
Comment #22
brim commentedPatch isn't indentented properly in above post. I don't know why because it pasted OK. I think its pretty easy to see what is intended though.
Comment #23
geerlingguy commented@brim - you'll need to either attach a .patch file to the post (use the File attachments form below the comment area), or paste it in with
tags at the beginning and end...Comment #24
brim commentedOK, here is the file as a patch file
Comment #25
jide commentedThank you brim, this issue was addressed in #677182: Make og_menu work properly if the user has access to only one group.
Comment #26
geerlingguy commented@jide - do you have a status update on the module/progress (not to rush or anything)? I'm thinking I might have time to do some more testing next week, and if things look good, I'll go live with the module when I launch the site in a few weeks (a pretty big site, so I want to make sure there aren't any show-stopping bugs).
Comment #27
jide commented@geerlingguy : Well, anyone who can help to test and review the module will help going forward.
I think it is quite functional now, just needs some more testing to be sure there are no bug anymore.
This issue will be set as fixed as soon as enough people say it works fine.
Comment #28
realityloop commentedThe attached patch seems to fix any remaining issues with og_menu, it's working fine here.
Issues fixed:
-Issue adding Menus.
-Wasn't saving expand state on menu items from menu link list.
Comment #29
jide commentedThanks realityloop, this has been committed to CVS. Didn't have time to test though, feedback welcome !
Comment #30
geerlingguy commentedJust installed on our development environment. The only issue I can see right now is that the block is putting a div.block-og_menu inside of itself:
If that one bug can be fixed, I can use this module on the new site I'm developing...
Also, a minor issue: the INSTALL.TXT file should read INSTALL.txt (lowercase).
Great work so far - this module is looking to be eons better than the previous revision!
[EDIT: I notice that you allow more than one menu in the block... this is all well and good, but could you possibly wrap the block in one class, and the internal menu blocks in another class? For instance, the main block class would be
block-og_menu, and the internal blocks (for each internal menu) would beinner-block-og_menuor something like that...]Comment #31
jide commentedAbout the block contained in itself, try to change the options of the block to display only one menu. I'm not sure how I could implement this differently, but that can wait if it only concerns multiple menus block.
Just saw your edit : I'll look into it, but I'm not sure it's easy with the way blocks are implemented.
Good catch about the lowercase extension. If that's the only issue, I think it's good news ;)
I'll probably create a release soon.
Comment #32
geerlingguy commentedI think a release would be perfectly safe. It's an awesome module, and imho, this and OG Taxonomy should be standard fare on any 'true' organic-groups-enabled site.
Comment #33
jide commented@geerlingguy : I updated the module to handle blocks differently in order to have clean theming. Now, 2 blocks are proposed, OG Menu : single and OG Menu : multiple. OG Menu : multiple is themed so that it is not nested anymore, and theme files can be overriden.
CVS has been updated.
I guess it's fine to create a release, so here we go !
Comment #34
jide commentedTada ! First release has been commited. So I guess this issue is fixed now !
Comment #35
geerlingguy commentedAwesome! I'll download later today and do more testing.