Hi maximpodorov,

I have tried loading ajax blocks using eg, latest comment but when I tried a views block it not loaded. Does ajax block also support views block with ajax turn off?

Comments

maximpodorov’s picture

Yes, the module's primary goal is to show view content.

mstrelan’s picture

I couldn't get this to work with a View either. The view I tried was a jCarousel style using jcarousel module, not sure if that affects it. I also had the ajax setting disabled and all cache settings in the view disabled.

kansaj’s picture

I confirm the problem.

jvc26’s picture

I also confirm the issue.

maximpodorov’s picture

The fix is committed. Could you try ajaxblocks 7.x-1.2?

ClaudeS-1’s picture

Just trying AjaxBlocks for the first time, have downloaded 7.x-1.2, testing with Boost enabled, and I'm unable to get blocks to load with AJAX whatever settings I try. One block is a View, the other is a Webform that is configured to be available as a block.

maximpodorov’s picture

What makes disabling boost?

ClaudeS-1’s picture

Some more info:

If I tick "anonymous users" for Load the block on cached pages for these roles only, and leave anonymous user Load the block on uncached pages for these roles only unchecked, there's no sign of any change, no AJAX Block mention around the block. The cached file is created by Boost, and then served every time after. The cached file has no AJAX Block code.

If I now tick "anonymous users" for Load the block on uncached pages for these roles only (it's the same if anon users for load on cached pages is ticked or not), the cached file that is created DOES contain an AJAX Block wrapper class, with an empty script tag, and a full noscript tag. The block is not rendered (only the title), and the block content is not loaded by AJAX.
If I then disable the noscript setting in AJAX Block, the AJAX Block wrapper class that is generated is completely empty.

It looks like AJAX Block is in Drupal's header of JS to load, and it looks like there are correct parameters loaded:

"ajaxblocks_path":"http:\/\/my.domain.com\/ajaxblocks","ajaxblocks":"blocks=views-latest_news-block\u0026path=taxonomy\/term\/136"

but it doesn't seem to be doing anything beyond that...

Do you mean "what difference does disabling boost make"?

I have tried that, and AJAX Blocks works fine, but given that I'm only using AJAX Blocks because I need to use Boost, it has to work with Boost.

Hopefully all of that helps you figure out what's going on.

maximpodorov’s picture

Title: Views block content are not loaded in Ajax Blocks » Fix Boost integration
divined’s picture

Version: 7.x-1.x-dev » 7.x-1.3

It is still not working with boost.

divined’s picture

With Varnish dont work too!!!

nimi’s picture

Same problem for me too. Boost module doesn't work on pages with Ajax blocks for anonymous users.

Nimi

volker23’s picture

Same here... i have tried to use a views block that shows content randomly. But with no effect, boost caches the first display and then there's no change anymore...

destinationsound’s picture

Issue summary: View changes

Still seems to be broken for the 1.3 version of this module. I first enable Boost and set it up. Everything is working fine. View Page source and shows boost is caching, check folder and i see the .html cache.

I then install this module and enable it. Boost still working.
I then go to a block and turn on the AJAX function now present.
It doesnt work so i try and enable the "Load the block on uncached pages for these roles only" aswell.

I then go to my page and the block is now being displayed with AJAX but, the page is no longer cached by Boost.

I view page source and it no longer shows boost is caching.
I turn off the AJAX Blocks module and then uninstall it, Boost still doesn't work.
I had to then uninstall Boost and start over.

marcoka’s picture

First problem

this moduel checks

 if ((module_exists('boost')) && (isset($GLOBALS['_boost'])) && (isset($GLOBALS['_boost']['cache_this'])) && ($GLOBALS['_boost']['cache_this'])) {
    //TODO check 403 and 404 for Boost: boost_get_http_status 403 404 for anon -> uncached
    $page_cacheable = TRUE;
    return $page_cacheable;
  }

cache_this doesnt exist anymore the array si called [is_cacheable] and is set TRUE or FALSE

so change it to

 if ((module_exists('boost')) && (isset($GLOBALS['_boost'])) && (isset($GLOBALS['_boost']['is_cacheable'])) && ($GLOBALS['_boost']['is_cacheable'])) {
    //TODO check 403 and 404 for Boost: boost_get_http_status 403 404 for anon -> uncached
    $page_cacheable = TRUE;
    return $page_cacheable;
  }

then boost will still not cache

Second Problem

you set drupal_page_is_cacheable(TRUE); on line 222. This will also prevent boost from ever caching the page.

If you fix those two. boost will cache.

if you have a flag block
be aware that anonymous flagging disables the cache on every page where the flag block is shown. i hacked views_flag_refresh to set that cache to TRUE again.

dnotes’s picture

Version: 7.x-1.3 » 7.x-1.4
Status: Active » Needs review
StatusFileSize
new704 bytes

Patch based on marcoka's work in #15. I found that the drupal_page_is_cacheable(FALSE) on line 221 did not prevent boost from caching the page, but just the block returned by ajaxblocks. I think that may have been the intention, so I've left that as is.

dnotes’s picture

patoshi’s picture

using 7-1.4 and still not working with boost, doesn't load via js. My block is a Views block (price list of my products via commerce with add to cart button).

vincent_jo’s picture

Hi,
any progress in this issue?
Ajax block doesn´t work for me too. Version 1.4 + patch from #16. No success.
I have a news site. I need some, few blocks not to be cached by boost.
I hoped ajax block will do the job.

thanks
Vincent