Moodle
  1. Moodle
  2. MDL-27246

Unable to check out strings into the language customization tool

    Details

    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      1. Go to Site administration > Language > Language customization
      2. TEST: make sure you are able to check out strings into the translator without the reported error (would be nice to test at PostgreSQL where this was reported)

      Show
      1. Go to Site administration > Language > Language customization 2. TEST: make sure you are able to check out strings into the translator without the reported error (would be nice to test at PostgreSQL where this was reported)
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-27246-cutomlang-version
    • Rank:
      17323

      Description

      Since commit bb8b29 the version.php started to use decimal number for version. This leads to problems in the customlang report:

      Debug info: ERROR: invalid input syntax for integer: "2011033002.02"
      INSERT INTO mdl_report_customlang_components (name,version) VALUES($1,$2) RETURNING id
      [array (
      'name' => 'core',
      'version' => '2011033002.02',
      )]
      Stack trace:

      • line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
      • line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      • line 781 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      • line 833 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
      • line 101 of /admin/report/customlang/locallib.php: call to pgsql_native_moodle_database->insert_record()
      • line 48 of /admin/report/customlang/index.php: call to report_customlang_utils::checkout()

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          Try out the new buttons, David

          Show
          Martin Dougiamas added a comment - Try out the new buttons, David
          Hide
          David Mudrak added a comment -

          Please pull the patch that changes the type of the 'version' field from integer to char.

          Show
          David Mudrak added a comment - Please pull the patch that changes the type of the 'version' field from integer to char.
          Hide
          Sam Hemelryk added a comment -

          Thanks David, this has been integrated now.

          I tested before and after the integration, I couldn't reproduce the error on either however I greatly suspect that is because I wasn't using a language pack with a decimal point.
          Is there a particular language pack that would be good to test with or perhaps some particular way to force a decimal point in the version?

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks David, this has been integrated now. I tested before and after the integration, I couldn't reproduce the error on either however I greatly suspect that is because I wasn't using a language pack with a decimal point. Is there a particular language pack that would be good to test with or perhaps some particular way to force a decimal point in the version? Cheers Sam
          Hide
          David Mudrak added a comment -

          Hi Sam

          Language packs do not have versions. The problem was with the components being loaded into the translator. The core components like moodle.org, auth.php etc have the version number from the main $CFG->dirroot/version.php. And that is when the problem occured - on MOODLE_20_STABLE, the main Moodle version is now decimal.

          Also, please make sure you try to reproduce at PostgreSQL as I believe MySQL silently casts the decimal into the integer, hence hiding the error (as usually...)

          Show
          David Mudrak added a comment - Hi Sam Language packs do not have versions. The problem was with the components being loaded into the translator. The core components like moodle.org, auth.php etc have the version number from the main $CFG->dirroot/version.php. And that is when the problem occured - on MOODLE_20_STABLE, the main Moodle version is now decimal. Also, please make sure you try to reproduce at PostgreSQL as I believe MySQL silently casts the decimal into the integer, hence hiding the error (as usually...)
          Hide
          Aparup Banerjee added a comment - - edited

          tested fine for me on master and MOODLE_20_STABLE on pg. (but couldn't replicate on either branches too)

          Show
          Aparup Banerjee added a comment - - edited tested fine for me on master and MOODLE_20_STABLE on pg. (but couldn't replicate on either branches too)
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Closing as fixed. Many (HOURSECS) thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Closing as fixed. Many (HOURSECS) thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: