Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When trying to enable a node panel, I got this:
Page manager module is unable to enable node/%node because some other module already has overridden with comment_bonus_api_node_page_view.
Comment | File | Size | Author |
---|---|---|---|
#28 | 672722-Add-a-simple-comment-ctools-panels-content-type.patch | 2.3 KB | smoothify |
#22 | comment_bonus_api_panels_3.patch | 1.25 KB | jcmarco |
#18 | comment_bonus_api_panels_2.patch | 1.07 KB | jcmarco |
#4 | comment_bonus_api_panels.patch | 1.1 KB | jcmarco |
Comments
Comment #1
Hiroaki CreditAttribution: Hiroaki commentedsame with me, unusable -.-
It broke my panels....
Comment #2
trevorleenc CreditAttribution: trevorleenc commentedit hasn't broken any panels, but all I am using panels for is a dashboard type page, and user profiles.
however I ran into this when trying to create a node-view panel...*ugh*
Comment #3
Hiroaki CreditAttribution: Hiroaki commentedyes because it overrides the view_node stuff on panel pages. it auto-disable the node related panels.
Comment #4
jcmarco CreditAttribution: jcmarco commentedI have patched the module to add the hook_page_manager_override() that allows to change the callback function from node_view.
This way the CTools' Panels initialize all its functions and then execute the comment_bonus_api function.
Other changes are avoid the menu alter if the ctools is going to make the callback, clean the menu alter function to just the callback_function value,
and also remove the unnecessary return $items because the alter function is called by reference.
I have tested OG_Panels without problems for the OG, Panels or Ajax Comments.
Comment #5
kmv CreditAttribution: kmv commentedThe patch in #4 works for me, but only insofar as it fixes the error the OP listed. It doesn't actually improve the compatibility enough to enable you to use overridden comments (such as AJAX Comments) in a panel.
Additionally it is probably worth mentioning somewhere that in order for the basic compatibility to function you MUST enable Panels' override of Node template (/node/%node) in admin/build/pages.
Comment #6
kmv CreditAttribution: kmv commentedI have had a look around and I think the problem is actually in CTools. The code in ".../ctools/plugins/content_types/node/node.inc" (which is the plug-in Panels uses when displaying a node) simply doesn't render comments at all - it calls node_view() directly and that's it.
I don't know CTools well enough, but I would guess that best way of fixing this might be to create a Panels widget which does its own rendering of node content.
If you are feeling hacky (as I was) then you can actually get this to work by hacking the above CTools node.inc from:
to
and your node in panels will now have comments, they even seem to AJAX properly.
Obviously I don't endorse the above approach - so I won't post a patch file. Perhaps someone should raise an issue on CTools?
Comment #7
mansspams CreditAttribution: mansspams commented#4 did not work for me. Its a very strange patch.
Anyways. Panels allows to place node without comments and then separately comment form and comments themselves. As I understand, Comments bonus API returns node + form + comments in one peace overriding panels way of displaying node. If there could be a way for Comments bonus API to actually work with separate elements - form and comment display - then compatibility would be possible.
Comment #8
rjbrown99 CreditAttribution: rjbrown99 commentedHi guys. I was added as a co-maintainer of the module with neochief (thanks!) If you can come to some agreement about a workable approach I'm happy to check it out. I am not using Panels so this isn't a direct issue for me but I'm more than happy to review a working patch and roll it into a commit. I'm just trying to provide some encouragement to fix it :)
Comment #9
vidichannel CreditAttribution: vidichannel commentedIf patch is created, I can test with latest versions of Panels and Chaos Tools. Having the same problem here.
Comment #10
jcmarco CreditAttribution: jcmarco commentedThe patch in #4 works for me since April
Comment #11
mansspams CreditAttribution: mansspams commentedPatch in #4 is working if node is displayed together with comments, very rare case. Panels are ment to change layouts freely, so comments form and comments display needs to be treated separately. I am working on rather large project now and it will eventually need ajax comments so I will probably be able to help, but not at the moment, since ajax comments are cosmetic thing. Also it will require little more than simple patch for few lines. Im talking colonoscopy here ;)
Comment #12
jthomasbailey CreditAttribution: jthomasbailey commentedsubscribing
EDIT: patch #4 didn't do anything for me, neither did adding those lines to ctools
Comment #13
tugis CreditAttribution: tugis commentedThe patch in #4 works for me. Thanks!
Comment #14
rjbrown99 CreditAttribution: rjbrown99 commentedThere are conflicting reports back and forth about #4. Can any of you, especially those with a coding background, provide some additional insight? If this is working and helps with Panels I'd be happy to commit it, but so far I'm not feeling great about RTBC given the varying reports.
Comment #15
jcmarco CreditAttribution: jcmarco commentedPanels can show different elements. If you are displaying full node then the patch in #4 works fine, but as @kmv tells, if you are displaying in a panel the different elements of a node one by one, I mean, title, body, links, comments.. then the patch #4 doesn't cover this.
For showing node elements probably it would be needed an extra work in panels code to allow overriding different elements and then add this hook to this module to override the original content when it was shown in a panel.
So, patch #4 solves one use case, when showing a full node in a panel.
The other use case, showing independent nodes elements is not solved by this patch, this would require more work in panels.
Comment #16
rjbrown99 CreditAttribution: rjbrown99 commented#15 do you feel it is well tested enough to roll in?
Comment #17
jcmarco CreditAttribution: jcmarco commentedThe patch solves the specific case where you are showing a full node in a page manager/panel.
It is using a hook defined in ctools/page_manager/plugins/tasks/node_view.inc function page_manager_node_view(). So I am sure it works fine, at least in works also for me in some installations.
About removing most of the content in the menu_alter is because any of that values are default ones so it doesn't have any sense alter menu fields that have the same values.
From http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...
So basically, this patch remove unnecessary code and just add a new hook function, used by ctools/page_manager.
As I told you it doesn't override when you are adding just the node's comment element of a node in a page_manager/panels. That is a different case.
Comment #18
jcmarco CreditAttribution: jcmarco commentedI was testing this again, and in same time the ctools changed its behavior and now the hook override only is called when there is a page manager context. So the first conditional change that altered the menu, never is executed and it should be removed.
Once again, this patch only add the hook_pager_manager_override, that is executed only when viewing a node in panels, and not when adding just a node comment form in panels.
The change in the alter is because this is the only necessary change in the menu alter, so it is just a simplification and it doesn't affect to the other part of the hook_page_manager_override.
Comment #19
thomas1977 CreditAttribution: thomas1977 commentedSubscribing
Comment #20
rjbrown99 CreditAttribution: rjbrown99 commentedRather than just subscribing, can I ask that anyone who happens upon this thread applies the most recent patch and provides a bit of feedback? Thanks.
Comment #21
tribsel CreditAttribution: tribsel commentedapplied latest patch. does not work with comment form and comments added to panel separately. (common case with panels i would say).
it also disabled panel overriding node view (Page manager module is unable to enable node/%node because some other module already has overridden with comment_bonus_api_node_page_view).
so i can not test the other scenario at all (full node displayed as panel content).
btw I used ctools 6.x-1.8, panels 6.x-3.9.
Comment #22
jcmarco CreditAttribution: jcmarco commentedOopss! I didn't test correctly the panels node view override behavior.
Umpteenth version of the same:
Comment #23
roalty CreditAttribution: roalty commentedIn case of panel with different elements (not node view) put this code as custom content in panels to activate ajax bonus api:
Comment #24
tribsel CreditAttribution: tribsel commentedthanks, patch 3 does not disable panels overriding nodes anymore.
roalty - when I do this, ajax comments start working. But tinymce disappears after I click reply to comment and its not possible to submit new comment - i get error message required field missing which does not say which. Maybe its because I customised my comment form.
Comment #25
picxelplay CreditAttribution: picxelplay commentedPatch 3 keeps panels enabled. Then go add a comment; submits, but not ajaxed. You have to refresh page to see new comment.
Comment #27
smoothify CreditAttribution: smoothify commentedPatch 3 works well and allows me to resume using the panels node overrides once again.
I would suggest committing this now and then addressing the issue with the actual ajaxification of the comments within panels.
Comment #28
smoothify CreditAttribution: smoothify commentedI looked at the code within panels for embedding comments and noticed it uses its own comment_render function. Rather than try to force this module or Ajax comments to work with it, by far the easiest option is to create a new panels/ctools content type.
I have created a stripped out one here, which when the patch is applied allows the display of the comments & forms inside a pane with the html unaltered so ajax comments work fine.
To use it, when in the panels admin page, go to add content and choose the category Comments Bonus API on the left, then simply select 'Comments'.
There are no settings for number of comments, sorting order or anything like that - these are best controlled per node type, or could be added alongside changes to this modules comment_render override.
Comment #29
mansspams CreditAttribution: mansspams commentedwhat you say smoothify makes perfect sense! will try to test.
Comment #30
micheleqj CreditAttribution: micheleqj commentedTried out the patch in #28....I was able to add "Comments Bonus API->Comments" to my panel page but I'm not seeing any output from it (no comment header, no comments, no comment form) when I view a node through that panel page. Not sure what I may have missed. Comments are enabled for that node type and node and the node does have comments on it already.
Using:
Panels 6.x-3.9
CTools 6.x-1.8
Comment Bonus API 6.x-1.x-dev
Very excited about this potential solution and hoping I missed something simple.
Comment #31
micheleqj CreditAttribution: micheleqj commentedThanks for working on the patch in post #22. It doesn't seem to work for me. But that's to be expected as I'm not able to add the full node with comments to my panel page as instructed. Maybe the ability to do that has gone away in Panels 3? It seems I can only add full node content and comments separately.
Comment #32
smoothify CreditAttribution: smoothify commented@michelqj - do the comments show when you use Comments Bonus API without panels? (i.e. on a regular node page) ?
Comment #33
tribsel CreditAttribution: tribsel commentedhi smoothify. I applied your patch #28 but I dont have any comments Bonus API on the left in panel admin page and ajax comments dont work (when I add comment form to panel and press submit, nothing happens). im using latest panels and ctools and ajax comments work on regular nodes (without panels).
Comment #34
Apfel007 CreditAttribution: Apfel007 commentedsub
Comment #35
rjbrown99 CreditAttribution: rjbrown99 commentedSeems like more work is needed on a patch.
Comment #36
calefilm CreditAttribution: calefilm commentedThe only patch I was able to successfully patch was in #4. But it didn't do anything but allow me to enable my node/%node panel page. The non-ajax functioning remained.
I patched the others in the same place using the same methods.. I assumed I'm to patch it in the comment bonus api root folder?
Wow, but this module is disabling the node/%node entirely even when I disable commenting in all comment types using that panel page. Now I have to choose between OG or ajax comments
Comment #37
kevinwalsh CreditAttribution: kevinwalsh commentedMy solution here will be to replace Panels with context, something i was planning on doing anyway. And since the main reason i'm using Panels is for OG, there's i'll have to use Context OG module as well.
Comment #38
myha CreditAttribution: myha commentedThe solution that works for me: create new custom content, filter format - php, code:
I have Ajax comments 6.x-1.8, but there are some hacks for Memcache and others.