Moodle
  1. Moodle
  2. MDL-20245

Allow bigger values (up to 1333 chars) in user preferences, alleviating some problems with grader report

    Details

    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide

      1) Go into the grader report for a course containing several categories. Collapse and re-expand several of them by clicking the +, o, - symbol next to the category name. Check that they can be collapsed and re-expanded.

      2) Run the lib/simpletest/testmoodlelib.php unit tests. Not failure related with "test_set_user_preference" should happen. That ensures that storage up to 1333 chars is working ok.

      Show
      1) Go into the grader report for a course containing several categories. Collapse and re-expand several of them by clicking the +, o, - symbol next to the category name. Check that they can be collapsed and re-expanded. 2) Run the lib/simpletest/testmoodlelib.php unit tests. Not failure related with "test_set_user_preference" should happen. That ensures that storage up to 1333 chars is working ok.
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-20245_user_preferences2
    • Rank:
      1181

      Description

      Noticed in my Postgres log that inserts into the user_preference table have been failing. Here is the log entry:

      ERROR: value too long for type character varying(255)
      STATEMENT: UPDATE mdl_user_preferences SET value = 'a:2:{s:14:\"aggregatesonly\";a:11:

      {i:41;s:4:\"1621\";i:46;s:4:\"1466\";i:47;s:4:\"1498\";i:48;s:4:\"1470 \";i:49;s:4:\"1622\";i:50;s:4:\"1623\";i:51;s:4:\"1465\";i:52;s:4:\"1668\";i:53;s:4:\"1669\";i:54;s:4:\"1670\";i:55;s:4:\"1671\";}

      s:10:\"gradesonly\";a:2:{i:1;s:4:\"1620\";i:2;s:4:\"3024\";}}' WHERE id =
      '1619';

      A quick look at the DB for the record in question:

      select * from mdl_user_preferences where id = '1619';
      id | userid | name | value
      ---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      1619 | 12405 | grade_report_grader_collapsed_categories | a:2:{s:14:"aggregatesonly";a:11:

      {i:41;s:4:"1621";i:46;s:4:"1466";i:47;s:4:"1498";i:48;s:4:"1470";i:49;s:4:"1622";i:50;s:4:"1623";i:51;s:4:"1465";i:52;s:4:"1668";i:53;s:4:"1669";i:54;s:4:"1670";i:55;s:4:"1671";}

      s:10:"gradesonly";a:1:{i:1;s:4:"1620";}}

      Unfortunately, I cannot determine how exactly this was triggered. I
      cannot decipher exactly what was being clicked on by the user at the
      time these things were logged. Any tips on recreating the problem?

      If I were to guess, I would say that there is a problem where a
      person may belong to too many courses with too many categories and
      have PHP pref arrays that don't serialize to a small enough value.
      Perhaps the size of the serialized value should be checked or else a
      note presented to the user to that the settings were not saved?

        Issue Links

          Activity

          Paul Ortman created issue -
          Eloy Lafuente (stronk7) made changes -
          Field Original Value New Value
          QA Assignee stronk7
          Fix Version/s 1.9.6 [ 10340 ]
          Assignee Eloy Lafuente (stronk7) [ stronk7 ] Nicolas Connault [ nicolasconnault ]
          Martin Dougiamas made changes -
          Fix Version/s 1.9.7 [ 10360 ]
          Fix Version/s 1.9.6 [ 10340 ]
          Martin Dougiamas made changes -
          Assignee Nicolas Connault [ nicolasconnault ] moodle.com [ moodle.com ]
          Eloy Lafuente (stronk7) made changes -
          Fix Version/s 1.9.8 [ 10400 ]
          Fix Version/s 1.9.7 [ 10360 ]
          Martin Dougiamas made changes -
          Fix Version/s 1.9.9 [ 10405 ]
          Fix Version/s 1.9.8 [ 10400 ]
          Martin Dougiamas made changes -
          Fix Version/s 1.9.10 [ 10407 ]
          Fix Version/s 1.9.9 [ 10405 ]
          Andrew Davis made changes -
          Assignee moodle.com [ moodle.com ] Andrew Davis [ andyjdavis ]
          Martin Dougiamas made changes -
          Fix Version/s 1.9.11 [ 10410 ]
          Fix Version/s 1.9.10 [ 10407 ]
          Martin Dougiamas made changes -
          Workflow jira [ 33303 ] MDL Workflow [ 45351 ]
          Andrew Davis made changes -
          Link This issue is duplicated by MDL-26011 [ MDL-26011 ]
          Martin Dougiamas made changes -
          Fix Version/s 1.9.12 [ 10536 ]
          Fix Version/s 1.9.11 [ 10410 ]
          Eloy Lafuente (stronk7) made changes -
          Labels triaged
          Fix Version/s STABLE backlog [ 10463 ]
          Fix Version/s 1.9.12 [ 10536 ]
          Affects Version/s 2.0.2 [ 10421 ]
          Affects Version/s 1.9.11 [ 10410 ]
          Priority Minor [ 4 ] Critical [ 2 ]
          Difficulty Moderate
          Martin Dougiamas made changes -
          Workflow MDL Workflow [ 45351 ] MDL Full Workflow [ 73699 ]
          Charles Fulton made changes -
          Link This issue is duplicated by MDL-26424 [ MDL-26424 ]
          Charles Fulton made changes -
          Link This issue is duplicated by MDL-26293 [ MDL-26293 ]
          Andrew Davis made changes -
          Fix Version/s STABLE Sprint 16 [ 11350 ]
          Fix Version/s STABLE backlog [ 10463 ]
          moodle.com made changes -
          Labels triaged sprinting
          Michael de Raadt made changes -
          Labels sprinting sprinting triaged
          Andrew Davis made changes -
          Status Open [ 1 ] Development in progress [ 3 ]
          Andrew Davis made changes -
          Andrew Davis made changes -
          Testing Instructions Go into the grader report for a course containing several categories. Collapse and reexpand several of them by clicking the +, o, - symbol next to the category name. Check that they can be collapsed and re-expanded.
          Andrew Davis made changes -
          Status Development in progress [ 3 ] Waiting for peer review [ 10012 ]
          Andrew Davis made changes -
          Link This issue has been marked as being related by MDL-30668 [ MDL-30668 ]
          Chris Follin made changes -
          Labels sprinting triaged moodlerooms partner sprinting triaged
          Andrew Davis made changes -
          Status Waiting for peer review [ 10012 ] Development in progress [ 3 ]
          Andrew Davis made changes -
          Status Development in progress [ 3 ] Waiting for peer review [ 10012 ]
          Andrew Davis made changes -
          Testing Instructions Go into the grader report for a course containing several categories. Collapse and reexpand several of them by clicking the +, o, - symbol next to the category name. Check that they can be collapsed and re-expanded. Go into the grader report for a course containing several categories. Collapse and re-expand several of them by clicking the +, o, - symbol next to the category name. Check that they can be collapsed and re-expanded.
          Pull 2.2 Diff URL https://github.com/andyjdavis/moodle/compare/MOODLE_22_STABLE...MDL-20245_user_preferences2_22
          Pull 2.2 Branch MDL-20245_user_preferences2_22
          Andrew Davis made changes -
          Status Waiting for peer review [ 10012 ] Waiting for integration review [ 10010 ]
          Eloy Lafuente (stronk7) made changes -
          Currently in integration Yes [ 10041 ]
          Eloy Lafuente (stronk7) made changes -
          Tester stronk7
          Eloy Lafuente (stronk7) made changes -
          Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
          Integrator stronk7
          Eloy Lafuente (stronk7) made changes -
          Summary Grader Preference not saved, value inserted into DB to long for user_preferences.value field Allow bigger values (up to 1333 chars) in user preferences, alleviating some problems with grader report
          Eloy Lafuente (stronk7) made changes -
          Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
          Affects Version/s 2.2 [ 10656 ]
          Affects Version/s 2.1.3 [ 11251 ]
          Affects Version/s 2.3 [ 10657 ]
          Fix Version/s 2.2.1 [ 11456 ]
          Eloy Lafuente (stronk7) made changes -
          Testing Instructions Go into the grader report for a course containing several categories. Collapse and re-expand several of them by clicking the +, o, - symbol next to the category name. Check that they can be collapsed and re-expanded. 1) Go into the grader report for a course containing several categories. Collapse and re-expand several of them by clicking the +, o, - symbol next to the category name. Check that they can be collapsed and re-expanded.

          2) Run the lib/simpletest/testmoodlelib.php unit tests. Not failure related with "test_set_user_preference" should happen. That ensures that storage up to 1333 chars is working ok.
          Sam Hemelryk made changes -
          Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
          Tester samhemelryk
          Sam Hemelryk made changes -
          Status Testing in progress [ 10011 ] Tested [ 10006 ]
          Eloy Lafuente (stronk7) made changes -
          Status Tested [ 10006 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Currently in integration Yes [ 10041 ]
          Integration date 23/Dec/11
          Eloy Lafuente (stronk7) made changes -
          Fix Version/s STABLE Sprint 16 [ 11350 ]

            People

            • Votes:
              34 Vote for this issue
              Watchers:
              27 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: