PrestaShop / PrestaShop

PrestaShop is the universal open-source software platform to build your e-commerce solution.
https://www.prestashop-project.org/
Other
8.11k stars 4.79k forks source link

Debug mode cannot be switched from the back office if defines_custom.inc.php is used #36487

Open kpodemski opened 3 months ago

kpodemski commented 3 months ago

Prerequisites

Describe the bug and add attachments

In PrestaShop 9, the debug mode cannot be switched from the back office performance page.

The error says:

Error: Could not find whether debug mode is enabled. Make sure that the correct permissions are set on the file /Users/kpodemski/code/prestashop9/config/defines.inc.php

It is because the file config/defines_custom.inc.php exists, and the code tries to determine the developer module inside it, instead of using the original one if const doesn't exist in the custom file.

Expected behavior

I should be able to switch debug mode from the back office even if I use file config/defines_custom.inc.php

Steps to reproduce

  1. Create a file config/defines_custom.inc.php
  2. Inside, you can put:
<?php

define('_PS_API_FORCE_TLS_VERSION_', false);
  1. Now try to switch the debug option inside the back office.

PrestaShop version(s) where the bug happened

9.0.0

PHP version(s) where the bug happened

8.1

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

No response

florine2623 commented 3 months ago

Hello @kpodemski ,

I reproduce the issue with PrestaShop version 9.0.0, I'll add this to the backlog so it can be fixed.

Screenshot 2024-07-03 at 15 26 42

Please be aware that some issues might take a very long time to be resolved. If this one is important to you and you cannot wait for it to be fixed on the project’s own time, we strongly suggest you consider contacting a professional to help you.

If you fix the issue on your end, please contribute it back to the project. Remember that the more people contribute, the better PrestaShop becomes for everyone.

Thank you

dnkhack commented 2 months ago

Hello.

Same issue on PS 8.1.6 PHP 8.1 I have tried to set full rights to defines.inc.php but that doesn't solve the issue.

@kpodemski can I ask you to make "Images Regenerate"? Do you have the right access to some image files during regeneration?

kpodemski commented 2 months ago

Hello.

Same issue on PS 8.1.6 PHP 8.1

I have tried to set full rights to defines.inc.php but that doesn't solve the issue.

@kpodemski can I ask you to make "Images Regenerate"? Do you have the right access to some image files during regeneration?

This issue I added is not related to file rights. I also do not have any issues with images regenerating