- Posts: 1
- Thank you received: 0
Fatal error: Cannot use object of type stdClass as array
- Vicky Bower
-
Topic Author
- Offline
- Fresh Boarder
-
Less
More
9 years 10 months ago #8147
by Vicky Bower
Fatal error: Cannot use object of type stdClass as array in /home/mysite/public_html/modules/mod_otclientlogosscroller/elements/otclientlogosscroller.php on line 73
Module installs fine - I edit the module but on saving I get this in backend which prevents me from editing the slider so I am forced to uninstall and reinstall the module if I need to do any edits!
Module installs fine - I edit the module but on saving I get this in backend which prevents me from editing the slider so I am forced to uninstall and reinstall the module if I need to do any edits!
Please Log in or Create an account to join the conversation.
- Igor Maric
-
- Offline
- Fresh Boarder
-
Less
More
- Posts: 1
- Thank you received: 0
9 years 6 months ago #8339
by Igor Maric
Replied by Igor Maric on topic Fatal error: Cannot use object of type stdClass as array
I've got the same problem and this is the first time I downloaded the module. Everything went well but this. When saved it displays this message, but only this time it's line 73.
Please Log in or Create an account to join the conversation.
- Tanase Butcaru
-
- Offline
- Fresh Boarder
-
Less
More
- Posts: 1
- Thank you received: 0
9 years 5 months ago #8386
by Tanase Butcaru
Replied by Tanase Butcaru on topic [FIX] Fatal error: Cannot use object of type stdClass as array
Hello guys,
Just got into this bug when using FaLang to translate the module.
The error is right, the " $this->value[$i] " is an object, not an array AND it is used as an array.
As a quick fix:
- open
- go to line 72 (where the for loop starts) and add the following:
So, old code:
...and the code with the fix:
Just got into this bug when using FaLang to translate the module.
The error is right, the " $this->value[$i] " is an object, not an array AND it is used as an array.
As a quick fix:
- open
Code:
modules/mod_otclientlogosscroller/elements/otclientlogosscroller.php
Code:
$this->value[$i] = (array) $this->value[$i];
So, old code:
Code:
71 if (!empty($this->value)){
72 for ($i = 0; $i < count($this->value); $i++){
73 if (!empty($this->value[$i]['avatar']))
Code:
71 if (!empty($this->value)){
72 for ($i = 0; $i < count($this->value); $i++){
73 $this->value[$i] = (array) $this->value[$i];
74 if (!empty($this->value[$i]['avatar']))
Please Log in or Create an account to join the conversation.
Time to create page: 0.188 seconds