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

PHP Notice when upgrading Youtube block

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.9.13, 3.10.10, 3.11.6, 4.0
    • 3.11.7
    • Blocks
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_311_STABLE
    • MDL-74434-311
    • MDL-74434-master
    • Hide
      1. You will need to obtain an API key (https://developers.google.com/youtube/v3/getting-started)
      2. Use a Moodle 3.8 instance without the patch applied.
      3. Login as admin.
      4. Go to Site administration > Plugins > Blocks > Manage blocks
      5. Enable and configure ("Settings" link) the Youtube block.
      6. In the configuration page, add the API key and save changes.
      7. Go to Site home, turn editing on and add the Tags block to the page via the 'Add a block' link.
      8. Go to the Admin's profile via the 'Profile' link in the user menu (top right)
      9. Click on 'Edit profile' in the 'User details' section.
      10. In the 'Interests' section add "cars" (you will need to press enter to add the tag) and save the changes.
      11. Go to Site home.
      12. Click on the "cars" tag in the Tags block.
      13. In the Tags page, turn editing on and add the Youtube block via the 'Add a block' link.
      14. Leave the default configuration settings for the Youtube block (make sure Category is set to 'Any category').
      15. Pull in the patch and run the upgrade.
        • confirm that the Youtube block was successfully updated and no error message were displayed during the upgrade
      Show
      You will need to obtain an API key ( https://developers.google.com/youtube/v3/getting-started ) Use a Moodle 3.8 instance without the patch applied. 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. Go to Site home. Click on the "cars" tag in the Tags block. In the Tags page, turn editing on and add the Youtube block via the ' Add a block ' link. Leave the default configuration settings for the Youtube block (make sure Category is set to 'Any category'). Pull in the patch and run the upgrade. confirm that the Youtube block was successfully updated and no error message were displayed during the upgrade
    • 1
    • QA time 2

    Description

      Discovered when upgrading moodle.org staging database to 4.0:

      -->block_tag_youtube
      !! The API key is missing in the Tag Youtube block configuration. Therefore, the youtube video
                      categories cannot be obtained and mapped with the legacy values used as category setting. All legacy
                      values used as category setting will still be updated and set by default to 'Any category'. !!
      PHP Notice:  Trying to get property 'category' of non-object in /opt/app/blocks/tag_youtube/db/upgrade.php on line 104
       
      Notice: Trying to get property 'category' of non-object in /opt/app/blocks/tag_youtube/db/upgrade.php on line 104
      PHP Notice:  Trying to get property 'category' of non-object in /opt/app/blocks/tag_youtube/db/upgrade.php on line 104
       
      ... (and so on continues)
      

      Attachments

        Issue Links

          Activity

            People

              Geshoski Mihail Geshoski
              mudrd8mz David Mudrák (@mudrd8mz)
              Sujith Haridasan Sujith Haridasan
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/May/22

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 51 minutes
                  3h 51m