Hello,
Is there an escape character for commas in tag names when adding photos with addSimple?
For example, I use a tag "Smith, John" I add a photo, with the tag, to piwigo using addSimple. When viewing the photo, it is tagged 2 times with "Smith" and "John".
I've tried sending the tag as:
Smith, John
"Smith, John"
Is there a way to 'escape' the comma character?
Thanks,
Ken
Offline
Hello
it seems no
"$tag_names = explode(',', $params['tags']);" :/
So I open a ticket in our bugtracker
Offline
Thank you.
Ken
Offline
fixed
[Subversion] r20741 if you want to apply the fix now, and test
Offline
just a question : why this field is not an array ? (like tag_id field in pwg.tags.getImages)
Offline
mistic100 wrote:
just a question : why this field is not an array ? (like tag_id field in pwg.tags.getImages)
Ho! Yeah... don't know... maybe historical reasons
If you have a better fix, I won't be offended ^^
Offline
we can't modify it for compatibility reasons, but why not adding an other field "tags2" or something, working like an array (and say that the first one is deprecated)
off-topic: I'm working on a small modification of reflexion.getMethodDetails allowing to add specific info for a field
Offline
mistic100 wrote:
we can't modify it for compatibility reasons
yep I thought of that
mistic100 wrote:
(and say that the first one is deprecated)
but didn't think as far
Good idea finally
Offline
I have a better fix
- make tags parameter as optional to accept array ( 'tags' => array('default' => null, 'flags' => WS_PARAM_ACCEPT_ARRAY),
- then
... if (is_array(params[tags])) tag_names = params[tags] else tag_names = explode(',', params[tags])
and that it is. fully backward compatible and properly working ...
Offline
this API system is so well coded ! :-)
Offline
rvelices wrote:
I have a better fix
- make tags parameter as optional to accept array ( 'tags' => array('default' => null, 'flags' => WS_PARAM_ACCEPT_ARRAY),
- thenCode:
... if (is_array(params[tags])) tag_names = params[tags] else tag_names = explode(',', params[tags])and that it is. fully backward compatible and properly working ...
and so spoke the voice of wisdom ^^
let me still add the escape of the comma for the string
Offline