• Closed by: Fred
  • Closed on: 17.01.22, 14:37
  • Reason: Closed
  • Comment: Glad to help!

Ticket #22889 - ContextErrorException Notice: Trying to access array offset on value of type bool in .file.module-m

My site is in debug mode for the Creative Elementor developer to investigate some problems. I see an error which i think has to do with the Alysum theme:


Notice: Trying to access array offset on value of type bool
in 5e2817645dc06bbb790b347b917f608aa8f8fc3d_2.file.module-miniproduct.tpl.php line 29.


Fred 12 Jan 2022, 18:18

Hi, Martin.
Where I can see that error?

Martin Crielaard 12 Jan 2022, 19:19

You can see it here: https://www.zhtest.nl If it is okay clear your browser cache.

Fred 12 Jan 2022, 19:30

The issue has been fixed. Please test to confirm the change
Updated file is /themes/alysum/templates/catalog/_partials/miniatures/module-miniproduct.tpl

Martin Crielaard 12 Jan 2022, 19:33

Is the error on the product page also a theme issue? https://www.zhtest.nl/kindergeschenken/verzilverde-spaarpotten/spaarpot-herby

Fred 12 Jan 2022, 19:34

it caused by config_boxes.tpl which is not a part of our modules. I assume you have some third party module that use that file

Martin Crielaard 12 Jan 2022, 19:36

Thanks the homepage is working again. Now the Kristof of Creactive elements can investigate why a custom 404 page is not working with your theme.

Fred 12 Jan 2022, 19:37

ok, let me know if you will need some help

Martin Crielaard 12 Jan 2022, 19:41

I created an custom 404 page with elements but the standard 404 page from the Alysum theme is displayed. I don’t understand why it is not switching to my custom page. (see attached screenshot)


404.png (125.2 KiB)
Fred 13 Jan 2022, 10:34

Do you have a reply from Kristof? he should better know module requirements. Because I didn’t find fast solution

Martin Crielaard 14 Jan 2022, 10:51

Hi Fred, Kristof is now trying to debug why it is not working but he is stumbling on some errors which has te do with some of the PromoKit modules. Can you help me with this?
You can see the errors when you try to view a preview of the custom 404 page created in Creative Elements: https://www.zhtest.nl/pagina-niet-gevonden?preview=true&id_employee=1&adtoken=4e19b67cf6ae8bc90a42df32f5213a07&preview_id=5170101

Thanks Martin

Fred 14 Jan 2022, 11:57

Something wrong with Favorites module, try to uninstall it for a while

Martin Crielaard 14 Jan 2022, 12:11

Okay uninstalled the favorite module. but stumbling on the next one which i really can’t deinstall: (1/1) UndefinedMethodException

Attempted to call an undefined method named “isLogged” of class “stdClass”.
in pk_menu.php line 1342

Fred 14 Jan 2022, 12:13

newer seen such issue before. The error say that method “isLogged” of Customer instance doesn’t exist. Need some time to figure out what’s wrong

Martin Crielaard 14 Jan 2022, 12:15

Sorry for that. For every error there is a firsttime ;-)

Martin Crielaard 14 Jan 2022, 12:15

Totally clean install with the latest version of the Alysum theme.

Fred 14 Jan 2022, 16:58

could you please disable Opcache in your server configuration to let me edit .php files

Martin Crielaard 14 Jan 2022, 17:01

I think it is disabled now. Please let me know.

Fred 15 Jan 2022, 10:49

it seem to be fixed now

Martin Crielaard 15 Jan 2022, 10:57

Great! Can you please tell me what you have changed? Because same issue was also in the favorites module which is temporary disabled.

Fred 15 Jan 2022, 11:24

I have installed Favorites module and it seem to work
As for the updated code

if (Context::getContext()->customer->id) {
   $this->user_groups = ($this->context->customer->isLogged() 
      ? $this->context->customer->getGroups() 
      : array(Configuration::get('PS_UNIDENTIFIED_GROUP')));

File /modules/pk_menu/pk_menu.php
Line: 1342

Fred 15 Jan 2022, 11:51

Please try now

Martin Crielaard 15 Jan 2022, 11:55

Yes it is working :-).

Is it normal that the 404 Alysum page is not pushed to pagenotfound? Therefore i think the custom page is not displayed. The custom page can be viewed at https://www.zhtest.nl/pagina-niet-gevonden (pagina-niet-gevonden is the dutch friendly url for pagenotfound)

Fred 15 Jan 2022, 12:08

when I try to open a page that is not exist I see “Page not found” page https://take.ms/yqJPY

Martin Crielaard 15 Jan 2022, 12:13

But is it redirected to the pagenotfound? (maybe i don’t understand it clearly) but if it is redirected to the pagenotfound then the custom elemetal page should be shown. See attached screenshot


404.png (134 KiB)
Martin Crielaard 15 Jan 2022, 12:25

Screenshots for extra explanation


404-2.png (135.8 KiB)
404-3.png (277.2 KiB)
Fred 16 Jan 2022, 11:41

I assume you are confused with two kind of pages, 404 (page not found) and Maintenance (page under construction)
I don’t see the issue in the theme, it shows the page you defined

Martin Crielaard 17 Jan 2022, 14:13

Please close this issue. It has something to do with friendly URL.