Jump to content
thirty bees forum

Leaderboard

Popular Content

Showing content with the highest reputation on 05/17/2025 in Posts

  1. Unfortunately it won't be easy to upgrade smarty to newer versions easily. New versions of smarty raises a lot of new deprecation warnings when templates call php methods directly. We are now required to register all methods that are allowed to be called from smarty template. As you can imagine, that's something absolutely impossible for system like thirtybees/prestashop -- we simply don't have that information. For example, if some module template contains code like this: {if Configuration::get('PS_INVOICE')} <span>...</span> {/if} we would have to tell smarty engine that the method Configuration::get exists and can be called. In the near future, using that template without registering the method would cause runtime error. Because we are using templates from third party modules and themes, we simply don't know what methods are used. The only potential solution for us is to parse templates to collect list of all used methods so we could register them before template is used. While the parsing can be done only once (when template source changes), the registration of methods needs to be done on every render. That will cause quite a big performance impact - we need to load the info from somewhere and pass it to smarty engine. I don't understand why this change has been introduced, and I'm very unhappy about that. We will either have to keep using smarty 4.4.1 forever (which is not possible due to new php versions not supporting it). Or we will have to invest days or weeks of work to implement that stupid registration, just to get to the same point we are now.
    1 point
×
×
  • Create New...