The module does not handle a fallback for browsers that have disabled javascript. And I can see why. The module alters the URLs to refer to /ajax_comments/* from the normal /comment/*. And the page callbacks always deliver ajax responses.
Am I missing something? If not, then I see two ways to go.
First, I think the module could implement the standard ajax/nojs convention in the url path, e.g. /ajax_comments/nojs/reply/*/* And the module could handle the nojs path by redirecting to the standard comment module url, e.g. /comment/reply/*/*
The second way is to change the generated html to use the standard href urls, but have the javascript handle changing the URLs to /ajax_comments/blah. I've tried this and it works!
I'm willing to do the work to make a patch to fix this if we can agree on the problem and best approach to fix it.
Thanks,
Mike Gering
Comment | File | Size | Author |
---|---|---|---|
#17 | ajax_comments-nojs-fallback-2108557-17.patch | 17.42 KB | kporras07 |
#5 | ajax_comments_nojs-2108557-5.patch | 14.33 KB | thebruce |
#4 | ajax_comments.module.patch | 12.31 KB | mfgering |
#2 | ajax_comments.module.patch | 12.8 KB | mfgering |
Comments
Comment #1
muschpusch CreditAttribution: muschpusch commentedFor me this seems to be the way to go. I took over maintainership of the module and this was on my todo list. It would be great if you could provide a patch. I would review and commit it.
Comment #2
mfgering CreditAttribution: mfgering commentedI agree this is the best approach. I created a patch and have done some testing. Please review.
Comment #3
muschpusch CreditAttribution: muschpusch commentedwow that was quick! I'm sorry but your patch doesn't apply anymore. :/ I pushed lot's of changes this morning and i think you downloaded the current development release or not? Please fetch from git: Drupal infrastructure only builds releases once or twice a day...
https://drupal.org/project/ajax_comments/git-instructions
Comment #4
mfgering CreditAttribution: mfgering commentedI cloned the git repo and merged my code into it. Please see the patch file for details.
Comment #5
thebruce CreditAttribution: thebruce commentedI re-rolled this patch against the current dev branch to address any differences as well as the removing the delivery callback from #4 for the comment edit menu callback (probably snuck in during the merge resolutions).
I couldn't find where the now 4th and 5th args for the menu item for reply are set. They don't seem to be set anywhere in the .module code. I had consistent issues with the menu router failing as a result - since they have defaults of (NULL and 'node') and they work as optional items for the menu item and there were no failures I pulled them per the original patch.
Comment #6
muschpusch CreditAttribution: muschpusch commentedThanks a lot! This looks good! Could somebody test this please then i will commit it asap....
Comment #7
muschpusch CreditAttribution: muschpusch commentedComment #8
SocialNicheGuru CreditAttribution: SocialNicheGuru commenteddeleted: wrong queue.
Comment #9
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedafter looking at the other patch I found that this line in ajax_comments/views might have to be altered also:
Edit 6/26/14:
the line should be:
Comment #10
thebruce CreditAttribution: thebruce commentedSocialNicheGuru - hmm, it looks like that it is already pointed to the correct menu router - ln 66 of ajax_comments.module, am I missing something? Happy to address whatever helps the nojs fallback here, I think I just am not following.
In other news, muschpusch - we've been running this without issue, but it would be good to have another eye on it.
Comment #11
SocialNicheGuru CreditAttribution: SocialNicheGuru commented@theBruce, it was suggested that adding to your solution might fix this issue: https://drupal.org/node/2266673
Comment #12
muschpusch CreditAttribution: muschpusch commented@thebruce it seems like the views plugin is still referencing the old handler. Could you please add that to the patch? Then i'm happy to commit it and create a new release
Comment #13
muschpusch CreditAttribution: muschpusch commentedComment #14
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThe fix gets the comment form to show up in a view
but I get the following error with linkit which is used with wysiwyg as part of panopoly distribution:
/modules/contrib/linkit/js/linkit.dialog.js?v=7.2&_=1404796095185
also none of the wysiwyg editor paths are included so I get a 404 error for every plugin to the wysiwyg editor.
Comment #15
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedthis no longer applies to beta1
Comment #16
formatC'vt CreditAttribution: formatC'vt commentedi think we still need this
Comment #17
kporras07 CreditAttribution: kporras07 commentedRe-rolled patch against last dev version.
Comment #18
kporras07 CreditAttribution: kporras07 commentedComment #19
formatC'vt CreditAttribution: formatC'vt commentedYou also replace same code in dev version.
For example
$commands[] = ajax_command_prepend('.comment-wrapper-' . $pid . ' + .indented', $form)
by$commands[] = ajax_command_before('.comment-wrapper-nid-' . $node->nid . '> .ajax-comment-wrapper:first', $form)
.Why you did this?
Comment #20
formatC'vt CreditAttribution: formatC'vt commentedComment #21
formatC'vt CreditAttribution: formatC'vt commentedI see a easy solution - use own javascript code for binding Ajax behaviors.
I'm working on this
Comment #23
formatC'vt CreditAttribution: formatC'vt commentedwow, this solution are described in this issue as second way =)
Implemented and committed to latest dev. Important: clear cache after upgrade (menu links are changed to drupal core comment module style)
Comment #24
formatC'vt CreditAttribution: formatC'vt commentedcommitted to 7.x-1.2