Post by tiredman » Wed May 06, 2020 12:18 am

OC v3.0.2, on default theme (php 7.4)

I recently migrated the OC to another server, same for the same version... I thought the migration went okay, until new customers couldn't add or amend addresses. The issue comes for the compulsory Region/State field. Any new attempt to add or amend an address will not be allowed, because the field can't move away from blank, and because it requires some data in there, not changes can be allowed.

If an existing customer checks out the past his/her addresses, the region/state pull-down menu comes out as a blank, where previously there some data there.

This what appears when it fails:

Code: Select all

Fatal error: Uncaught Error: Object of class stdClass could not be converted to string in  /opencart/htdocs/catalog/model/localisation/country.php:4 Stack trace: #0  /opencart/storage/modification/system/engine/loader.php(248): ModelLocalisationCountry->getCountry() #1  /opencart/htdocs/system/engine/proxy.php(47): Loader->{closure}() #2  /opencart/htdocs/catalog/controller/account/address.php(447): Proxy->__call() #3  /opencart/htdocs/catalog/controller/account/address.php(68): ControllerAccountAddress->validateForm() #4  /opencart/storage/modification/system/engine/action.php(79): ControllerAccountAddress->edit() #5  /opencart/htdocs/catalog/controller/startup/router.php(25): Action->execute() #6  /opencart/storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() #7  /opencart/htdocs/system/engine/router.php(67): Action->execute() #8  /opencart/htdocs/system/engine/ in  /opencart/htdocs/catalog/model/localisation/country.php on line 4
This is what line 4 says in country.php:

Code: Select all

<?php
class ModelLocalisationCountry extends Model {
	public function getCountry($country_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "country WHERE country_id = '" . (int)$country_id . "' AND status = '1' ");
		return $query->row;
	}
....
I'm stumped.

Thank you.
Last edited by straightlight on Wed May 06, 2020 12:42 am, edited 1 time in total.

New member

Posts

Joined
Mon Aug 06, 2018 1:11 am

Post by paulfeakins » Wed May 06, 2020 6:24 pm

tiredman wrote:
Wed May 06, 2020 12:18 am
I recently migrated the OC to another server, same for the same version... I thought the migration went okay, until new customers couldn't add or amend addresses. The issue comes for the compulsory Region/State field. Any new attempt to add or amend an address will not be allowed, because the field can't move away from blank, and because it requires some data in there, not changes can be allowed.
Please list all extensions you have?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by thekrotek » Wed May 06, 2020 7:08 pm

Looks like instead of integer for country_id you're passing an object.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by straightlight » Wed May 06, 2020 7:15 pm

Contact the extension developer to resolved this issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by tiredman » Thu May 07, 2020 10:41 am

[/quote]
Please list all extensions you have?
[/quote]
Sure.:
Custom Group Coupon dotbox creative 1.0 Enabled 16/04/2020
Default timezone for PHP and Database Tri Le 5.1.0 Enabled 04/05/2020
Export/Import Tool (V3.22) for OpenCart 3.x mhccorp.com 3.x-3.22 Disabled 28/04/2020 (*conflicts with php7.4)
Featured Plus AlexDW 1.02 Enabled 16/04/2020
Fix Filter Opencart 3.x AlexDW 1.00 Enabled 16/04/2020
Google Adwords Conversion Tracking [3.x.x.x] HuntBee OpenCart Services 1.3 Disabled 17/04/2020
Order Information in Confirmation Step Developer Kavad- sk4 1.0 Enabled 17/04/2020
Order Status - Color Code eXOTRik 1.0 Enabled 16/04/2020
Order Time in Order List High as a Kite 3.x Enabled 16/04/2020
Order-products-by-id-in-admin ImakeITwork 3.0 Enabled 16/04/2020
Quick Save 3x AlexDW 1.02 Enabled 04/05/2020
Remove Region Dropdown When No Regions OC2PS 3.2 Enabled 05/05/2020 (*installed after issued was discovered... still not working)
Smart Search Clear Thinking, LLC v303.2 Enabled 17/04/2020
USPS Smart Flexible Shipping Drugoe 5.6.4 Enabled 17/04/2020
X-Shipping Pro OpenCartMart 3.3.9 Enabled 21/04/2020

New member

Posts

Joined
Mon Aug 06, 2018 1:11 am

Post by tiredman » Thu May 07, 2020 10:53 am

thekrotek wrote:
Wed May 06, 2020 7:08 pm
Looks like instead of integer for country_id you're passing an object.
I'm able to change the customer's Region/State internally from the admin side. Customers on the front-end cannot add a new address or amend an existing address.

Changing the 'query' to below did not help either:

Code: Select all

	$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "WHERE status = '1' AND country_id = '" . (int)$country_id . "'");
and ported over the admin side query from getCountry, which is the same query as above, except that it has no 'status=1'.

Some orders still came in, but they were from existing customers, who already had addresses that don't amendments.

New member

Posts

Joined
Mon Aug 06, 2018 1:11 am

Post by tiredman » Thu May 07, 2020 11:02 am

I had to roll back the migration.

New member

Posts

Joined
Mon Aug 06, 2018 1:11 am

Post by thekrotek » Thu May 07, 2020 2:05 pm

tiredman wrote:
Thu May 07, 2020 11:02 am
I had to roll back the migration.
That wasn't necessary. You simply had to debug the issue, not that much variables to check in the given file.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by tiredman » Fri May 08, 2020 6:12 pm

Under pressure to roll-back due to a new-design launch starting today. I had it running live since 1st May, but I didn't catch the error. It is still there, under test-www.example.com instead. I'm not sure, I don't know where to begin... not the sharpest tool in the drawer :-)

New member

Posts

Joined
Mon Aug 06, 2018 1:11 am
Who is online

Users browsing this forum: No registered users and 26 guests