Jump to content

Pending to Process Problems - tried fixes on Forum


sleepyfrog

Recommended Posts

Store version 6.1.1 (can't upgrade yet as lots of changes made to templates)

Gateway; Paypal Standard - latest mod

Store is registering order but not updating to 'Processing' when payment made and can't manually change as just get a blank screen. Getting paypal notifications through OK if payment refunded - order status changes to Cancelled.

Changed timeout to 45 in request.class.php

Uploaded latest sanitize.class.php from GitHub

Recently installed an SSL on website so checked all referenced URLs are https

Anyone any other ideas? It's driving me mad!

Link to comment
Share on other sites

Thanks for responding.

The only errors logged during the time I was testing the system are:

Invalid Security Token in /home/cluster-sites/4/m/***.co.uk/public_html/classes/sanitize.class.php on line 149

array_keys() expects parameter 1 to be array, boolean given in /home/cluster-sites/4/m/***.co.uk/public_html/admin_TMo7iI/sources/dashboard.index.inc.php on line 311

I assume these are when trying to manually change the status from Pending to Processing.

There are no errors logged with respect to Paypal and why the orders aren't being changed to Processing automatically.

Link to comment
Share on other sites

The entries in the error log should have the time the error occured shown. Please note the time when you get the blank screen. Then compare the time(s) in the log. The one that matches (may be off by some time zones, but the minutes will be accurate) will be related to the problem.

If it is an Invalid Security Token, then either:
You have too many windows/tabs open and you are submitting forms one window/tab right after the other, or
You recently upgarded and have conflicting versions of the admin folder contents (probably not likely).

With respect to the array_keys problem, that has been fixed. In dashboard.index.inc.php, near line 309:

Find:

if($GLOBALS['session']->has('version_check')) {
	$extension_updates = $GLOBALS['session']->get('version_check');
	$extension_updates = $GLOBALS['db']->select('CubeCart_extension_info', false, array('file_id' => array_keys($extension_updates)));
	if($extension_updates) {
		$GLOBALS['main']->addTabControl($lang['dashboard']['title_extension_updates'], 'extension_updates', null, null, count($extension_updates));
		$GLOBALS['smarty']->assign('EXTENSION_UPDATES', $extension_updates);
	}
}

Change to:

if($GLOBALS['session']->has('version_check')) {
	$extension_updates = $GLOBALS['session']->get('version_check');
	$file_ids = (is_array($extension_updates) && !empty($extension_updates) ? array_keys($extension_updates) : array(-1));
	$extension_updates = $GLOBALS['db']->select('CubeCart_extension_info', false, array('file_id' => $file_ids));
	if($extension_updates) {
		$GLOBALS['main']->addTabControl($lang['dashboard']['title_extension_updates'], 'extension_updates', null, null, count($extension_updates));
		$GLOBALS['smarty']->assign('EXTENSION_UPDATES', $extension_updates);
	}
}

When CubeCart disagrees with the Security Token, it dumps the POSTed form data (that is, nothing gets updated), and delivers to you the Dashboard. When building the dashboard page, CubeCart will display its results from a remote query as to whether any modules have updated versions available.

So, if you were doing the "many open tabs" activity, that would explain the entire chain of events with the exception of the blank screen. If the error_log does not show a Fatal Error, then, in my experience, the blame is on Smarty trying to build a page with very bad data. Smarty does not allow its errors to be logged in PHP's error_log. But, you might be able to see Smarty errors in CubeCart's System Error Log.

Link to comment
Share on other sites

1) I didn't have multiple windows open

2) The entire code you referenced doesn't appear in my dashboard.index.inc.php at all. The only place where $GLOBALS['session'] is referenced is

## Save notes
if (isset($_POST['notes']['dashboard_notes']) && !empty($_POST['notes']['dashboard_notes'])) {
    $update = array('dashboard_notes' => $_POST['notes']['dashboard_notes']);
    if ($GLOBALS['db']->update('CubeCart_admin_users', $update, array('admin_id' => Admin::getInstance()->get('admin_id')))) {
        $GLOBALS['session']->delete('', 'admin_data');
        $GLOBALS['main']->setACPNotify($lang['dashboard']['notice_notes_save']);
    } else {
        $GLOBALS['main']->setACPWarning($lang['dashboard']['error_notes_save']);
    }
    httpredir(currentPage());
}

 

I am running 6.1.1

 

Link to comment
Share on other sites

This is from line 309 to the end:

 

$tmp1 = 0;
$tmp2 = 0;

$system = array(
    'cc_version' => CC_VERSION,
    'cc_build'  => null,
    'php_version' => PHP_VERSION,
    'mysql_version' => $GLOBALS['db']->serverVersion(),
    'server'  => htmlspecialchars($_SERVER['SERVER_SOFTWARE']),
    'client'  => htmlspecialchars($_SERVER['HTTP_USER_AGENT']),
    'dir_images' => dirsize(CC_ROOT_DIR.'/images', $tmp1),
    'dir_files'  => dirsize(CC_ROOT_DIR.'/files', $tmp2),
);

$GLOBALS['smarty']->assign('SYS', $system);
$GLOBALS['smarty']->assign('PHP', ini_get_all());
$GLOBALS['smarty']->assign('COUNT', $count);

$GLOBALS['main']->addTabControl($lang['common']['search'], 'sidebar');

foreach ($GLOBALS['hooks']->load('admin.dashboard.custom_quick_tasks') as $hook) include $hook;
if(isset($custom_quick_tasks) && is_array($custom_quick_tasks)) {
    $GLOBALS['smarty']->assign('CUSTOM_QUICK_TASKS', $custom_quick_tasks);
}

$page_content = $GLOBALS['smarty']->fetch('templates/dashboard.index.php');

 

Link to comment
Share on other sites

In a stock CC611, those lines are at 375-400.

The error message says the problem with array_keys is on line 311, which does not match up with the code shown above.

The code shown above at line 309 would be if code had been deleted - code that is the entire section of checking for the Latest News from CubeCart HQ, and getting the latest versions of extensions.

 

Link to comment
Share on other sites

  • 3 weeks later...

Thanks - no idea who deleted the code, but uploaded the file from the base code, changed lines from 309 as you suggested, cleared caches and still having the same problem.

Happens from either the Dashboard or within the Orders section - try to change an order status from Pending to Processing and just goes to a blank screen.

It's not due to multiple windows open as I tried it with nothing open but the store admin.

Unfortunately I don't have access to the server logs, just the log Cubecart creates and there was nothing logged at the time I was testing.

Link to comment
Share on other sites

In CubeCart's admin, Store Settings, Advanced tab, enable debugging and enter your IP address in the adjacent field (www.whatismyip.com).

For every page delivered to you, there will be a diagnostic block of data at the bottom.

Then, when you get the blank screen, see if there are any new clues in the error_log and/or the admin System Error Log. And, if the diagnostic block shows, but not the actual page itself, we may be able to find a clue there.

Link to comment
Share on other sites

Ok - weird things lol.

Enabled debugging and tried again - this time it worked, sort of:

Can manually change status from Pending to Processing when going to the order via the Orders option in the left nav bar.

However, if you click on the order via the Dashboard > Unsettled Orders link it updates the status ok, but returns the 404 error page as it's adding characters to the URL - admin_MxFTXQ.php#orders - when I assume it should just be admin.php#orders

No errors shown in the debugging text and nothing logged in System Logs.

I need to verify with the person who handles the orders, but I think it may have also gone back to updating the status to Processing from the code returned by Paypal; if so then I also assume this means it was something to do with the hosting rather than the store code.

I'm definately getting too old for all this - maybe 2018 is the year I finally run off to join a circus....... :-D

Link to comment
Share on other sites

The characters that are part of admin.php is a new strategy implemented in the last few versions of CubeCart. The strategy is designed to apply "security by obscurity". That is, by making the admin folder and the admin script have un-guessable names, there will be far less likely chance of unauthorized access to CubeCart's admin pages.

So, in CubeCart's main folder, make sure there is only one admin folder (/admin_hAsHeS/) and only one admin script (admin_mIxEdS). Then, in /includes/global.inc.php, make sure those very same names are the values for the related variables.

The above situation should explain why you are getting a 404 page. But then, if the .htaccess file is being processed correctly, there is a directive there that says to send CubeCart's index.php page with the announcement that is a 404 message, and not the web server's plain message.

Link to comment
Share on other sites

Doh! You have found my stupid error!

On our hosting we have multiple areas/sites which all have their own 'admins' - so I had renamed the cubecart admin folder with a suffix. Whilst I remembered to change the location for anything referencing it, including our .htaccess set up, I had forgot about the global.inc.php file.  The page is now redirecting as it should. (Weird how everything else worked, but hey ho.)

No idea why it's started to auto update from the Paypal notifications again - no doubt it'll go funny again the next time they 'upgrade' the hosting.

Thank you for all your help - wishing you a Happy New Year and all the best for 2018

:-) Carol

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...