We recently updated our webserver to latest PHP.
Now we get a message ontop of our website the reads:
"Unknown: Using the "Twig_Loader_Array" class is deprecated since Twig version 2.7, use "Twig\Loader\ArrayLoader" instead. in C:\inetpub\OC_MBT_STORAGE\vendor\twig\twig\lib\Twig\Loader\Array.php on line 7Unknown: Using the "Twig_Loader_Filesystem" class is deprecated since Twig version 2.7, use "Twig\Loader\FilesystemLoader" instead. in C:\inetpub\OC_MBT_STORAGE\vendor\twig\twig\lib\Twig\Loader\Filesystem.php on line 7"
I dont know what to do to correct this.
Can anyone help me please?
OC version
PHP version
Theme used
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com
Or turn off Error display
Or, you can update TWIG vendor to 3.3.4/3.3.5 because WebKull company was lazy to add 3.x Twig version in 3.0.x.x Branch...
https://github.com/opencart/opencart/issues/9356
If you don't have custom modification you can upgrade to latest 3.0.3.8
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Code: Select all
new \Twig_Loader_Array( ... )
Hence, you are not providing sufficient details to really be able to help you.
The last 2 OpenCart releases 3.0.3.7 and 3.0.3.8 already use this in the system/library/template/twig.php:
Code: Select all
$loader = new \Twig\Loader\ArrayLoader(array($filename . '.twig' => $code));
So, unless you give us more details about your exact OpenCart version used, modifications used, extensions used, web theme, etc, nobody will be able to help you here.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Sorry, I might seem dumb, but Im just inexpereinced with this.
It seems that this issues exited with others. Updating TWIG...
Ok, and now maybe a dumb question... How do I update twig?
Twig 3.3.5
Attachments
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Thank you for your help.
I tried this, but it didnt fix the issue.
It only caused the content of the site to not be visible anymore either.
Before, the site was visible, just with the message on top. Now the message is on top, but no content anymore.
The path should be: storage_folder/vendor/twig/twig (and here files/folders)
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Yes, I have copied and overwritten the files (I kept copy of the original folder, so I can put back)
Am I allowed to post the URL of the site in question, so you can see what the current situation is?
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
What is that constant path name about?Kevin.VdH wrote: ↑Mon Jan 03, 2022 5:32 pmHi,
We recently updated our webserver to latest PHP.
Now we get a message ontop of our website the reads:
"Unknown: Using the "Twig_Loader_Array" class is deprecated since Twig version 2.7, use "Twig\Loader\ArrayLoader" instead. in C:\inetpub\OC_MBT_STORAGE\vendor\twig\twig\lib\Twig\Loader\Array.php on line 7Unknown: Using the "Twig_Loader_Filesystem" class is deprecated since Twig version 2.7, use "Twig\Loader\FilesystemLoader" instead. in C:\inetpub\OC_MBT_STORAGE\vendor\twig\twig\lib\Twig\Loader\Filesystem.php on line 7"
I dont know what to do to correct this.
Can anyone help me please?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Clear both OC caches from the OC admin after applying these changes.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: Semrush [Bot] and 556 guests