Page MenuHomePhabricator

Magic word "PAGESINCATEGORY" with parameter "pages" returns negative value on zhwikibooks
Closed, InvalidPublic

Description

Steps to reproduce:

  1. Visit any page of zhwikibooks and edit (sandbox as an example)
  2. Replace the text in the input box with {{PAGESINCATEGORY:快速刪除候選|pages}}
  3. Preview and the result is -1

As the category 快速刪除候選 has two subcategories and no other pages, the result is supposed to be 0. I tried to purge the category but it did not work.

Event Timeline

Restricted Application added subscribers: Cosine02, Aklapper. · View Herald TranscriptNov 29 2018, 2:49 PM
Xiplus added a subscriber: Xiplus.Nov 29 2018, 2:57 PM
Zest added a subscriber: Zest.Nov 29 2018, 3:00 PM

(PAGESINCATEGORY is not part of the ParserFunctions extension, hence removing that project tag)

It is stored in the database:
https://zh.wikibooks.org/w/api.php?action=query&prop=categoryinfo&pageids=13169

{
    "batchcomplete": "",
    "query": {
        "pages": {
            "13169": {
                "pageid": 13169,
                "ns": 14,
                "title": "Category:\u5feb\u901f\u522a\u9664\u5019\u9078",
                "categoryinfo": {
                    "size": 1,
                    "pages": -1,
                    "files": 0,
                    "subcats": 2
                }
            }
        }
    }
}

It seems the text "This category has the following 2 subcategories, out of 2 total. " on the category itself is ignoring negative values.

WhitePhosphorus closed this task as Invalid.Oct 22 2019, 5:50 AM

According to @A2093064 's advise I removed both of its subcategories and deleted that category to fix above glitch in database. After restoring again it seems working well so I'm closing it as invalid (if I'm making mistakes fell free to correct me).

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptOct 22 2019, 5:50 AM
Xiplus moved this task from Backlog to Closed on the Chinese-Sites board.Oct 22 2019, 6:09 AM
Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptOct 22 2019, 6:09 AM