Moodle
  1. Moodle
  2. MDL-41843

Incorrect uses of namespace in mod/lti/OAuthBody.php

    Details

    • Testing Instructions:
      Hide
      1. Create a external tool (LTI) activity with
        1. Launch url http://www.imsglobal.org/developers/LTI/test/v1p1/tool.php
        2. key 12345
        3. secret secret
      2. Launch external tool and it should work fine
      3. Modify mod/lti/service.php and add $consumerkey='12345' before if (empty($consumerkey))
      4. In browser go to mod/lti/service.php and make sure you see exception and not Fatal error: Class 'moodle\mod\lti\Exception' not found
      Show
      Create a external tool (LTI) activity with Launch url http://www.imsglobal.org/developers/LTI/test/v1p1/tool.php key 12345 secret secret Launch external tool and it should work fine Modify mod/lti/service.php and add $consumerkey='12345' before if (empty($consumerkey)) In browser go to mod/lti/service.php and make sure you see exception and not Fatal error: Class 'moodle\mod\lti\Exception' not found
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      wip-mdl-41843
    • Story Points (Obsolete):
      5
    • Sprint:
      BACKEND Sprint 6

      Description

      OAuthBody.php states moodle\mod\lti namespace, but Exception class doesn't exist in this namespace, it should be \Exception or use OAuthException.

        Gliffy Diagrams

          Activity

          Hide
          Ankit Agarwal added a comment -

          Hi Dongsheng,
          Thanks for fixing this.

          1. Can you please add some testing instructions to test atleast one of these exceptions.
          2. Also please consider back-porting this if possible.
          3. OAuth.php also uses Exception() instead of \Exception or OAuthexception, can you please fix those as well?
            Feel free to submit for integration, once those issues are taken care of.
            Thanks
          Show
          Ankit Agarwal added a comment - Hi Dongsheng, Thanks for fixing this. Can you please add some testing instructions to test atleast one of these exceptions. Also please consider back-porting this if possible. OAuth.php also uses Exception() instead of \Exception or OAuthexception, can you please fix those as well? Feel free to submit for integration, once those issues are taken care of. Thanks
          Hide
          Rajesh Taneja added a comment -

          Taking this as Dongsheng might not be working on this.

          Show
          Rajesh Taneja added a comment - Taking this as Dongsheng might not be working on this.
          Hide
          Rajesh Taneja added a comment -
          Show
          Rajesh Taneja added a comment - Dongsheng's branch: git@github.com:dongsheng/moodle.git https://github.com/dongsheng/moodle/compare/MOODLE_25_STABLE...MDL-41843_oauthexception_25
          Hide
          Ankit Agarwal added a comment -

          +1

          Show
          Ankit Agarwal added a comment - +1
          Hide
          Rajesh Taneja added a comment -

          Thanks Ankit.

          Show
          Rajesh Taneja added a comment - Thanks Ankit.
          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
          Eloy Lafuente (stronk7) added a comment -

          Integrated (24, 25 & master), thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (24, 25 & master), thanks!
          Hide
          Rossiani Wijaya added a comment -

          This is working as expected.

          Tested for 2.4, 2.5 and master.

          Test passed.

          Show
          Rossiani Wijaya added a comment - This is working as expected. Tested for 2.4, 2.5 and master. Test passed.
          Hide
          Dan Poltawski added a comment -

          Hurrah! Thanks for your contribution - this fix is part of Moodle.

          Show
          Dan Poltawski added a comment - Hurrah! Thanks for your contribution - this fix is part of Moodle.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Agile