Forums | Mahara Community

Support /
Upgrade from 22.04 to 25.04 : functions in theme templates


Cédric Bois's profile picture
Posts: 1

26 January 2026, 22:49

Hello,

I'm trying to update my Mahara from 22.04 to 25.04 

I have a custom theme with files in smarty which use functions from PHP native or from lib files, but in the new version of Mahara, theses functions are not able in the view files. Do you have a solution to expose it without modify the Mahara core ?

Thank you

Kristina Hoeppner's profile picture
Posts: 5023

29 January 2026, 12:31

Hi Cédric,

Thank you for your question and yeah for the upgrade! Smarty does not allow any more that PHP functions are called directly. Rather than use a PHP function in the template, you message the data on the PHP side and then send the formatted data to the template.

However, if you do nee to use PHP functions, you would added them the allow-list of functions in the Smarty file that can be used in template files. There is a list of Smarty functions and modifiers and you would allow list what you need in that file. Each then has a wrapper function that calls the PHP function.

We have a migration guide in the wiki.

Cheers

Kristina
(on behalf of the dev who provided the tech details 😃)

 

2 results