When you've got facets with "checkboxes and links" enabled on a Solr search page the checkboxes will be displayed when you're logged in.

Anonymous users on the other hand will not see the checkboxes when block caching is enabled. They just see links.
Turning block caching off fixes the problem with the checkboxes, but of course turns block caching off...

Files: 
CommentFileSizeAuthor
#4 checkboxes-with-cache-1621034-4.patch1013 bytescpliakas
PASSED: [[SimpleTest]]: [MySQL] 566 pass(es).
[ View ]
#3 checkboxes-with-cache-1621034-3.patch1013 bytescpliakas
PASSED: [[SimpleTest]]: [MySQL] 566 pass(es).
[ View ]

Comments

This is probably because the javascript that converts the links to checkboxes is added in the block rendering logic which is not executed when the block is cached. Therefore it is not added when the data is cached.

Thanks for posting,
Chris

Looks like the technique at http://www.jaypan.com/tutorial/adding-css-and-js-cached-block-drupal-7 should fix the issue.

Version:7.x-1.0-rc4» 7.x-1.x-dev
Status:Active» Needs review
StatusFileSize
new1013 bytes
PASSED: [[SimpleTest]]: [MySQL] 566 pass(es).
[ View ]

The attached patch moved the JS including into an #attached property.

StatusFileSize
new1013 bytes
PASSED: [[SimpleTest]]: [MySQL] 566 pass(es).
[ View ]

Re-thinking location of the #attached so it is in the base widget class.

Bumping to first page.

#4: checkboxes-with-cache-1621034-4.patch queued for re-testing.

Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Issue summary:View changes
Status:Closed (fixed)» Needs work

I still have this problem. To solve it, I changed the line of code in adapter.inc from:

<?php
  drupal_add_js
($merge_settings, 'setting');
?>

to:

<?php
  $build
['#attached']['js'][] = array(
   
'data' => $merge_settings,
   
'type' => 'setting',
  );
?>

It works for me perfectly.