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

[Youtube Plugin] Selecting a category results in <data could not be obtained> error

XMLWordPrintable

    • MOODLE_310_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-70063-master-1
    • Hide

      Prerequisites

      1. You will need to obtain an API key (https://developers.google.com/youtube/v3/getting-started)
      2. Login as admin.
      3. Go to Site administration > Plugins > Blocks > Manage blocks
      4. Enable and configure ("Settings" link) the Youtube block.
      5. In the configuration page, add the API key and save changes.
      6. Go to Site home, turn editing on and add the Tags block to the page via the 'Add a block' link.
      7. Go to the Admin's profile via the 'Profile' link in the user menu (top right)
      8. Click on 'Edit profile' in the 'User details' section.
      9. In the 'Interests' section add "cars" (You will need to press enter to add the tag) and save the changes.

      Test 1

      1. Go to Site home.
        • You should see the added "cars" tag in the Tags block.
      2. Click on the tag.
      3. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link.
      4. Configure the Youtube block.
        1. Set Category = "Education"
        2. Save changes.
      5. In the Tags page
        1. confirm the Youtube block properly displays videos related to the selected category without any errors.

      Test 2 (upgrade)

      NOTE: If you have already run the upgrade and you hit a screen or message saying that your version of code is older than the current code, then run the following mdk command in the console:
      "mdk run version"

      1. Without the patch applied (git checkout to the commit prior to "MDL-70063 block_tag_youtube: Update category config to use category ID")
      2. Go to the Site home.
      3. Click on the tag in the Tags block.
      4. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link.
      5. Configure the Youtube block.
        1. Set Category = "Films & Animation"
        2. Save changes.
      6. The Youtube block should now display an error (no videos as well)
      7. Apply the patch (git checkout to the commit "MDL-70063 block_tag_youtube: Fix category config in existing instances")
      8. Run the upgrade.
      9. Go to Site home.
      10. Click on the tag in the Tags block.
      11. In the Tags page
        1. confirm the Youtube block properly displays videos related to the selected category without any errors.

      Test 3 (upgrade - Youtube API key not set)

      NOTE: If you have already run the upgrade and you hit a screen or message saying that your version of code is older than the current code, then run the following mdk command in the console:
      "mdk run version"

      1. Without the patch applied (git checkout to the commit prior to "MDL-70063 block_tag_youtube: Update category config to use category ID")
      2. Go to Site administration > Plugins > Blocks > Manage blocks
      3. Configure the Youtube block.
        1. Remove the API key and save changes.
      4. Go to the Site home.
      5. Click on the tag in the Tags block.
      6. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link.
      7. Configure the Youtube block.
        1. Set Category = "Education"
        2. Save changes.
      8. The Youtube block should now display an error: API key is not set (no videos as well)
      9. Apply the patch (git checkout to the commit "MDL-70063 block_tag_youtube: Fix category config in existing instances")
      10. Run the upgrade.
        1. confirm that you see a warning message during the upgrade stating that the API key is not configured and therefore the category setting will be set by default to "Any category" as the categories cannot be obtained and mapped.
      11. Go to Site administration > Plugins > Blocks > Manage blocks
      12. Configure the Youtube block.
        1. Add a valid API key and save changes.
      13. Go to Site home.
      14. Click on the tag in the Tags block.
      15. In the Tags page,
        1. confirm the Youtube block properly displays videos
      16. Configure the Youtube block.
        1. confirm the Category is set to "Any category"

      Test 4 (upgrade - Youtube API key is not valid)

      NOTE: If you have already run the upgrade and you hit a screen or message saying that your version of code is older than the current code, then run the following mdk command in the console:
      "mdk run version"

      1. Without the patch applied (git checkout to the commit prior to "MDL-70063 block_tag_youtube: Update category config to use category ID")
      2. Go to Site administration > Plugins > Blocks > Manage blocks
      3. Configure the Youtube block.
        1. For the API key, add an value that does not represents a valid key (ex. 'invalidkeyvalue').
      4. Go to the Site home.
      5. Click on the tag in the Tags block.
      6. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link.
      7. Configure the Youtube block.
        1. Set Category = "Films & Animation"
        2. Save changes.
      8. The Youtube block should not display any videos
      9. Apply the patch (git checkout to the commit "MDL-70063 block_tag_youtube: Fix category config in existing instances")
      10. Run the upgrade.
        1. confirm that you see a warning message during the upgrade stating that the API key is not valid and therefore the category setting will be set by default to "Any category" as the categories cannot be obtained and mapped.
      11. Go to Site administration > Plugins > Blocks > Manage blocks
      12. Configure the Youtube block.
        1. Add a valid API key and save changes.
      13. Go to Site home.
      14. Click on the tag in the Tags block.
      15. In the Tags page,
        1. confirm the Youtube block properly displays videos
      16. Configure the Youtube block.
        1. confirm the Category is set to "Any category"
      Show
      Prerequisites You will need to obtain an API key ( https://developers.google.com/youtube/v3/getting-started ) Login as admin. Go to Site administration > Plugins > Blocks > Manage blocks Enable and configure ("Settings" link) the Youtube block. In the configuration page, add the API key and save changes. Go to Site home, turn editing on and add the Tags block to the page via the 'Add a block' link. Go to the Admin's profile via the ' Profile ' link in the user menu (top right) Click on ' Edit profile ' in the 'User details' section. In the 'Interests' section add " cars " (You will need to press enter to add the tag) and save the changes. Test 1 Go to Site home. You should see the added " cars " tag in the Tags block. Click on the tag. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link. Configure the Youtube block. Set Category = "Education" Save changes. In the Tags page confirm the Youtube block properly displays videos related to the selected category without any errors. Test 2 (upgrade) NOTE: If you have already run the upgrade and you hit a screen or message saying that your version of code is older than the current code, then run the following mdk command in the console: " mdk run version " Without the patch applied (git checkout to the commit prior to " MDL-70063 block_tag_youtube: Update category config to use category ID") Go to the Site home. Click on the tag in the Tags block. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link. Configure the Youtube block. Set Category = "Films & Animation" Save changes. The Youtube block should now display an error (no videos as well) Apply the patch (git checkout to the commit " MDL-70063 block_tag_youtube: Fix category config in existing instances") Run the upgrade. Go to Site home. Click on the tag in the Tags block. In the Tags page confirm the Youtube block properly displays videos related to the selected category without any errors. Test 3 (upgrade - Youtube API key not set) NOTE: If you have already run the upgrade and you hit a screen or message saying that your version of code is older than the current code, then run the following mdk command in the console: " mdk run version " Without the patch applied (git checkout to the commit prior to " MDL-70063 block_tag_youtube: Update category config to use category ID") Go to Site administration > Plugins > Blocks > Manage blocks Configure the Youtube block. Remove the API key and save changes. Go to the Site home. Click on the tag in the Tags block. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link. Configure the Youtube block. Set Category = "Education" Save changes. The Youtube block should now display an error: API key is not set (no videos as well) Apply the patch (git checkout to the commit " MDL-70063 block_tag_youtube: Fix category config in existing instances") Run the upgrade. confirm that you see a warning message during the upgrade stating that the API key is not configured and therefore the category setting will be set by default to "Any category" as the categories cannot be obtained and mapped. Go to Site administration > Plugins > Blocks > Manage blocks Configure the Youtube block. Add a valid API key and save changes. Go to Site home. Click on the tag in the Tags block. In the Tags page, confirm the Youtube block properly displays videos Configure the Youtube block. confirm the Category is set to "Any category" Test 4 (upgrade - Youtube API key is not valid) NOTE: If you have already run the upgrade and you hit a screen or message saying that your version of code is older than the current code, then run the following mdk command in the console: " mdk run version " Without the patch applied (git checkout to the commit prior to " MDL-70063 block_tag_youtube: Update category config to use category ID") Go to Site administration > Plugins > Blocks > Manage blocks Configure the Youtube block. For the API key, add an value that does not represents a valid key (ex. 'invalidkeyvalue'). Go to the Site home. Click on the tag in the Tags block. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link. Configure the Youtube block. Set Category = "Films & Animation" Save changes. The Youtube block should not display any videos Apply the patch (git checkout to the commit " MDL-70063 block_tag_youtube: Fix category config in existing instances") Run the upgrade. confirm that you see a warning message during the upgrade stating that the API key is not valid and therefore the category setting will be set by default to "Any category" as the categories cannot be obtained and mapped. Go to Site administration > Plugins > Blocks > Manage blocks Configure the Youtube block. Add a valid API key and save changes. Go to Site home. Click on the tag in the Tags block. In the Tags page, confirm the Youtube block properly displays videos Configure the Youtube block. confirm the Category is set to "Any category"
    • 3
    • 4.0 holding pattern 8

      How to reproduce:

      • As admin navigate to <Site home>
      • Turn editing on
      • Add a new tags block
      • Click on any of the tag in the block (tester used cars)
      • Turn editing on
      • Add youtube block (on test instance it has to be enabled in site administration / plugins / blocks and it needs proper API key)
      • Edit the new block and select one of the categories

       

       

      Initially I've thought this might be an issue where there are no videos found. However, this has been tested on a car tag and the category was autos & vehicles so it's more than certain there should be some hits.

        1. MDL-70063-test1-step1.png
          MDL-70063-test1-step1.png
          12 kB
        2. MDL-70063-test1-step4.png
          MDL-70063-test1-step4.png
          27 kB
        3. MDL-70063-test1-step5.png
          MDL-70063-test1-step5.png
          128 kB
        4. MDL-70063-test2-step1.png
          MDL-70063-test2-step1.png
          56 kB
        5. MDL-70063-test2-step11.png
          MDL-70063-test2-step11.png
          101 kB
        6. MDL-70063-test2-step6.png
          MDL-70063-test2-step6.png
          115 kB
        7. MDL-70063-test2-step8.png
          MDL-70063-test2-step8.png
          23 kB
        8. MDL-70063-test3-step10.png
          MDL-70063-test3-step10.png
          41 kB
        9. MDL-70063-test3-step12.png
          MDL-70063-test3-step12.png
          27 kB
        10. MDL-70063-test3-step15.png
          MDL-70063-test3-step15.png
          105 kB
        11. MDL-70063-test3-step16.png
          MDL-70063-test3-step16.png
          13 kB
        12. MDL-70063-test3-step3.png
          MDL-70063-test3-step3.png
          19 kB
        13. MDL-70063-test3-step8.png
          MDL-70063-test3-step8.png
          16 kB
        14. MDL-70063-test4-step10.png
          MDL-70063-test4-step10.png
          54 kB
        15. MDL-70063-test4-step15.png
          MDL-70063-test4-step15.png
          124 kB
        16. MDL-70063-test4-step16.png
          MDL-70063-test4-step16.png
          12 kB
        17. MDL-70063-test4-step3.png
          MDL-70063-test4-step3.png
          19 kB
        18. MDL-70063-test4-step8.png
          MDL-70063-test4-step8.png
          61 kB

            Geshoski Mihail Geshoski
            gonnatest Krystian Papski
            Carlos Escobedo Carlos Escobedo
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ilya Tregubov Ilya Tregubov
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 40 minutes
                2d 40m

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