[tags] Allow comma in tag #222

Open
opened 2026-10-04 23:47:59 +02:00 by adam · 4 comments
Owner

Reported by nikrou on 9 Apr 2013 20:12

Version: 2.5.0

tag associated to picture can not contains comma because of str2url function. I think this function can let users had comma in their tags to have tags like "Smith, John" for example.

The str2url function is also used for category name in url when we choose id-name for category style.

In both case, there's no problem to have comma in url. URL parser doesn't split elements on comma.

Additional information: See this two posts :
http://piwigo.org/forum/viewtopic.php?id=21743
http://piwigo.org/forum/viewtopic.php?id=21433

Piwigo Bugtracker #2886

**Reported by nikrou on 9 Apr 2013 20:12** **Version:** 2.5.0 tag associated to picture can not contains comma because of str2url function. I think this function can let users had comma in their tags to have tags like &quot;Smith, John&quot; for example. The str2url function is also used for category name in url when we choose id-name for category style. In both case, there&#039;s no problem to have comma in url. URL parser doesn&#039;t split elements on comma. **Additional information:** See this two posts : http://piwigo.org/forum/viewtopic.php?id=21743 http://piwigo.org/forum/viewtopic.php?id=21433 [Piwigo Bugtracker #2886](http://piwigo.org/bugs/view.php?id=2886) <!-- github-sync-id:97226556 -->
Author
Owner

Comment posted by brylie on 20 Apr 2013 05:46

Wikimedia Commons has several tags with commas in them. Examples include 'City, State' combinations. This functionality would be useful for cross-posting images between Wikimedia Commons and Piwigo.

**Comment posted by brylie on 20 Apr 2013 05:46** Wikimedia Commons has several tags with commas in them. Examples include &#039;City, State&#039; combinations. This functionality would be useful for cross-posting images between Wikimedia Commons and Piwigo. <!-- github-comment-id:124893046 -->
Author
Owner

I wanted to move to Piwigo from gallery2 but this issue with commas a blocker as I use commas everywhere in my tags.
I created the attached patch which I think resolves the issue, in a configurable way.
Default config is existing behaviour.
But see my local config change attached, internally it uses chr(127) as a separator, and maps nothing to the separator. My photo tagging software (geosetter) inserts tags as an IPTC list so I don't have to worry about removing separators.
I'm a Piwigo novice so no guarantees that this is a robust change... but at a glance, seems to work for me...

piwigo.patch.txt

Patch is taken against 2.8.2.

I wanted to move to Piwigo from gallery2 but this issue with commas a blocker as I use commas everywhere in my tags. I created the attached patch which I think resolves the issue, in a configurable way. Default config is existing behaviour. But see my local config change attached, internally it uses chr(127) as a separator, and maps nothing to the separator. My photo tagging software (geosetter) inserts tags as an IPTC list so I don't have to worry about removing separators. I'm a Piwigo novice so no guarantees that this is a robust change... but at a glance, seems to work for me... [piwigo.patch.txt](https://github.com/Piwigo/Piwigo/files/1338739/piwigo.patch.txt) Patch is taken against 2.8.2. <!-- github-comment-id:332657177 -->
Author
Owner

I finally got around to creating PR #1169 for this...

I finally got around to creating PR #1169 for this... <!-- github-comment-id:608092762 -->
Author
Owner

I came back to Piwigo after not touching it for a while and see that the above PR is not merged.

https://github.com/Piwigo/Piwigo/pull/2511 is a fresh PR against the latest Piwigo.

I came back to Piwigo after not touching it for a while and see that the above PR is not merged. https://github.com/Piwigo/Piwigo/pull/2511 is a fresh PR against the latest Piwigo. <!-- github-comment-id:3757403660 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#222