Hi there,

Looks like my fix didn't work. I tried:


Index: /var/www/html/myapp/lib/Cake/Model/Datasource/DboSource.php
===================================================================
--- /var/www/html/myapp/lib/Cake/Model/Datasource/DboSource.php
+++ /var/www/html/myapp/lib/Cake/Model/Datasource/DboSource.php
@@ -3087,7 +3087,9 @@
  */
        public function __destruct() {
                if ($this->_methodCacheChange) {
-                       Cache::write('method_cache', self::$methodCache,
'_cake_core_');
+                       if (!empty(self::$methodCache)) {
+                               Cache::write('method_cache', self::
$methodCache, '_cake_core_');
+                       }
                }
        }

and this seems better, for now... :-)

Kind regards,
Derik

On Thu, 2011-10-20 at 23:11 -0700, J.W.F. Thirion wrote:

> Dear Community,
> 
> Not sure if this is the right place, but here goes. I've upgraded an
> application from 1.3.10 to 2.0.0 and now get the following error:
> 
> "Fatal error: Access to undeclared static property: DboSource::
> $methodCache in /var/www/html/myapp/lib/Cake/Model/Datasource/
> DboSource.php on line 3090"
> 
> I'm using a master-slave setup and have modified the AppModel
> callbacks appropriately (as explained on one of the bakery pages). For
> Cake 1.3 this works nicely, but on 2.0 I get the error above. I have
> modified the cake code (I know I shouldn't :-) ) as follows:
> 
> Index: /var/www/html/myapp/lib/Cake/Model/Datasource/DboSource.php
> ===================================================================
> --- /var/www/html/myapp/lib/Cake/Model/Datasource/DboSource.php
> +++ /var/www/html/myapp/lib/Cake/Model/Datasource/DboSource.php
> @@ -3087,6 +3087,9 @@
>   */
>         public function __destruct() {
>                 if ($this->_methodCacheChange) {
> +                       if (empty(self::$methodCache)) {
> +                               self::$methodCache =
> Cache::read('method_cache', '_cake_core_');
> +                       }
>                         Cache::write('method_cache', self::
> $methodCache, '_cake_core_');
>                 }
>         }
> 
> This solved the problem and I no longer get the messages. Is this a
> bug and is my fix above the correct solution?
> 
> Many thanks in advance!
> 
> Kind regards,
> Derik


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to