Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-3299

Site plugins cannot use the canBeCleared option in site schemas

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8.0
    • Fix Version/s: 3.8.1
    • Component/s: Site add-ons
    • Labels:
    • Testing Instructions:
      Hide

      This issue should only be tested in 1 device.

      1. Install the plugin attached to this issue in a Moodle site. 
      2. In a course, create a group choice. Make sure to allow editing the response (to make it easier to test).
      3. In the app, login in the site and open the group choice.
      4. Go offline.
      5. WIthout leaving the group choice, go to the More tab > App Settings > Space usage.
      6. Remember the number of "entries in cache" displayed in the current site.
      7. Answer the choice. Check that you see a message saying that there's offline data, and the app displays the choice you selected in offline.
      8. Go back to the Space usage and perform a PTR. Check that the number of entries in cache has increased by 1.
      Show
      This issue should only be tested in 1 device. Install the plugin attached to this issue in a Moodle site.  In a course, create a group choice. Make sure to allow editing the response (to make it easier to test). In the app, login in the site and open the group choice. Go offline. WIthout leaving the group choice, go to the More tab > App Settings > Space usage. Remember the number of "entries in cache" displayed in the current site. Answer the choice. Check that you see a message saying that there's offline data, and the app displays the choice you selected in offline. Go back to the Space usage and perform a PTR. Check that the number of entries in cache has increased by 1.
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Sprint:
      Moodle App 3.8.1

      Description

      As pointed out by Noel in MOBILE-3277, since the site plugins schemas aren't added to the siteSchemas object they cannot use the canBeCleared option. We aren't adding the site plugins schemas to the object because we don't want them to be created by all sites. One possible solution is to add a new calculated property in the schema to indicate that the schema should only be created on the current site or something like that.

      Also, right now we're assuming that all schemas registered after the site has been created belong to site plugins, and this could change in the future. The only solution we thought of is to create a subclass of CoreSitesProvider with a different implementation of registerSiteSchema, and send that subclass to the site plugins instead of the original one.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dpalou Dani Palou
              Reporter:
              dpalou Dani Palou
              Peer reviewer:
              Noel De Martin
              Integrator:
              Juan Leyva
              Tester:
              Isabel Renedo Rouco
              Participants:
              Component watchers:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Mar/20