Code change suggestion for administration mapping screen.

  • Jonathan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 7 months ago #1 by Jonathan
To avoid errors with non-existing shopping components try the following code change at line 127 and following in file: .../administrator/components/com_joomdle/views/mappings/view.html.php:

if ($option) {
$filter_order = $mainframe->getUserStateFromRequest( "$option.filter_order", 'filter_order', 'joomla_app', 'cmd' );
$filter_order_Dir = $mainframe->getUserStateFromRequest( "$option.filter_order_Dir", 'filter_order_Dir', 'asc', 'word' );

/* kludge while I learn how to do it FIXME */
if (($filter_order != 'joomla_app') && ($filter_order != 'moodle_field'))
$filter_order = 'joomla_app';
/* kludge while I learn how to do it FIXME */

$filter_type = $mainframe->getUserStateFromRequest( "$option.filter_type", 'filter_type', 0, 'string' );
$search = $mainframe->getUserStateFromRequest( "$option.search", 'search', '', 'string' );
$search = JString::strtolower( $search );
$limitstart = $mainframe->getUserStateFromRequest( $option.'.limitstart', 'limitstart', 0, 'int' );
}
else {
$filter_type = 0;
$filter_order_Dir = null;
$filter_order = 'joomla_app';
$search = null;
$limitstart = 0;
$app->enqueueMessage('Option not supported.', 'notice');
}

$limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );

Please Log in or Create an account to join the conversation.

  • Jonathan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 7 months ago #2 by Jonathan
Also change line 75 to:

if (!is_array($joomla_fields)) $joomla_field = array();
else foreach ($joomla_fields as $jf)

This will avoid error messages when clicking + New button if the shopping component not installed.

Please Log in or Create an account to join the conversation.