seb-vial / grav-plugin-about-me

Simple plugin to show some information about yourself, with a nice picture, your name, your title/job and a description
MIT License
9 stars 7 forks source link

Problem with avatars in Grav 1.1 RC3 #3

Closed paulcmal closed 8 years ago

paulcmal commented 8 years ago

After modifying settings in the plugin admin interface, the aboutme page cannot be rendered anymore :

"An exception has been thrown during the rendering of a template ("Array to string conversion") in "partials/aboutme.html.twig" at line 4."

Digging around, I found that picture_src is not storing just the filename with Grav 1.1 but saving a full array of info about the file, hence the error.

Sample data from aboutme.yaml after uploading :

picture_src:
  user/plugins/aboutme/assets/avatars/100px-PlaceHolder.png:
    name: 100px-PlaceHolder.png
    path: user/plugins/aboutme/assets/avatars/100px-PlaceHolder.png
    type: image/png
    size: 30971
    file: user/plugins/aboutme/assets/avatars/100px-PlaceHolder.png
    route: null
seb-vial commented 8 years ago

I haven't tried Grav 1.1 yet, I'll check the doc and see if I can handle both ways. Thanks for the update

seb-vial commented 8 years ago

Ok I've added a condition which manage the v1.1 RC3 case. I'm curious as to why they would use the file path as key in the array of files, there's already a path key for the file's array...