Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76324

WebDAV is not working with PHP8

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-76324-master
    • Hide

      Initial setup

      Software

      1. Install Docker.
      2. Install ngrok

      Setup Nextcloud

      1. Run the command: docker run -d -p 8081:80 nextcloud:24.0.7
      2. Please note we need to use the 24.0.7 version because Nextcloud 25 is having some issues.
      3. Run the command: ngrok http 8081
      4. Access the generated URL of ngrok.
      5. Create the admin user and log in to the NextCloud instance.
      6. Create 2 new accounts called: T1 and S1.
      7. Run the command: docker ps
      8. Copy the container id of the Nextcloud.
      9. Run the command: docker exec -it [Container_Id] /bin/bash
      10. Add 'overwriteprotocol' => 'https', to the end of the config/config.php file.
        • To edit the file, you can install vim from the docker container command line:

           apt-get update
           apt-get install vim
          

          Alternatively, you can insert the line via sed:

          sed "$ i 'overwriteprotocol' => 'https'," config/config.php

      11. Navigate to Admin Settings -> Security page.
      12. In OAuth 2.0 clients. Fill out the form as below:
      13. Click Add button.
      14. Copy the Client Identifier and Secret to a safe place for future use.

      Setup Moodle

      1. Log in as admin.
      2. Navigate to Site Administration -> Server -> OAuth 2 services.
      3. In the Create new service, click the Nextcloud button.
      4. Fill the form as below:
        1. Client ID: Client Identifier from Nextcloud.
        2. Client secret: Secret from Nextcloud.
        3. Service base URL: The generated URL of ngrok.
      5. Click Save changes.
      6. Click Connect to a system account.
      7. Log in as Nextcloud admin and authorize the request.
      8. Navigate to Site administration -> Plugins -> Repositories -> Manage repositories.
      9. Select Enabled and visible for Nextcloud.
      10. Click the Settings link of Nextcloud.
      11. Click the button Create a repository instance.
      12. Fill out the form as below:
        1. Name: Moodle Nextcloud
        2. Issuer: Nextcloud.
        3. Leave other fields as default.
      13. Click Save.

      Testing

      Note: This patch needs to be tested on both PHP 7 (>= 7.3.x) and PHP 8 (8.0.x)

      1. Create a course.
      2. Create a teacher and a student.
      3. Enrol teacher and student to the created course.
      4. Make sure to log out of the Nextcloud account.
      5. Log in as teacher.
      6. Navigate to the created course.
      7. Turn on edit mode.
      8. Click Add and activity or resource.
      9. Select File.
      10. Give it a name. Ex: Nextcloud file.
      11. Click the Add button in the Select files.
      12. Verify that you will see Moodle Nextcloud on the left.
      13. Click on it.
      14. Login as T1 Nextcloud account.
      15. Choose a file and select 'Create an access controlled link to the file'.
      16. Click Save and return to course.
      17. Verify that you will not see any errors.
      18. Verify that the File activity will be created successfully.
      19. Make sure to log out of the Nextcloud account.
      20. Log in to Nextcloud with the S1 account.
      21. Log in to Moodle as the student.
      22. Navigate to the created course.
      23. Verify that you can download the file in the File activity.
      24. Switch to Nextcloud browser.
      25. Verify that the file you just downloaded exists in the Moodlefiles folder.

       

       

      Show
      Initial setup Software Install Docker . Install ngrok .  Setup Nextcloud Run the command: docker run -d -p 8081:80 nextcloud:24.0.7 Please note we need to use the 24.0.7 version because Nextcloud 25 is having some issues. Run the command: ngrok http 8081 Access the generated URL of ngrok. Create the admin user and log in to the NextCloud instance. Create 2 new accounts called: T1 and S1 . Run the command: docker ps Copy the container id of the Nextcloud. Run the command: docker exec -it [Container_Id] /bin/bash Add 'overwriteprotocol' => 'https', to the end of the config/config.php file. To edit the file, you can install vim from the docker container command line: apt-get update apt-get install vim Alternatively, you can insert the line via sed: sed "$ i 'overwriteprotocol' => 'https'," config /config .php Navigate to Admin Settings -> Security page. In OAuth 2.0 clients. Fill out the form as below: Name: Moodle Redirection URL: [Your_Moodle_URL] + admin/oauth2callback.php (Ex: http://localhost/m/stable_master/admin/oauth2callback.php) Click Add button. Copy the Client Identifier and Secret to a safe place for future use. Setup Moodle Log in as admin. Navigate to Site Administration -> Server -> OAuth 2 services . In the Create new service, click the Nextcloud button. Fill the form as below: Client ID: Client Identifier from Nextcloud. Client secret: Secret from Nextcloud. Service base URL: The generated URL of ngrok. Click Save changes. Click Connect to a system account. Log in as Nextcloud admin and authorize the request. Navigate to Site administration -> Plugins -> Repositories -> Manage repositories. Select Enabled and visible for Nextcloud. Click the Settings link of Nextcloud. Click the button Create a repository instance. Fill out the form as below: Name: Moodle Nextcloud Issuer: Nextcloud. Leave other fields as default. Click Save. Testing Note : This patch needs to be tested on both PHP 7 (>= 7.3.x) and PHP 8 (8.0.x) Create a course. Create a teacher and a student. Enrol teacher and student to the created course. Make sure to log out of the Nextcloud account. Log in as teacher. Navigate to the created course. Turn on edit mode. Click Add and activity or resource. Select File. Give it a name. Ex: Nextcloud file. Click the Add button in the Select files. Verify that you will see Moodle Nextcloud on the left. Click on it. Login as T1 Nextcloud account. Choose a file and select ' Create an access controlled link to the file '. Click Save and return to course. Verify that you will not see any errors. Verify that the File activity will be created successfully. Make sure to log out of the Nextcloud account. Log in to Nextcloud with the S1 account. Log in to Moodle as the student. Navigate to the created course. Verify that you can download the file in the File activity. Switch to Nextcloud browser. Verify that the file you just downloaded exists in the Moodlefiles folder.    
    • 3
    • Team Hedgehog Sprint 1.1, Team Hedgehog Sprint 1.2

    Description

      According to the changelog

      From PHP 8.0:

      This function returns an XMLParser instance now; previously, a resource was returned, or false on failure.

      We need to change the code to adapt with the new return type

      Attachments

        Issue Links

          Activity

            People

              huongn@moodle.com Huong Nguyen
              huongn@moodle.com Huong Nguyen
              Mihail Geshoski Mihail Geshoski
              Victor Déniz Falcón Victor Déniz Falcón
              Kim Jared Lucas Kim Jared Lucas
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 4 hours, 40 minutes
                  2d 4h 40m

                  Clockify

                    Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.