Page 1 of 1

SOLVED: Listit2: File Upload doesnt work with $item_alias

Posted: Sat Oct 12, 2013 2:26 pm
by faglork
Hi!

In the field edit page, when you edit a file upload field, the info says:

"Directory path that will be appended to $config['uploads_url'] . No slash at the end. {$item_id} and {$item_alias} will be replaced."

This seems not to work:

/images/mydir/{$item_alias}

leads to creation of a directory named

/images/mydir/{$item_alias}

not to

/images/mydir/somealias

so it takes it literally, and does not replace the variable with its value.

Same when I omit the parenthesis.

Does anyone know how this is supposed to work?

Cheers,
Alex

Re: Listit2: File Upload doesnt work with $item_alias

Posted: Sun Oct 13, 2013 8:29 pm
by Stikki
Howdy,

I just tested this on my server and it seems to work fairly well.

My test case was: images/single_test/item{$item_id}

And there was no error, no problems occurred.

As far i can tell, there is nothing wrong with this field type.

Re: Listit2: File Upload doesnt work with $item_alias

Posted: Sun Oct 13, 2013 8:31 pm
by Stikki
Oh, sorry, your correct.

Probably some translation or old version of lang file.

New info says: Directory path that will be appended to $config['uploads_url'] . No slash at the end. {$item_id} and {$field_id} will be replaced.

so {$item_alias} is not valid, that's why it's not transformed at all.

Re: Listit2: File Upload doesnt work with $item_alias

Posted: Tue Oct 15, 2013 6:12 pm
by faglork
Hmmm ... any idea why {$item_alias} is no longer supported?
It would be nice because managing files in directories named by numbers is much harder ... it would be easy if you just knew to which data set the directory belongs. As it is now, you have to switch permanently between Filemanager and Listit2 just to look up the IDs :-(

Cheers,
Alex

Re: Listit2: File Upload doesnt work with $item_alias

Posted: Tue Oct 15, 2013 7:16 pm
by Stikki
Because when i did this change, fielddef didn't have knowledge of alias directly.

Field has knowledge of complete item that it belongs now, but until i am happy with API shortcuts to gain certain values from item, i wont add this back.

How ever, open FR to ListItExtended project and i'll look into this when i do some work with fielddef API next time i look into it.

If you need this feature right away, you may fork field type and make your own.

Re: Listit2: File Upload doesnt work with $item_alias

Posted: Tue Oct 15, 2013 11:14 pm
by faglork
Thanks for clarification! I'll submit an FR.

BTW, Listit2 is a fantastic module. Congrats!

Cheers,
Alex