Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-22725

admin/replace.php breaks serialised data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Minor Minor
    • None
    • 1.9.9, 2.0
    • Administration
    • MOODLE_19_STABLE, MOODLE_20_STABLE

      Serialised data breaks when using the migration approach documented by http://docs.moodle.org/en/Moodle_migration

      Either using /admin/replace.php or `sed` causes the issue.

      The severity of the issue depends on what string you are replacing. In PHP 5.1.6, if you edit serialised data and replace a string with one of different length without updating the s:<number>: value to the new length, it will throw a warning and return false. In PHP 5.2.10 it put up with the incorrect length and worked anyway.

      If the problem is effecting the course.modinfo field you can simply update mdl_course set modinfo='' to fix. The issue effected a third party block I was using (course_menu block) which used serialised data and contained a URL which I was replacing, causing the block to crash out and not display.

      I checked all core code for other uses of unserialise. There are some serialised fields stored in mnet as well as gradebook preferences which could break if they get tampered with.

      Thanks

            moodle.com Moodle HQ
            ashleyholman Ashley Holman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.