Page MenuHomePhabricator

Arabic Wikiversity: Some broken Flow redirects can't be fixed due to namespace issues
Open, Needs TriagePublic

Description

Request:

  • Please run namespaceDupes.php on the Arabic Wikiversity (arwikiversity) because some pages are inaccessible to users due to namespace issues.

Problem:

  • These pages appear as broken redirects on v:ar:Special:BrokenRedirects (see screenshot) but they can't be fixed because those pages are inaccessible (i.e. local admins can't delete the pages).

  • Notes:

    Thank you.

    Event Timeline

    Meno25 created this task.Aug 4 2020, 4:42 PM
    Restricted Application added subscribers: alanajjar, Aklapper. · View Herald TranscriptAug 4 2020, 4:42 PM
    Reedy changed the task status from Open to Stalled.Aug 4 2020, 5:41 PM
    Reedy added a subscriber: Reedy.

    Unless someone has just run it before I did...

    reedy@deploy1001:~$ mwscript namespaceDupes.php --wiki=arwikiversity
    0 pages to fix, 0 were resolvable.
    
    0 links to fix, 0 were resolvable, 0 were deleted.
    
    Looks good!
    reedy@deploy1001:~$
    Urbanecm closed this task as Resolved.Aug 10 2020, 11:52 AM
    Urbanecm added a subscriber: Urbanecm.

    The script was run by Reedy, no fixes found.

    Hello @Reedy and @Urbanecm, I already deleted all of this broken redirects on 2-3 May 2019, but still appear on Special:BrokenRedirects

    Dealing with LTR characters is hard for me (plus a script I cannot read)...

    All of them are in the same namespace, right? Which is it (ideally NS id)?

    Do you know how to use quarry? Can you get the page IDs?

    All of them are in the same namespace, right? Which is it (ideally NS id)?

    Yes on the same namespace.
    {{NAMESPACE}} = موضوع (In English: Type) - per this "No longer used, as of version 1.6.0 and removed in 3.0.0."
    {{NAMESPACENUMBER}} = 104

    Do you know how to use quarry? Can you get the page IDs?

    I can't do that easily. I tried through API for the first page, and I get (pageid missed):

    {
        "batchcomplete": "",
        "query": {
            "pages": {
                "-1": {
                    "ns": 104,
                    "title": "\u0645\u0648\u0636\u0648\u0639:\u0639\u0644\u0645 \u0627\u0644\u0645\u0648\u0627\u062f",
                    "missing": "",
                    "contentmodel": "wikitext",
                    "pagelanguage": "ar",
                    "pagelanguagehtmlcode": "ar",
                    "pagelanguagedir": "rtl"
                }
            }
        }
    }
    Reedy added a comment.Aug 11 2020, 1:38 PM

    All of them are in the same namespace, right? Which is it (ideally NS id)?

    Yes on the same namespace.
    {{NAMESPACE}} = موضوع (In English: Type) - per this "No longer used, as of version 1.6.0 and removed in 3.0.0."
    {{NAMESPACENUMBER}} = 104

    Why does it have SMW namespaces? :/

    alanajjar added a comment.EditedAug 11 2020, 2:30 PM

    Why does it have SMW namespaces? :/

    Really it's confusing, as:

    • When I used {{NAMESPACENUMBER}} it gave 104, but
    • from Special:AllPages it gave Topic namespace (namespace=2600). There's 5 pages under this topic all of them already deleted (Same pages that appear on Special:BrokenRedirects

    Overlapping conclusions: those pages created on 2010 under (Type namespace 104), and on 2011 moved to main namespace with redirect from type namespace. Before 2014 there's no Topic namespace (Flow - 2600)? (words type and topic translated to same word on Arabic).

    Reedy added a comment.Aug 11 2020, 4:28 PM

    Yeah... It's a Flow "issue"

    Reedy added a comment.Aug 11 2020, 4:31 PM

    If I can get the right sql query (which can be hard with RTL on an LTR console), I think it's easiest to just delete them manually

    Reedy renamed this task from Arabic Wikiversity: Some broken redirects can't be fixed due to namespace issues (Run namespaceDupes.php to fix it) to Arabic Wikiversity: Some broken Flow redirects can't be fixed due to namespace issues.Aug 11 2020, 4:32 PM
    Reedy added a project: StructuredDiscussions.

    If I can get the right sql query (which can be hard with RTL on an LTR console), I think it's easiest to just delete them manually

    So how I can help? should we opened this task?

    Reedy added a comment.Aug 11 2020, 5:43 PM

    If in doubt, get the SQL ;)

    SELECT  p1.page_namespace AS `namespace`,p1.page_title AS `title`,rd_namespace,rd_title,rd_fragment  FROM `redirect` JOIN `page` `p1` ON ((rd_from=p1.page_id)) LEFT JOIN `page` `p2` ON ((rd_namespace=p2.page_namespace) AND (rd_title=p2.page_title))   WHERE (rd_namespace >= 0) AND (rd_interwiki IS NULL OR rd_interwiki = '') AND (p2.page_namespace IS NULL)  ORDER BY rd_namespace,rd_title,rd_from LIMIT 51

    Sooo....

    MariaDB [arwikiversity]> SELECT p1.page_id, p1.page_namespace AS `namespace`,p1.page_title AS `title`,rd_namespace,rd_title,rd_fragment  FROM `redirect` JOIN `page` `p1` ON ((rd_from=p1.page_id)) LEFT JOIN `page` `p2` ON ((rd_namespace=p2.page_namespace) AND (rd_title=p2.page_title))   WHERE (rd_namespace >= 0) AND (rd_interwiki IS NULL OR rd_interwiki = '') AND (p2.page_namespace IS NULL)  ORDER BY rd_namespace,rd_title,rd_from LIMIT 51;
    +---------+-----------+--------------------------------------------+--------------+--------------------------------------------+-------------+
    | page_id | namespace | title                                      | rd_namespace | rd_title                                   | rd_fragment |
    +---------+-----------+--------------------------------------------+--------------+--------------------------------------------+-------------+
    |    2394 |      2600 | علم_المواد                                 |            0 | علم_المواد                                 |             |
    |    1958 |      2600 | ميكانيكا_تطبيقية                           |          104 | ميكانيكا_تطبيقية                           |             |
    |    2393 |      2600 | ميكانيكا_تطبيقية/box-footer                |          104 | ميكانيكا_تطبيقية/box-footer                |             |
    |    1959 |      2600 | ميكانيكا_تطبيقية/box-header                |          104 | ميكانيكا_تطبيقية/box-header                |             |
    +---------+-----------+--------------------------------------------+--------------+--------------------------------------------+-------------+
    4 rows in set (0.01 sec)
    
    MariaDB [arwikiversity]> select * from page where page_id IN (2394, 2393, 1959, 1958);
    +---------+----------------+--------------------------------------------+-------------------+------------------+-------------+----------------+----------------+--------------------+-------------+----------+--------------------+-----------+
    | page_id | page_namespace | page_title                                 | page_restrictions | page_is_redirect | page_is_new | page_random    | page_touched   | page_links_updated | page_latest | page_len | page_content_model | page_lang |
    +---------+----------------+--------------------------------------------+-------------------+------------------+-------------+----------------+----------------+--------------------+-------------+----------+--------------------+-----------+
    |    1958 |           2600 | ميكانيكا_تطبيقية                           |                   |                1 |           0 |  0.65450269518 | 20190503191110 | NULL               |        6032 |       80 | wikitext           | NULL      |
    |    1959 |           2600 | ميكانيكا_تطبيقية/box-header                |                   |                1 |           0 | 0.208505523467 | 20190502050445 | NULL               |        6033 |       91 | wikitext           | NULL      |
    |    2393 |           2600 | ميكانيكا_تطبيقية/box-footer                |                   |                1 |           1 | 0.346024329584 | 20190502040942 | NULL               |        9035 |       69 | wikitext           | NULL      |
    |    2394 |           2600 | علم_المواد                                 |                   |                1 |           0 | 0.381512291255 | 20200501035823 | NULL               |       18270 |       35 | wikitext           | NULL      |
    +---------+----------------+--------------------------------------------+-------------------+------------------+-------------+----------------+----------------+--------------------+-------------+----------+--------------------+-----------+
    4 rows in set (0.00 sec)
    
    MariaDB [arwikiversity]>

    Those are the right pages (that need removing), yes?

    Those are the right pages (that need removing), yes?

    Yes, exactly!

    Yeah... It's a Flow "issue"

    Thank you, @Reedy for taking the time to look into this issue (and thank you @alanajjar). I will explain it in more detail here:

    • The root cause of the problem is that the Arabic word "موضوع" (Arabic translation of the word "Topic", Unicode: \u0645\u0648\u0636\u0648\u0639) is used as a namespace name on two different namespaces on Arabic Wikiversity.
    • The first "موضوع" namespace is NS: 104. It is identical to the "Topic" namespace on English Wikiversity. This is a normal Wikitext namespace.

    https://en.wikiversity.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces

    • The second "موضوع" namespace is that of Flow/Structured Disscusions (NS: 2600) defined in

    https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/Flow.namespaces.php#L14

    • So, we have 2 namespaces on the same wiki with the same exact name but different NS id which caused this problem.
    • If you are asking yourself why didn't the English Wikiversity community complain about this clash of namespace names, the answer is that only Arabic Wikiversity (but not English Wikiversity) has Flow enabled.

    https://github.com/wikimedia/operations-mediawiki-config/blob/master/dblists/flow.dblist#L3

    • Check the entry about namespaces 104 and 2600 on Arabic Wikiversity.

    https://ar.wikiversity.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces

    • Personally, I would prefer to uninstall Extension Flow from the wiki to solve this issue (Flow was already removed from many other wikis) but you are the expert here. Please do what is necessary to fix this issue. Thank you.
    Meno25 reopened this task as Open.Aug 11 2020, 6:29 PM
    Restricted Application added a project: Growth-Team. · View Herald TranscriptAug 11 2020, 6:29 PM