Post by Kevin.VdH » Mon Jan 03, 2022 5:32 pm

Hi,
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?

Newbie

Posts

Joined
Mon Jan 03, 2022 5:28 pm

Post by xxvirusxx » Mon Jan 03, 2022 6:07 pm

More info...

OC version
PHP version
Theme used

My Converted Modules | Opencart Upgrade Service | Free Dashboard Maps | Buy me a beer | My Custom OC 3.0.3.8


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by thekrotek » Mon Jan 03, 2022 6:16 pm

Revert back to PHP 7.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by Kevin.VdH » Mon Jan 03, 2022 6:33 pm

xxvirusxx wrote:
Mon Jan 03, 2022 6:07 pm
More info...

OC version
PHP version
Theme used
OC version: 3.0.3.6
PHP version : 8
Theme used: I dont know. Where can I see this? I recently took over administrating this website, and have limited expererience with OC

Newbie

Posts

Joined
Mon Jan 03, 2022 5:28 pm

Post by Kevin.VdH » Mon Jan 03, 2022 6:34 pm

thekrotek wrote:
Mon Jan 03, 2022 6:16 pm
Revert back to PHP 7.
Thank you for your suggestion. But that's not an option. We have another site running on the webserver that needs latest PHP, that's why we had to update.

Newbie

Posts

Joined
Mon Jan 03, 2022 5:28 pm

Post by xxvirusxx » Mon Jan 03, 2022 6:34 pm

The easy way is this
thekrotek wrote:
Mon Jan 03, 2022 6:16 pm
Revert back to PHP 7.4.
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...
Kevin.VdH wrote:
Mon Jan 03, 2022 6:33 pm
OC version: 3.0.3.6
https://github.com/opencart/opencart/issues/9356

If you don't have custom modification you can upgrade to latest 3.0.3.8
Last edited by xxvirusxx on Mon Jan 03, 2022 6:42 pm, edited 1 time in total.

My Converted Modules | Opencart Upgrade Service | Free Dashboard Maps | Buy me a beer | My Custom OC 3.0.3.8


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by JNeuhoff » Mon Jan 03, 2022 6:39 pm

None of the OpenCart 3.0.x releases use

Code: Select all

new \Twig_Loader_Array( ... )
in the system/library/template/twig.php.

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));
and won't produce this particular error.

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.

Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by xxvirusxx » Mon Jan 03, 2022 6:44 pm

JNeuhoff wrote:
Mon Jan 03, 2022 6:39 pm
Hence, you are not providing sufficient details to really be able to help you.
Kevin.VdH wrote:
Mon Jan 03, 2022 6:33 pm
OC version: 3.0.3.6
PHP version : 8
https://github.com/opencart/opencart/issues/9356

My Converted Modules | Opencart Upgrade Service | Free Dashboard Maps | Buy me a beer | My Custom OC 3.0.3.8


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Kevin.VdH » Mon Jan 03, 2022 6:56 pm

xxvirusxx wrote:
Mon Jan 03, 2022 6:44 pm
JNeuhoff wrote:
Mon Jan 03, 2022 6:39 pm
Hence, you are not providing sufficient details to really be able to help you.
Kevin.VdH wrote:
Mon Jan 03, 2022 6:33 pm
OC version: 3.0.3.6
PHP version : 8
https://github.com/opencart/opencart/issues/9356
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?

Newbie

Posts

Joined
Mon Jan 03, 2022 5:28 pm

Post by xxvirusxx » Mon Jan 03, 2022 7:43 pm

Copy this in Vendor folder from you storage, extract( extract here) and should work.
Twig 3.3.5

My Converted Modules | Opencart Upgrade Service | Free Dashboard Maps | Buy me a beer | My Custom OC 3.0.3.8


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Kevin.VdH » Mon Jan 03, 2022 8:36 pm

xxvirusxx wrote:
Mon Jan 03, 2022 7:43 pm
Copy this in Vendor folder from you storage, extract( extract here) and should work.
Twig 3.3.5
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.

Newbie

Posts

Joined
Mon Jan 03, 2022 5:28 pm

Post by xxvirusxx » Mon Jan 03, 2022 9:02 pm

Sure you have copied correctly?

The path should be: storage_folder/vendor/twig/twig (and here files/folders)

My Converted Modules | Opencart Upgrade Service | Free Dashboard Maps | Buy me a beer | My Custom OC 3.0.3.8


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Kevin.VdH » Mon Jan 03, 2022 9:22 pm

xxvirusxx wrote:
Mon Jan 03, 2022 9:02 pm
Sure you have copied correctly?

The path should be: storage_folder/vendor/twig/twig (and here files/folders)
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?

Newbie

Posts

Joined
Mon Jan 03, 2022 5:28 pm

User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by Kevin.VdH » Mon Jan 03, 2022 9:43 pm

xxvirusxx wrote:
Mon Jan 03, 2022 9:27 pm
Then pay a developer.
Thank you for your time to try and help me.

Newbie

Posts

Joined
Mon Jan 03, 2022 5:28 pm

Post by xxvirusxx » Mon Jan 03, 2022 9:48 pm

If you want to look to the issue contact me on PM or Skype ( My profile) to discuss.

My Converted Modules | Opencart Upgrade Service | Free Dashboard Maps | Buy me a beer | My Custom OC 3.0.3.8


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by straightlight » Mon Jan 03, 2022 10:06 pm

Kevin.VdH wrote:
Mon Jan 03, 2022 5:32 pm
Hi,
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?
What is that constant path name about?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Mon Jan 03, 2022 10:07 pm

Kevin.VdH wrote:
Mon Jan 03, 2022 9:22 pm
xxvirusxx wrote:
Mon Jan 03, 2022 9:02 pm
Sure you have copied correctly?

The path should be: storage_folder/vendor/twig/twig (and here files/folders)
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?
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


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by zaferhali » Tue Jan 25, 2022 9:29 pm

I'm getting the same error. can you help me?

previous Oc Ver. 3.0.3.2
previous Php 7.3

current;
Oc Ver. 3.0.3.8
Php 8

@xxvirusxx Twig 3.3.5 it didn't work for me

Note: I'm sorry for my bad english

Newbie

Posts

Joined
Thu Jan 24, 2019 9:54 pm

Post by JNeuhoff » Wed Jan 26, 2022 12:05 am

zaferhali wrote:
Tue Jan 25, 2022 9:29 pm
I'm getting the same error. can you help me?

previous Oc Ver. 3.0.3.2
previous Php 7.3

current;
Oc Ver. 3.0.3.8
Php 8

@xxvirusxx Twig 3.3.5 it didn't work for me

Note: I'm sorry for my bad english
Use PHP 7.4

Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 21 guests