Recoverable fatal error: Object of class stdClass could not be converted to stri

  • Posts: 76
  • Thank you received: 2
3 years 1 month ago #336162

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.10.2
-- PHP version -- : 7.3.31
-- Browser(s) name and version -- : Edge
-- Error-message(debug-mod must be tuned on) -- : Recoverable fatal error: Object of class stdClass could not be converted to string in /home/claycellar/public_html/administrator/components/com_hikashop/classes/zone.php on line 71

Hi guys,

when a user goes to the checkout and needs to select the shipping tab i get error 500 on the front-end.
After enabling site debug and error report to development i get:

Recoverable fatal error: Object of class stdClass could not be converted to string in /xxxxx/administrator/components/com_hikashop/classes/zone.php on line 71

Can you please let me know how should i sort it out?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 1 month ago #336163

Hi,

I don't see how that error is possible.
Could you edit the file administrator/components/com_hikashop/classes/zone.php
On line 71, you should have this code:

$query = 'SELECT '.implode(',', $columns).' FROM #__hikashop_zone WHERE '.hikashop_secureField($key).' IN ('.implode(',',$ids).')';
If that's the case, add these lines before it:
hikashop_writeToLog($columns);
hikashop_writeToLog($key);
hikashop_writeToLog($ids);
Then, reproduce the error once, and go in the HikaShop configuration page, under the Files section of the main tab, and check the "payment log file" setting.
There, at the end of the log file, you'll find the content of these 3 variables used on the line 71. Please provide that debug data so that we can understand what's going on. That will allow us to provide a fix.

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
3 years 1 month ago #336168

Also getting this error for registered customers when clicking next button.
Works fine when checkout as a super-user!

Hikashop 4.4.3
PHP 7.3.31
Joomla 3.10.2

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 1 month ago #336170

Can you do the modifications I provided in my previous message and get the debug log ? Because I'm not able to reproduce on my end.

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

  • Posts: 76
  • Thank you received: 2
3 years 1 month ago #336172

Here is the debug:

