mayamcdougall / freelancer-pico

A Pico port of Freelancer by Start Bootstrap.
MIT License
11 stars 7 forks source link

Stopped working in Nextcloud 24 #10

Open kugiigi opened 1 year ago

kugiigi commented 1 year ago

Description

Not sure if this is part of your scope but I'm using this theme in PicoCMS for Nextcloud. I've upgraded to NC 24 (also upgraded to PHP 8 which probably also matter). Since then, I'm getting internal server error. I also can't add the theme anymore as it shows an error.

Additional Information

Upon investigation, I was able to add the theme again by not including the file pico-theme.yml in the folder. I was also able to fix the internal server error by removing all line breaks in all content properties. Sadly, this means no multiple paragraphs like in the about section which I do.

mayamcdougall commented 1 year ago

Thanks for the heads up. 😁

I'll keep an eye on your other issue (https://github.com/nextcloud/cms_pico/issues/215) and see what we learn about the | issue before I change anything.

In the meantime, you can just delete the entire demo property in pico-theme.yml (everything from Line 15, demo:, down). It's just placeholder data I used to populate the theme without needing to provide separate sample content (.md) files. 😉

I'd recommend still keeping the top part of pico-theme.yml though, just to be safe. Without reading an api_version in pico-theme.yml, Pico defaults to reading the theme in compatibility mode, which could cause unforeseen weirdness. It's probably fine either way though.

For your About section, you can try temporarily using \n to get it to display the same. The YAML will just have to look ugly in the meantime. 😒

For example, change it from:

content: |
  This is my multiline about section.
  Isn't it nice?

to

content: "This is my multiline about section.\nIsn't it horrible?"

The end result should be rendered the same on the page.

kugiigi commented 1 year ago

Thank you! The workaround worked. I actually already tried to modify the twig to use a different separator which worked but I guess this is better :) It's possibly really the PHP upgrade that caused it since the error in the log is in the YAML's Parser.php.

mayamcdougall commented 1 year ago

No problem. 😉

Yeah, it's probably an upstream dependency issue, because the | syntax is proper YAML.

Traditional Pico has static dependency versions for things it outsources, like YAML and markdown processing. They're pretty dated, but nothing breaks between Pico releases. (In fact, there's a much-overdue 3.0 release we need to finish to properly support PHP 8.0, but that's another matter. 😓).

As far as I know, Pico for Nextcloud instead has more of a rolling dependency situation, since it has to keep up with and run in the same environment as Nextcloud.

The Nextcloud version is certainly convenient, but it does unfortunately run into more technical hurdles than the regular release. 😔