Taxonomy terms may contain slashes, but the autocomplete widget used to populate a taxonomy term list does not allow slashes.
The latest patch in #207 implements the following solution:
Tweaks the autocomplete menu callback to include all arguments passed by the menu system.
Adds automated test coverage for this functionality.
- The approach needs to be reviewed, manually tested and then committed to
D8,D7 and D6.
Steps to test this patch
- Create an article and enter a tag containing a slash. Save the article and verify the term is created correctly.
- Create a second article and try to use the autocomplete to add the term you added to the first article. Save the article and check at
admin/structure/taxonomy/tags/addto make sure it used the same tag rather than creating a new one.
- Add some other terms containing slashes to the tags vocabulary at
admin/structure/taxonomy/tags/add. Try some different patterns:
"Term name containing a comma, plus / slashes / too.",
This term's got / slashes and apostrophes.Etc.
- Test autocompletion and saving of these terms as well.
User interface changes
Original report by moonray
Using a slash in an autocomplete field breaks functionality.
The requested URL /drupal/recipe/ingredient/autocomplete/looking for 1/2 a loaf was not found on this server.
Apache/2.0.55 (Ubuntu) PHP/5.1.6 Server at localhost Port 80
The reason (I believe) is that it interprets the escaped slash as a regular slash, and thus a path delimiter. This error does not occur when you don't use clean urls.
Is there another way to escape forward slashes than %2F, so they don't get interpreted as a path delimiter?
If you give me that answer I can write a patch to submit. :-)
FAILED: [[SimpleTest]]: [MySQL] 40,597 pass(es), 1 fail(s), and 0 exception(s). View
|#213||drupal-93854-autocomplete-slashes-extra-test-d6.patch||779 bytes||Steven Jones|
PASSED: [[SimpleTest]]: [MySQL] 190 pass(es). View
|#207||drupal-93854-autocomplete-slashes-extra-test-d7.patch||4.61 KB||Steven Jones|
PASSED: [[SimpleTest]]: [MySQL] 38,318 pass(es). View
|#200||autocomplete_ie9.png||9.36 KB||Steven Jones|