5.0 Update - Tested og2list 5.1 port

joshk - March 15, 2007 - 18:58
Project:Organic groups list manager
Version:HEAD
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

Here's a quick patch of my (mostly working) 5.0 install vs current HEAD.

AttachmentSize
og2list_5.patch7.16 KB

#1

damien_vancouver - April 11, 2007 - 21:36
Title:5.0 Update» 5.0 Update - Tested og2list 5.1 port
Category:feature request» task

Here is a tested patch against the 1.105 version in CVS HEAD. Hopefully this will make its way into CVS soon but here it is.

AttachmentSize
og2list_v1.105_drupal5_port_plus_incoming_groups_insert_fix.patch 5.64 KB

#2

damien_vancouver - April 11, 2007 - 21:40

I forgot to say that my patch is just a bug fixed and tested version of joshk's original patch :)

Attached to this comment is the .info file you would also need. Just rename the og2list.info.txt attahcment to og2list.info and put in the same folder as the module.

... or wait for the official 5.x version release which is coming soon.

AttachmentSize
og2list.info_.txt 146 bytes

#3

damien_vancouver - May 6, 2007 - 16:46
Status:active» reviewed & tested by the community

I found a further bug where og2list was using the _og_forum_get_group_forum() helpfer function.

This function vanished from og_forum in version 1.9.2.5. I upgraded my og and og_forum modules and og2list stopped working!

The attached patch against HEAD includes the missing function so that og2list can work.
This patch should also build the .info file. Apply it to og2list 4.7 HEAD and you should have a working 5.0 module with og, og_forum and og2list all updated to HEAD circa April 2007.

D.

AttachmentSize
og2list-5.x-0.1-dev_1.patch 6.95 KB

#4

killes@www.drop.org - May 7, 2007 - 12:06
Status:reviewed & tested by the community» fixed

Thanks, I've applied the last patch.

We should look into why og-forum removed this function.

#5

damien_vancouver - May 7, 2007 - 15:01

It's strange, as there are a pair of functions in og_forum and they are identical except they order their select statement opposite. One of them vanished (og_forum_get_forum) and the other is still there (og_forum_get_container). The idea is that each og_forum has two nodes, one container and one -Generic Discussion node that is the actual forum. So they looked like these:

/**
* Retrieve forum for given group
*
* @param $group_id
*   Organic group ID
* @return
*   Forum's term ID
*/
function og_forum_get_forum($group_id) {
  // Grab most recent term created for group; this will be the forum as
  // opposed to the forum container.
  return db_result(db_query_range('SELECT tid FROM {og_term} WHERE nid = %d ORDER BY tid DESC', $group_id, 0, 1));
}

/**
* Retrieve container for given group
*
* @param $group_id
*   Organic group ID
* @return
*   Forum container's term ID
*/
function og_forum_get_forum_container($group_id) {
  // Grab most first term created for group; this will be the forum container
  return db_result(db_query_range('SELECT tid FROM {og_term} WHERE nid = %d ORDER BY tid ASC', $group_id, 0, 1));
}

depending on which one you call you'd get the first or last termID. It's possible that there can be more than one og_term row now and this query no longer works right. But in that case, why is og_forum_get_forum_container still around? And how did it ever work for me in Drupal 5 if the function was removed before the DRUPAL-5 branch? Perhaps I didn't have og_forum enabled at first or perhaps it came back. I will look into all these things and report back here with more info and maybe a patch.

D.

#6

Anonymous - May 21, 2007 - 15:01
Status:fixed» closed

#7

anniekin - May 24, 2007 - 17:44

A few questions:

-When is the "official 5.x version release" coming out? How soon is "soon"?

-How well should the current HEAD version work for Drupal 5? I'm running into problems and I'm not sure whether it's something I'm doing wrong or whether I should attribute it to the fact that I'm not using an official release. I'm rather a newbie, so debugging Drupal is not something I can do easily.

Any pointers to info are welcome, too... I'm about googled out...
Thanks.

 
 

Drupal is a registered trademark of Dries Buytaert.