Last modified: 2014-02-06 18:02:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46517, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44517 - Nonexistent but populated categories don't return 404
Nonexistent but populated categories don't return 404
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Categories (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-30 19:15 UTC by Danny B.
Modified: 2014-02-06 18:02 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Danny B. 2013-01-30 19:15:30 UTC
While every nonexistent page returns 404, the nonexistent but populated categories don't return 404.

Not sure if it's intended behavior (if yes, why?), so reporting at least for reference.
Comment 1 Daniel Friesen 2013-01-30 19:19:51 UTC
Categories are not articles. Categories are lists of pages. If a category has pages in it. Then why should it be a 404? There's content there. Category page text is nothing but a worthless description. It matters not whether the description exists or not.
Comment 2 Danny B. 2013-01-30 19:27:50 UTC
1) The category text is definitely not a worthless description (and even if the description text was, there is still categorization itself, which is indeed important, plus interwiki).
2) Without returning 404 it can't be recognized that the category does not exist.
Comment 3 Daniel Friesen 2013-01-30 19:28:52 UTC
The category does exist. Pages are using it.
Comment 4 Danny B. 2013-01-30 19:38:45 UTC
The category *page* does not exist though.
Comment 5 Andre Klapper 2013-01-30 19:55:54 UTC
Testcase welcome, for future reference.
Comment 6 Daniel Friesen 2013-01-30 19:58:59 UTC
(In reply to comment #4)
> The category *page* does not exist though.

The page is irrelevant. Whether the page exists or not. There is still something MW has to display at that url. Hence, it is not a 404.

A 404 indicates that absolutely nothing exists there. The only stuff outputted is stuff global to the whole site and stuff relevant to an error.

That behaviour is incorrect when MW is outputting something for that page.
Comment 7 Danny B. 2013-01-30 19:59:40 UTC
(In reply to comment #5)
> Testcase welcome, for future reference.

That's quite hard because people obviously create those categories or remove them from pages. So having a stable permalink to nonexistent but populated category is pretty much impossible.
Comment 8 Daniel Friesen 2013-01-30 20:00:47 UTC
Anything red from https://en.wikipedia.org/wiki/Special:WantedCategories would work as a test case.
Comment 9 Bawolff (Brian Wolff) 2013-01-30 20:16:16 UTC
I think this bug should be wontfixed (per daniel). If the behaviour being asked for was present, I would consider that to be a bug.
Comment 10 Danny B. 2013-01-30 21:03:24 UTC
Bug is, when there is an inconsistent behavior. 404 is (apart from obvious 404 cases) returned when the *page* does not exist = there is no such row in page table. Populated categories do not have a row in page table because the category page does not exist. So it should stay consistent with the rest.
Comment 11 Danny B. 2013-01-30 21:04:13 UTC
s/Populated categories/Nonexistent populated categories/
Comment 12 Daniel Friesen 2013-01-30 21:24:48 UTC
(In reply to comment #10)
> Bug is, when there is an inconsistent behavior. 404 is (apart from obvious
> 404
> cases) returned when the *page* does not exist = there is no such row in page
> table. Nonexistent populated categories do not have a row in page table because
> the category page does not exist. So it should stay consistent with the rest.

No, 404 is not a function of what is inside the database. 404 is something decided by whether the controller of the request's output decides it should be a 404. Be that Article, SpecialPage, ImagePage, CategoryPage, or some other custom controller.

Different namespaces can have different behaviours. For example, Special: pages don't exist inside the database, whether it's a 404 or not is entirely decided by the class making the output. And likewise for categories -- which have content in the form of a list of pages that are inside the category -- 404 is decided based on if both the page does not exist AND there are no pages inside the category to display. ImagePage could be another special case given it too is more than just an article.
Comment 13 Bawolff (Brian Wolff) 2013-01-30 22:01:33 UTC
Where in the code/db doesn't really matter. What matters is the meaning of the error. 404 means resource not found. If we return a 404, it should be entirely safe (albeit annoying beyond belief) for a web browser to replace our 404 page with its own error page. This would not be the case if there are category entries.

If there are entries in the category, we are returning actual content, hence 200 is the appropriate status code.

----

As an additional technical motivation. Returning 404 on such a page would prevent them from being indexed by search engines. I believe most people would want such a page to be indexed.
Comment 14 Chad H. 2014-02-06 18:02:46 UTC
I agree with Brian and Daniel. I'm going ahead and WONTFIXing this now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links