Additional characters added to cover image filename

I’ve been trying to duplicate the Album plugin in the v3 Starterkit. The duplicated plugin and blueprint are now called Portfolio. It’s mostly working; however I’ve found an odd thing which is causing the cover image to break.

I can use Panel to select a cover image in a new Portfolio page, and that choice gets displayed back next time I view the Portfolio page in Panel.

However, when I view the PHP object for the Portfolio page I can see the value for cover has a “- >” prefix. The same prefix exists in the page’s text file. Any thoughts on where this prefix is coming from…?

/1_portfolio_test/portfolio.txt
Kirby-coverimage

/portfolio.yml

index.html with PHP object printed

/models/portfolio.php

I dont think thats anything to worry about, the files are in yaml, and that > is part of yaml, not the filename. I think youve got it because the file name is so long.

normally files get stored like:

- filename1.jpg
- filename2.jpg
- filename3.jpg

Im not sure about the finer points of yaml, but i think that > charchter is there to get it to look to the next line, otherwise it would probably think the field was empty.

Try shortening the file name.

There are two ways to write multi-line strings in yaml:

  • The pipe (|) is used to preserve new lines in text strings
  • The “greater then” (>) character is used to collapse new lines in text strings

Shortening the filename hasn’t helped.

Edit: Apparently it did!
Looks like this issue is something to do with the model or the controller.