Hi guys,
I use A panels page -- panels2 (5.x-2.0-beta2) -- to override the Node display (ie. using URL: node/%)

I show node content (using "Node ID" content) I also show "Node ID" Comments. My problem is when I show the "Node ID" Comment Form, this form does not display a fivestar selection as it should.

Details:

I setup my fivestar module to "require" Comment widget rating. This shows the fivestar rating widget inside of each comment form, regardless where the comment form is.

However, when Panels2 is used, and I select to show the comment form in the same page as the content node by selecting "Node ID" Comment Form, this required fivestar rating widget is missing from this comment form.

Now, the fivestar widget shows up if you go to the URL mysite.com/comment/reply/nid (not using panels2)
But, it doesn't show when I go to URL like this mysite.com/nodetitle (using the "Node ID" Comment Form)

Normally, when Panels2 are not used, fivestar widget appears as expected, so as far as I can tell this isn't a fivesat module problem rather a panels2 Node ID Context problem.

How do I put in this fivestar widget into the "NodeID Context" Comment Form so I can use panels2 and display the comment form in the same page that shows the node content without loosing the FiveStar widget?

Thank you so much for your help and I hope this is fixed in a future version.

Comments

merlinofchaos’s picture

We probably need to very very nicely ask the fivestar developer to add the panels version of the comment form to fivestar's form_alter which adds the widget. Unfortunately Panels can't just use the original comment form, it has to make a couple of changes. So I think that is probably the only solution. :/

ethanre’s picture

What about CAPTCHA, I just noticed that it is also missing from my "Node ID" Comment Form while it shows as expected when Panels2 is not in use. Is this the same issue?

merlinofchaos’s picture

Hmm. Yes, probably. That's an annoying oversight on my part. Ugh. Not sure what to do about this. Need to see if there's some creative way I can trick the system.

ethanre’s picture

Thank you so much. I promise, these are the only 2 issue I found.. I'm sure you will find a way :-)

catch’s picture

Title: Required "Fivestar Widget" Missing from Panels2 "Node ID" Comment Form » Panels version of comment form incompatible with comment_form_alter
Version: 5.x-2.0-beta2 » 5.x-2.x-dev
Category: support » bug

Retitling. Ran into this with fivestar today (although client pretty wanted talk.module anyway in the end), but handy to have.

/me kicks comment.module

catch’s picture

Title: Panels version of comment form incompatible with comment_form_alter » Modules that form_alter comment incompatible with Panels

Slightly better title.

sun’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new1.58 KB

Well, although this will break a few comment forms in my current project, attached patch should fix this issue.

Bumping to critical, since this breaks quite a lot of contrib modules.

EDIT: Of course, this will just break the styles of the theme that are currently based on #panels-comment-form... ;)

ethanre’s picture

StatusFileSize
new32.32 KB

Thank you!!

I applied the patch and edited Panels > added the "Node ID" comment form. fivestar and re-captcha show up and work as expected.

I have 1 issues to report:

Only when logged in, my page shows 2 comment forms (see screen shot attached) along with one fivestar widget. The 2 forms act as one.

When not logged in only one form shows, re-captcha and the fivestar and it works great!

Thanks

ethanre’s picture

Here's the code behind these 2 forms:

<div class="form-item">
<label for="edit-comment">

...removed...

<span id="mce_editor_1_parent" class="mceEditorContainer">
<table class="mceEditor" width="320" height="240" cellspacing="0" cellpadding="0" border="0" style="width: 320px; height: 240px;">
<tbody>
<tr>
</tr>
<tr>
<td align="center">
</td>
</tr>
</tbody>
</table>
<span id="mce_editor_1_resize_box" class="mceResizeBox"/>
</span>
<span id="mce_editor_0_parent" class="mceEditorContainer">
<table class="mceEditor" width="506" height="261" cellspacing="0" cellpadding="0" border="0" style="width: 506px; height: 261px;">

...removed...

</iframe>
</td>
</tr>
</tbody>
</table>
<span id="mce_editor_0_resize_box" class="mceResizeBox"/>
</span>
</div>

...removed...

<input id="edit-form-token" type="hidden" value="88076158fa98aab21336db346c3642a7" name="form_token"/>
<input id="edit-comment-form" type="hidden" value="comment_form" name="form_id"/>
<input id="edit-preview" class="form-submit" type="submit" value="Preview comment" name="op"/>
<input id="edit-submit-1" class="form-submit" type="submit" value="Post comment" name="op"/>
</div>
</form>
</div>

sun’s picture

Hm. I'm unable get your result - did you already clear your cache? Does this also happen in a new panel where only one comment form is contained?

ethanre’s picture

To answer your question: Yes.

I was able to get one comment form by commenting out a line from the patch. The patch includes these 2 lines:

drupal_process_form('comment_form', $form);
drupal_prepare_form('comment_form', $form);

I commented out the second, this effectively removed the duplicate forms. The remaining form, captcha and fivestar work as expected now.

Why removing the 2nd line helps, I don't know. But removing it didn't seem to break anything.

merlinofchaos’s picture

That iframe code suggests that tinyMCE is somehow not happy with this version of the form. I'm 99.5% sure that this problem is related to TinyMCE. Though it may be our fault; not sure. We may need a tinyMCE expert (are there any?) to look at this.

sun’s picture

Ethan, I'm unable to replicate your problem. Just applying this patch (no changes to existing panes required) made the comment form completely working.

sun’s picture

Well, TinyMCE module is quite unmaintained - consider switching to Wysiwyg Editor for integrating TinyMCE. So, no need to deal with tinymce.

catch’s picture

Status: Needs review » Reviewed & tested by the community

#8 looks good and worked for me. TinyMCE conflicts are a minor bug (if at all) compared to this critical one, so RTBC.

sdboyer’s picture

So fyi, this one looks good to me, but because there's the potential to break stuff in it, I'm not going to commit it until I've had a bit more sleep and can properly think about those ramifications, as well as how to notify them about the change.

sun’s picture

Just add this note to the release notes and you're done (b/c this bug exists in a beta, and, most people read those notes carefully, especially since update_status links to them directly):

Noteworthy changes

  • A bug fix for manually inserted node comment forms in panes will cause the form id (previously panels_comment_form, resp. #panels-comment-form) to change to the regular node comment form id. This might break custom alterations to this form and CSS styles, if there are any.
sdboyer’s picture

Status: Reviewed & tested by the community » Fixed

Good enough for me. Committed. Thanks again, sun! :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

kulfi’s picture

I too was getting duplicate comment textareas, the solution recommended by #11 (http://drupal.org/node/280589#comment-921835) worked for me.