Hi! I use module asaf (http://drupal.org/project/asaf) for ajax submit node add form. This module implements hook_form_alter and adds #ajax for buttons. Like this:

<?php
//...
if (!empty($element['#asaf_control'])) {
    $element += array(
      '#type' => 'submit',
      '#attributes' => array(),
      '#id' => drupal_html_id(asaf_get_id($key, $form_state)),
      '#ajax' => array(
        'callback' => 'asaf_ajax_callback',
        'path' => $form_state['asaf']['options'][ASAF_SETTINGS_PAGE_CACHE] ? 'system/ajax/asaf/pagecache' : 'system/ajax',
        'wrapper' => asaf_get_area_wrapper_id(!empty($element['#asaf_target_area']) ? (is_array($element['#asaf_target_area']) ? reset($element['#asaf_target_area']) : $element['#asaf_target_area']) : 'form', $form_state),
        'progress' => array(
          'type' => 'throbber',
          'message' => ''
        )
      ),
    );
//...
?>

Problem is that when i do submit form, page reloaded (ajax not work). It is noteworthy that all works in other themes (Seven, Bartik, Garland, Tao, my custom theme, etc.) and not works in rubik theme. I compared the behavior module asaf in different themes and found strange feature. Ajax callback ('callback' => 'asaf_ajax_callback',) not called, if i'm use rubik theme. But others themes 'asaf_ajax_callback' called. I think it because the rubik changes actions buttons. But i can not find where it happens. Because of which this can be ?

CommentFileSizeAuthor
#2 rubik-ajax-calls-2479367-2.patch2.14 KBjamessw
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

h1nds1ght’s picture

I have the same problem. I was wondering why ajax was not working anymore and therefore I looked into my modules list and I also had asaf installed but disabled. After deinstalling asaf (and clearing the caches - just to be sure) the problem still persists, so maybe in my case this might not really be related to asaf. Nevertheless in all other themes (as in your case) the ajax callbacks are working.

The really really strange thing is that I also have drupalchat installed. As soon as I edit a display of a content type the chat window pops up (even though it has not the permission since drupalchat should be disabled in the admin interface). So in general ajax is not working with rubik for me and therefore I always have to switch the theme if I really have to edit a page which uses ajax.

Therefore I really hope there will be a solution for this problem soon, since I love rubik...

jamessw’s picture

Category: Support request » Bug report
FileSize
2.14 KB

Are there any Javascript errors showing up in your console? My current thought is that an incomplete version of the page is loaded when AJAX is called, meaning that Drupal.settings.rubik is not defined. This patch catches that.

h1nds1ght’s picture

Unfortunately there are no errors in my console, otherwise I would have a starting point.

Nevertheless I tried the patch but it didn't change anything. The ajax throbber is just rotating all the time after ajax gets triggered. Even if I wait some minutes there will be simply no result and the throbber still rotates. My only chance is then to change the theme, trigger ajax, change back to rubik and voila: I changed something via ajax and can watch the result in rubik :/

Edit: Finally I found the reason! I have implemented a custom rubik_form_alter within template.php. Inside this function there was an if condition, which has destroyed the ajax callback (only the condition, not the code inside!). Somehow I wonder why, because it was secured with isset(), has never thrown any PHP Notice and is not called on the specific pages...
I discovered this because I replaced template.php with a "fresh" one. So finally it was my fault and it all works as expected again.... :D

aramboyajyan’s picture

Status: Active » Closed (cannot reproduce)

I just tried this on a clean install with ASAF module, and couldn't reproduce the issue.

Submitting a sample node form works exactly the same as with Seven theme.
Please try the latest dev version of Rubik when testing.

Meanwhile, I'm closing this issue. Feel free to reopen if it still doesn't work for you.

Thanks!

_renify_’s picture

Mine also