Media db “leading zero” in dir names

Found a bug? Tell us!!
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Media db “leading zero” in dir names

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Media db “leading zero” in dir names

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Media db “leading zero” in dir names

Post by Timbalu »

He said
Using s9y 1.7-alpha1 (aka “master”) in a dev blog
Smartification is in 2.0! :wink:
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Media db “leading zero” in dir names

Post 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!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Media db “leading zero” in dir names

Post 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.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Media db “leading zero” in dir names

Post by yellowled »

Just stumbled upon: same error for the category select field when upload new media. (In recent 2.0 branch.)

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Media db “leading zero” in dir names

Post 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

{'&nbsp;'|@str_repeat:($folder.depth*2)} {$folder.name}</option>
Update: I send you a pull request.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Media db “leading zero” in dir names

Post 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. :mrgreen:

YL
Post Reply