Post by Rob Assink » Fri Jan 29, 2016 10:17 pm

Hi there,

My error log is showing some errors and I am not able to solve them. I looked on the internet but with no succes. Contacted the developer but they do not reply. Is there somebody here who can guide me in the right direction?

The error logs shows the following errors,

PHP Notice: unserialize(): Error at offset 0 of 28 bytes in /var/www/vhosts/subsupply.eu/httpdocs/store/catalog/controller/ne/cron.php on line 1132
PHP Notice: unserialize(): Error at offset 0 of 1641 bytes in /var/www/vhosts/subsupply.eu/httpdocs/store/catalog/controller/ne/cron.php on line 1132

The code on line 1132 is,
1132: $this->config->set($setting['key'], unserialize($setting['value']));

I am using OC 2.1.0.1

Regards,

Rob
Last edited by Rob Assink on Sat Jan 30, 2016 8:23 pm, edited 1 time in total.

New member

Posts

Joined
Wed Dec 17, 2014 11:00 pm

Post by Randem » Mon Feb 01, 2016 11:59 pm

This is the way it is done now in index.php (v2.1.x)

Code: Select all

// Settings
$query = $db->query("SELECT * FROM " . DB_PREFIX . "setting WHERE store_id = '0'");

foreach ($query->rows as $setting) {
	if (!$setting['serialized']) {
		$config->set($setting['key'], $setting['value']);
	} else {
		$config->set($setting['key'], json_decode($setting['value'], true));
	}
}
This is the way is was done in v1.5.x

Code: Select all

// Settings
$query = $db->query("SELECT * FROM " . DB_PREFIX . "setting WHERE store_id = '0' OR store_id = '" . (int)$config->get('config_store_id') . "' ORDER BY store_id ASC");

foreach ($query->rows as $setting) {
	if (!$setting['serialized']) {
		$config->set($setting['key'], $setting['value']);
	} else {
		$config->set($setting['key'], unserialize($setting['value']));
	}
}
As you can see the way you have it in the cron extension is for v1.5.x and will not work in v2.1.x. Now just replacing the line may not work for I have no idea of what else they are doing from v1.5.x or why they are not using the information already gotten from the index.php file.

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by Rob Assink » Tue Feb 02, 2016 1:57 am

Yes, it's the version from 1.5 they are using. I will change the code and see what will happen. Thank you anyway so far.

New member

Posts

Joined
Wed Dec 17, 2014 11:00 pm

Post by Randem » Tue Feb 02, 2016 11:13 am

You are aware that 1.5 extensions may not work properly in v2.1.x (mostly do not).

NEVER take serious; anyone who gives negative impact statements with no ABSOLUTE proof!
OpenCart Helpful Information * Upgrade 1.5 to 2.1 * Upgrade 2.1 to 2.2
"Why do people NEVER have enough time to do it right but ALWAYS enough time to do it over?"
DO NOT EVER GIVE SOMEONE YOU DON"T KNOW ADMIN ACCESS TO ANYTHING!
I am NOT affiliated with OpenCart


User avatar
Active Member

Posts

Joined
Sat Sep 27, 2014 9:17 am

Post by Rob Assink » Tue Feb 02, 2016 3:03 pm

Yes I am aware of that and it did not work.
I finally managed to get in contact with the developer and he will have a look into it. Hopefully he will solve my problem and if not I need somebody else to fix it for me. Thank you very much so far.

New member

Posts

Joined
Wed Dec 17, 2014 11:00 pm

Post by Rob Assink » Fri Feb 12, 2016 4:45 pm

Problem has been solved by the developer and my hoster. Extension was not completely ready for OC2.1 Thanks for the help

New member

Posts

Joined
Wed Dec 17, 2014 11:00 pm

Post by mupcku » Fri Aug 18, 2017 5:13 pm

Hi folks! I have the same problem! Error is "PHP Notice: unserialize(): Error at offset 0 of 2 bytes in ..." This error is in quickcheckout module, where the client is registering their profile while completing the order, but this is making a problem in my system and the products are not showing in the order! This is the code where the notice is shown

Code: Select all

if ($this->customer->isLogged()) {
				$customer_info = $this->model_account_customer->getCustomer($this->customer->getId());

				$data['customer_id'] = $this->customer->getId();
				$data['customer_group_id'] = $customer_info['customer_group_id'];
				$data['firstname'] = $customer_info['firstname'];
				$data['lastname'] = $customer_info['lastname'];
				$data['email'] = $customer_info['email'];
				$data['telephone'] = $customer_info['telephone'];
				$data['fax'] = $customer_info['fax'];
				$data['custom_field'] = unserialize($customer_info['custom_field']);

			} elseif (isset($this->session->data['payment_address']) && isset($this->session->data['payment_address']['firstname'])) {
				$data['customer_id'] = 0;
				$data['customer_group_id'] = $this->session->data['payment_address']['customer_group_id'];
				$data['firstname'] = $this->session->data['payment_address']['firstname'];
				$data['lastname'] = $this->session->data['payment_address']['lastname'];
				$data['email'] = $this->session->data['payment_address']['email'];
				$data['telephone'] = $this->session->data['payment_address']['telephone'];
				$data['fax'] = $this->session->data['payment_address']['fax'];
				$data['custom_field'] = $this->parseCustomFields($this->session->data['payment_address'], 'account');
			} else { // ->this is the row!!!!
				return false; 
			}

How can i fix it?

https://wedeom.bg
Image


Active Member

Posts

Joined
Tue Jan 24, 2017 8:12 pm
Who is online

Users browsing this forum: No registered users and 61 guests