Changing Company Makes Shop Crash

I have upgraded 4.12.1 store to /dev category

moved this new cart to root /

updated paths accordingly, login in to backend all works until I click to change store like

/admin.php?dispatch=index.index&storefront_id=0&switch_company_id=1

cache is deleted, where else to look for problem ?

This seams to be a major bug for ultimate cs-cart

https://forum.cs-cart.com/tracker/issue-7865-multi-storefront-ultimate-problem/

Ok so I am going crazy with it (this was tested on 4.11.5 and problem there does not exist), maybe someone can look at the code and maybe they can spot obvious problem with code..

Problem consists of

Warning: Illegal string offset '' in /app/Tygh/Settings.php on line 828 (code below in bold)


My Ultimate store (with 4 store fronts) operated by this link

/admin.php?dispatch=index.index&storefront_id=0&switch_company_id=0

Crashed with such

/admin.php?dispatch=index.index&storefront_id=0&switch_company_id=1

$section_tab_name = ($_row['section_tab_id'] != 0 && isset($_sections[$_row['section_tab_id']])) ? $_sections[$_row['section_tab_id']]['name'] : '';

        if ($result) {
            foreach ($result as $_row) {
                $section_name = ($_row['section_id'] != 0 && isset($_sections[$_row['section_id']])) ? $_sections[$_row['section_id']]['name'] : '';
                $section_tab_name = ($_row['section_tab_id'] != 0 && isset($_sections[$_row['section_tab_id']])) ? $_sections[$_row['section_tab_id']]['name'] : '';
            $force_parse = $_row['type'] == 'N' ? true : false;
            if (!empty($_row['section_tab_id']) && $hierarchy) {
                $settings[$section_name][$section_tab_name][$_row['name']] = $this->unserializeValue($_row['value'], $force_parse);
            } elseif (!empty($_row['section_id']) && $hierarchy) {
                $settings[$section_name][$_row['name']] = $this->unserializeValue($_row['value'], $force_parse);
            } else {
                $settings[$_row['name']] = $this->unserializeValue($_row['value'], $force_parse);
            }
        }

        if (empty($section_id) || !$hierarchy) {
            return $settings;
        } elseif (!empty($section_id) && empty($section_tab_id)) {
            return $settings[$section_name];
        } elseif (!empty($section_tab_id)) {
            return $settings[$section_id][$section_tab_id];
        }
    }

    return $settings;

PHP warning should not crash your store. Do you see any other errors in the server error logs?

Error log gives this

[Fri Dec 04 18:50:34.994311 2020] [:error] [pid 4404:tid 140070918821632] [client xxx.xxx.xxx.xxx:53678] FastCGI: server "/usr/local/fastcgi/cgi-bin/php-cgi-pm" stderr: Error: Cannot use string offset as an array in /home/ttttt/domains/xxxxxxxxxx.com/public_html/dev/app/Tygh/Settings.php:828, referer: https://www.xxxxxxxxxx.com/dev/admin.php
[Fri Dec 04 18:50:34.994376 2020] [:error] [pid 4404:tid 140070918821632] [client xxx.xxx.xxx.xxx:53678] FastCGI: server "/usr/local/fastcgi/cgi-bin/php-cgi-pm" stderr: Stack trace:, referer: https://www.xxxxxxxxxx.com/dev/admin.php
[Fri Dec 04 18:50:34.994388 2020] [:error] [pid 4404:tid 140070918821632] [client xxx.xxx.xxx.xxx:53678] FastCGI: server "/usr/local/fastcgi/cgi-bin/php-cgi-pm" stderr: #0 /home/ttttt/domains/xxxxxxxxxx.com/public_html/dev/app/functions/fn.init.php(943): Tygh\\Settings->getValues(), referer: https://www.xxxxxxxxxx.com/dev/admin.php
[Fri Dec 04 18:50:34.994397 2020] [:error] [pid 4404:tid 140070918821632] [client xxx.xxx.xxx.xxx:53678] FastCGI: server "/usr/local/fastcgi/cgi-bin/php-cgi-pm" stderr: #1 /home/ttttt/domains/xxxxxxxxxx.com/public_html/dev/app/functions/fn.init.php(1147): fn_init_settings(), referer: https://www.xxxxxxxxxx.com/dev/admin.php
[Fri Dec 04 18:50:34.994407 2020] [:error] [pid 4404:tid 140070918821632] [client xxx.xxx.xxx.xxx:53678] FastCGI: server "/usr/local/fastcgi/cgi-bin/php-cgi-pm" stderr: #2 /home/ttttt/domains/xxxxxxxxxx.com/public_html/dev/init.php(175): fn_init(Array), referer: https://www.xxxxxxxxxx.com/dev/admin.php
[Fri Dec 04 18:50:34.994416 2020] [:error] [pid 4404:tid 140070918821632] [client xxx.xxx.xxx.xxx:53678] FastCGI: server "/usr/local/fastcgi/cgi-bin/php-cgi-pm" stderr: #3 /home/ttttt/domains/xxxxxxxxxx.com/public_html/dev/admin.php(25): require('/home/ttttt/domai...'), referer: https://www.xxxxxxxxxx.com/dev/admin.php
[Fri Dec 04 18:50:34.994425 2020] [:error] [pid 4404:tid 140070918821632] [client xxx.xxx.xxx.xxx:53678] FastCGI: server "/usr/local/fastcgi/cgi-bin/php-cgi-pm" stderr: #4 {main}, referer: https://www.xxxxxxxxxx.com/dev/admin.php

Try to contact support team since examination is required here

I did. Thank you

Try to contact support team since examination is required here

OK so cs-cart team has sorted the problem. Problem was

db table cscart_settings_objects object_id = 6448;

It had empty name field.

Not sure where did it came from, probably some addon. Strange but it did not caused any problems till I got over 4.11.5 version.

Thank you for keeping us updated