Closed Bug 871638 Opened 7 years ago Closed 7 years ago

ISE on wiki tag list pages

Categories

(developer.mozilla.org :: General, defect, P1)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lorchard, Unassigned)

References

Details

(Whiteboard: [specification][type:bug])

What did you do?
================
Visit one of these pages:

https://developer.mozilla.org/en-US/docs/tag/CSS%20Reference
https://developer.mozilla.org/ja/docs/tag/CSS%20Reference


What happened?
==============
500 Internal Server Error

What should have happened?
==========================
Page listing documents tagged "CSS Reference"

Is there anything else we should know?
======================================
The following appeared in my django errors inbox:

Traceback (most recent call last):

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/views/decorators/http.py", line 41, in inner
    return func(request, *args, **kwargs)

  File "/data/www/developer.mozilla.org/kuma/apps/wiki/views.py", line 744, in list_documents
    tag_obj = tag and get_object_or_404(DocumentTag, name=tag) or None

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/shortcuts/__init__.py", line 113, in get_object_or_404
    return queryset.get(*args, **kwargs)

  File "/data/www/developer.mozilla.org/kuma/vendor/src/django/django/db/models/query.py", line 368, in get
    % (self.model._meta.object_name, num, kwargs))

MultipleObjectsReturned: get() returned more than one DocumentTag -- it returned 2! Lookup parameters were {'name': u'CSS Reference'}
Priority: -- → P1
Duplicate of this bug: 873472
Getting tons more of these. :(
The problem is:

mysql> select * from wiki_documenttag where name='CSS Reference';
+-------+---------------+-----------------+
| id    | name          | slug            |
+-------+---------------+-----------------+
|     5 | CSS Reference | css-reference   |
| 15943 | CSS R�f�rence | css-reference_1 |
+-------+---------------+-----------------+
2 rows in set (0.01 sec)

That 2nd tag is 'CSS Référence' (e.g., on https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_values_syntax)

Both of these tags are heavily used:

mysql> select count(*) from wiki_taggeddocument where tag_id = 15943;
+----------+
| count(*) |
+----------+
|      482 |
+----------+
1 row in set (0.08 sec)

mysql> select count(*) from wiki_taggeddocument where tag_id = 5;
+----------+
| count(*) |
+----------+
|      693 |
+----------+
1 row in set (0.00 sec)

CC'ing our French contingent: Do we want to keep the 'CSS Référence' tag along with 'CSS Reference'?
I'm fine if they're merged to be the same, but that'll continue to happen.
Long term, it might make sense to translate tags (?)
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/e0a3da5e48b4d039bfdda71cd4c1398b51bb663f
fix bug 871638 - fix list for dupe named tags

some tag names evaluate as equal between ascii & non-ascii representations

https://github.com/mozilla/kuma/commit/6f22224f961fdfb044a14132a321fa2925726e81
Merge pull request #1127 from groovecoder/multiple-objects-tags-871638

fix bug 871638 - fix list for dupe named tags
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.