Array
(
    [0] => `zone_published`
)
zone_namekey
Array
(
    [0] => stdClass Object
        (
            [zone_id] => 
            [zone_namekey] => 
            [zone_name] => 
            [zone_name_english] => 
            [zone_code_2] => 
            [zone_code_3] => 
            [zone_type] => 
            [zone_published] => 
            [zone_currency_id] => 
        )

    [1] => stdClass Object
        (
            [zone_id] => 
            [zone_namekey] => 
            [zone_name] => 
            [zone_name_english] => 
            [zone_code_2] => 
            [zone_code_3] => 
            [zone_type] => 
            [zone_published] => 
            [zone_currency_id] => 
        )

    [2] => 'state_Bath_and_North_East_Somerset_4037'
    [3] => 'state_Bedfordshire_4039'
    [4] => 'state_Berkshire_4040'
    [5] => 'state_Blaenau_Gwent_4045'
    [6] => 'state_Borders_4055'
    [7] => 'state_Bristol_4060'
    [8] => 'state_Buckinghamshire_4061'
    [9] => 'state_Cambridgeshire_4062'
    [10] => 'state_Ceredigion_4064'
    [11] => 'state_Cheshire_4066'
    [12] => 'state_Dumbarton_4065'
    [13] => 'state_Glamorgan_4068'
    [14] => 'state_Middlesex_4069'
    [15] => 'state_Merseyside_4070'
    [16] => 'state_Cumbria_4072'
    [17] => 'state_West_Midlands_4073'
    [18] => 'state_Carmarthenshire_4074'
    [19] => 'state_Cornwall_4075'
    [20] => 'state_West_Yorkshire_4076'
    [21] => 'state_Conwy_4080'
    [22] => 'state_Derbyshire_4082'
    [23] => 'state_Denbighshire_4083'
    [24] => 'state_Devon_4085'
    [25] => 'state_Dumfries_and_Galloway_4087'
    [26] => 'state_Dorset_4090'
    [27] => 'state_Dyfed_4093'
    [28] => 'state_Durham_4094'
    [29] => 'state_East_Ayrshire_4096'
    [30] => 'state_Edinburgh_4097'
    [31] => 'state_East_Dunbartonshire_4098'
    [32] => 'state_East_Renfrewshire_4102'
    [33] => 'state_East_Riding_of_Yorkshire_4103'
    [34] => 'state_Essex_4104'
    [35] => 'state_East_Sussex_4105'
    [36] => 'state_Fife_4108'
    [37] => 'state_Flintshire_4109'
    [38] => 'state_Grampian_4110'
    [39] => 'state_Glasgow_4111'
    [40] => 'state_Gloucestershire_4112'
    [41] => 'state_Greater_Manchester_4113'
    [42] => 'state_Gwent_4114'
    [43] => 'state_Gwynedd_4115'
    [44] => 'state_Hampshire_4117'
    [45] => 'state_Herefordshire_4120'
    [46] => 'state_Hertfordshire_4126'
    [47] => 'state_Inverclyde_4132'
    [48] => 'state_Kent_4135'
    [49] => 'state_Lancashire_4140'
    [50] => 'state_Leicestershire_4144'
    [51] => 'state_Lincolnshire_4146'
    [52] => 'state_London_4149'
    [53] => 'state_Manchester_4153'
    [54] => 'state_North_Ayrshire_4164'
    [55] => 'state_Northumberland_4165'
    [56] => 'state_Norfolk_4169'
    [57] => 'state_North_Lanarkshire_4171'
    [58] => 'state_Northamptonshire_4175'
    [59] => 'state_Nottinghamshire_4177'
    [60] => 'state_North_Yorkshire_4181'
    [61] => 'state_Oxfordshire_4186'
    [62] => 'state_Pembrokeshire_4187'
    [63] => 'state_Powys_4192'
    [64] => 'state_Rhondda_Cynon_Taf_4196'
    [65] => 'state_Renfrewshire_4199'
    [66] => 'state_South_Ayrshire_4204'
    [67] => 'state_Suffolk_4206'
    [68] => 'state_South_Gloucestershire_4208'
    [69] => 'state_Shropshire_4211'
    [70] => 'state_South_Lanarkshire_4215'
    [71] => 'state_Somerset_4218'
    [72] => 'state_Surrey_4220'
    [73] => 'state_Staffordshire_4226'
    [74] => 'state_South_Yorkshire_4228'
    [75] => 'state_Tayside_4235'
    [76] => 'state_Torfaen_4236'
    [77] => 'state_Tyne_and_Wear_4237'
    [78] => 'state_Warwickshire_4240'
    [79] => 'state_Wiltshire_4245'
    [80] => 'state_West_Lothian_4248'
    [81] => 'state_Worcestershire_4252'
    [82] => 'state_West_Sussex_4257'
    [83] => 'state_Angus_4506'
    [84] => 'state_Brecknockshire_4511'
    [85] => 'state_Cardiganshire_4515'
    [86] => 'state_Clackmannanshire_4517'
    [87] => 'state_East_Lothian_4522'
    [88] => 'state_Midlothian_4535'
    [89] => 'state_Monmouthshire_4536'
    [90] => 'state_Morayshire_4538'
    [91] => 'state_Rutland_4546'
    [92] => 'state_Stirlingshire_4549'
    [93] => 'state_Aberdeenshire_4554'
    [94] => 'state_Anglesey_4555'
    [95] => 'state_Avon_2126144982'
    [96] => 'state_KingstonuponHull_242002565'
    [97] => 'state_BlackburnwithDarwen_1211898051'
    [98] => 'state_Blackpool_289313961'
    [99] => 'state_StocktonOnTees_1623145216'
    [100] => 'state_Middlesbrough_687382770'
    [101] => 'state_Hartlepool_1857309039'
    [102] => 'state_RedcarandCleveland_2111003368'
    [103] => 'state_Yorkshire_1382393797'
    [104] => 'state_Swansea_29956173'
    [105] => 'state_NeathPortTalbot_1001871215'
    [106] => 'state_Bridgend_1483492616'
    [107] => 'state_MerthyrTydfil_1941408300'
    [108] => 'state_Caerphilly_1120784658'
    [109] => 'state_Cardiff_503900270'
    [110] => 'state_Newport_848326300'
    [111] => 'state_Wrexham_374883226'
    [112] => 'state_WestDunbartonshire_1800508830'
    [113] => 'state_Falkirk_864788383'
    [114] => 'state_CentralScotland_492047643'
    [115] => 'state_PerthandKinross_1969546350'
    [116] => 'state_Dundee_409332477'
    [117] => 'state_Lothian_1784004665'
)

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 1 month ago #336174

Hi,

Thanks, I can see what is the problem.
Change the code:

					if(!empty($id->$key))
						$ids[$k] = $this->database->Quote($id->$key);
to:
						$ids[$k] = $this->database->Quote(@$id->$key);
in the file administrator/components/com_hikashop/classes/zone.php a few lines above and you should not have the problem anymore.
We'll add the modification on our end.

The following user(s) said Thank You: jberry210490

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

Time to create page: 0.070 seconds
Powered by Kunena Forum