Warning (2): Missing argument 1 for ElementsController::featured(), called in /home/dodonieu/public_html/cake/libs/object.php on line 115 and defined [APP/controllers/elements_controller.php, line 112]
Code }
function featured($category_id) {
ElementsController::featured() - APP/controllers/elements_controller.php, line 112
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
Object::requestAction() - CORE/cake/libs/object.php, line 100
include - APP/views/elements/featured.ctp, line 1
View::_render() - CORE/cake/libs/view/view.php, line 662
View::element() - CORE/cake/libs/view/view.php, line 343
include - APP/views/pages/categories.ctp, line 24
View::_render() - CORE/cake/libs/view/view.php, line 662
View::render() - CORE/cake/libs/view/view.php, line 376
Controller::render() - CORE/cake/libs/controller/controller.php, line 774
PagesController::products() - APP/controllers/pages_controller.php, line 227
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
[main] - APP/webroot/index.php, line 84
Notice (8): Undefined variable: category_id [APP/controllers/elements_controller.php, line 114]
Code function featured($category_id) {
$allChildren = $this->Category->children($category_id, false, array('Category.id'));
ElementsController::featured() - APP/controllers/elements_controller.php, line 114
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
Object::requestAction() - CORE/cake/libs/object.php, line 100
include - APP/views/elements/featured.ctp, line 1
View::_render() - CORE/cake/libs/view/view.php, line 662
View::element() - CORE/cake/libs/view/view.php, line 343
include - APP/views/pages/categories.ctp, line 24
View::_render() - CORE/cake/libs/view/view.php, line 662
View::render() - CORE/cake/libs/view/view.php, line 376
Controller::render() - CORE/cake/libs/controller/controller.php, line 774
PagesController::products() - APP/controllers/pages_controller.php, line 227
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
[main] - APP/webroot/index.php, line 84
Notice (8): Undefined variable: category_id [APP/controllers/elements_controller.php, line 116]
Code |
Context$allChildren = array(
"217",
"218",
"223",
"220",
"221",
"219",
"222",
null
)
$allChildren = $this->Category->children($category_id, false, array('Category.id'));
$allChildren = Set::combine($allChildren, '{n}.Category.id', '{n}.Category.id');
$allChildren[] = $category_id;
ElementsController::featured() - APP/controllers/elements_controller.php, line 116
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
Object::requestAction() - CORE/cake/libs/object.php, line 100
include - APP/views/elements/featured.ctp, line 1
View::_render() - CORE/cake/libs/view/view.php, line 662
View::element() - CORE/cake/libs/view/view.php, line 343
include - APP/views/pages/categories.ctp, line 24
View::_render() - CORE/cake/libs/view/view.php, line 662
View::render() - CORE/cake/libs/view/view.php, line 376
Controller::render() - CORE/cake/libs/controller/controller.php, line 774
PagesController::products() - APP/controllers/pages_controller.php, line 227
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
[main] - APP/webroot/index.php, line 84
Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND `I18n__name`.`locale` = 'en' AND NOT (`I18n__name`.`content` = '') ORDER' at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 514]
Code |
Context$sql = "SELECT `Product`.`retail`, `Product`.`bulk`, `Product`.`reduction`, `Product`.`slug`, `Product`.`image`, `Category`.`slug`, `I18n__name`.`content`, `Product`.`id` FROM `products` AS `Product` LEFT JOIN `i18n` AS `I18n__name` ON (`Product`.`id` = `I18n__name`.`foreign_key` AND `I18n__name`.`model` = 'Product' AND `I18n__name`.`field` = 'name' AND `I18n__name`.`locale` = 'en') LEFT JOIN `categories` AS `Category` ON (`Product`.`categories_id` = `Category`.`id`) LEFT JOIN `customer_groups` AS `CustomerGroup` ON (`Product`.`customer_groups_id` = `CustomerGroup`.`id`) WHERE `Product`.`published`=1 AND `Product`.`featured`=1 AND `Product`.`categories_id` IN (217,218,223,220,221,219,222,) AND `I18n__name`.`locale` = 'en' AND NOT (`I18n__name`.`content` = '') ORDER BY `Product`.`id` ASC LIMIT 3"
$error = "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND `I18n__name`.`locale` = 'en' AND NOT (`I18n__name`.`content` = '') ORDER' at line 1"
$out = null
$out = null;
if ($error) {
trigger_error("<span style = \"color:Red;text-align:left\"><b>SQL Error:</b> {$this->error}</span>", E_USER_WARNING);
DboSource::showQuery() - CORE/cake/libs/model/datasources/dbo_source.php, line 514
DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 201
DboSource::fetchAll() - CORE/cake/libs/model/datasources/dbo_source.php, line 337
DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php, line 636
Model::find() - CORE/cake/libs/model/model.php, line 1956
Model::findAll() - CORE/cake/libs/model/model.php, line 2821
ElementsController::featured() - APP/controllers/elements_controller.php, line 120
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 245
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 211
Object::requestAction() - CORE/cake/libs/object.php, line 100
include - APP/views/elements/featured.ctp, line 1
View::_render() - CORE/cake/libs/view/view.php, line 662
View::element() - CORE/cake/libs/view/view.php, line 343
include - APP/views/pages/categories.ctp, line 24
View::_render() - CORE/cake/libs/view/view.php, line 662
View::render() - CORE/cake/libs/view/view.php, line 376
Query: SELECT `Product`.`retail`, `Product`.`bulk`, `Product`.`reduction`, `Product`.`slug`, `Product`.`image`, `Category`.`slug`, `I18n__name`.`content`, `Product`.`id` FROM `products` AS `Product` LEFT JOIN `i18n` AS `I18n__name` ON (`Product`.`id` = `I18n__name`.`foreign_key` AND `I18n__name`.`model` = 'Product' AND `I18n__name`.`field` = 'name' AND `I18n__name`.`locale` = 'en') LEFT JOIN `categories` AS `Category` ON (`Product`.`categories_id` = `Category`.`id`) LEFT JOIN `customer_groups` AS `CustomerGroup` ON (`Product`.`customer_groups_id` = `CustomerGroup`.`id`) WHERE `Product`.`published`=1 AND `Product`.`featured`=1 AND `Product`.`categories_id` IN (217,218,223,220,221,219,222,) AND `I18n__name`.`locale` = 'en' AND NOT (`I18n__name`.`content` = '') ORDER BY `Product`.`id` ASC LIMIT 3