updating a node doesn't delete the cache file

harhoo - October 21, 2009 - 09:28
Project:Boost
Version:6.x-1.x-dev
Component:Core compatibility
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I've just upgraded a site (from an oldish version of boost (6.0.8?) to the latest). When I come to add a Boost block I get the following error:

Fatal error: Cannot use string offset as an array in [path to drupal]/includes/form.inc on line 979

(I'm still currently on Drupal 6.13)

Not sure if that's to do with leaping a few upgrades or a bug in the latest version or A.N.Other.

[Also can I just check: in the latest versions of Boost, is it the case that updating a node DOESN'T clear the cache unless the Flush Page is hit on the block (or a rule is set to run cron on update). However, it will (if configured) automatically clear any associated Views?]

#1

harhoo - October 21, 2009 - 09:57

Actually, is line 978. I stuck in a line to try and debug it so shifted it down one. doing a var_dump of the $form value at that stage I get:

array(13) { ["#type"]=>  string(5) "value" ["#value"]=>  string(5) "boost" ["#post"]=>  array(0) { } ["#programmed"]=>  bool(false) ["#tree"]=>  bool(false) ["#parents"]=>  array(1) { [0]=>  string(6) "module" } ["#array_parents"]=>  array(1) { [0]=>  string(6) "module" } ["#weight"]=>  int(0) ["#processed"]=>  bool(false) ["#description"]=>  NULL ["#attributes"]=>  array(0) { } ["#required"]=>  bool(false) ["#input"]=>  bool(true) } array(13) { ["#type"]=>  string(5) "value" ["#value"]=>  string(6) "status" ["#post"]=>  array(0) { } ["#programmed"]=>  bool(false) ["#tree"]=>  bool(false) ["#parents"]=>  array(1) { [0]=>  string(5) "delta" } ["#array_parents"]=>  array(1) { [0]=>  string(5) "delta" } ["#weight"]=>  float(0.001) ["#processed"]=>  bool(false) ["#description"]=>  NULL ["#attributes"]=>  array(0) { } ["#required"]=>  bool(false) ["#input"]=>  bool(true) } array(18) { ["#type"]=>  string(9) "textfield" ["#title"]=>  string(11) "Block title" ["#maxlength"]=>  int(64) ["#description"]=>  string(135) "Override the default title for the block. Use <none> to display no title, or leave blank to use the default block title." ["#default_value"]=>  string(0) "" ["#weight"]=>  int(-18) ["#post"]=>  array(0) { } ["#programmed"]=>  bool(false) ["#tree"]=>  bool(false) ["#parents"]=>  array(1) { [0]=>  string(5) "title" } ["#array_parents"]=>  array(2) { [0]=>  string(14) "block_settings" [1]=>  string(5) "title" } ["#processed"]=>  bool(false) ["#attributes"]=>  array(0) { } ["#required"]=>  bool(false) ["#input"]=>  bool(true) ["#size"]=>  int(60) ["#autocomplete_path"]=>  bool(false) ["#process"]=>  array(2) { [0]=>  string(16) "form_expand_ahah" [1]=>  string(22) "i18n_textfield_process" } } string(187) "�span class="boost cache-status" content="-1">This page is being served live to anonymous visitors, as it is not currently in the static page cache."

which looks odd towards the end.

Also, this only happens when I click on configure: it looks like the block has been added successfully.

#2

mikeytown2 - October 21, 2009 - 10:09

Just tested configure on all 3 boost blocks, all seem to work... any thing else you can tell me?

nodeapi will clear it's own node. If you enable views functionality, any view containing that node.

#3

harhoo - October 21, 2009 - 10:55

I can have a look, but not sure what else to look for. It does seem from the var_dump of $form in includes/form.inc that for some reason the $form variable seems slightly mangled, with a string added at the end. I'll upgrade to 6.14 at some point and see if that makes a difference.

Assuming that nodeapi is supposed by default to clear the cache for that node on update, for some reason is not working for me on either site I have it set up for. (Although the cache is cleared for any views associated with a node fi I have that option turned on).

It's not a big deal (as it works OK for me, giving me a chance to check live edits before clearing the cache to publish). All my sites are either i18n or domain access so not sure whether that's the spanner. Clearing the cache any other way (cron, flush through block, flush through boost config page) works fine.

(Sorry for not being more helpful)

#4

mikeytown2 - October 22, 2009 - 11:11

In terms of your site setup is it a single database doing a multisite? Consider turning on a brand new feature, should clear that node on edit in all your i18n sites at the same time.
admin/settings/performance/boost
Boost advanced settings
"Flush all sites caches in this database (singe db, multisite)."

If you wish to not push out the changes ASAP, look into this setting. File will get flushed on next cron run.
"Expire content in DB, do not flush file."

#5

harhoo - October 23, 2009 - 00:36

I have two separate Drupal instances. One is a 'normal' i18n site and one uses Domain Access so runs several sites of one database. On both sites I have "Flush all sites caches in this database (singe db, multisite)." checked, and on both updating a node doesn't delete the cache file. I'm not sure why that should be the case (as Boost can delete cache files under different circumstances so shouldn't be a permission thing for example or a path thing). I have reset the database on a few occasions, but this shouldn't affect matters?

If there's an alert or anything I can add in to help debug that I'm happy to do so.

[And just so this isn't too whingy; I do genuinely love this module as it makes Drupal usuable for me]

#6

mikeytown2 - October 23, 2009 - 03:23
Version:6.x-1.13» 6.x-1.x-dev
Status:active» needs review

Try this patch with the tomorrows dev. Should be out in about 10 hours. This should fix the node update and del cached file issue.

#7

mikeytown2 - October 23, 2009 - 03:24
AttachmentSize
boost-610398.patch 2.61 KB

#8

mikeytown2 - October 27, 2009 - 09:49

Need to make the patch respect the "Expire content in DB, do not flush file." setting.

#9

mikeytown2 - October 28, 2009 - 03:27
Title:Error with block after upgrade» updating a node doesn't delete the cache file

Sorry for hijacking this thread, but the block issue is minor.

Reworked the boost_expire_node() function. Streamlined it so it should be faster as a result. Also did some more cleanup elsewhere... Testing of this patch would be appreciated.

AttachmentSize
boost-610398.patch 12.11 KB

#10

mikeytown2 - October 28, 2009 - 04:01
AttachmentSize
boost-610398.1.patch 12.11 KB

#11

mikeytown2 - October 28, 2009 - 04:07
Status:needs review» fixed

committed

#12

System Message - November 11, 2009 - 04:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.