Minishop2 for 3.0.4?

There is only one error for today, and it is the following:

[30-Nov-2023 08:35:22 Europe/Berlin] PHP Notice:  session_start(): ps_files_cleanup_dir: opendir(/tmp/.priv) failed: Permission denied (13) in /htdocs/modx/core/model/modx/modx.class.php on line 2357

It’s unlikely that this is the correct error message.

In the developer tools → “Network” tab, is there by any chance an error message in the response of the request with the 500 status code?
Click the request and instead of the tab “Headers” (as in your screenshot above) select the tab “Response”.

In the “Response” tab, there is nothing present. No response is being displayed to me:

Well without an error message it’s hard to find out what causes the 500 error.
Is it possible to (temporarily) set display_errors to On (in the server config) to show errors on screen (or in the “Response” tab)?

Is it only Minishop2-Product-resources you can’t save, or all MODX resources?

It’s only MiniShop2 resources that are not being saved…
Can you tell me where I define display_errors?

For self-hosting, it’s in the configuration file php.ini.

If you are using a hosting provider, then maybe you can activate it somewhere in the control panel. There’s no general answer. It depends on the provider.

Ah, of course… I have now changed it accordingly. However, no response is still being displayed…
Also, nothing new is being displayed.

Should I rather open a new topic to discuss this issue? Or should we continue to talk about it here?

Additionally, the MODX error log is still showing an error with the Anti Spam plugin…

/htdocs/modx/core/cache/includes/elements/modplugin/5.include.cache.php : 42) PHP warning: Undefined property: modX::$documentOutput

and I can’t make sense of the following entries:

[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/cache/includes/elements/modsnippet/12.include.cache.php : 56) PHP warning: Undefined array key "category"
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/cache/includes/elements/modsnippet/12.include.cache.php : 56) PHP warning: Undefined array key "category_name"
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/cache/includes/elements/modsnippet/12.include.cache.php : 56) PHP warning: Undefined array key "category"
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/cache/includes/elements/modsnippet/12.include.cache.php : 56) PHP warning: Undefined array key "category_name"
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/cache/includes/elements/modsnippet/12.include.cache.php : 110) PHP warning: Undefined array key "return"
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/cache/includes/elements/modsnippet/12.include.cache.php : 110) PHP warning: Undefined array key "return"
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/components/minishop2/handlers/storage/session/cartsessionhandler.class.php : 15) PHP warning: Undefined array key "minishop2"
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/components/minishop2/handlers/storage/session/cartsessionhandler.class.php : 15) PHP warning: Trying to access array offset on value of type null
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/components/minishop2/handlers/storage/session/ordersessionhandler.class.php : 22) PHP warning: Undefined array key "minishop2"
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/components/minishop2/handlers/storage/session/ordersessionhandler.class.php : 22) PHP warning: Trying to access array offset on value of type null
[2023-12-01 08:53:12] (ERROR @ _/htdocs/modx/core/cache/includes/elements/modplugin/5.include.cache.php : 42) PHP warning: Undefined property: modX::$documentOutput
[2023-12-01 08:54:43] (ERROR @ _/htdocs/modx/core/cache/includes/elements/modplugin/5.include.cache.php : 42) PHP warning: Undefined property: modX::$documentOutput

I have noticed that the “is being saved” display keeps running continuously, but changes in the resource are displayed/adopted after the display is ignored. However, when I try to create a new product resource, the following error is displayed in the frontend: Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/modx/core/components/pdfresource/vendor/mpdf/mpdf/mpdf.php on line 2349.
So, do I have to update PDFResource because PHP 8.0 standards are not met? That would be my worst case…

These are all mere “PHP warnings”. The code still works correctly. It’s just that now in PHP 8 a warning is created.

What is the snippet with the ID = 12?
If it’s a custom snippet, then adjust the code on line 56 (or 110 for the other warning) to be correct in PHP 8.
If it’s from an extra, then the code will probably get fixed by the author of the extra in the next version.

This is also just a warning. Maybe try to fix the code yourself.
Or switch to a different extra (like “emo”). I can’t even find this extra in the extras-repository anymore, or on Github.

Do you have the latest version of the extra PDFResource installed? Version 2.0.1-pl?

There is an event OnDocFormSave that runs after a resource has been saved.
If a resource is saved correctly, but the “save”-request fails, then usually a plugin that runs on the event OnDocFormSave throws an error.

You could go to the system settings page (manager/?a=system/settings), then change to the tab “System Events” and filter by “OnDocFormSave” to see what plugins run on this event.
Then maybe temporarily deactivate them one by one to see what plugin causes the error.

The snippet with ID 12 is msProductOptions from MiniShop2.
This is the content in line 55 & 56:

    $skip = (!empty($ignoreGroups) && (in_array($option['category'], $ignoreGroups) || in_array($option['category_name'], $ignoreGroups)))
        || (!empty($groups) && !in_array($option['category'], $groups) && !in_array($option['category_name'], $groups));

For now, I will deactivate the AntiSpam extra and then look for an alternative…

I have not installed a new version of PDFResource, as strangely, all my settings were lost in two attempts to update it. For testing and finding the error, I have deactivated the extra…

Ah okay, I will take a look at that.