ezpreferences in login.tpl (need a cache-block)

Author Message

Eric Weik

Tuesday 04 January 2005 10:06:44 pm

I'm attempting to update the login.tpl template to output some user information stored in the ezpreferences system. However, the output does not change if the preference has changed until the user logs out and logs back in.

A simple example:
I.e.: I can update a variable (favorite_color) via a link to: /user/preferences/set/favorite_color/blue

And then output it via an override of login.tpl with:
{ezpreference( 'haircolor' )|wash}

It works fine. But if I change favorite_color to green, it will continue to output blue until the user logs out and logs back in. Even clearing all caches does not make it update!

Any suggestions?

liu spider

Tuesday 25 January 2005 8:56:07 pm

I had exactly the same bug.
this is a temporary fix for this issue.

Index: kernel/classes/ezpreferences.php
===================================================================
--- kernel/classes/ezpreferences.php    (revision 10604)
+++ kernel/classes/ezpreferences.php    (working copy)
@@ -107,7 +107,7 @@
                 $db->query( $query );
             }
         }
-        if ( $storeUserID !== false )
+//        if ( $storeUserID !== false )
             eZPreferences::storeInSession( $name, $value );
         return true;
     }

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Frederik Holljen

Wednesday 26 January 2005 1:27:46 am

if this is a bug in eZ publish, can you please report it?

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 18 2025 21:05:57
Script start
Timing: Jan 18 2025 21:05:57
Module start 'layout'
Timing: Jan 18 2025 21:05:57
Module start 'content'
Timing: Jan 18 2025 21:05:57
Module end 'content'
Timing: Jan 18 2025 21:05:57
Script end

Main resources:

Total runtime0.0187 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0080 589.1719152.6406
Module start 'layout' 0.00800.0030 741.812539.4766
Module start 'content' 0.01100.0057 781.289189.4609
Module end 'content' 0.01670.0019 870.750034.3047
Script end 0.0187  905.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002915.2977140.0002
Check MTime0.00116.0969140.0001
Mysql Total
Database connection0.00084.492610.0008
Mysqli_queries0.004021.640730.0013
Looping result0.00000.075210.0000
Template Total0.00168.410.0016
Template load0.00094.631610.0009
Template processing0.00073.776010.0007
Override
Cache load0.00063.154910.0006
General
dbfile0.00137.143980.0002
String conversion0.00000.043440.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