Page 1 of 1

Accees to null customers.php

Posted: Fri Apr 02, 2021 2:12 am
by plamastus
Hi,

Phoenix v1.0.8.0

May be some has a solution, found "Trying to access array offset on value of type null " in error_log

[01-Apr-2021 15:54:31 America/New_York] PHP Notice: Array to string conversion in /home/geishacoffee/public_html/includes/system/versioned/1.0.7.other/1.0.7.12/hooks.php on line 152
[01-Apr-2021 15:54:39 America/New_York] PHP Notice: Trying to access array offset on value of type null in /home/geishacoffee/public_html/admin/customers.php on line 218
[01-Apr-2021 21:37:40 America/New_York] PHP Notice: Undefined variable: product in /home/geishacoffee/public_html/admin/categories.php on line 1117


Thanks,

Patrick

Re: Access to null customers.php

Posted: Fri Apr 02, 2021 3:50 am
by ecartz
plamastus wrote: Fri Apr 02, 2021 2:12 am PHP Notice: Array to string conversion in /home/geishacoffee/public_html/includes/system/versioned/1.0.7.other/1.0.7.12/hooks.php on line 152
This says that there is a hook that is returning an array rather than a string.

I don't get this when I visit admin/customers.php in the default install. So I'm guessing that this is something that you installed (as opposed to a bug in one of the core hooks). It could be a supporters' code or any other add-on. Or something that you created yourself.

I don't really have a much better suggestion than installing a clean copy and adding things until you find what gives this error. You could try changing line 152 from

Code: Select all

        $result .= call_user_func($callback, $parameters);
to

Code: Select all

        $return = call_user_func($callback, $parameters);
        if (is_array($return)) {
          print_r([$callback, $parameters, $return], true);
          debug_print_backtrace();
          exit();
        } else {
          $result .= $return;
        }
That might give more information, although it might be hard to read. And of course it breaks things even more when it happens.

Re: Accees to null customers.php

Posted: Fri Apr 02, 2021 11:56 am
by plamastus
Thanks I'll keep you posted.