Block refresh is:
- always working when the argument is [current-user:user];
- not working when the argument is [current-page:user].
But when there is an ajax event in the views (a flag button views field which is pressed for instance), the block refresh is loading and working, after being triggered by the ajax event.
After searching in the file I found that the scope of the js is 'footer'.
I changed it to 'header' just to see and it works in all situations.
I currently don't know how to suggest a patch, I am not there yet, hopefully arriving there in a few weeks or months. I'll suggest this later on if there aren't any reason why the scope should stay in footer.

The file is block_refresh.module line 19 :

function block_refresh_init() {
  if (user_access(BLOCK_REFRESH_ACCESS_CONTENT_PERMISSION)) {
    <strong>drupal_add_js(drupal_get_path('module', 'block_refresh') . '/js/block_refresh.js', array('scope' => 'footer'));</strong>
    drupal_add_css(drupal_get_path('module', 'block_refresh') . '/css/block_refresh.css');
    drupal_add_js(array(
      'block_refresh' => array(
        'settings' => variable_get('block_refresh_settings', array()),
        'args' => arg(),
        'query' => block_refresh_get_query_as_string(),
      )
    ), 'setting');
  }
}

Comments

Tritof’s picture

Issue summary: View changes
Tritof’s picture

Issue summary: View changes
Tritof’s picture

I just noticed that if I use it with an admin account, it is loaded at first.

Tritof’s picture

Title: Block refresh button appears after event is triggered depending on the argument » Block refresh is not working except for admin if argument is current-page:user
Issue summary: View changes

Actually, after a few more tests, it is all about the arguments, I am updating the issue description

tripper54’s picture

Status: Active » Postponed (maintainer needs more info)

Hi Tritof,

Thanks for reporting. To clarify, so I can reproduce:

* is this a views block you're trying to refresh?
* where are the arguments you mentioned used?

If you can provide a sample view (export) to demonstrate the bug, that would be most helpful.

Thanks

tripper54’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing this as I haven't heard back. Please feel free to reopen with more info if required.