Moodle
  1. Moodle
  2. MDL-31429

PayPal Enrolment Message Provider Not Installed

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide

      As admin go to site admin > plugins > enrolments > manage enrol plugins
      Enable ims enterprise, flat file and paypal.
      Go to my profile settings > messaging and check that ims enterprise, flat file and paypal enrolment messages appear.
      Disable the 3 enrolment plugins.
      Refresh your messaging settings and check that the 3 enrolment messages no longer appear.

      Re-enable paypal.

      Go into the paypal enrolment options.
      Enable the notifications to students, teachers, and/or admins on the PayPal enrolment settings page.
      Set Allow PayPal enrolments to yes.
      Enrol into a course via PayPal.
      You should receive the notifications and the message and body strings should have been found.

      Show
      As admin go to site admin > plugins > enrolments > manage enrol plugins Enable ims enterprise, flat file and paypal. Go to my profile settings > messaging and check that ims enterprise, flat file and paypal enrolment messages appear. Disable the 3 enrolment plugins. Refresh your messaging settings and check that the 3 enrolment messages no longer appear. Re-enable paypal. Go into the paypal enrolment options. Enable the notifications to students, teachers, and/or admins on the PayPal enrolment settings page. Set Allow PayPal enrolments to yes. Enrol into a course via PayPal. You should receive the notifications and the message and body strings should have been found.
    • Workaround:
      Hide

      Turn off the notifications in PayPal enrollment plugin settings, but this does not prevent errors when a PayPal enrollment fails for some other reason and message_send() is called to send a notification of the error to the admin.

      Show
      Turn off the notifications in PayPal enrollment plugin settings, but this does not prevent errors when a PayPal enrollment fails for some other reason and message_send() is called to send a notification of the error to the admin.
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-31429_paypal_messages
    • Rank:
      37954

      Description

      The PayPal enrollment plugin uses message_send() to send notifications of failures to admins and of successes to students, teachers, and admins; however, the message provider was not installed in the 2.0 upgrade so all of these messages are failing. enrol/paypal/db/messages.php does not exist.

      I'm attaching a patch that creates enrol/paypal/db/messages.php, bumps the version of enrol/paypal by 1 so that the message provider can be installed, and also fixes a few get_string() calls that were not looking for the strings in the correct component, which should be enrol.

      1. MDL-31429_languagestring.patch
        1.0 kB
        Chris Follin
      2. MDL-31429.patch
        4 kB
        Chris Follin

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          reassigning to messaging maintainer, thanks for the report and patch

          Show
          Petr Škoda added a comment - reassigning to messaging maintainer, thanks for the report and patch
          Hide
          Chris Follin added a comment -

          Attaching another patch that resolves a missing string for the message output. This should be applied with the first patch; it is not a replacement.

          Show
          Chris Follin added a comment - Attaching another patch that resolves a missing string for the message output. This should be applied with the first patch; it is not a replacement.
          Hide
          Andrew Davis added a comment - - edited

          I'm curious, who is Eugene Venter? He's listed as the original author in messages.php in your patch.

          Looks like the get_string() fixes have already been made in master at least.

          Show
          Andrew Davis added a comment - - edited I'm curious, who is Eugene Venter? He's listed as the original author in messages.php in your patch. Looks like the get_string() fixes have already been made in master at least.
          Hide
          Andrew Davis added a comment -

          I've added a git branch and diff URL containing the changes. The only problem we have now is that "PayPal enrolment messages" now appears in the messaging settings for everyone even if the Paypal enrolment plugin is disabled.

          Show
          Andrew Davis added a comment - I've added a git branch and diff URL containing the changes. The only problem we have now is that "PayPal enrolment messages" now appears in the messaging settings for everyone even if the Paypal enrolment plugin is disabled.
          Hide
          Chris Follin added a comment -

          Hi Andrew. I don't know who Eugene Venter is. His name shows up throughout the paypal plugin.

          Show
          Chris Follin added a comment - Hi Andrew. I don't know who Eugene Venter is. His name shows up throughout the paypal plugin.
          Hide
          Andrew Davis added a comment -

          As you're the original author of that messages.php file the @copyright should really be you. Do you mind if I put your name in? It would then look like this...

          @copyright 2012 Chris Follin

          Show
          Andrew Davis added a comment - As you're the original author of that messages.php file the @copyright should really be you. Do you mind if I put your name in? It would then look like this... @copyright 2012 Chris Follin
          Hide
          Andrew Davis added a comment -

          Putting this up for peer review. I've added db/messages.php for some of the other enrolment plugins. Chris, for the moment I've got your name in the messages.php you created. Let me know if you want it taken out for whatever reason.

          Show
          Andrew Davis added a comment - Putting this up for peer review. I've added db/messages.php for some of the other enrolment plugins. Chris, for the moment I've got your name in the messages.php you created. Let me know if you want it taken out for whatever reason.
          Hide
          Chris Follin added a comment -

          Yes, that's fine. I had copied the whole header from another paypal file to be sure I included everything but didn't change the name. Thanks, Andrew.

          Show
          Chris Follin added a comment - Yes, that's fine. I had copied the whole header from another paypal file to be sure I included everything but didn't change the name. Thanks, Andrew.
          Hide
          Jason Fowler added a comment -

          Looks good Andrew.

          Do you need a @category doc-tag for the files or not? I can't remember what the decision was during the doc sprint...

          And line 402 of lib/messagelib.php is added whitespace - was this intentional?

          Show
          Jason Fowler added a comment - Looks good Andrew. Do you need a @category doc-tag for the files or not? I can't remember what the decision was during the doc sprint... And line 402 of lib/messagelib.php is added whitespace - was this intentional?
          Hide
          Andrew Davis added a comment -

          As I understand the function of the category tag its used to mark areas that might be of interest to external developers. I could be wrong though...

          The white space at line 402 was deliberate so that it is formatted all purty.

          Show
          Andrew Davis added a comment - As I understand the function of the category tag its used to mark areas that might be of interest to external developers. I could be wrong though... The white space at line 402 was deliberate so that it is formatted all purty.
          Hide
          Andrew Davis added a comment -

          Dear integrators. I have created versions for master and 2.2 stable. Are you able to cherry-pick into 2.1 stable? I attempted to do so, got conflicts due to all the altered version.php files, somehow messed up resolving the conflicts and now the commit isn't in my log and git won't let me cherry-pick it again as it says it is "bad object".

          Show
          Andrew Davis added a comment - Dear integrators. I have created versions for master and 2.2 stable. Are you able to cherry-pick into 2.1 stable? I attempted to do so, got conflicts due to all the altered version.php files, somehow messed up resolving the conflicts and now the commit isn't in my log and git won't let me cherry-pick it again as it says it is "bad object".
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Sam Hemelryk added a comment -

          Thanks Andrew, this has been integrated now.
          It looks like Authorize plugin may be missing a string, but with a quick look I couldn't find the plugin settings anywhere. I suppose testing will turn that up if it is in fact missing.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Thanks Andrew, this has been integrated now. It looks like Authorize plugin may be missing a string, but with a quick look I couldn't find the plugin settings anywhere. I suppose testing will turn that up if it is in fact missing. Cheers Sam
          Hide
          Michael de Raadt added a comment -

          I wasn't able to complete the test.

          I tried this with a real PayPal account and a Sandbox one. I kept receiving an error after successfully paying and returning back to Moodle. In the sandbox instructions (looking rather dated) there was some alternate code, but that didn't change the outcome.

          So I wasn't able to get to the point where the message would be sent.

          I've tried to seek help from others with PayPal experience, but I couldn't find any volunteers.

          Show
          Michael de Raadt added a comment - I wasn't able to complete the test. I tried this with a real PayPal account and a Sandbox one. I kept receiving an error after successfully paying and returning back to Moodle. In the sandbox instructions (looking rather dated) there was some alternate code, but that didn't change the outcome. So I wasn't able to get to the point where the message would be sent. I've tried to seek help from others with PayPal experience, but I couldn't find any volunteers.
          Hide
          Michael de Raadt added a comment -

          Hi, Chris.

          As reporter, I assume you have a working PayPal setup. Can you test this?

          Show
          Michael de Raadt added a comment - Hi, Chris. As reporter, I assume you have a working PayPal setup. Can you test this?
          Hide
          Chris Follin added a comment -

          Michael,
          We applied the patch to our production systems in February. It's confirmed as working.

          Show
          Chris Follin added a comment - Michael, We applied the patch to our production systems in February. It's confirmed as working.
          Hide
          Dan Poltawski added a comment -

          Spoke to Andrew and he is happy with this test being sufficient.

          Show
          Dan Poltawski added a comment - Spoke to Andrew and he is happy with this test being sufficient.
          Hide
          Eloy Lafuente (stronk7) added a comment -
          UPDATE tracker_issues
             SET status = 'Closed',
                comment = 'Thanks!'
          WHEN participants = 'Did a gorgeous work'
          

          This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

          Show
          Eloy Lafuente (stronk7) added a comment - UPDATE tracker_issues SET status = 'Closed', comment = 'Thanks!' WHEN participants = 'Did a gorgeous work' This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

            People

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

              Dates

              • Created:
                Updated:
                Resolved: