Jump to content

Array to string conversion/Illegal string offset in AdminModulesController.php


Glasso

Recommended Posts

Hi,

On clicking the modules page in v1.6.1.17, a big message box with the following errors pops up referencing this line 1439 of AdminModulesController.php:

            $modules_preferences[$v['module']] = $v;

Help please?

--------------------------------------------------

Here is the related block with this line:

        foreach ($modules_preferences_tmp as $k => $v) {
            if ($v['interest'] == null) {
                unset($v['interest']);
            }
            if ($v['favorite'] == null) {
                unset($v['favorite']);
            }
            $modules_preferences[$v['module']] = $v;
        }

 

Here is the error pop up:

Quote

Warning on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[2] Illegal string offset 'blocktopmenu'

Notice on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[8] Array to string conversion

Warning on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[2] Illegal string offset 'htmlbox'

Notice on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[8] Array to string conversion

Warning on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[2] Illegal string offset 'blockcontact'

Notice on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[8] Array to string conversion

Warning on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[2] Illegal string offset 'blockcontactinfos'

Notice on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[8] Array to string conversion

Warning on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[2] Illegal string offset 'InstamojoPrestaShop'

Notice on line 1439 in file /home/tb1/public_html/controllers/admin/AdminModulesController.php
[8] Array to string conversion

 

Link to comment
Share on other sites

Hello Glasso,

Indded, it seems to be a really ugly issue in PrestaShop, which most people might not get because they do not have the same configuration as you have.

To fix this issue, go to the line 1422 of AdminModulesController.php and replace:

$modules_preferences = '';

With:

$modules_preferences = array();

 

Let us know if this works for you.

Best regards,
Web Development VIZO.

  • Like 2
Link to comment
Share on other sites

  • 2 years later...
On 11/8/2017 at 6:35 PM, Web VIZO said:

Hello Glasso,

Indded, it seems to be a really ugly issue in PrestaShop, which most people might not get because they do not have the same configuration as you have.

To fix this issue, go to the line 1422 of AdminModulesController.php and replace:


$modules_preferences = '';

With:


$modules_preferences = array();

 

Let us know if this works for you.

Best regards,
Web Development VIZO.

 

Look like it's working for me too!!

 

Thank you very much @Web VIZO!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...