Closed (fixed)
Project:
OG Forum
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
12 Dec 2007 at 17:33 UTC
Updated:
13 Oct 2008 at 20:01 UTC
Jump to comment: Most recent
This is a task for myself. I want to evaluate the advanced_forum module and see:
a) if this module can easily support it right out of the gate
b) if not, can I adapt this module without spoiling support for the regular forum module?
c) if not, can I adopt code from it to convert the forum & og_forum combo to be more like advanced_forum?
d) if not, how big a pain will it be to write a new og_advanced_forum module to work with it?
Comments
Comment #1
Walt Esquivel commentedThis link might be helpful to you in terms of ideas towards a solution:
http://drupal.org/node/59826#comment-724550
Comment #2
michelleFrom what Miraploy said, it sounds like the issue is we're overriding the same functions. Right now my focus is the D6 port and D5 backport so everything else is on hold for that. Once things have settled down, I can take a look at OG forum and see how we can make them work together.
Michelle
Comment #3
rconstantine commentedI'm all for it and will pitch in where I can. Let me know what findings you come up with.
Comment #4
nath commentedI'm using both modules and so far it seems to work. What are the known problems? Perhaps I could also have a look at them.
Comment #5
nath commentedOk, now I can see what the problems are. Has there been any progress?
Comment #6
nath commentedI had a look at both modules. It seems, the problem lies in three functions (because of duplication):
forum_display
forum_list
forum_topic_list
Am I right that one only has to merge those three functions to have everything work as intended?
Comment #7
michelleWell, the problem is that we're both overriding those theme functions but merging them won't be simple. You're using the 5.x forum code and I'm using the 6.x forum code. I think what I'll need to do is diff your code against the core forum to find out exactly what you changed and write a template_preprocess function to make the changes. Not sure when I'm going to have time, though. I've got my hands pretty full with this module already. :( So if you're able to put anything towards that, I'd appreciate it.
Michelle
Comment #8
nath commentedAfter taking a closer look, theme_og_forum_list doesn't seem to be changed from theme_forum_list despite it claiming to be "slightly modified". Using my template.php I copied the contents of phptemplate_forum_list (form advanced_forum) into my phptemplate_og_forum_list. That seems to work without problems.
If I didn't miss anything, that would bring us down to two functions that need to be merged. To be sure, a verification by rconstantine would be needed though.
Comment #9
nath commentedI now had a look at the "forum_topic_list" part.
It seems, the only thing needed there is a way to set each topic as "public" or not.
How can I add this info to the return value?
return _phptemplate_callback("$forum_theme/advf-forum-topic-list", $variables);It needs to get into the variables?
On my site, it isn't a real problem as we don't have public forums, but for a real solution, this would be necessary.
Comment #10
nath commentedTo be precise, we would need a way to have a variable $topic->private that could be set to "public", "private" or "" (empty). Then one could use the contents of that variable in the template. How would I set that variable before calling the callback?
Comment #11
nath commentedOk, for the forum_topic_list I have a solution that one can put into the template.php:
Comment #12
nath commentedFor a "forum_display" that combines og_foum with advanced_forum, it seems we need to change the "d6_compat.inc", that advanced_forum provides.
It's the
function template_preprocess_forums(&$variables)that needs to be expanded. I will post the changed function, when I got it working. For an inclusion into advanced_forum, it would be necessary to check for the existence of og_forums and react accordingly.Comment #13
michelleYou need to make your own preprocess function. The d6compat file is just that: for D6 compatability. Other than a few minor changes to make it work in D5, that is unchanged from core.
What needs to happen is og_forum needs an og_forum_preprocess_* for each function that it needs to modify the variables. Then we need to decide how we will handle who calls what when both modules are installed. Either I will wrap mine in an "if (!module_exists("og_forum"))" and let og_forum handle all the function calls, or they need to do that for advforum and let me handle the forum theming when people have advforum installed.
I've looked at the og_forum code and it's pretty complicated. It's not something I'm going to have time to dig through in the near future. I'll take a look at what you come up with, but I'm going to be pretty picky with how much I add to advanced forum. Supporting another module should be limited to function calls and checking if the other module exists to avoid conflicts.
Michelle
Comment #14
rconstantine commentedSorry I'm not around much lately. Work for me has shifted from primarily being development, to primarily being content generation. So I've only got one or two days every couple of weeks for module maintenance - and since everything works for us, you can imagine things aren't the priority I'd like them to be.
In any case, I'm currently trying to address the issues in this module's queue. Once I take care of some of the more immediate concerns, I can look more into this issue.
@nath - thanks for looking at this. #8 may be correct. I will double check. I'll also look at your other notes and observations.
@Michelle - You're right that this is a complicated module, but I think it does some fun things. And I'm adding more. But I agree that code changes to either module should be very minimal as you suggest. Checking for existence of the other and deferring to it in certain situations should be enough I would think. That's all I've ever had to do when working with other module creators. Most of my modules have compatibility with several modules and most were easy to do. There were a couple that weren't, but both creators were willing to work things out and the results were quite good. I think your module is one worth working with.
Guys, I'll be in touch, maybe just not as quickly as we'd all like.
Comment #15
nath commentedI'm simply trying to get both modules working together for our site. Posting the results here is just so that other people having the same problem have an easier time nd to provide some hints on where the conflicts are. I succeeded by adding some small changes to the mentioned function in the compatibility file. I know that this is not the clean way to do it but it was the easiest way.
If I'm right with #8 and forum_list isn't changed in og_forums after all, that function could be removed from og_forums thus allowing most of advanced_forums to work
The changes to forum_topic_list are just cosmetical if I'm not mistaken. They allow for different icons for public and private forums. In addition, that change is easy to implement for everyone by putting the posted function into the template.php.
The real complicated thing is forum_display as it deals with the access rights. I think I got it right with my changes to d6_compat.inc but I'm not sure how to do it with an additional preprocess function. That would be something for you two to figure out.
Anyway, this is the function as I use it now:
Comment #16
michelle@rconstantine: I'm willing to work with you to make the modules compatable. The problem is that my 8 month old has been barely napping and my 3 year old is just about giving them up. So I'm dealing with kids pretty much non stop from 7am to midnight. I haven't been able to get much of anything done.
One thing you might want to consider, though it's no small amount of work and I understand if you don't want to, is bring og_forum for 5.x in line with the 6.x forum code like I did for advanced forum. The initial backport was rough but now I only need to maintain one set of theme files that works for both versions. Plus I got some goodies like #new working across pages.
@nath: I understand you're making it work for your site but what you are doing is hacking the module in a way that will not be incorporated. If you want to do that, that's fine, but I want to warn everyone following along that you will need to redo the changes on every upgrade if you go that route. We'll get this worked out in a clean way but it may take a while since both of us are very busy.
Michelle
Comment #17
rconstantine commentedI would imagine that bringing my 5.x code inline with 6.x forum code would be easier if I actually get around to releasing a 6.x version of og_forum first, no? I haven't even looked at Drupal 6 yet, so I don't know what specifics you are referring to or how I would backport changes to version 5.x.
For now, at least, I'm open to that idea. It will just take time.
Comment #18
michelleGoing through some old issues in my list... This isn't something I will have time to do for D5. Once it's ported to D6, we can see if there's still any conflicts that need to be resolved.
Michelle
Comment #19
nath commentedOk, so I will have to write my own small module instead of using OG forums.
Comment #20
michelleI was curious and took a (*very*) brief look at the code and see a couple problems:
* OG Forum is clobbering the /forum menu path. AF uses hook_menu_alter() to provide a version of that page with extra information in the query. So that page won't work right with AF.
* OG Forum is using the old 5.x style theme_* functions and not the preprocess system. I'm not sure what will happen there. Likely OG Forum will just shut out AF for those functions.
Just based on this, I would have to say that OG Forum and Advanced Forum continue to be incompatable. I don't know whether they can be made to work together. Certainly it would help if you use the preprocess system but I haven't looked at the code deeply enough to know if that is enough. Since I don't use OG forum myself, I don't know when or even if I'll have the time to investigate more. If someone that uses both has ideas, patches are welcome on my end. Up to the OGF maintainer(s) about their end.
Michelle
Comment #21
daniorama commentedAny info or news about how to make both of them work together? Thanks!
Comment #22
Anonymous (not verified) commentedIt looks as though compatibility with Advanced Forum is not not something we will be able to look into in the near future .
I would recommend finding paid for support on drupal.org
http://drupal.org/profile/drupal-services
However i will look into ...
" OG Forum is using the old 5.x style theme_* functions and not the preprocess system. I'm not sure what will happen there. Likely OG Forum will just shut out AF for those functions."
.. in the near future