Forum (and Advanced Forum) use comment_new_page_count to find the first unread post in a topic. Nodecomment has no equivalent function, yet.
Michelle
Forum (and Advanced Forum) use comment_new_page_count to find the first unread post in a topic. Nodecomment has no equivalent function, yet.
Michelle
Comments
Comment #1
merlinofchaos commentedWe need this ASAP for advanced forum integration.
Comment #2
quicksketchI should've marked myself assigned on this, I've got an in-progress patch that may or may not work for this problem, it's a bit more difficult than the comment.module implementation, since we need to get the assigned view then modify it's query to get the first page with a new comment.
Comment #3
michelleAny chance you could pick a name for the function you're going to use and add it, even if it just returns 0 for now? Then I can get everything in place in AF so it will just start working as soon as its implemented here.
Thanks,
Michelle
Comment #4
merlinofchaos commentedAfter forcing the view to order by threaded or not based on the node type, which is an easier solution to administer, I then just adapted comment.module's function to this. http://drupal.org/cvs?commit=223350
Comment #5
michelleFixed in AF as well. Will be committed in a couple hours.
Thanks,
Michelle
Comment #6
drcheers commentedI don't get what to do... I get the "Fatal error: Call to undefined function comment_new_page_count() in /.../../.../.../sites/all/modules/advanced_forum/advanced_forum.module on line 789
I don't understand what that link is ( http://drupal.org/cvs?commit=223350) or what to do. I just downloaded the latest AF for Drupal 6.12. I also downloaded the latest nodecomments for D6.
Heres my forum error link: http://stupidai.com/forum
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
EDIT: They NEED to include ALL of these needed modules in Drupal 7 and I just gave up on trying to fix it...
Comment #7
michelle@drcheers: You can't possibly be using the very latest dev version of AF 6.x-2.x because that line isn't there. If you want to help test the new version, make sure you have the latest out of CVS for AF, NC, and Views. It sounds, though, like you're not a developer so I suggest waiting until things get a bit more stable before you jump in to help test.
Michelle
Comment #8
michellere your edit: If you're suggesting adding these to core, no, that won't happen in Drupal 7 and probably not ever. They will be ported to Drupal 7 in contrib, though.
It sounds like helping us test this is frustrating you. While it's nice of you to try, I repeat my advice to just hang on until we get more of the kinks worked out before testing it.
Michelle
Comment #9
iva2k commentedI noticed that nodecomment in CVS started to get a number of comment_*() functions that replace comment.module. It sets these two on a collision course, unless comment.module is also patched to have "if (!function_exists(...))" clauses around functions that's being overridden. One place where it is destined to happen is admin/build/modules, where even disabled modules are loaded.
Just a thought... it seems to me that hook system in Drupal core should be capable of getting the job done for all overridden functions. My impression was that hook system was created specifically to avoid name collisions. Can something like this do the job?
I think this type of caller-side wrapper is more universal than having multiple-defined functions. Then each of the "comment"-providing modules will implement all of those as hook_*(). Best part of it is that it requires no patching of comment.module, and honors coding conventions.
Comment #10
michelle@iva2k: Where? I just grepped the source and can't find a single instance of nodecomment defining a comment_* function. I am running bleeding edge nodecomment on my dev site and have not had a single collision. Could you name some examples of where you're seeing this?
Michelle
Comment #11
iva2k commentedYes, I stay corrected, nodecomment in d.o ftp still has these, e.g:
But CVS -dev totally got rid of them. Sorry for rushing the conclusions.
Still, is there any merit in using hook api to resolve which module/function provides comments?
Comment #12
michelleI don't think using a hook is a good idea. Why would you want both nodecomment and comment to run each function? Better to explicitly call one or the other. Less overhead that way.
Michelle
Comment #13
iva2k commented>Why would you want both nodecomment and comment to run each function?
They would not do that. I mean for AF and all other modules which would want to decouple from comment.module and allow nodecomment or any other comment engine.
Nodecomment.module only has to define nodecomment_*() functions that would replace comment_*() functions.
Comment #14
iva2k commented@Michelle
Which of the branches in CVS are you running for AF, NC and Views?
Comment #15
michelleThat's what it does... I was talking about your proposed hook system which would run both the comment and nodecomment version for every call.
2.x, just like the version dropdown says.. :)
Michelle
Comment #16
iva2k commented> I was talking about your proposed hook system which would run both the comment and nodecomment version for every call.
module_invoke_all() will only run enabled modules. nodecomment disables comment and vice versa, so module_invoke_all() will only run one function out of currently enabled module. It will return either one element array, or zero (if some module calls it without proper dependency on comment). Yes, it is off-label use of potent drug, but if it works, it works. Short of a proper provider API in core, it may be a best work-around.
Re: Versions
Is this list correct? (I'm still confused about Views)
AF: DRUPAL-6--2
NC: DRUPAL-6--2
Views: DRUPAL-6--2-6 (or HEAD? or DRUPAL-6--3?)
Comment #17
michelleNodecomment does not disable comment. In fact, comment is a dependency. So you will always have comment enabled if you have nodecomment enabled. Which means using a hook would run it in both.
For versions, all three are 2.x, latest code in CVS.
Michelle
Comment #18
michelleActually... Views might be HEAD, but it's the 2.x version. I don't remember for sure which I pulled from when I checked it out. Not 3.x.
Michelle
Comment #19
iva2k commentedThanks for the clarification. In admin/build/modules comment is greyed out and unchecked. Maybe it changed in CVS, but in nodecomment from ftp it was disabled, so I thought only one module is actually used. Good to know that now.
I will try Views HEAD first then.
Best,
Comment #20
merlinofchaos commentediva2k: You say you're using Nodecomment 2 but it really sounds like you're using Nodecomment 1. I can say with some certainty that not only does Nodecomment 2 define any comment_* functions, it has comment.module as a dependency *and* the update script will try to enable comment.module in case you're upgrading from an older version. I think you somehow hoave the older version installed.
Not to mention, what you report has *nothing* to do with this issue anyway, so you've now added what looks like 20 or so comments to an unrelated issue. That's very confusing to everyone.