Product Filters 500 Internal Server Error

Problem Description:

Recently, I encountered the following error while using the JupiterX Core plugin on our site:

2024-06-14T05:38:08+00:00 Critical Uncaught TypeError: Cannot access offset of type string on string in /httpdocs/wp-content/plugins/jupiterx-core/includes/extensions/raven/includes/modules/products/module.php:267

500 Internal Server Error

PHP Fatal error

AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in httpdocs/wp-content/plugins/jupiterx-core/includes/extensions/raven/includes/modules/products/module.php:112\nStack trace:\n#0 httpdocs/wp-includes/class-wp-hook.php(324): JupiterXCore\Raven\Modules\Products\Module::ravenbeforeshoploopitem()\n#1 httpdocs/wp-includes/class-wp-hook.php(348): WPHook->applyfilters()\n#2 httpdocs/wp-includes/plugin.php(517): WPHook->doaction()\n#3 httpdocs/wp-content/themes/jupiterx/lib/templates/woocommerce/content-product.php(41): doaction()\n#4 httpdocs/wp-includes/template.php(792): require('…')\n#5 httpdocs/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): loadtemplate()\n#6 /wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shor…', referer: /negozio/?sellkitfilters=1&products_cat=diffusori

This error occurs in the module.php file at line 267. After analyzing the code, I found that the issue is in the addcustomlayout_hooks function, where it attempts to access an offset on a string.

Relevant Code:

public static function ravenbeforeshoploopitem() {

$layout = self::$settings['content_layout']; // line 112$location = self::$settings['pc_atc_button_location']; // line 118

}

public static function addcustomlayout_hooks( $settings ) {

$location = self::$settings['pc_atc_button_location']; // line 267

}

Temporary Solution:

To temporarily resolve the issue, I modified the code as follows:

$location = 'overlay';

$layout = 'metro';

This workaround allowed me to bypass the error and get the site functioning properly.

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
💡

Feature Request

Date

Almost 2 years ago

Author

Enri

Subscribe to post

Get notified by email when there are changes.