?
avatar PetarT
PetarT
22 Jun 2015

Steps to reproduce the issue

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.

Expected result

Permissions untouched and order applied.

Actual result

Order applied but permissions reset to default.

System information

Joomla 3.4.1

Additional comments

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();
    }
avatar PetarT PetarT - open - 22 Jun 2015
avatar joomla-cms-bot joomla-cms-bot - change - 22 Jun 2015
Build 3.4.1 staging
avatar AteDev
AteDev - comment - 22 Jun 2015

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

avatar javigomez
javigomez - comment - 23 Jun 2015

I can't reproduce, but while testing discovered http://issues.joomla.org/tracker/joomla-cms/7251


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7243.

avatar PetarT
PetarT - comment - 23 Jun 2015

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.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7243.

avatar brianteeman brianteeman - close - 23 Jun 2015
avatar brianteeman brianteeman - change - 23 Jun 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-06-23 07:53:41
Closed_By brianteeman
avatar brianteeman brianteeman - close - 23 Jun 2015
avatar brianteeman
brianteeman - comment - 23 Jun 2015

Closed as requested


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7243.

Add a Comment

Login with GitHub to post a comment