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

Onsite preset doesn't retain the advanced search template.

    Details

    • Testing Instructions:
      Hide

      Pre-requisites

      • Testing requires access to the database.
      • The ability to modify records.
      • The ability to delete files from the the data area.

      Test steps

      1. Create a database activity
      2. Add some fields.
      3. Alter the templates so that you know that you will know if they revert back to the default template.
      4. Export the database preset as a zip file and save it on your computer (file 1).
      5. Go back to the presets tab and save the preset in the 'Save as preset' section. This will save the preset file on the system (file 2).
      6. In the same course, create a database activity and import the preset zip file from your computer(file 1).
        • Check that the preset has imported correctly and that the new database activity is identical to the original.
      7. In the same course, create another database activity and select the system saved preset (file 2) and import that.
        • Check that the preset has imported correctly and that the new database activity is identical to the original.

      Backwards compatibility

      To test a preset file created before advanced search templates were included in the preset file, you will need to alter the files. (or create a 1.7 installation)

      External zip file.

      1. Create a database activity.
      2. Add some fields.
      3. Save the templates.
      4. Export the database preset as a zip file and save it on your computer.
      5. Extract the file.
      6. Delete the asearchtemplate.html file and re-compress the file.
      7. Create a new database activity.
      8. Upload the preset zip file from you computer.
        • Check that no error is shown when uploading the preset file.

      On-site preset.

      1. Create a database activity.
      2. Add some fields.
      3. Save the templates.
      4. Save as a preset ('Save as preset' area, click continue).
      5. Open the database manager of your choice.
      6. Browse through mdl_files and find your preset (check filepath).
      7. When the filepath is the preset file that you created, check filename for asearchtemplate.html.
      8. make note of the contenthash.
      9. Go to the moodledata / filedir directory.
      10. The first two characters of the contenthash are the first directory, enter that directory.
      11. the third and fourth characters of the contenthash are the next directory. Enter that directory.
      12. Delete the file in that directory (make sure that the file name is exactly the same as the contenthash.
      13. Delete the record that corresponds to the file that you just deleted from the database.
      14. Create a new database activity.
      15. Go to the preset page and select the on-site preset that you just hacked.
        • Check that no errors are displayed when using this preset.

      Please note that viewing the advanced search template immediately after uploading the preset will display nothing. Clicking the 'Search' tab will automatically generate a default template.

      Show
      Pre-requisites Testing requires access to the database. The ability to modify records. The ability to delete files from the the data area. Test steps Create a database activity Add some fields. Alter the templates so that you know that you will know if they revert back to the default template. Export the database preset as a zip file and save it on your computer (file 1). Go back to the presets tab and save the preset in the 'Save as preset' section. This will save the preset file on the system (file 2). In the same course, create a database activity and import the preset zip file from your computer(file 1). Check that the preset has imported correctly and that the new database activity is identical to the original. In the same course, create another database activity and select the system saved preset (file 2) and import that. Check that the preset has imported correctly and that the new database activity is identical to the original. Backwards compatibility To test a preset file created before advanced search templates were included in the preset file, you will need to alter the files. (or create a 1.7 installation) External zip file. Create a database activity. Add some fields. Save the templates. Export the database preset as a zip file and save it on your computer. Extract the file. Delete the asearchtemplate.html file and re-compress the file. Create a new database activity. Upload the preset zip file from you computer. Check that no error is shown when uploading the preset file. On-site preset. Create a database activity. Add some fields. Save the templates. Save as a preset ('Save as preset' area, click continue). Open the database manager of your choice. Browse through mdl_files and find your preset (check filepath). When the filepath is the preset file that you created, check filename for asearchtemplate.html. make note of the contenthash. Go to the moodledata / filedir directory. The first two characters of the contenthash are the first directory, enter that directory. the third and fourth characters of the contenthash are the next directory. Enter that directory. Delete the file in that directory (make sure that the file name is exactly the same as the contenthash. Delete the record that corresponds to the file that you just deleted from the database. Create a new database activity. Go to the preset page and select the on-site preset that you just hacked. Check that no errors are displayed when using this preset. Please note that viewing the advanced search template immediately after uploading the preset will display nothing. Clicking the 'Search' tab will automatically generate a default template.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-36551-master

      Description

      Using a preset zip file will keep all the information correctly when importing into a new database activity, but a locally stored preset will not.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/Jan/13