Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide

      For testing this new webservice:
      Use this client: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/client.php

      functionname core_course_import_course

      /// PARAMETERS $params = array(
      'importfrom' => 2, // The id of the course we are importing from
      'importto' => 3, // The id of the course we are importing to
      'deletecontent' => 0, // Delete the content of the course we are importing to
      'options' => array(array('name'=>'blocks', 'value'=>1), array('name'=>'activities', 'value'=>1), array('name'=>'filters', 'value'=>1)) // Backup options );

      Change the importfrom and importto values to match your courses

      Show
      For testing this new webservice: Use this client: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/client.php functionname core_course_import_course /// PARAMETERS $params = array( 'importfrom' => 2, // The id of the course we are importing from 'importto' => 3, // The id of the course we are importing to 'deletecontent' => 0, // Delete the content of the course we are importing to 'options' => array(array('name'=>'blocks', 'value'=>1), array('name'=>'activities', 'value'=>1), array('name'=>'filters', 'value'=>1)) // Backup options ); Change the importfrom and importto values to match your courses
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-32919-core_course_import_course
    • Rank:
      39998

      Description

      This web service function will import the activites, blocks and filters from a course to an existing one

      It's a copy of the current backup Import functionallity in Moodle

      Parameters:
      ----------

      importfrom - int The id of the course we are importing from
      importto - int The id of the course we are importing to
      deletecontent - int Delete the content of the course we are importing to
      backup settings - struct of key value:
      Possible keys:
      'activities' => 'Default to 1',
      'blocks' => 'Default to 1',
      'filters' => 'Default to 1',

      Return value:
      -----------
      null

        Issue Links

          Activity

          Hide
          Juan Leyva added a comment -

          Requesting peer review for validating the description parameteres and code

          Show
          Juan Leyva added a comment - Requesting peer review for validating the description parameteres and code
          Hide
          Jérôme Mouneyrac added a comment -

          Moving to API list you can start Juan.

          Show
          Jérôme Mouneyrac added a comment - Moving to API list you can start Juan.
          Hide
          Jérôme Mouneyrac added a comment -

          Hi Juan, all seems good. Testing...

          Show
          Jérôme Mouneyrac added a comment - Hi Juan, all seems good. Testing...
          Hide
          Jérôme Mouneyrac added a comment -

          There is a little bug, so I try to commit and rebase but too many conflicts. I let you fix it Juan

          My commit: https://github.com/mouneyrac/moodle/tree/MDL-32919-juan (if it's too complex to resolve the conflicts, and it's easier to not keep my commit, it's ok)

          Cheers.

          Show
          Jérôme Mouneyrac added a comment - There is a little bug, so I try to commit and rebase but too many conflicts. I let you fix it Juan My commit: https://github.com/mouneyrac/moodle/tree/MDL-32919-juan (if it's too complex to resolve the conflicts, and it's easier to not keep my commit, it's ok) Cheers.
          Hide
          Jérôme Mouneyrac added a comment -

          I also forgot: don't forget to bump the version number in version.php. Otherwise it makes the tester wonder why it doesn't work. (web service functions are updated/installed/removed automatically every new version). Thanks.

          Show
          Jérôme Mouneyrac added a comment - I also forgot: don't forget to bump the version number in version.php. Otherwise it makes the tester wonder why it doesn't work. (web service functions are updated/installed/removed automatically every new version). Thanks.
          Hide
          Juan Leyva added a comment -

          I've updated the branch rebasing, adding your commit and also bumping the version number.

          Can you submit it for integration review?

          Show
          Juan Leyva added a comment - I've updated the branch rebasing, adding your commit and also bumping the version number. Can you submit it for integration review?
          Hide
          Jérôme Mouneyrac added a comment -

          Thanks Juan. Submitting.

          Show
          Jérôme Mouneyrac added a comment - Thanks Juan. Submitting.
          Hide
          Aparup Banerjee added a comment -

          Hi Juan,
          i'm afraid its a bit late to get this into core as we're already way past halfway with our QA cycle prior to release. Still, i've looked at this and it is looking great.

          I'll come back to this after the release.

          Show
          Aparup Banerjee added a comment - Hi Juan, i'm afraid its a bit late to get this into core as we're already way past halfway with our QA cycle prior to release. Still, i've looked at this and it is looking great. I'll come back to this after the release.
          Hide
          Dan Poltawski added a comment -

          Taking integration held issues out of integration (whilst we are keeping master and 23_STABLE in sync).

          Show
          Dan Poltawski added a comment - Taking integration held issues out of integration (whilst we are keeping master and 23_STABLE in sync).
          Hide
          Jérôme Mouneyrac added a comment -

          Hi Juan,
          it misses the PHPunit test. PHPunit test is now requirement to send a web service function to integration. An example can be found there: https://github.com/moodle/moodle/blob/master/course/tests/externallib_test.php (you can look at get_categories as example).
          Cheers,
          Jerome

          Show
          Jérôme Mouneyrac added a comment - Hi Juan, it misses the PHPunit test. PHPunit test is now requirement to send a web service function to integration. An example can be found there: https://github.com/moodle/moodle/blob/master/course/tests/externallib_test.php (you can look at get_categories as example). Cheers, Jerome
          Hide
          Dan Poltawski 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
          Dan Poltawski 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 -

          Hi Juan,

          Thanks for the effort, this has been integrated to master now and will be part of 2.4.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Hi Juan, Thanks for the effort, this has been integrated to master now and will be part of 2.4. Cheers Sam
          Hide
          Adrian Greeve added a comment -

          I ran the web service and it didn't return any errors. Just some xml to the screen.
          Test passed

          Show
          Adrian Greeve added a comment - I ran the web service and it didn't return any errors. Just some xml to the screen. Test passed
          Hide
          Dan Poltawski added a comment -

          *Notice*: Undefined variable: friendlyintegrator in /Users/danp/git/tokenintegrationthanks.php on line 26

          Congratulations

          {tracker.user.name}

          !

          You've made into Moodle

          {tracker.fixversion-1}

          +

          I would like to personally thank you for this contribution on behalf of all Moodle users throughout the world.

          cheers!

          {tracker.friendlyintegrator}
          Show
          Dan Poltawski added a comment - * Notice *: Undefined variable: friendlyintegrator in /Users/danp/git/tokenintegrationthanks.php on line 26 Congratulations {tracker.user.name} ! You've made into Moodle {tracker.fixversion-1} + I would like to personally thank you for this contribution on behalf of all Moodle users throughout the world. cheers! {tracker.friendlyintegrator}

            People

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

              Dates

              • Created:
                Updated:
                Resolved: