For reproducing this bug yuo should use drag and drop option for reordering objects in the list. If object has any permission options set, once you change the order of that object in the list, JModel->storeorder() method (JTable defined function I suppose) is reseting permissions to defaults.
Permissions untouched and order applied.
Order applied but permissions reset to default.
Joomla 3.4.1
In most cases I saw the usage like this:
public function saveOrderAjax()
{
$pks = $this->input->post->get('cid', array(), 'array');
$order = $this->input->post->get('order', array(), 'array');
// Sanitize the input.
JArrayHelper::toInteger($pks);
JArrayHelper::toInteger($order);
// Get the model.
$model = $this->getModel();
// Save the ordering.
$return = $model->saveorder($pks, $order);
if ($return)
{
echo "1";
}
// Close the application.
JFactory::getApplication()->close();
}
I think it should be changed in favor of using JSON result here like this:
public function saveOrderAjax()
{
$pks = $this->input->post->get('cid', array(), 'array');
$order = $this->input->post->get('order', array(), 'array');
// Sanitize the input.
JArrayHelper::toInteger($pks);
JArrayHelper::toInteger($order);
// Get the model.
$model = $this->getModel();
// Save the ordering.
echo json_encode($model->saveorder($pks, $order));
// Close the application.
JFactory::getApplication()->close();
}
Build | 3.4.1 | ⇒ | staging |
I can't reproduce, but while testing discovered http://issues.joomla.org/tracker/joomla-cms/7251
I couldn't reproduce this on any Joomla component along side Joomla (com_content for instance). Talked with Javi about this, and it might be a problem problem with component I am working on. Feel free to close this one.
About 2nd part, I am aware of JResponseJson, and I believe we should go with it instead of outputing "1" as result of success there.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-23 07:53:41 |
Closed_By | ⇒ | brianteeman |
Closed as requested
For the first part (permissions reseting).
Could you provide more details about "object", are you using third application or 1 component from joomla?
What are thoose "permission options" ?
About the second part (json response)
see that: JResponseJson / Generating json