To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #484 (closed defect: fixed)

Opened 19 months ago

Last modified 13 months ago

[tagging] Slashes allowed in the tag field, but cause 404 errors when output on the frontend

Reported by: agilbert Owned by: tboutell
Priority: blocker Milestone: 1.5
Component: apostrophePlugin Version: 1.4
Keywords: taggable, 1.5rc2 Cc: dordille, johnnyoffline, rickybanister, geoffd
Symfony version: 1.4

Description

Tom, I guess this may end up being a bug with the Taggable behavior? Not sure. But since it related to hiw the taggable stuff interacts with Apostrophe I'm opening it here for your consideration. Let me know if you'd like me to do something else with this bug report.

The issue is that an admin user can enter a "/" as part of a tag, but this will break Apostrophe routes when trying to filter objects by that tag as a parameter in a URL. Obvious reasons here.

We could solve this by:

  • stripping the slashes out
  • replacing them with another more friendly character
  • validation errors

I would be in favor of one of the first two options there.

Change History

Changed 19 months ago by tboutell

  • status changed from new to accepted

I think we should strip slashes in tags.

Changed 13 months ago by geoffd

  • keywords taggable, 1.5rc2 added; taggable removed
  • priority changed from major to blocker
  • milestone changed from 1.4.2 to 1.5

This is horrible.

1. We let people put slashes in tags
2. We let services import items with slashes in tags
3. The nav links for tags with slashes in tags break, unfixable Symfony issue
4. The tag admin crashes with a 500 error if a tag with a slash exists

Two things have to happen:

1. Convert slash to dash. Make very sure this is done for both our tag widget and the service imports
2. Fix the 500 error if there *is* a tag with a slash, tag admin must be able to cope if they do it somehow

Changed 13 months ago by tboutell

The 500 error was unrelated and is fixed in [3173]. Seems you can't call getFilters in an admin gen module that doesn't have a filter form. This was introduced by my work on filters for users, groups and permissions this weekend.

Changed 13 months ago by tboutell

  • status changed from accepted to closed
  • resolution set to fixed

Fixed in [3175]: all slashes in tags are converted to dashes. This avoids a serious issue with both major web servers which are typically configured to refuse to permit an escaped slash in a URL, ever. This is done in apostrophe:migrate and also for all new saves of tags.

Also, we were converting tags to lowercase in some places but not others. After consultation I've determined that we *want* mixed case in tags, although we compare tags in a case-insensitive way (if we have the tag apple and the tag Apple comes along, that's the same tag). The tag admin can then be used to fix the case of any proper name tags that started out lowercase, etc.

There was some discussion of not showing spaces as + signs in permalinks to tags, or perhaps having actual slugs for tags, however since this is deep in the guts of Symfony, the webserver and the tag plugin (which does not have slugs for tags) this is not practical for 1.5

* * *

Also, one unrelated issue: you couldn't edit a video that came from a supported service because the embed field was blank and the code to populate it with the service_url field wasn't having a chance to run. This is fixed.

Note: See TracTickets for help on using tickets.