Bug: important plugin list issue

Status
Not open for further replies.

jfquestiaux

Well-Known Member
I use a PHP list plugin on a list.

In the code, to retreive the affected row, I use
Code:
$jinput = JFactory::getApplication()->input;  
$ids =       $jinput->get('ids', NULL, 'array');
     
foreach ( $ids AS $k ) {
    $row = $model->getRow($k); 
....
}

The problem is that no matter which row I check, $ids is always
[ids] => Array ( [1] => 1 )

What does change however is this
[purchases] => Array ( [1] => 2 )

where 'purchases' is the name of the databasetable.
If I check row 1, I have
[ids] => Array ( [1] => 1 )

[purchases] => Array ( [1] => 1 )

If I check row 2, I have
[ids] => Array ( [1] => 1 )

[purchases] => Array ( [1] => 2 )
The problem is (besides the fact that I don't think this is the correct behaviour) is that if I check rows 1 AND 2, I get
[ids] => Array ( [1] => 1 )

[purchases] => Array ( [1] => 2 )
so I can't cycling through the rows.

This is an important issue for me to solve.
 
this works for me:

Code:
$app = JFactory::getApplication();
$input = $app->input;
$ids = $input->get('ids', array(), 'array');
print_r($ids);
 
you sure you are using array() as the default and not null as per your example?
 
After GitHub 591, the issue is still there.

Note : the list in question has a join to it. Maybe this is related.
 
I don't see this. Even with joined data. Remember that if you have one parent record and 4 child records, and are not showing the data merged, then all four checkboxes are going to have the same value as the value refers to the main record's id and not that of the child elements.
 
My mistake. That makes sense. I reset my join in the proper way and it is working. Thanks for pointing me in the right direction.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top