I use the code from the docs for moveup and movedown, but I looked up
the code in the class file and I needed to modify the function call to
include $model, and some other little adjustments:
=========================
        function moveDown($id = null, $delta = null) {
                if ($id==null) {
                        $this->Session->setFlash('Please enter an id');
                        $this->redirect(array('action' => 'index'), null, true);
                }
                $this->Link->id = $id;
                if ($delta > 0) {
                        $this->Link->moveDown($this->Link, $id, $delta);
                } else {
                        $this->Session->setFlash('Please provide the number of 
positions
the field should be moved down.');
                }
                        $this->redirect(array('action' => 'index'), null,
true);
        }
==============================

I get the following error messages:

==============================
Warning (2): mysql_real_escape_string() expects parameter 1 to be
string, object given [CORE\cake\libs\model\datasources\dbo
\dbo_mysql.php, line 247]
mysql_real_escape_string - [internal], line ??
DboMysql::value() - CORE\cake\libs\model\datasources\dbo
\dbo_mysql.php, line 247
DboSource::__parseKey() - CORE\cake\libs\model\datasources
\dbo_source.php, line 1872
DboSource::conditionKeysToString() - CORE\cake\libs\model\datasources
\dbo_source.php, line 1823
DboSource::conditions() - CORE\cake\libs\model\datasources
\dbo_source.php, line 1713
DboSource::buildStatement() - CORE\cake\libs\model\datasources
\dbo_source.php, line 1242
DboSource::generateAssociationQuery() - CORE\cake\libs\model
\datasources\dbo_source.php, line 1051
DboSource::read() - CORE\cake\libs\model\datasources\dbo_source.php,
line 626
Model::find() - CORE\cake\libs\model\model.php, line 1795
TreeBehavior::moveup() - CORE\cake\libs\model\behaviors\tree.php, line
494
ModelBehavior::dispatchMethod() - CORE\cake\libs\model\behavior.php,
line 166
BehaviorCollection::dispatchMethod() - CORE\cake\libs\model
\behavior.php, line 409
Model::call__() - CORE\cake\libs\model\model.php, line 391
Overloadable::__call() - CORE\cake\libs\overloadable_php5.php, line 59
Link::moveUp() - [internal], line ??
LinksController::moveUp() - APP\controllers\links_controller.php, line
84
Object::dispatchMethod() - CORE\cake\libs\object.php, line 118
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 256

Warning (2): array_values() [function.array-values]: The argument
should be an array [CORE\cake\libs\model\behaviors\tree.php, line 494]
array_values - [internal], line ??
TreeBehavior::moveup() - CORE\cake\libs\model\behaviors\tree.php, line
494
ModelBehavior::dispatchMethod() - CORE\cake\libs\model\behavior.php,
line 166
BehaviorCollection::dispatchMethod() - CORE\cake\libs\model
\behavior.php, line 409
Model::call__() - CORE\cake\libs\model\model.php, line 391
Overloadable::__call() - CORE\cake\libs\overloadable_php5.php, line 59
Link::moveUp() - [internal], line ??
LinksController::moveUp() - APP\controllers\links_controller.php, line
84
Object::dispatchMethod() - CORE\cake\libs\object.php, line 118
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 256
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 230
[main] - APP\webroot\index.php, line 91
=================================

What goes wrong here?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to