cms_pico icon indicating copy to clipboard operation
cms_pico copied to clipboard

Twig incompatibility issues with other Nextcloud apps

Open dave-kennedy opened this issue 3 years ago • 3 comments

This code in my template causes the page to timeout:

{{ [page.author, page.date_formatted] | filter(v) | join(' | ') }}

This seems to work fine however:

{{ [page.author, page.date_formatted] | filter(v => v is not empty) | join(' | ') }}

The former works in my dev environment, which has nothing to do with Nextcloud, but not on my prod website, which is using the Nextcloud integration.

Nextcloud version: 23.0.3 Pico CMS for Nextcloud version: 1.0.18

I'd love to tell you which Twig version I have but not sure how.

dave-kennedy avatar Mar 25 '22 03:03 dave-kennedy

It was about time that this also happens for Twig :see_no_evil:

This is the same issue as with #116 and #121: Another Nextcloud app ships a different Twig version than the one Pico uses. Also see https://github.com/nextcloud/cms_pico#app-incompatibilities. Unfortunately we can't do anything about this, this is how Nextcloud deals with dependencies. If there are multiple major versions in between, contents (Markdown, YAML, Twig) might require changes to work properly. AFAIK the only breaking incompatibility is with Parsedown, i.e. in your case you can solve it by editing your theme. To do so you should make sure that your dev setup matches your prod setup.

PhrozenByte avatar Mar 25 '22 13:03 PhrozenByte

Which app is it this time? I guess this app should be added to the incompatibility list then...

szaimen avatar May 02 '22 17:05 szaimen

Since one can solve the issue by simply avoiding the Twig code in question, it rather is a soft incompatibility: It will cause issues at first, but you can solve these issues and get Pico CMS for Nextcloud working. Just like with #121. On the other hand, #116 is a hard incompatibility, because you can't use Pico CMS for Nextcloud - no matter what you do. We only list hard incompatibilities.

PhrozenByte avatar May 02 '22 17:05 PhrozenByte