I've been working on Ajaxsubmit to provide working Instant Comments Submission, this patch provide that feature.

Blessings!

CommentFileSizeAuthor
ajaxsubmit_ics.patch5 KBdevelcuy

Comments

develcuy’s picture

Please take a look at project demo site: http://develcuy.elblog.de/ics/

nedjo’s picture

Thanks for the contribution. This is indeed an area where additional work is needed. Your effort is a valuable first step.

My first priority in AjaxSubmit is to convert it to use the jQuery forms plugin (now part of Drupal 6). So I'd like to do that before adding significant new features.

Beyond that, I try to avoid AJAX/AHAH approaches that expose data through new menu items. When you take that approach, you need to either (a) replicate complex access control logic that's already handled elsewhere or (b) open significant security holes. The approach in this patch so far falls under b)--it exposes potentially sensitive data by bypassing the usual access controls.

Can we implement comment preview without a new menu item? I suspect we can. See e.g. the implementations in activeedit for returning rendered node and comment bodies.

yngens’s picture

i am looking forward to see this feature functional in Drupal 6. nevertheless, i would like to thank develCuy for his contribution.

develcuy’s picture

Assigned: Unassigned » develcuy

Thanks nedjo for your guidelines, I'm going to review activeedit to avoid security holes. I've don't tried D6 before but it is a good opportunity to start on. So, I assigned this task to me. Will keep you informed about my progress.

Blessings!

shames’s picture

sir this patch is working perfectly this is what i'm lo0king for. But i dont know how to patch it manually. Can you email me the modified ajaxsubmit module? i'm using drupal 4.7 thanks sh4m3s@yahoo.com

alex_shapka’s picture

unfortunately, for 5.x-1.1 it produces an error if you submit two comments in a row. to see what was the error try to delete added comment and it will give:



    * warning: Invalid argument supplied for foreach() in /home/mysite/public_html/modules/node/node.module on line 521.
    * warning: implode() [function.implode]: Invalid arguments passed in /home/mysite/public_html/modules/node/node.module on line 525.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM blog_node n INNER JOIN users u ON u.uid = n.uid INNER JOIN blog_node_revisions r ON r.vid = n.vid WHERE in /home/mysite/public_html/includes/database.mysql.inc on line 172.
    * warning: Invalid argument supplied for foreach() in /home/mysite/public_html/modules/node/node.module on line 521.
    * warning: implode() [function.implode]: Invalid arguments passed in /home/mysite/public_html/modules/node/node.module on line 525.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM blog_node n INNER JOIN users u ON u.uid = n.uid INNER JOIN blog_node_revisions r ON r.vid = n.vid WHERE in /home/mysite/public_html/includes/database.mysql.inc on line 172.


does this mean there are dramatical changes in mysql tables between 5.x-0.8 and 5.x-1.1, or this error caused by conflict between some other modules - i can't figure out.

develcuy’s picture

@alex.shapiro, I've been very busy, and did not checked jstools 1.1 yet, and I will not review it until June :(. So please keep me update if there are some changes about ICS in further jstools releases.

Blessings!

Brian.Harris’s picture

The patch works almost perfectly in 5.x-1.1. The only thing i see not working is when an anonymous user posts a comment, the comment does get posted, but the comments do not reload to show the new comment.

also the actual patch file didn't work for me, but i made the changes manually and it works.

Brian.Harris’s picture

Just figured out what was wrong. for some reason you need the "Administer Menu" permission in order to access ajaxsubmit/backend/comment/thread/comment/reply/* so i modified your patch to this:

function ajaxsubmit_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/ajaxsubmit',
      'title' => t('AJAX submit'),
      'description' => t('Configuration for AJAX submit'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array('ajaxsubmit_admin_settings')
    );
    $items[] = array(
      'path' => 'ajaxsubmit/dispatch',
      'title' => t('ajaxsubmit'),
      'access' => user_access('access content'),
      'type' => MENU_CALLBACK,
      'callback' => 'ajaxsubmit_dispatch'
     );
    $items[] = array(
      'path' => 'ajaxsubmit/progress',
      'title' => t('ajaxsubmit progress'),
      'access' => user_access('access content'),
      'type' => MENU_CALLBACK,
      'callback' => 'ajaxsubmit_progress'
     );
} else {
    $items[] = array(
      'path' => 'ajaxsubmit/backend',
      'title' => t('ICS backend'),
      'access' => user_access('access comments'),
      'type' => MENU_CALLBACK,
      'callback' => 'ajaxsubmit_ics'
    ); 
  }
  return $items;
}

hope this helps someone. kick ass patch by the way.

bobdalob’s picture

good to see progress on this - it's starting to work better than before.
I tried this (patch+modification #9) however I report the following problems:

* if comment editing is available, editing loads a standard comment edit page and things go pear-shaped when trying to preview or post (ajax form). preview doesn't preview, and when user posts the changes there is no confirmation and user is stuck on comment edit page although, when the node is reloaded, the edit has been successfully saved.
* use of comment preview or post using IE7 can [sometimes] trigger progress bar which progresses, slowly, before it reaches half way and the bar then hangs.
* in all browsers, after submitting a comment (not previewing), comment voting via extra voting forms will not work.

ahkiam’s picture

subscribe

develcuy’s picture

Assigned: develcuy » Unassigned
Issue summary: View changes