Page 1 of 1
Media db “leading zero” in dir names
Posted: Fri Oct 05, 2012 2:50 pm
by yellowled
Using s9y 1.7-alpha1 (aka “master”) in a dev blog, I get a zero in front of every directory I add to the media db. This is only displayed in select elements in the backend, i.e. when I pre-select a directory in any of the media db dialogues. It's not displayed in the directory list or settings. Only tested in Chrome.
YL
Re: Media db “leading zero” in dir names
Posted: Sat Oct 06, 2012 12:14 pm
by garvinhicking
Hi!
Thanks for the heads-up. I suppose this is due to the smartification of the backend templates. Timbalu, can you reproduce/check this?
Regards,
Garvin
Re: Media db “leading zero” in dir names
Posted: Sat Oct 06, 2012 1:33 pm
by Timbalu
He said
Using s9y 1.7-alpha1 (aka “master”) in a dev blog
Smartification is in 2.0!

Re: Media db “leading zero” in dir names
Posted: Sat Oct 06, 2012 7:02 pm
by Timbalu
I would expect its this
Code: Select all
{' '|@str_repeat:$folder.depth*2}
as found in templates\default\admin\media_upload.tpl and media_pane.tpl, which can't cope with Smarty 3 somehow..., needs investigation!
Re: Media db “leading zero” in dir names
Posted: Sun Oct 07, 2012 9:54 am
by Timbalu
fixed str_repeat modifier use …
A Smarty3 modifier has higher priority than multiplication, so we have to use parenthesis to execute math first. Using additional parenthesis will do no harm in Smarty2 environments, so better check for others.
Re: Media db “leading zero” in dir names
Posted: Wed Nov 21, 2012 8:41 am
by yellowled
Just stumbled upon: same error for the category select field when upload new media. (In recent 2.0 branch.)
YL
Re: Media db “leading zero” in dir names
Posted: Wed Nov 21, 2012 9:26 am
by Timbalu
Is that a question to repair?
It should already be there in 2.0 smartified files. See
https://github.com/s9y/Serendipity/comm ... upload.tpl
Please update your files at
https://github.com/yellowled/s9y-admin- ... d.tpl#L233
to
Code: Select all
{' '|@str_repeat:($folder.depth*2)} {$folder.name}</option>
Update: I send you a pull request.
Re: Media db “leading zero” in dir names
Posted: Wed Nov 21, 2012 12:02 pm
by yellowled
Timbalu wrote:Is that a question to repair?
More like “stumbled upon it, didn't have the time to take a closer look myself because I'm knee-deep in media db tpl files, so I thought I'd report it”.
Timbalu wrote:Update: I send you a pull request.
Thanks. I love getting those.
YL