Deprecated functions in PHTML files #2606
Replies: 4 comments 11 replies
-
Have you tried syntax-check that is used in github workflow? |
Beta Was this translation helpful? Give feedback.
-
Ref my comment here, can you try to change line 263 to magento-lts/app/code/core/Mage/Core/Block/Template.php Lines 263 to 266 in 5de30bf Does it throw an error on implode after the change?
|
Beta Was this translation helpful? Give feedback.
-
At this moment we have the following code in OpenMage: magento-lts/app/code/core/Mage/Core/Block/Template.php Lines 262 to 265 in f96f0b3 I would propose the following change: } catch (Throwable $e) {
ob_get_clean();
Mage::logException($e);
// throw $e; By using The advantage of this simple modification is that the Frontend is loaded entirely and only the block with the issue is omitted. In my case, where the implode function was used, it is not displayed. Now troubleshooting is simple, I go to /var/log and I get all the template issues in exceptions file. I'm really surprised why it was preferred to display errors from templates in the browser instead of being recorded in exceptions.log or another file by using |
Beta Was this translation helpful? Give feedback.
-
I have a pending PR that resolves a lot of deprecation errors, but it's not exhaustive. Please if you can, take note of any errors you encounter that have to do with PHP 8.1's changed behavior so that they can be worked on either by me, or anyone else. |
Beta Was this translation helpful? Give feedback.
-
I recently worked at a store that needs to switch to PHP 8.1. If regarding the OpenMage files the matter was resolved and I did not encounter any errors in the log files, the theme and the extensions caused me big issues.
Today I spent an hour trying to understand why the product page does not load in the information area. After disabling all the extensions and not getting any positive results, I took the layout files first. I found that removing one loaded the page. I looked inside and identified the few PHTML files. Analyzing them one by one, I found nothing wrong, the variables were all displayed.
Then I went to the comment line by line until I found
echo implode ($config, ',')
. When I reversed the parameters of the function, the situation was resolved. I looked for references and starting with PHP 8.0 this function parameters were switched. Honestly, I didn't know about this change, but I can't help but notice that in version 7, the PHP team scratched their right ear with their left hand in some respects.In case someone faces this problem I wanted to make it public. Please note no errors were reported in the log files. Is there any way to debug the PHTML files and get in system.log the errors?
Beta Was this translation helpful? Give feedback.
All reactions