YunoHost-Apps / shaarli_ynh

Shaarli package for YunoHost
GNU General Public License v3.0
20 stars 14 forks source link

Templates are not updated on upgrade (was: Title and descriptions fields do not autofill anymore) #65

Closed nicofrand closed 2 years ago

nicofrand commented 3 years ago

Describe the bug

When adding a link (ex: https://github.com/shaarli/Shaarli), the title and description fields are not auto-filled.

Context

Steps to reproduce

Expected behavior

You can try on https://demo.shaarli.org/admin/shaare?post=https%3A%2F%2Fgithub.com%2Fshaarli%2FShaarli with login demo and password demo.

Logs

I could not find any meaningful log.

nicofrand commented 3 years ago

The demo loads a metadata.min.js script unlike my instance (and `tpl/default/editlink.html is not uptodate with https://github.com/shaarli/Shaarli/blob/v0.12.1/tpl/default/editlink.html#L116).

nicofrand commented 3 years ago

I think my default template was not updated along with the 0.12.1 version…

I just tried yunohost app upgrade shaarli -u https://github.com/YunoHost-Apps/shaarli_ynh/ and the template still seems obsolete. If I delete the directory and retry the upgrade the directory is not recreated.

https://github.com/YunoHost-Apps/shaarli_ynh/blob/master/scripts/upgrade#L77 should probably only copy templates that do not exist in the freshly downloaded source!

lapineige commented 3 years ago

Thanks for investigating into that issue !

https://github.com/YunoHost-Apps/shaarli_ynh/blob/master/scripts/upgrade#L77 should probably only copy templates that do not exist in the freshly downloaded source!

Do we need to do any manual change to these files ? If not, then the easiest way is not to copy them, and install all templates again.

nicofrand commented 3 years ago

The initial issue with templates was that everything currently installed was removed (templates downloaded by the user too) and only "official" templates (the ones in the sources) were available.

I do not believe we need to support manual changes to the templates: any modification in the source should be preferred or there will be bugs (like the current one).

To sum up: current templates directory should be copied only if not already existing in the sources.

lapineige commented 3 years ago

I believe #66 should fix this : it copies the files in shaarli folder, but don't override any existing file that was installed with the upgrade.

lapineige commented 3 years ago

:up: