CMS MADE SIMPLE FORGE

CGExtensions

 

[#10365] sortablelists bug if used twice on one page

avatar
Created By: Chris Taylor (chrisbt)
Date Submitted: Thu Jan 15 18:24:54 -0500 2015

Assigned To:
Version: 1.44.5
CMSMS Version: 1.11.11
Severity: Minor
Resolution: None
State: Open
Summary:
sortablelists bug if used twice on one page
Detailed Description:
If sortable lists used twice on one page and the first list contains items & the
second doesn't $selectarea_selected_str still contains the values of the first
when second sortable list is generated.

Added the else to the end of the if statement in CGExtensions.module.php line
693+:

        if( !empty($selected) ) {
            $sel = explode(',',$selected);
            $tmp = array();
            foreach($sel as $theid) {
if( array_key_exists($theid,$items) ) $tmp[$theid] =
$items[$theid];
            }
            $smarty->assign('selectarea_selected_str',$selected);
            $smarty->assign('selectarea_selected',$tmp);
        } else {
            $smarty->assign('selectarea_selected_str','');
            $smarty->assign('selectarea_selected',array() );
        }


History