Moodle
  1. Moodle
  2. MDL-4972

No preview when you edit utf8 help files

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6
    • Component/s: Language
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE
    • Rank:
      28083

      Description

      Preview doesn't work when translating help files because $forcelang param is filtered in help.php as PARAM_ALPHAEXT and then the '8' is removed from 'en_utf8'. Resulting $filepath is wrong:

      dataroot/lang/en_utf/help/accessibility.html

      > lib/moodlelib.php

      >

      > case PARAM_ALPHAEXT: // Remove everything not a-zA-Z/_-

      > return eregi_replace('[^a-zA-Z/_-]', '', $param);

        Activity

        Hide
        Martin Dougiamas added a comment -

        From dialoge dialoge (rh at dialoge.net) Monday, 27 March 2006, 03:08 PM:

        I think it is an other error. The preview button is searching the help file at the old place: http://192.168.2.100/16/moodle/lang/de_utf8/docs/README.txt

        From oen roggemans (koen at roggemans.net) Tuesday, 27 June 2006, 01:19 PM:

        Passing this to David

        It appears the error only occurs for doc files, help files are ok now

        From David Mudrak (mudrd8mz at uxit.pedf.cuni.cz) Tuesday, 27 June 2006, 07:44 PM:

        I will take a look at it ASAP and will let you know. Sorry I did not notice this problem before.

        From David Mudrak (mudrd8mz at uxit.pedf.cuni.cz) Wednesday, 28 June 2006, 08:47 AM:

        Ad carles' comment: you are right: /help.php should imho use PARAM_ALPHANUM // PARAM_ALPHAEXT. But strange thing is that preview works at my machine 8-o I did not explore why but it correctly (probably by default) uses en_utf8. I do not have rights to fix help.php, thus am assigning this bug to Nobody and changing severity to Minor problem.

        Ad rh's comment: you are right as well. But since docs/ should move into moodle.org wiki, there is no supported way how to view documentation stored locally in 1.6. Current lib/moodlelib.php document_file() which is used in docs/index.php still relies on old pre-utf8 language locations. That is why /docs URL does not work at all in 1.6 (sounds almost like bug, does it? but it is feature

        Anyway, I have fixed langdoc.php to hide preview link if you are still using this tool to translate docs/ files.

        This bug ticket should focus only on described problem in /help.php

        Show
        Martin Dougiamas added a comment - From dialoge dialoge (rh at dialoge.net) Monday, 27 March 2006, 03:08 PM: I think it is an other error. The preview button is searching the help file at the old place: http://192.168.2.100/16/moodle/lang/de_utf8/docs/README.txt From oen roggemans (koen at roggemans.net) Tuesday, 27 June 2006, 01:19 PM: Passing this to David It appears the error only occurs for doc files, help files are ok now From David Mudrak (mudrd8mz at uxit.pedf.cuni.cz) Tuesday, 27 June 2006, 07:44 PM: I will take a look at it ASAP and will let you know. Sorry I did not notice this problem before. From David Mudrak (mudrd8mz at uxit.pedf.cuni.cz) Wednesday, 28 June 2006, 08:47 AM: Ad carles' comment: you are right: /help.php should imho use PARAM_ALPHANUM // PARAM_ALPHAEXT. But strange thing is that preview works at my machine 8-o I did not explore why but it correctly (probably by default) uses en_utf8. I do not have rights to fix help.php, thus am assigning this bug to Nobody and changing severity to Minor problem. Ad rh's comment: you are right as well. But since docs/ should move into moodle.org wiki, there is no supported way how to view documentation stored locally in 1.6. Current lib/moodlelib.php document_file() which is used in docs/index.php still relies on old pre-utf8 language locations. That is why /docs URL does not work at all in 1.6 (sounds almost like bug, does it? but it is feature Anyway, I have fixed langdoc.php to hide preview link if you are still using this tool to translate docs/ files. This bug ticket should focus only on described problem in /help.php
        Hide
        David Mudrak added a comment -

        Fixed by skodak in help.php @ 1.33

        $forcelang = optional_param('forcelang', '', PARAM_SAFEDIR);

        Closing

        Show
        David Mudrak added a comment - Fixed by skodak in help.php @ 1.33 $forcelang = optional_param('forcelang', '', PARAM_SAFEDIR); Closing

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: