Home / Prestashop Module Tutorials / Ap Page Builder / [Error] Try to acccess array offset on value of type null in apgencode.php line 106

[Error] Try to acccess array offset on value of type null in apgencode.php line 106

Hi

If you see error

Try to acccess array offset on value of type null in apgencode.php line 106

please follow my guide to fix

open file /modules/appagebuilder/classes/shortcodes/ApGenCode.php

find code:

$profile_data = $module->getProfileData();
$profile_folder = $profile_data[‘profile_key’];

remove it

code:

$file_url = apPageHelper::getConfigDir(‘theme_profiles’).$profile_folder.’/’.$file_name;

replace it with

$file_url = apPageHelper::getConfigDir(‘theme_profiles’).’/’.$file_name;

find the code

$assign[‘formAtts’][‘error_message’] = “ERROR!!! Generate Code
‘$title’. Physical file does not exist “.apPageHelper::getThemeName().’/’.$profile_folder.’/’.$file_name;

replace with

$assign[‘formAtts’][‘error_message’] = “ERROR!!! Generate Code
‘$title’. Physical file does not exist “.apPageHelper::getThemeName().’/’.$file_name;

find the code

$profile_data = $module->getProfileData();
$folder = $folder_profiles.$profile_data[‘profile_key’];

remove it

$folder = $folder_profiles.$profile_data[‘profile_key’];

replace to

$folder = $folder_profiles;

your override file with link

/modules/appagebuilder/classes/shortcodes/ApGenCode.php

https://github.com/leotheme/fixbugpagebuilder/blob/main/ApGenCode.php

About Leo Theme

Check Also

Update Zoom in in mobile and lightgallery for product detail

Hi. We have just update zoom product image in mobile and added lightgallery for product …