Twig errors with custom template on Chamilo upgrade

If you use Chamilo and decided to develop your own template, you might be faced with an issue while upgrading from Chamilo 1.11.2 (or below) to 1.11.4 (or above).

The issue will usually be reflected by either of these:

  • a white page
  • an error message about Twig
  • if you have xdebug installed and showing error messages, something like this:

Twig error syntax unknown filter

This is due to the “get_configuration_value” filter being modified in 1.11.4 to “api_get_configuration_value”. Nothing out of the ordinary, but you might be surprised to find it when you upgrade.

Again, this only happens if you have developed your own template. If you haven’t, then this will be taken in charge by the Chamilo upgrade process.

To fix this, you have 2 methods:

  • Enter each file and change “get_configuration_value” to “api_get_configuration_value”, then enter the admin panel of Chamilo and clean the cache directory
  • Under Linux, in command line, automate that replacement by getting into the main/template/my-template/ directory and launching the following command (then also clean the cache as above)

find . -type f -exec sed -i ‘s/get_configuration_value/api_get_configuration_value/g’ {} +

Our blog system sometimes replaces single quotes by some type of fancy quote, so if you have issues with the command above, just retype the quotes by hand.

About BeezNest

BeezNest is (from 2016 to 2018) the recognized official editor of Chamilo. Together with the Chamilo Association and the Chamilo community, we provide you with the easiest to use, best value for money and most motivating Open Source e-learning platform there is. We are experts in providing highly advanced services for complex e-learning use cases.

As always, if you have needs for advanced consulting, development or support on Chamilo, don’t hesitate to drop us a request in our contact form.

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *