related object cache not cleared when adding location

Author Message

Marko Žmak

Tuesday 26 July 2011 6:58:56 am

This is the situation...

I have enabled:

ClearRelationTypes[]=reverse_attribute

I have an object called "Blog frontpage" that has an object relation attribute "Map of authors". This attribute is connected to a folder called "AUTHORS".

I have a user group with users. When I go to a user and add him to the folder AUTHORS (with "Add Location"), the cache for "Blog frontpage" doesn't get cleared (while it should).

And when I (for the same user) remove the "AUTHORS" location, the cache does get cleared.

Is this a bug and can someone confirm it's happening?

I'm using eZP community 2011.6

 

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Gaetano Giunta

Tuesday 26 July 2011 11:56:22 am

"When I go to a user and add him to the folder AUTHORS (with "Add Location", the cache for "Blog frontpage" doesn't get cleared (while it should)."

Not sure it should expire. You're not modifying the object that is related to your blog, but one of its children...

I am in fact more surpries about the cache getting cleared when you remove the user from teh AUTHORS folder ;-)

Principal Consultant International Business
Member of the Community Project Board

Marko Žmak

Wednesday 27 July 2011 1:20:12 am

"

Not sure it should expire. You're not modifying the object that is related to your blog, but one of its children...

I am in fact more surpries about the cache getting cleared when you remove the user from teh AUTHORS folder ;-)

"

I suspected I would get an answer like this... :)

But, look at this logic:

  • when I add a user under AUTHORS I'm changing something about this user object so this triggers the cache clearing mechanism for the parents of the user
  • since the AUTHORS now is a parent of the user object, it's cache clearing mechanism is tiggered
  • and since I enabled reverse_attribute clear relation type, the cache clearing for AUTHORS should trigger the cache clearing for the Blog frontpage

It sounds logical to me...

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Gaetano Giunta

Wednesday 27 July 2011 6:18:22 am

But you need to take into account recursion: if you expire the cache of the parent node in a recursive manner, he will expire his own parent and so on...

I'm not really sure this is clear cut, but whenever a node (other than the currently edited one) is expired based on either standard expiry rules or smart view cache ones, eZ does not recurse cache expiration.

Principal Consultant International Business
Member of the Community Project Board

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 29 2025 13:44:34
Script start
Timing: Jan 29 2025 13:44:34
Module start 'layout'
Timing: Jan 29 2025 13:44:34
Module start 'content'
Timing: Jan 29 2025 13:44:34
Module end 'content'
Timing: Jan 29 2025 13:44:34
Script end

Main resources:

Total runtime0.0127 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0040 588.3594151.2266
Module start 'layout' 0.00400.0022 739.585936.6875
Module start 'content' 0.00630.0051 776.273495.0313
Module end 'content' 0.01140.0012 871.304733.9766
Script end 0.0126  905.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002116.3761140.0001
Check MTime0.00097.3209140.0001
Mysql Total
Database connection0.00065.117910.0006
Mysqli_queries0.001914.975130.0006
Looping result0.00000.071610.0000
Template Total0.00097.310.0009
Template load0.00075.671510.0007
Template processing0.00021.587310.0002
Override
Cache load0.00054.050210.0005
General
dbfile0.00139.957180.0002
String conversion0.00000.037740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs