Jump to content

After 6.4.2 upgrade my modification doesn't work


Claudia

Recommended Posts

Ok, I promised myself I was not going to bother you but here I am.

I upgraded to 6.4.2 ( with the 2 items in Github for 6.4.3) and applied all my modifications.  Everything works except I cannot get my Group Memberships on the Admins Orders page to be be sortable.  The up and down arrows are there but when I click one it goes to my homepage and I get these errors.

Thanks in advance, Claudia

 

[07-Dec-2020 11:44:39 America/Louisville] PHP Warning:  Security Warning: Illegal array key "https:/www_xxxxxxx_com/admin_xxxxxx_php" was detected and was removed. in /home/xxxxxx/public_html/classes/sanitize.class.php on line 114

 

[07-Dec-2020 11:44:40 America/Louisville] PHP Warning:  No callback method defined. in /home/xxxxxx/public_html/classes/cubecart.class.php on line 325

 

Here are the changes I've made:  ( don't use any Code Snippets for this)

In the admin skin template orders.index.php, near line 44, find:

 

{else}

    {$order.name}

{/if}

   </td>

 

On a new blank line after that, add:

 

<td>{$order.cust_groups}</td>

 

Near line 23, find:

 

   <td>{$THEAD.customer}</td>

 

On a new blank line after that, add:

 

<td>{$THEAD.membership}</td>

 

In the admin file /sources/order.index.inc.php, near line 812, find:

 

$orders  = $GLOBALS['db']->select(sprintf('`%1$sCubeCart_order_summary` LEFT JOIN `%1$sCubeCart_customer` ON %1$sCubeCart_order_summary.customer_id = %1$sCubeCart_customer.customer_id', $GLOBALS['config']->get('config', 'dbprefix')), sprintf('%1$sCubeCart_order_summary.*, %1$sCubeCart_customer.type, CONCAT(%1$sCubeCart_order_summary.last_name, %1$sCubeCart_order_summary.first_name) AS `customer`, %1$sCubeCart_order_summary.status', $GLOBALS['config']->get('config', 'dbprefix')), $where, $order_by, $per_page, $page);

 

Change to:

// $orders  = $GLOBALS['db']->select(sprintf('`%1$sCubeCart_order_summary` LEFT JOIN `%1$sCubeCart_customer` ON %1$sCubeCart_order_summary.customer_id = %1$sCubeCart_customer.customer_id', $GLOBALS['config']->get('config', 'dbprefix')), sprintf('%1$sCubeCart_order_summary.*, %1$sCubeCart_customer.type, CONCAT(%1$sCubeCart_order_summary.last_name, %1$sCubeCart_order_summary.first_name) AS `customer`, %1$sCubeCart_order_summary.status', $GLOBALS['config']->get('config', 'dbprefix')), $where, $order_by, $per_page, $page);

 

On a new blank line after that, add:

 

if ($key[0] == "member_groups") { $order_by = " ORDER BY `group_name` ".$_GET['sort'][$key[0]].", `cart_order_id` DESC"; }

$orders = $GLOBALS['db']->select(

sprintf('`%1$sCubeCart_order_summary` LEFT JOIN `%1$sCubeCart_customer` ON %1$sCubeCart_order_summary.customer_id = %1$sCubeCart_customer.customer_id LEFT JOIN %1$sCubeCart_customer_membership ON %1$sCubeCart_order_summary.customer_id = %1$sCubeCart_customer_membership.customer_id LEFT JOIN %1$sCubeCart_customer_group ON CubeCart_customer_membership.group_id = %1$sCubeCart_customer_group.group_id', $GLOBALS['config']->get('config', 'dbprefix')),

sprintf('%1$sCubeCart_order_summary.*, %1$sCubeCart_customer.type, CONCAT(%1$sCubeCart_order_summary.last_name, %1$sCubeCart_order_summary.first_name) AS `customer`, %1$sCubeCart_order_summary.status, %1$sCubeCart_customer_group.group_name AS `cust_groups`', $GLOBALS['config']->get('config', 'dbprefix')),

$where, $order_by, $per_page, $page);

 

Lines around 808 - 819 look lke this:

 $GLOBALS['smarty']->assign('THEAD', $thead_sort);

    // Sort has to be a string in this instance as column 'customer' doesn't exist!!

    $key   = array_keys($_GET['sort']);

    $order_by  = '`'.$key[0].'` '.$_GET['sort'][$key[0]];

      // START My Edits

// $orders  = $GLOBALS['db']->select(sprintf('`%1$sCubeCart_order_summary` LEFT JOIN `%1$sCubeCart_customer` ON %1$sCubeCart_order_summary.customer_id = %1$sCubeCart_customer.customer_id', $GLOBALS['config']->get('config', 'dbprefix')), sprintf('%1$sCubeCart_order_summary.*, %1$sCubeCart_customer.type, CONCAT(%1$sCubeCart_order_summary.last_name, %1$sCubeCart_order_summary.first_name) AS `customer`, %1$sCubeCart_order_summary.status', $GLOBALS['config']->get('config', 'dbprefix')), $where, $order_by, $per_page, $page);

   if ($key[0] == "member_groups") { $order_by = " ORDER BY `group_name` ".$_GET['sort'][$key[0]].", `cart_order_id` DESC"; }

$orders = $GLOBALS['db']->select(

sprintf('`%1$sCubeCart_order_summary` LEFT JOIN `%1$sCubeCart_customer` ON %1$sCubeCart_order_summary.customer_id = %1$sCubeCart_customer.customer_id LEFT JOIN %1$sCubeCart_customer_membership ON %1$sCubeCart_order_summary.customer_id = %1$sCubeCart_customer_membership.customer_id LEFT JOIN %1$sCubeCart_customer_group ON CubeCart_customer_membership.group_id = %1$sCubeCart_customer_group.group_id', $GLOBALS['config']->get('config', 'dbprefix')),

sprintf('%1$sCubeCart_order_summary.*, %1$sCubeCart_customer.type, CONCAT(%1$sCubeCart_order_summary.last_name, %1$sCubeCart_order_summary.first_name) AS `customer`, %1$sCubeCart_order_summary.status, %1$sCubeCart_customer_group.group_name AS `cust_groups`', $GLOBALS['config']->get('config', 'dbprefix')),

$where, $order_by, $per_page, $page);

// END My Edits

 

Near line 793, find:

 

    $thead_sort = array(

 

On a new blank line after that, add:

 

'membership'   => $GLOBALS['db']->column_sort('member_groups', $lang['customer']['title_groups_membership'], 'sort', $current_page, $_GET['sort']),

 

Lines around 793 - 802 look like this: membership on one line

$thead_sort = array(

       // START My Edits

        'membership'   => $GLOBALS['db']->column_sort('member_groups', $lang['customer']['title_groups_membership'], $current_page, $_GET['sort']),

// END My Edits

        'cart_order_id' => $GLOBALS['db']->column_sort('cart_order_id', $lang['orders']['order_number'], 'sort', $current_page, $_GET['sort']),

        'customer'   => $GLOBALS['db']->column_sort('customer', $lang['orders']['title_customer'], 'sort', $current_page, $_GET['sort']),

        'status'   => $GLOBALS['db']->column_sort('status', $lang['common']['status'], 'sort', $current_page, $_GET['sort']),

        'date'    => $GLOBALS['db']->column_sort('order_date', $lang['common']['date'], 'sort', $current_page, $_GET['sort']),

        'total'   => $GLOBALS['db']->column_sort('total', $lang['basket']['total'], 'sort', $current_page, $_GET['sort'])

    );

Link to comment
Share on other sites

There is something here that looks wrong:

Near line 793, find:
 
    $thead_sort = array(
 
On a new blank line after that, add:
 
'membership'   => $GLOBALS['db']->column_sort('member_groups', $lang['customer']['title_groups_membership'], 'sort', $current_page, $_GET['sort']),

NOTE above the placement of 'sort' as an argument in the list of the function's arguments.

Lines around 793 - 802 look like this: membership on one line

$thead_sort = array(

// START My Edits
        'membership'   => $GLOBALS['db']->column_sort('member_groups', $lang['customer']['title_groups_membership'], $current_page, $_GET['sort']),
// END My Edits

NOTE above the missing 'sort' as an argument in the list of the function's arguments.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...