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

core-site-plugins-call-ws-on-load isn't executed when performing a PTR

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.2
    • Fix Version/s: 3.6.0
    • Component/s: Site add-ons
    • Labels:
    • Testing Instructions:
      Hide
      1. In a Moodle site, install the certificate plugin (the old one).
      2. Create a certificate in a course.
      3. In the app, open the certificate.
      4. In web, go to the logs of that course (Cog icon > More > Reports > Logs) and check that there is a log entry saying the student has viewed the activity.
      5. In the app, perform a PTR.
      6. In web, refresh the logs. Check that a new viewed entry has been added to the log.
      Show
      In a Moodle site, install the certificate plugin (the old one). Create a certificate in a course. In the app, open the certificate. In web, go to the logs of that course (Cog icon > More > Reports > Logs) and check that there is a log entry saying the student has viewed the activity. In the app, perform a PTR. In web, refresh the logs. Check that a new viewed entry has been added to the log.
    • Workaround:
      Hide

      To ensure that the template is always recompiled, ensure that the content changes after each refresh.

      A simple way of doing this is to pass PHP's time() to the mustache template, and render it in an element with display: none;

      Show
      To ensure that the template is always recompiled, ensure that the content changes after each refresh. A simple way of doing this is to pass PHP's time() to the mustache template, and render it in an element with display: none;
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Sprint:
      Moodle Mobile 3.6.0

      Description

      This directive was created with logging in mind. In the app, we only call logging WebServices when the user opens a page, they aren't called when the user performs a PTR. It's not a bug, it was designed like this.

      However, the behaviour of this directive isn't consistent. If the user performs a PTR and the HTML or Javascript returned by the plugin has changed, the page is compiled and core-site-plugins-call-ws-on-load is executed (this cannot be prevented). If the HTML and javascript haven't changed, then the code isn't compiled and the directive isn't executed.

      We discussed this internally and we decided to always compile the code, even if it hasn't changed. This means that the directive will be executed when performing a PTR too.

        Attachments

          Activity

            People

            Assignee:
            dpalou Dani Palou
            Reporter:
            dpalou Dani Palou
            Peer reviewer:
            Pau Ferrer Pau Ferrer
            Integrator:
            Juan Leyva Juan Leyva
            Tester:
            Albert Gasset Albert Gasset
            Participants:
            Component watchers:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Jan/19