Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-1296

Moodle Docs links need to be fixed to handle language derivatives (i.e. en_us, fr_ca, etc.)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: docs.moodle.org
    • Labels:
      None

      Description

      The document links are using current_language() producing links like:

      http://docs.moodle.org/en_us/question/import (which end up redirecting to the main page)

      Is current_language() really what we want/intend? Would it make more sense to use something like get_parent_language to return en instead of en_us? If Moodle Docs is going to support child languages like en_us, then we need to ensure that pages are correctly redirecting.

      This came up at the Oklahoma Moot and created a little confusion. I would have expected to be directed to:

      http://docs.moodle.org/en/question/import

      Do we want the link generated to be en or en_us? If it is en_us, then Docs should redirect automatically to en version if the page does not exist (which may make creating the page more complicated).

      Peace - Anthony

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              aborrow Anthony Borrow created issue -
              aborrow Anthony Borrow made changes -
              Field Original Value New Value
              Fix Version/s STABLE backlog [ 10463 ]
              Priority Minor [ 4 ] Major [ 3 ]
              aborrow Anthony Borrow made changes -
              Link This issue has been marked as being related by MDL-27695 [ MDL-27695 ]
              Hide
              nebgor Aparup Banerjee added a comment -

              Hi Anthony,
              Thanks for the report. I had a chat with Jordan, he did think that en_us urls should map to en urls.

              Guys, do we do this in docs or in moodle?

              imo, its pretty docs.moodle.org specific. i suppose anyone implementing their own docs (ou) could handle mapping how they like if we left the mapping to the doc server.

              cheers,
              Aparup

              Show
              nebgor Aparup Banerjee added a comment - Hi Anthony, Thanks for the report. I had a chat with Jordan, he did think that en_us urls should map to en urls. Guys, do we do this in docs or in moodle? imo, its pretty docs.moodle.org specific. i suppose anyone implementing their own docs (ou) could handle mapping how they like if we left the mapping to the doc server. cheers, Aparup
              jtomkinson Jordan Tomkinson made changes -
              Assignee moodle.com [ moodle.com ] Jordan Tomkinson [ jtomkinson ]
              jtomkinson Jordan Tomkinson made changes -
              Project Moodle [ 10011 ] Moodle Community Sites [ 10020 ]
              Key MDL-27803 MDLSITE-1296
              Workflow MDL Full Workflow [ 97215 ] jira [ 97217 ]
              Affects Version/s 2.0.3 [ 10537 ]
              Fix Version/s STABLE backlog [ 10463 ]
              Component/s docs.moodle.org [ 10101 ]
              Component/s Documentation [ 10073 ]
              Hide
              jtomkinson Jordan Tomkinson added a comment -

              Added language aliases for en_us es_es, es_mx, es_ar, es_cb, fr_ca, no_gr, zh_cn, zh_tw

              If you can think of any more please let me know

              Show
              jtomkinson Jordan Tomkinson added a comment - Added language aliases for en_us es_es, es_mx, es_ar, es_cb, fr_ca, no_gr, zh_cn, zh_tw If you can think of any more please let me know
              jtomkinson Jordan Tomkinson made changes -
              Status Open [ 1 ] Resolved [ 5 ]
              Resolution Fixed [ 1 ]
              Hide
              dougiamas Martin Dougiamas added a comment -

              +1 for server redirects

              Show
              dougiamas Martin Dougiamas added a comment - +1 for server redirects
              Hide
              aborrow Anthony Borrow added a comment -

              Jordan - I am re-opening this as it does not seem to be working for all pages. I see that it works for the one page but not for all - for example:

              http://docs.moodle.org/20/en_us/admin/user/profile/index is going back to main page rather than
              http://docs.moodle.org/20/en/admin/user/profile/index
              which is what I would expect.

              Peace - Anthony

              Show
              aborrow Anthony Borrow added a comment - Jordan - I am re-opening this as it does not seem to be working for all pages. I see that it works for the one page but not for all - for example: http://docs.moodle.org/20/en_us/admin/user/profile/index is going back to main page rather than http://docs.moodle.org/20/en/admin/user/profile/index which is what I would expect. Peace - Anthony
              aborrow Anthony Borrow made changes -
              Resolution Fixed [ 1 ]
              Status Resolved [ 5 ] Reopened [ 4 ]
              Tester aborrow
              Hide
              jtomkinson Jordan Tomkinson added a comment -

              updated rule to include version specific docs

              Show
              jtomkinson Jordan Tomkinson added a comment - updated rule to include version specific docs
              jtomkinson Jordan Tomkinson made changes -
              Status Reopened [ 4 ] Resolved [ 5 ]
              Resolution Fixed [ 1 ]
              Hide
              aborrow Anthony Borrow added a comment -

              Looks good, thanks Jordan! Peace - Anthony

              Show
              aborrow Anthony Borrow added a comment - Looks good, thanks Jordan! Peace - Anthony
              aborrow Anthony Borrow made changes -
              Status Resolved [ 5 ] Closed [ 6 ]
              Hide
              tsala Helen Foster added a comment -

              Reopening following comment from Mike Algozzine in http://moodle.org/mod/forum/discuss.php?d=176065

              We just noticed that docs.moodle.org/19/en_us links are redirecting to docs.moodle.org/20/en links. Shouldn't they redirect to docs.moodle.org/19/en instead?

              Show
              tsala Helen Foster added a comment - Reopening following comment from Mike Algozzine in http://moodle.org/mod/forum/discuss.php?d=176065 We just noticed that docs.moodle.org/19/en_us links are redirecting to docs.moodle.org/20/en links. Shouldn't they redirect to docs.moodle.org/19/en instead?
              tsala Helen Foster made changes -
              Resolution Fixed [ 1 ]
              Status Closed [ 6 ] Reopened [ 4 ]
              Hide
              jtomkinson Jordan Tomkinson added a comment -

              Helen this is the expected behaviour and is being discussed at MDLSITE-1312.

              Show
              jtomkinson Jordan Tomkinson added a comment - Helen this is the expected behaviour and is being discussed at MDLSITE-1312 .
              jtomkinson Jordan Tomkinson made changes -
              Status Reopened [ 4 ] Resolved [ 5 ]
              Resolution Fixed [ 1 ]
              Tester aborrow
              jtomkinson Jordan Tomkinson made changes -
              Status Resolved [ 5 ] Closed [ 6 ]
              Hide
              malgozzine Mike Algozzine added a comment -

              MDLSITE-1312 indicates that it's not possible to redirect based on whether or not the target page exists, but I don't think that sort of redirection is necessary. I'm suggesting that a docs.moodle.org/19/en_us link should always redirect to the corresponding docs.moodle.org/19/en link, regardless of whether or not the page exists. Just to clarify our scenario:

              1. Moodle 1.9.8 user changes their preferred language to English (en_us).
              2. Moodle 1.9.8 user clicks a "Moodle Docs for this page" link, such as http://docs.moodle.org/19/en_us/course/view.
              3. Moodle 1.9.8 user is redirected to http://docs.moodle.org/20/en/course/view, even though http://docs.moodle.org/19/en/course/view exists and is clearly more relevant.

              The consensus among our users is that this is not the expected behavior.

              Show
              malgozzine Mike Algozzine added a comment - MDLSITE-1312 indicates that it's not possible to redirect based on whether or not the target page exists, but I don't think that sort of redirection is necessary. I'm suggesting that a docs.moodle.org/19/en_us link should always redirect to the corresponding docs.moodle.org/19/en link, regardless of whether or not the page exists. Just to clarify our scenario: 1. Moodle 1.9.8 user changes their preferred language to English (en_us). 2. Moodle 1.9.8 user clicks a "Moodle Docs for this page" link, such as http://docs.moodle.org/19/en_us/course/view . 3. Moodle 1.9.8 user is redirected to http://docs.moodle.org/20/en/course/view , even though http://docs.moodle.org/19/en/course/view exists and is clearly more relevant. The consensus among our users is that this is not the expected behavior.
              jtomkinson Jordan Tomkinson made changes -
              Resolution Fixed [ 1 ]
              Status Closed [ 6 ] Reopened [ 4 ]
              Hide
              jtomkinson Jordan Tomkinson added a comment -

              You are completely correct - not sure what I was thinking previously (maybe I was confused)

              I have updated the htaccess rules if you could test, thanks.

              Show
              jtomkinson Jordan Tomkinson added a comment - You are completely correct - not sure what I was thinking previously (maybe I was confused) I have updated the htaccess rules if you could test, thanks.
              jtomkinson Jordan Tomkinson made changes -
              Status Reopened [ 4 ] Resolved [ 5 ]
              Resolution Fixed [ 1 ]
              Tester malgozzine
              Hide
              malgozzine Mike Algozzine added a comment -

              It's working correctly for us now. The docs.moodle.org/19/en_us links are redirecting to docs.moodle.org/19/en. Thanks very much.

              Show
              malgozzine Mike Algozzine added a comment - It's working correctly for us now. The docs.moodle.org/19/en_us links are redirecting to docs.moodle.org/19/en. Thanks very much.
              Hide
              tsala Helen Foster added a comment -

              Mike, glad to hear things are now working correctly. Thanks for your feedback and thanks to Jordan for fixing the problem

              Show
              tsala Helen Foster added a comment - Mike, glad to hear things are now working correctly. Thanks for your feedback and thanks to Jordan for fixing the problem
              tsala Helen Foster made changes -
              Status Resolved [ 5 ] Closed [ 6 ]
              dougiamas Martin Dougiamas made changes -
              Workflow jira [ 97217 ] SITES Full Workflow [ 127295 ]
              tsala Helen Foster made changes -
              Workflow SITES Full Workflow [ 127295 ] SITES workflow plus [ 136925 ]

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: