Invalid argument supplied for foreach()
-
/var/www/vhosts/mcf.rs/httpdocs/VectorCMS/Config/functions.conf.php : 143
136 *137 * @return array The sorted array. Any keys not found in the $sort array will be appended to the138 * end, in the original order.139 */140 function manualSort($array, $sort) {141 $result = [];142143 foreach ($sort as $key) {144 if (key_exists($key, $array)) {145 $result[$key] = $array[$key];146 unset($array[$key]);147 }148 }149150 return $result + $array;151 }
-
AppErrorHandler
::
handleError
(
integer: 2
, Invalid argument supplied for foreach()
, /var/www/vhosts/mcf.rs/httpdocs/VectorCMS/Config/functions.conf.…
, integer: 143
, Array
(
[array] => Array
(
[1549] => Arr…
)
/var/www/vhosts/mcf.rs/httpdocs/VectorCMS/Config/functions.conf.php : 143136 *137 * @return array The sorted array. Any keys not found in the $sort array will be appended to the138 * end, in the original order.139 */140 function manualSort($array, $sort) {141 $result = [];142143 foreach ($sort as $key) {144 if (key_exists($key, $array)) {145 $result[$key] = $array[$key];146 unset($array[$key]);147 }148 }149150 return $result + $array;151 } -
manualSort
(
Array
(
[1549] => Array
(
[News] => Arra…
, News.published
)
/var/www/vhosts/mcf.rs/httpdocs/VectorCMS/Model/Behavior/DefaultBehavior.php : 205198 }199 }200 }201 }202203 // Manual sort204 if (property_exists($Model, 'sort')) {205 $results = manualSort($results, $Model->sort);206 unset($Model->sort);207 }208 }209 Timer::endLoop('DefaultBehavior::afterFind()');210211 return $results;212 }213 -
DefaultBehavior
➝
afterFind
(
News Object
(
[isModule] => 1
[moduleId] => 5
[modul…
, Array
(
[1549] => Array
(
[News] => Arra…
, boolean: true
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Utility/ObjectCollection.php : 128121 $collected = array();122 $list = array_keys($this->_enabled);123 if ($options['modParams'] !== false && !isset($params[$options['modParams']])) {124 throw new CakeException(__d('cake_dev', 'Cannot use modParams with indexes that do not exist.'));125 }126 $result = null;127 foreach ($list as $name) {128 $result = call_user_func_array(array($this->_loaded[$name], $callback), compact('subject') + $params);129 if ($options['collectReturn'] === true) {130 $collected[] = $result;131 }132 if ($options['break'] && ($result === $options['breakOn'] ||133 (is_array($options['breakOn']) && in_array($result, $options['breakOn'], true)))134 ) {135 return $result;136 } elseif ($options['modParams'] !== false && !in_array($result, array(true, false, null), true)) { -
ObjectCollection
➝
trigger
(
afterFind
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Event/CakeEventManager.php : 243236 foreach ($listeners as $listener) {237 if ($event->isStopped()) {238 break;239 }240 if ($listener['passParams'] === true) {241 $result = call_user_func_array($listener['callable'], $event->data);242 } else {243 $result = call_user_func($listener['callable'], $event);244 }245 if ($result === false) {246 $event->stopPropagation();247 }248 if ($result !== null) {249 $event->result = $result;250 }251 } -
CakeEventManager
➝
dispatch
(
HUGE CakeEvent
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Model/Model.php : 33523345 * @param bool $primary If this is the primary model results (results from model where the find operation was performed)3346 * @return array Set of filtered results3347 * @triggers Model.afterFind $this, array($results, $primary)3348 */3349 protected function _filterResults($results, $primary = true) {3350 $event = new CakeEvent('Model.afterFind', $this, array($results, $primary));3351 $event->modParams = 0;3352 $this->getEventManager()->dispatch($event);3353 return $event->result;3354 }33553356 /**3357 * This resets the association arrays for the model back3358 * to those originally defined in the model. Normally called at the end3359 * of each call to Model::find()3360 * -
Model
➝
_filterResults
(
Array
(
[0] => Array
(
[News] => Array
…
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Model/Model.php : 30423035 * @return array3036 */3037 protected function _readDataSource($type, $query) {3038 $results = $this->getDataSource()->read($this, $query);3039 $this->resetAssociations();30403041 if ($query['callbacks'] === true || $query['callbacks'] === 'after') {3042 $results = $this->_filterResults($results);3043 }30443045 $this->findQueryType = null;30463047 if ($this->findMethods[$type] === true) {3048 return $this->{'_find' . ucfirst($type)}('after', $query, $results);3049 }3050 } -
Model
➝
_readDataSource
(
all
, Array
(
[conditions] => Array
(
[News.is…
)
/var/www/vhosts/mcf.rs/httpdocs/VectorCMS/Model/AppModel.php : 162616191620 # Read from database1621 if (empty($data)) {1622 Timer::startLoop('Model::find()');1623 {16241625 $this->getDatasource()->fullDebug = false;1626 $data = $this->_readDataSource($type, $params);16271628 if ($enabled) {16291630 # Save the cache1631 $lastQuery = $this->getLastQuery(true, "\n");1632 if ($lastQuery) {1633 if ($useStandardCache) {1634 Cache::write($file, $lastQuery . $separator . serialize($data)); -
AppModel
➝
find
(
all
, Array
(
[conditions] => Array
(
[News.is…
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Controller/Component/PaginatorComponent.php : 196189 $conditions, $fields, $order, $limit, $page, $recursive, $extra190 );191 } else {192 $parameters = compact('conditions', 'fields', 'order', 'limit', 'page');193 if ($recursive != $object->recursive) {194 $parameters['recursive'] = $recursive;195 }196 $results = $object->find($type, array_merge($parameters, $extra));197 }198 $defaults = $this->getDefaults($object->alias);199 unset($defaults[0]);200201 if (!$results) {202 $count = 0;203 } elseif ($object->hasMethod('paginateCount')) {204 $count = $object->paginateCount($conditions, $recursive, $extra); -
PaginatorComponent
➝
paginate
(
News Object
(
[isModule] => 1
[moduleId] => 5
[modul…
, Array
(
)
, Array
(
)
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Controller/Controller.php : 10871080 * @param Model|string $object Model to paginate (e.g: model instance, or 'Model', or 'Model.InnerModel')1081 * @param string|array $scope Conditions to use while paginating1082 * @param array $whitelist List of allowed options for paging1083 * @return array Model query results1084 * @link http://book.cakephp.org/2.0/en/controllers.html#Controller::paginate1085 */1086 public function paginate($object = null, $scope = array(), $whitelist = array()) {1087 return $this->Components->load('Paginator', $this->paginate)->paginate($object, $scope, $whitelist);1088 }10891090 /**1091 * Called before the controller action. You can use this method to configure and customize components1092 * or perform logic that needs to happen before each controller action.1093 *1094 * @return void1095 * @link http://book.cakephp.org/2.0/en/controllers.html#request-life-cycle-callbacks -
Controller
➝
paginate
(
News
)
/var/www/vhosts/mcf.rs/httpdocs/VectorCMS/Controller/FrontController.php : 171164 $query = $order + $limit + $offset + $conditions;165166 # Pagination parameters167 $query = $this->Module->alterPaginationParams($query, $this->request);168 if (!empty($params['paginate'])) {169 $query['limit'] = (int) $params['paginate'];170 $this->paginate[$params['module']] = [ 'recursive' => 1 ] + $query;171 $this->set($plural, $this->paginate($params['module']));172 } else {173 $this->set($plural, $this->Module->find('all', $query));174 }175 }176 }177 $this->request->pageLinks = $this->pageLinks;178179 $this->set('page', $this->page); -
FrontController
➝
beforeFilter
(
HUGE CakeEvent
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Event/CakeEventManager.php : 243236 foreach ($listeners as $listener) {237 if ($event->isStopped()) {238 break;239 }240 if ($listener['passParams'] === true) {241 $result = call_user_func_array($listener['callable'], $event->data);242 } else {243 $result = call_user_func($listener['callable'], $event);244 }245 if ($result === false) {246 $event->stopPropagation();247 }248 if ($result !== null) {249 $event->result = $result;250 }251 } -
CakeEventManager
➝
dispatch
(
HUGE CakeEvent
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Controller/Controller.php : 677670 * - triggers Component `startup` methods.671 *672 * @return void673 * @triggers Controller.initialize $this674 * @triggers Controller.startup $this675 */676 public function startupProcess() {677 $this->getEventManager()->dispatch(new CakeEvent('Controller.initialize', $this));678 $this->getEventManager()->dispatch(new CakeEvent('Controller.startup', $this));679 }680681 /**682 * Perform the various shutdown processes for this controller.683 * Fire the Components and Controller callbacks in the correct order.684 *685 * - triggers the component `shutdown` callback. -
Controller
➝
startupProcess
(
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Routing/Dispatcher.php : 189182 *183 * @param Controller $controller Controller to invoke184 * @param CakeRequest $request The request object to invoke the controller for.185 * @return CakeResponse the resulting response object186 */187 protected function _invoke(Controller $controller, CakeRequest $request) {188 $controller->constructClasses();189 $controller->startupProcess();190191 $response = $controller->response;192 $render = true;193 $result = $controller->invokeAction($request);194 if ($result instanceof CakeResponse) {195 $render = false;196 $response = $result;197 } -
Dispatcher
➝
_invoke
(
HUGE FrontController
, CakeRequest Object
(
[params] => Array
(
…
)
/var/www/vhosts/mcf.rs/httpdocs/lib/Cake/Routing/Dispatcher.php : 167160 if (!($controller instanceof Controller)) {161 throw new MissingControllerException(array(162 'class' => Inflector::camelize($request->params['controller']) . 'Controller',163 'plugin' => empty($request->params['plugin']) ? null : Inflector::camelize($request->params['plugin'])164 ));165 }166167 $response = $this->_invoke($controller, $request);168 if (isset($request->params['return'])) {169 return $response->body();170 }171172 $afterEvent = new CakeEvent('Dispatcher.afterDispatch', $this, compact('request', 'response'));173 $this->getEventManager()->dispatch($afterEvent);174 $afterEvent->data['response']->send();175 } -
Dispatcher
➝
dispatch
(
CakeRequest Object
(
[params] => Array
(
…
, CakeResponse Object
(
[_statusCodes:protected] => Array
…
)
/var/www/vhosts/mcf.rs/httpdocs/VectorCMS/webroot/index.php : 156149 # Cronjob handler150 if (isset($argc) && $argc == 2 && isCLI()) {151 define('CRONJOB', $argv[1]);152 $Dispatcher->dispatch(new CakeRequest($argv[1]), new CakeResponse());153 exit;154 }155156 $Dispatcher->dispatch(new CakeRequest(), new CakeResponse([ 'charset' => Configure::read('App.encoding') ]));157