So far, development of og_subgroups for Drupal 6 has followed an approach that makes og_sg dependent on the Core book module, which in turn enjoys benefits of the Core menu system's management of hierarchies. We should eliminate the dependence on book.module, and utilize the core menu system directly. Using book.module isn't ideal because of the limitations it imposes which restrict important functionality that was available in the og_sg for drupal 6. Utilizing book.module we have:
1) No multiple inheritance: A group cannot be member of two different groups which are each at the same level in a hierarchy.
2) There is no distinction between book hierarchies and og ancestry trees. This prevents og_subgroups and book from being implemented on the same site as book.module while preserving the usual functionality of each module.
3) Using the book.module fieldset is is confusing. Users are not editing a book hierarchy, they are editing a group hierarchy. Sure, we could form alter the name of the fieldset but see #2.
4) Restricting the ability
There's no doubt that the work Amitai has fantastic great work on both the 5.x and 6.x versions so far, but I believe it's important to proceed in this direction.
It's not too difficult to implement this. It appears that book.module uses the menu system internally by defining its own menu_name for each parent book, and not creating a value in menu_custom.
I'm marking as critical because it's a high priority issue for the module and there's no "high" priority.
| Comment | File | Size | Author |
|---|---|---|---|
| #47 | build_og_subgroup_table.php.txt | 180 bytes | BayouBill |
| #37 | og_subgroups.install.txt | 2.69 KB | BayouBill |
| #30 | og_subgroups-port-5x-6x.tar_.gz | 11.95 KB | bschilt |
Comments
Comment #1
ezra-g commentedand #4 is blank. fantastic. That was supposed to say that using book.module's fieldset requires us to do a form alter to restrict hierarchies by group node type, which seems less efficient to me than not adding a form element to begin with.
Comment #2
amitaibuBasically I'm in favor of this. We need to plan carefully how we want to do it and be careful not to duplicate the book.module
While the 'no multiple inheritance' is important I think that the biggest reason for doing this, is to make this module more user friendly.
Ezra, we're in different time zones but lets try to IRC on it.
Comment #3
ezra-g commentedSounds good. I'm online now if you want to talk. I think that part of the code will be similar to the book module's, and that this isn't a problem.
Comment #4
justin.hopkins commentedHey guys -
I'm just installing this module due to its obvious greatness. Thanks for all your hard work on this important module!
I was a bit confused by the use of the book module to accomplish the hierarchy. I'm wondering: If you do eliminate the dependency, what would happen to the hierarchy in the event of an upgrade from a version that used the book module to a version that did not use the book module? Is it too hard to say whether or not the hierarchy could be preserved?
Comment #5
ezra-g commentedActually, I think it should be fairly straightforward to preserve that data.
Comment #6
moshe weitzman commentedSounds like an admirable plan to me. This is a bit like the forum admin page which is another UI for taxonomy admin.
Comment #7
moshe weitzman commentedBeware though that we might have to implement own Views integration, token integration, etc. That comes for free by depending on book.
Also, book's limitation that a node only appear once in the tree is not deliberate IMO and should be improved.
Comment #8
amitaibuMaybe that's a direction we should take - not to eliminate book completely, but to change the UI.
@ezra_g,
Except of the single parent - is there something else that book limits us?
Comment #9
ezra-g commentedYes. See #2 in my original post on this thread.
Comment #10
amitaibuWhen I first wrote the D6 version I thought about re-writing from scratch, but soon enough I've noticed that book is doing so much work for us. I think that some hooking and altering might bring us to where we want, without replicating code.
I agree with all Ezra's remarks - in this comment I try to think how to solve them without removing the book dependency.
as Moshe states it might be a flaw in the book module, we should check it. However, if this is the only restriction, then IMO it doesn't worth removing the dpenedency.
blocks are built according book_get_books(). We can hook to the db_rewrite_sql and tell it not to bring the books that are groups.
Agreed - let's form_alter() it or as you suggest in #4 write a new element. We'll also have to alter the options in the select list.
Comment #11
ezra-g commentedThanks for being thoughtful here, Amitai. It's good to consider the options thoroughly.
Your friendly co-maintainer disagrees with this approach:
Multiple inheritance is a key feature for this module. Just as multiple inheritance is key to the usefulness of Drupal taxonomy, it is important to og_subgroups. It was part of 5.x, and eliminating it dramatically reduces the flexibility of og_subgroups implementations. It also happens to be central to the types of implementations that originally led me to take over as maintainer, and an implementation which should allow me to turn more attention back to og_subgroups in the coming months. I'm not willing to eliminate multiple inheritance or to wait on significantly revising the core book.module and then the next Drupal Core release. How complicated will it be to implement a stopgap patch to book.module to make multiple inheritance possible? I'm not thrilled about the idea of requiring a core patch to use this part of og_subgroups but perhaps it's worth thinking about.
In a non-book dependent og_subgroups module this solution isn't necessary. Still, if we db_rewrite_sql to make sure that menu_name is written with og_subgroups_[x] rather than [book_toc_x] in order to separate the data, can we be sure that book.module loads that data properly in all cases? We have to account for more than blocks. What about other modules that rely on this data? This approach seems like it could be problematic. It seems that having multiple modules (such as og_node_access) rewrite the same sql statement might complicate this further.
Moshe also makes a good point by pointing out that the Contrib space already provides Views and Token integration for Book.module. Looking at the code that Views implements on behalf of book.module, it's pretty minimal (~120) lines and could be provided for og_subgroups fairly easily. Which brings us to the point of avoiding the duplication of code:
I think it's not necessarily true to say that we would be duplicating code by using the menu system directly. The D6 menu system is a natural fit for storing data about node hierarchies, so it makes sense that other modules would seek to harness it in a custom way. The reason we would be writing code that is analogous to book.module's is because just as analogous database queries were written in various modules before Views was available, the ability to use the menu system for storing node hierarchies hasn't been abstracted out and made available as a separate API. As we code towards the "essence" of storing hierarchies perhaps we could develop a hierarchy abstraction module that makes the menu system (which has the distinct functionality we want) available without shoehorning into the book.module (which contains code-flow and limitations that we don't want).
Comment #12
ezra-g commentedAfter further thought, with a db_rewrite_sql approach, we still couldn't have a group node be part of a book and a group simultaneously, correct?
Comment #13
philbar commentedSubscribing
Comment #14
scottrigby+1 for multiple inheritance. For now, I'm trying to do this using a nodereference field from one OG node to another, and modifying views accordingly. This helps with group posts, but doesn't replace all of the great functionality of this module - following this issue in the meantime.
Comment #15
ezra-g commentedRather than postpone a 6.x version further in pursuit of a more complex solution, I intend to port one of the 5.x versions to Drupal 6. I hope to have a stable release by the end of March.
Comment #16
VinceW commentedLS,
forgive my boldness to step into this thread, but ... I would like to bring in some other perspectives on this:
As Amitaibu stated on December 12, 2008 - 12:21 in this thread:
further more was mentioned:
Considering:
Such ideas imply much more than a discussion on changing the implementing of another hierarchy (although it's a good reason to start :-) ). OG subgroups should IMO not rely on the hierarchy of the book module, but develop to a next level.
This post certainly means no disrespect to the maintainers and contributers of this 'damn good' module, but to point out several opportunities for the future. Not alone for OG-subgroup, but also for the whole OG-module. I think there should be a (re)consideration whether or not wanting a dependency on the book module for OG-subgroups, or design a new approach on the matter.
I've some other points of view on this matter I'm willing to share, so if there is going to be a discussion on the topic, I'll #subscribe :-).
Best,
VinceW
Comment #17
seutje commentedalso consider the fact that there is no way to limit the depth right now
Comment #18
ezra-g commentedAfter hacking on this for a while and trying to use the menu system to store hierarchies, it seems that the menu system is not appropriate for storing hierarchies where a node has multiple parents at the same level (and each of those parents of multiple parents). pwolanin, the maintainer of the menu system agreed that it's not the right system to use.
So, we must find another solution. Ironically, taxonomy (which was used in the 4.7 version of this module before someone decided to change the strategy) seems like the top candidate, potentially with the help of http://drupal.org/project/nat . I conversed with amitai about this and he is ok with the idea, so hopefully we can make progress on this shortly.
Comment #19
seutje commentedpersonally, I'd go for a fully independant way of handling things, making this rely on other modules will most likely break compatability and customizability
but if you must, taxonomy does seem like the best candidate, since it will still allow you to create other vocabularies to work with on the same site, you will be able to set a limit on the depth and the depth can even go infinite...
it would also allow you to make a group a subgroup of more than 1 top level group (and even make it a subgroup of a top level group AND a non-top level group) and it would simplify the input form to a single drop-down list (with an extra one for weight I guess)
Comment #20
likewhoa commenteddon't mind me I am just subscribing.
Comment #21
izmeez commentedsubscribe
Comment #22
emi_bcn commentedsubscribing
Edit: Programmers: if you need help, I can do things. Tell me and I'll look what can I do.
Comment #23
philbar commentedWhat do you think about using Node2Node or Node Relativity to provide this functionality?
Perhaps they are better than Book. If anything, you can use them for inspiration.
Comment #24
emi_bcn commentedI think it's better to eliminate dependencies to other modules, but taking the ideas from there is not a bad idea.
Comment #25
petednz commentedsubscribe
Comment #26
smithn.nc commentedSubscribe.
Comment #27
erle commentedJust a comment for others looking to implement subgroups and having books functionality. We have just implement Node Relativity Works great. You don't get the inheritance of subgroups, but it does fit our need. Worth a look at in some cases..
Comment #28
smithn.nc commented@erle That module does look promising for this use, except that I don't see how it could propagate content or users up or down the hierarchy. Am I missing something, or is this the case?
Comment #29
erle commented@smithn.nc your right, its not a replacement for subgroups. Just suited our purpose, I'd left a placeholder for anyone else stumbling in after me, since I found @phibar 's comment extremely useful.
We do not need to propagation so never looked that deep. Perhaps a custom workflow to overcome shortcomings? Since we wanted books, we really had no option, but thankfully this option did the trick for us.
Comment #30
bschilt commented@ezra-g
Being in need of a D6 version of og_subgroups that does not have a dependency on the book module, I have ported the 5.x version to 6.x. This is a straight port and does not add any new functionality. I'm not sure what to do with this port as far as contributing it back for those who prefer the way that 5.x worked. I'll attach a tarball for now.
Comment #31
ngstigator commentedsubscribing
Comment #32
likewhoa commentedumm, thanks will test it and report back.
Comment #33
Russellf commentedSubscribing
Comment #34
likewhoa commentedThanks for this, tested both "Group/User propagation" settings and everything looks good on Drupal-6.13 with -dev modules. Will report if I run into any bugs. This should be RTBC.
Comment #35
BayouBill commented"I have ported the 5.x version to 6.x...I'll attach a tarball for now."
How is this supposed to work in a 6.x environment? The .install module doesn't seem to run, resulting in "og_subgroup" table not found errors when you try to edit a Group.
Comment #36
seutje commented@BayouBill : the error u experienced is probably due to the ugly mac OSX trash left behind in the tarball, although when I tested it with an without the mac-trash, in both occurrences it successfully created the og_subgroups table and no errors were thrown
Comment #37
BayouBill commented"the error u experienced is probably due to the ugly mac OSX trash left behind in the tarball"
If you are referring to the files in the tarball that began with ".", I got rid of those, winding up with an og_subgroups folder that contained just the following:
INSTALL.TXT
og_subgroups.info
og_subgroups.install
og_subgroups.module
README.TXT
I did the standard upload of that folder and activation in Modules, but when I went to edit a Group, I got a "table acctname.dbname.og_subgroups doesn't exist" error. I tried playing with the og_sg configuration settings, but no joy. I tried running the Drupal Update function, but that didn't generate any results. It appears that the .install module doesn't function. I've attached it as a .txt file so the author can verify that I have the right one.
Help!
Comment #38
BayouBill commentedWell, Duh Is Me, because on closer examination all the .install code has been commented out. I've manually built the og_subgroups table and am no longer getting the "table not found" errors. If there are any other db mods I need to do manually, please advise.
Also, where is the documentation on how to use the 5.x version of this module?
Comment #39
BayouBill commented"Being in need of a D6 version of og_subgroups that does not have a dependency on the book module, I have ported the 5.x version to 6.x."
Okay, I've installed the above (comment #30, http://drupal.org/comment/reply/337808/1783018#comment-1783018), which is supposed to be a port of the Drupal 5 version of og_sg to Drupal 6 (I've done this because I'm pretty sure the current "book" approach of the D6 version won't work for me.) It seems to be working fine, but I've tried to implement my project and am running into some deadends. So, I am basically asking if this version of og_subgroups will allow me to do the following. I think the issue is "multiple inheritance", which as noted at the top of this thread the "book" approach does not support, but I don't see how the ported Drupal 5 version of og_sg supports it either.
My civic group wants to expand its Drupal site to perform what we are calling "Neighborhood Notices". The concept is as follows:
1. We will set up og groups for any "entity" for which we want to post a notice. For example, each of our council districts.
2. We will set up og groups for each of the "subdivisions" in our community.
3. We want to set up a structure that allows us to define which "entities" are included in each "subdivision". An "entity" can be included in multiple "subdivisions". In other words, part of a subdivision may be located in one council district, and another part of the same subdivision may be located in a different council district.
4. People (Drupal Users) would indicate which "subdivision" they belonged to on their registration page (i.e. "Registration form" would be set on for the "subdivision" groups, but not, to keep the UI as simple as possible, for the "entities").
5. We want to be able to post a notice to an "entity" and have it propagate to all of the "subdivisions" that include it. So, posting to "council district 1" would propagate to all of the subdivisions located in that district. By propagate, I mean (using the context of og_sg), we want the "council district 1" notices to be visible to anyone who is a member of any of the subdivisions in district 1, and, more importantly, we want a notice of the new content post to be sent out to anyone who is a member of those subdivisions.
The problem I've run into with og_sg is that I cannot tell the module that, using the example above, both "subdivision a" and "subdivision b" include "council district 1" (i.e. that "council district 1" has multiple parents).
Can I accomplish this with any version of og_sg or some other combination of og modules?
Comment #40
seutje commentedplease don't change the title to something less descriptive
if the issue concerns subgroups in general please make a separate issue
Comment #41
BayouBill commentedMy previous post changed the title of the issue. Posting this to correct. Sorry.
Comment #42
erykmynn commentedjust subscribing... since this is like one giant issue, is anyone working on it breaking the task into smaller parts?
Comment #43
mal@groups.drupal.org commentedIts good to see that work is continuing on this module. I see a post as recent as 2.5 weeks ago.
I guess I should be patient and wait, but I think I'll just go ahead and register my desperate need for this module....just in case no one else had done so. I'm in the middle of a project, and my developer committed to using this module eventhough it was clearly in dev. status. I trusted him, and now I think he is stuck. Speaking from the perspective of a user, the interrelationship between Book.module and Subgroups is quite confusing.
1) Is this interdependence documented (in operational detail) anywhere?
2) Is there any possibility of getting a simple version released soon (end of Sept 09?), while the greater complexities get worked out?
3) When do you anticipate a stable release of the full version?
4) Are there any workarounds (perhaps using the main Groups modules) to implement subgroups..?
Thanks for your work on these important modules.
Comment #44
bacchus101 commentedSubscribing.
Comment #45
BayouBill commented> mal wrote "Are there any workarounds"
The D6 port at #30 worked for me, but note that it does not support multiple inheritance.
Comment #46
mal@groups.drupal.org commentedYes--I am asking my developer to take a close look at that. I'm not quite sure of the implications of "not supporting multiple inheritances". But it may be good enough for me. But what about comment #38. Is that still an issue? If so, how does one deal with it?
Comment #47
BayouBill commented"what about comment #38. Is that still an issue? If so, how does one deal with it?"
Run the attached php code (*), which just contains the code from the #30 .install module that builds the necessary table. That's how I did it in #38.
Standard Disclaimer: Use at your own risk and backup your database first!
Edit:(*) Create a page, insert code, specify PHP Code as the Input Format, save the page, and view it just once. The other way to do it is to use PHPMyAdmin to go directly to your database and cut and paste the query into a SQL box.
Comment #48
likewhoa commentedSince recent upgrade of organic groups patch at #30 no longer works. The error I get when going to subgroups tab is:
The function in question:
Comment #49
bravo commentedSubscribing.
We are going ahead with current dev snapshot of 6.0 og_subgroups hoping that the later release will provide an upgrade path, even if it removes book module dependency.
Thanks
Comment #50
myshkin commentedIs CVS current? I see code being posted after the last commit date. If I was going to build on this module, what is the best code base to work from?
Comment #51
ad4m commentedSubscribing
Comment #52
ad4m commentedAny progress in the issue? I would love to see the first release of this module asap. Can I help anyhow?
Comment #53
jide commentedJust subscribing.
Comment #54
hlevinson commentedsubscribing
Comment #55
jonathan.morgan commentedSubscribing. Would like to help with development.
Comment #56
kobnim commentedsubscribing
Comment #57
Ivo.Radulovski commentedsubscribing
Comment #58
sarandi commentedsubscribe
Comment #59
pgillis commentedsubscribe
Comment #60
deltab commentedsubscribe
Comment #61
Stalski commentedSubscribing
Really hoping to see progress in this matter. Especially with OpenAtrium this could rock! Me too can help if needed.
Imho, the book dependency is not bad at all. let's keep it :)
Comment #62
mrhanlon commentedHas there been any progress on this? It seems that there is a lot of interest, but I do not see any recent activity. Does the port of the 5.x module to 6.x work? #48 seems to indicate that it does not, however I have not tested myself. I am interested in pursuing this or helping to develop this module.
Comment #63
yajnin commentedsub
Comment #64
Anonymous (not verified) commentedAs part of my Google Summer of Code Project, http://activismlabs.org , I will be creating some form of functional og_subgroups. After reading this thread, I'm really torn on how I should go about getting that functionality.
It seems foolish to create this tool from scratch. But at the same time, the concerns around the book module and lack of recent updates to the code (or responses to this issue) are disheartening.
To all of those subscribed to this issue: What would you like to see? Remove dependence on book? A proper D5 port? A new module that can start fresh on these issues?
I'm going to begin by pouring over the current og_subgroups code and the D5->D6 port posted in comment #30.
Jeremy
Activism Labs
Comment #65
moshe weitzman commentedThe D7 version of OG handles subgroups pretty cleanly. I think a D7 version of this module will look very different. Its probably best to focus on D7, IMO.
Comment #66
emi_bcn commentedHi Jeremy,
I think that the best option is to create a new module for D6 that can start fresh on these issues. May be a good idea is to see how D7 solves this functionality.
emi
Comment #67
BayouBill commentedThe one thing this module does *not* need is any more dead ends. IMHO, multiple inheritance is essential. If the D7 version of Groups (nee OG) will handle subgroups with multiple inheritance, I don't see the point of trying to perpetuate this module. On the other hand, for those not needing multiple inheritance, but needing D6 support for this module, I think a port of the D5 version to D6 would be the most logical place to invest time and effort. In any case, I think the current design of this module, based on books, was a bad idea and should be abandoned.
Comment #68
ezra-g commentedPlease see my latest response at http://drupal.org/node/841010#comment-3147548
Comment #69
amitaibu@ezra-g
The port in #30, is a strait port from D5 code. I think we can branch out D6, and commit it there -- it seems that the book dependency wasn't the best thing after all ;)
Comment #70
bschilt commentedthere is now a 6.x-1.x-dev version available that does not have a dependency on the book module.
Comment #71
juan_g commentedThank you very much, bschilt.
A related discussion is Subgroups for Organic Groups Rewrite.
Comment #72
bschilt commentedComment #74
revxml commentedThis would eliminate a ton of issues I've had to overcome with end-user training :-) subscribing now!