Deleting last comment sometimes also delete "add new comment" form (default form bottom of the page)
I think this is erorr in ajax_comments_comment_view_alter()/ajax_comments_entity_prepare_view()
and i think we can use native drupal comment module div's without this functions (without adding own div's, only add classes and id's to existing divs).
I will try to make it on this week.
UPDATED:
Motivation:
- Decrease chance to be broken by other modules/themes. Refactoring ajax logic from using html IDs to classes
- Makes comment form id/class more obvious (based on node and comment, not on the current time).
As result with this patch ajax_comments:
- compatible with Views module. Displaying comments for nodes in views work fine (delete, edit and cancel - flat and threaded)
- compatible with Comment goodness module.
- compatible with Display Suite module
- has NodeJS integration
Also fixes:
#2312957: Issues when comments has a file/image field.
#2293275: Replying to a comment in a flat list.
#2327353: Set focus on comment field
#2288281: Reply link callback not found error 404
Comment | File | Size | Author |
---|---|---|---|
#8 | ajax_comments-2320845-make_7x1dev_version_work_part2-v5.patch | 50.32 KB | formatC'vt |
#8 | interdiff-v5.patch | 8.72 KB | formatC'vt |
Comments
Comment #1
formatC'vt CreditAttribution: formatC'vt commentedI'm done big work, and make it work, again =)
Motivation:
- Decrease chance to be broken by other modules/themes. Refactoring ajax logic from using html IDs to classes
- Makes comment form id/class more obvious (based on node and comment, not on the current time).
As result with this patch ajax_comments:
- compatible with Views module. Displaying comments for nodes in views work fine (delete, edit, cancel - flat and threaded)
- compatible with Comment goodness module. Also in combination Views + Comment goodness. Warning: Comment goodnes doesn't work with jQuery update module (see #2294195: .live() is not a function error) and broke ajax calls.
- compatible with Display Suite module
also i do some code cleanup (delete unused functions and commented code)
Comment #2
formatC'vt CreditAttribution: formatC'vt commentedalso this patch include code/logic from #2312957: Issues when comments has a file/image field. and #2293275: Replying to a comment in a flat list.
Comment #3
formatC'vt CreditAttribution: formatC'vt commented- Add unique buttons IDs (need for Views with enabled AJAX)
- Set focus on comment text field (#2327353: Set focus on comment field)
Comment #4
formatC'vt CreditAttribution: formatC'vt commentedthis patch with bug in "Show reply form on the same page as comments" mode (and form caching bug in this mode). I try to fix it on this week.
Comment #5
formatC'vt CreditAttribution: formatC'vt commented- fix bug with "Show reply form on the same page as comments" option - #2288281: Reply link callback not found error 404
Comment #6
andypostI see no reason in this!
Once you change variables you should provide hook_update_N() to convert variables.
This change breaks BC and causing other contrib modules to update - please aware that!
The common practice to place this functions into Drupal.ajaxComments.*
see http://cgit.drupalcode.org/drupal/tree/modules/contextual/contextual.js?...
any reason for? this could scare an end user.
this change is wrong, you need to make sure that 4 argument is existing comment or 0 (zero)
this looks strange...
node_is_page() could not work in panels... the the check was explicit!
By default comments are rendered only on full node page! http://cgit.drupalcode.org/drupal/tree/modules/comment/comment.module?h=...
this needs manual testing...
please do not comment-out code...
any reason?!
Comment #7
formatC'vt CreditAttribution: formatC'vt commented1. The reason is make name more simplify. This option (Disable scroll to comment) only in dev version of this module and still doesn't exist in release/beta.
2. Done. Now it's in Drupal style.
3. this is dev =) and error in js break all js on the page, replace alert to log
4. This check in ajax_comments_reply()
5. And this is already removed
6. I test it by myself but it is be good if it test someone else
7. OK, i will remove it
8. My bad =)
Thanks!
Comment #8
formatC'vt CreditAttribution: formatC'vt commented- Added NodeJS integration
- Small bugfixes (see interdiff)
Comment #9
seiplax CreditAttribution: seiplax commentedIn the current patch the Cancel text on line 181 can not be translated
/contrib/ajax_comments/ajax_comments.module:
177: // If this a reply to comment offer a 'cancel' button
178 if (isset($form_state['comment']->pid)) {
179: $form['actions']['cancel'] = array (
180 '#type' => 'button',
181: '#value' => 'Cancel',
182 '#access' => true,
183 '#weight' => 21,
184 '#limit_validation_errors' => array(),
185 );
If you want to have this as a separate issue, please re-open https://www.drupal.org/node/2334861
Comment #11
muschpusch CreditAttribution: muschpusch commentedAh damn it! I'm really sorry i did something wrong since and didn't put you as the committer :/ But finally this got committed. Thanks a lot for putting so much effort in this!
Comment #12
formatC'vt CreditAttribution: formatC'vt commentedHello, muschpusch! I glad to see you again. Do you have enough time to maintain this module?
When i lost hope i open this issue #2335709: Offering to maintain AJAX Comments, but i can close it.
Comment #13
muschpusch CreditAttribution: muschpusch commentedHey formatC'vt! Sorry for disappearing! I was pretty busy and just found some time to review the patch at drupalcon. Are you in Amsterdam? I think it's a good idea to make you co-maintainer see updated #2335709: Offering to maintain AJAX Comments
Comment #14
formatC'vt CreditAttribution: formatC'vt commentedNo, I'm about 2000 km from the Amsterdam =) Thanks.