You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling this as: {getHolderByVakgebied $_modx->resource.ubeeo_vakgebied} works fine. but using it like this:
{foreach json_decode(getHolderByVakgebied $_modx->resource.ubeeo_vakgebied, true) as $block index=$index}
does not work and gives errors, I also tryed to set it as a variable first like this: {var $blocks = getHolderByVakgebied $_modx->resource.ubeeo_vakgebied}
same errors.
This function uses $this->modx->..., so I can not make it static...
The only way I got this to work on my tests is to allow php in tags and skip the whole addFuction part and call the function directly, but that is not so safe I think: {foreach json_decode($modx->adwUbeeo->getHolderByVakgebied($_modx->resource.ubeeo_vakgebied), true) as $block index=$index}
but that works fine.
The text was updated successfully, but these errors were encountered:
I found this bug
When you create your own function with addFunction or addFunctionSmart and like to use the results in another fenom tag/function, i get errors
This is Fenom and PHP version and environment (server/fpm/cli etc) I am using
I use Fenom parser in MODx on php7.4
This is the function in my class
This is a plugin code snippet I use to add the tag
Calling this as:
{getHolderByVakgebied $_modx->resource.ubeeo_vakgebied}
works fine. but using it like this:{foreach json_decode(getHolderByVakgebied $_modx->resource.ubeeo_vakgebied, true) as $block index=$index}
does not work and gives errors, I also tryed to set it as a variable first like this:
{var $blocks = getHolderByVakgebied $_modx->resource.ubeeo_vakgebied}
same errors.
This function uses $this->modx->..., so I can not make it static...
The only way I got this to work on my tests is to allow php in tags and skip the whole addFuction part and call the function directly, but that is not so safe I think:
{foreach json_decode($modx->adwUbeeo->getHolderByVakgebied($_modx->resource.ubeeo_vakgebied), true) as $block index=$index}
but that works fine.
The text was updated successfully, but these errors were encountered: