For some reason the bakery login redirected me to other article and I've posted this on the wrong page, so here I post it again:
---
One issue i ran into: the auto loader won't save the loader_instance on the first run (for initialize) so i've changed the loaderExecute method to: <?php
function loaderExecute($method) {
foreach (App::objects('plugin') as $plugin) {
$loader_file = Inflector::underscore($plugin).'_auto_loader';
$loader_class = Inflector::classify($loader_file);
$loader_instance = null;
if (!ClassRegistry::isKeySet($loader_class)) {
App::import('Plugin', $loader_class, Inflector::underscore($plugin).DS.$loader_file.'.php');
if (class_exists($loader_class)) {
ClassRegistry::addObject($loader_class, new $loader_class());
}
}
$loader_instance =& ClassRegistry::getObject($loader_class);
if (!empty($loader_instance) && in_array($method, get_class_methods($loader_class))) {
$loader_instance->{$method}($this->__controller);
}
}
}
?>
and now it works.
thanks for sharing!
One issue i ran into: the auto loader won't save the loader_instance on the first run (for initialize) so i've changed the loaderExecute method to: function loaderExecute($method) {
foreach (App::objects('plugin') as $plugin) {
$loader_file = Inflector::underscore($plugin).'_auto_loader';
$loader_class = Inflector::classify($loader_file);
$loader_instance = null;
if (!ClassRegistry::isKeySet($loader_class)) {
App::import('Plugin', $loader_class, Inflector::underscore($plugin).DS.$loader_file.'.php');
if (class_exists($loader_class)) {
ClassRegistry::addObject($loader_class, new $loader_class());
}
}
$loader_instance =& ClassRegistry::getObject($loader_class);
if (!empty($loader_instance) && in_array($method, get_class_methods($loader_class))) {
$loader_instance->{$method}($this->__controller);
}
}
}
and now it works.
thanks for sharing!
unset($Model->data[$Model->alias][$field]);
And it was overwriting the fields on the original model when I used an associative array for the 'fields' setting. I've changed that line to:
unset($Model->data[$Model->alias][$translatable_field]);
And now seems to be using the except parameter correctly :)
cheers!
---
One issue i ran into: the auto loader won't save the loader_instance on the first run (for initialize) so i've changed the loaderExecute method to:
and now it works.<?php
function loaderExecute($method) {
foreach (App::objects('plugin') as $plugin) {
$loader_file = Inflector::underscore($plugin).'_auto_loader';
$loader_class = Inflector::classify($loader_file);
$loader_instance = null;
if (!ClassRegistry::isKeySet($loader_class)) {
App::import('Plugin', $loader_class, Inflector::underscore($plugin).DS.$loader_file.'.php');
if (class_exists($loader_class)) {
ClassRegistry::addObject($loader_class, new $loader_class());
}
}
$loader_instance =& ClassRegistry::getObject($loader_class);
if (!empty($loader_instance) && in_array($method, get_class_methods($loader_class))) {
$loader_instance->{$method}($this->__controller);
}
}
}
?>
thanks for sharing!
and now it works.function loaderExecute($method) {
foreach (App::objects('plugin') as $plugin) {
$loader_file = Inflector::underscore($plugin).'_auto_loader';
$loader_class = Inflector::classify($loader_file);
$loader_instance = null;
if (!ClassRegistry::isKeySet($loader_class)) {
App::import('Plugin', $loader_class, Inflector::underscore($plugin).DS.$loader_file.'.php');
if (class_exists($loader_class)) {
ClassRegistry::addObject($loader_class, new $loader_class());
}
}
$loader_instance =& ClassRegistry::getObject($loader_class);
if (!empty($loader_instance) && in_array($method, get_class_methods($loader_class))) {
$loader_instance->{$method}($this->__controller);
}
}
}
thanks for sharing!
Keep the great job, guys!