l3pp4rd/DoctrineExtensions — Issue #275: Sortable - warning
Author: professor-monkfish
Created: 2012-02-24 14:13:49+00:00
State: open

Warning: call_user_func_array() expects parameter 2 to be array, null given in C:\public_html\teon\library\DoctrineExtensions\lib\Gedmo\Sortable\SortableListener.php on line 235

It seems quite easy to get sortable to error by saving an item whose position has not changed.

lines 215 :

$relocation = null;
if ($newPosition < $oldPosition) {
$relocation = array($hash, $config['useObjectClass'], $groups, $newPosition, $oldPosition, +1);
} elseif ($newPosition > $oldPosition) {
$relocation = array($hash, $config['useObjectClass'], $groups, $oldPosition + 1, $newPosition + 1, -1);
}

you can see that if the newPosition == oldPosition then $relocation is not set (it remains NULL)