Moodle
  1. Moodle
  2. MDL-29512

File manager - "download...rename...move...delete... button" fails or has destructive results

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.4, 2.1.1, 2.2
    • Fix Version/s: 2.0.5, 2.1.2
    • Component/s: Files API
    • Labels:
      None
    • Environment:
      Apache 2.2.19 php 5.3.5 mysql 5.0.92
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1. Add files to "My Private Files". Try to rename or delete any file. The changes appear to have happened. Click "Save Changes" and all deletes/renames are ignored.
      2. Create an "Advanced Uploading of Files" activity. Upload several files. Save Changes. All works fine. "Edit these files"... Try to delete a single file. It appears that just that file has been deleted. "Save Changes".... all files are gone.
      This is a recently introduced bug on 21 Sep 2011 Weekly Release. Problem did not exist on 14 Aug 2011 Release.

      Show
      1. Add files to "My Private Files". Try to rename or delete any file. The changes appear to have happened. Click "Save Changes" and all deletes/renames are ignored. 2. Create an "Advanced Uploading of Files" activity. Upload several files. Save Changes. All works fine. "Edit these files"... Try to delete a single file. It appears that just that file has been deleted. "Save Changes".... all files are gone. This is a recently introduced bug on 21 Sep 2011 Weekly Release. Problem did not exist on 14 Aug 2011 Release.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Rank:
      19221

      Description

      In "My Private Files" now unable to rename or delete any files.
      In Assignment "Advanced Uploading of Files" if you try to delete or rename any file, ALL files are deleted.

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          Increasing priority because this is imo a serious regression, thanks a lot for the report.

          Show
          Petr Škoda added a comment - Increasing priority because this is imo a serious regression, thanks a lot for the report.
          Hide
          Petr Škoda added a comment -

          I am getting on PG:

          Debug info: ERROR: invalid input syntax for integer: ""
          SELECT * FROM mdl21e_files WHERE contextid = $1 AND component = $2 AND filearea = $3 AND itemid = $4 ORDER BY id
          [array (
          0 => '13',
          1 => 'user',
          2 => 'draft',
          3 => '',
          )]
          Stack trace:
          line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
          line 678 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
          line 1122 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
          line 1071 of /lib/dml/moodle_database.php: call to moodle_database->get_records_select()
          line 266 of /lib/filestorage/file_storage.php: call to moodle_database->get_records()
          line 443 of /lib/filelib.php: call to file_storage->get_area_files()
          line 49 of /user/filesedit_form.php: call to file_get_draft_area_info()
          line 499 of /lib/formslib.php: call to user_filesedit_form->validation()
          line 448 of /lib/formslib.php: call to moodleform->validate_defined_fields()
          line 545 of /lib/formslib.php: call to moodleform->is_validated()
          line 67 of /user/filesedit.php: call to moodleform->get_data()

          Show
          Petr Škoda added a comment - I am getting on PG: Debug info: ERROR: invalid input syntax for integer: "" SELECT * FROM mdl21e_files WHERE contextid = $1 AND component = $2 AND filearea = $3 AND itemid = $4 ORDER BY id [array ( 0 => '13', 1 => 'user', 2 => 'draft', 3 => '', )] Stack trace: line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end() line 678 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end() line 1122 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql() line 1071 of /lib/dml/moodle_database.php: call to moodle_database->get_records_select() line 266 of /lib/filestorage/file_storage.php: call to moodle_database->get_records() line 443 of /lib/filelib.php: call to file_storage->get_area_files() line 49 of /user/filesedit_form.php: call to file_get_draft_area_info() line 499 of /lib/formslib.php: call to user_filesedit_form->validation() line 448 of /lib/formslib.php: call to moodleform->validate_defined_fields() line 545 of /lib/formslib.php: call to moodleform->is_validated() line 67 of /user/filesedit.php: call to moodleform->get_data()
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Reverting these commits:

          master:

          • 7dfe3c517b8cf88356b1d1e208480b1a15452273
          • f03a17bb09bed83a29cda253c2049c937852dd38

          21_STABLE:

          • 1f552b4c48c0cb509387d3046e2b2e5c27865c95
          • b19539bf44ac82ee4c379712b09f4fe54d8a7bd9

          20_STABLE:

          • 312a8e04362a56249d75037c3c1ac559cb000b75
          • 59bc05c4a269d01dbd680048f9835a70492fab4d

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Reverting these commits: master: 7dfe3c517b8cf88356b1d1e208480b1a15452273 f03a17bb09bed83a29cda253c2049c937852dd38 21_STABLE: 1f552b4c48c0cb509387d3046e2b2e5c27865c95 b19539bf44ac82ee4c379712b09f4fe54d8a7bd9 20_STABLE: 312a8e04362a56249d75037c3c1ac559cb000b75 59bc05c4a269d01dbd680048f9835a70492fab4d Ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Petr reviewd and tested 2.1 and master, so pass.

          Show
          Eloy Lafuente (stronk7) added a comment - Petr reviewd and tested 2.1 and master, so pass.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Closing this as fixed. Thanks David & Petr.

          One emergency build has been executed so now all the git and cvs repositories (Build: 20110925) have this fixed.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Closing this as fixed. Thanks David & Petr. One emergency build has been executed so now all the git and cvs repositories (Build: 20110925) have this fixed. Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: