madi-nuralin / material

A theme plugin for pkp/ojs
GNU General Public License v3.0
2 stars 0 forks source link

Smarty Deprecation error #42

Open munir-abbasi opened 2 weeks ago

munir-abbasi commented 2 weeks ago

I am getting this error. screenshot is attached. It appeared after I tried to create a childtheme. However, it persists, even after disabling the child theme, updating to latest material theme.

is it, by any chance, associated with material theme? Screenshot 2024-07-10 175548

munir-abbasi commented 2 weeks ago

Please check this too.

madi-nuralin commented 2 weeks ago

I haven't examined this issue before, my assumptions: It seems like the deprecation error involves to the newer version of smarty engine which you're using. According to https://github.com/smarty-php/smarty/issues/962 we can't call static php methods directly anymore. So that we need to apply the following trick: https://www.smarty.net/docs/en/api.register.class.tpl

Nevertheless, those templates where overriden from the latest ojs repository.

munir-abbasi commented 2 weeks ago

I actually posted here hoping to get help from you. I tried registering the classes with smarty and have visited the page you mentioned in your reply. It took me a week of constant trying. I did manage to make some errors disappear by tempering with the smarty_internal_templateparser.php but it was becoming alot tedious.

I actually have no coding background. I am just a hobbiyst who can google. :) I reinstalled OJS, reinstalled the material theme after you updated it, and the error re-appeared. Found that it appears with the OJS default theme too.

Unless the OJS team comes up with a solution, I think the only option I have is to downgrade smarty to get rid of this error.

madi-nuralin commented 2 weeks ago

Fine, For the moment I'm a little busy. After all, this project is kind a hobby for me, and I don't always have time to maintain the repository.

But I will consider this issue in the near future, let’s leave this issue open (possibly with milestone v3_0_2-0). I need to analyze the theme's compatibility with the latest version of the Smarty engine.

On the other hand, as you mentioned, such coding practices are widespread throughout the pkp/ojs project, so fixing them quickly is quite problematic.

And thank you for reporting issue!

munir-abbasi commented 2 weeks ago

Thank you. I understand that most of these projects are individual projects, hobby usually. I am currently trying to find a solution. If and when I find one, I will report back.