We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44235
    • 6 Posts
    Quote from: fab at Sep 02, 2014, 01:16 PM
    Hi,

    I'm trying to use this addon, but I get this error code

    [2014-09-02 23:12:10] (ERROR @ /home/xxxxx/public_html/core/components/getyoutube/model/getyoutube/search.class.php : 41) PHP warning: Invalid argument supplied for foreach()

    what does it mean?

    Can you post your snippet call and the MODX version please
      Find us on Twitter, Google+, Facebook and GitHub

      Check out all our MODX Extras

      tasian.media
      • 9342
      • 50 Posts
      I'm using mods 2.3.1 and the snippet call is exactly as shown in the doc.

      [[!getYoutube? &mode=`channel` &channel=`UCBR8-60-B28hp2BmDPdntcQ` &tpl=`videoTpl` &toPlaceholder=`videos`]]
      [[+videos:notempty=`[[+videos]]`]]
        • 44235
        • 6 Posts
        I've just tested using MODX 2.3.1 and the same snippet call with no issues.

        Have you entered a valid API Key in the 'getyoutube.api_key' setting?
          Find us on Twitter, Google+, Facebook and GitHub

          Check out all our MODX Extras

          tasian.media
          • 9342
          • 50 Posts
          I did followed the instruction and choose browser when generating the API key, then entered in the setting.
            • 44235
            • 6 Posts
            Check the error log and see if you have an entry like the one below:
            [2014-09-02 15:04:51] (ERROR @ /index.php) getYoutube() - Channel API request not recognised
              Find us on Twitter, Google+, Facebook and GitHub

              Check out all our MODX Extras

              tasian.media
              • 9342
              • 50 Posts
              No, I don't get this error message. I got only one error message, the one above.

              Just wonder that is there anything to do with the server setting?
                • 34890
                • 10 Posts
                Quote from: tasianmedia at Sep 02, 2014, 02:07 PM
                Check the error log and see if you have an entry like the one below:
                [2014-09-02 15:04:51] (ERROR @ /index.php) getYoutube() - Channel API request not recognised

                hi. i have this problem. please help

                [2015-08-14 15:30:44] (ERROR @ /home/c/cx75511/public_html/core/components/getyoutube/model/getyoutube/search.class.php : 24) PHP warning: file_get_contents(https://www.googleapis.com/youtube/v3/search?part=id,snippet&channelId=UCc7Pxi_ksLztQffLknCaKwQ&type=video&safeSearch=none&maxResults=50&order=date&pageToken=&key=AIzaSyDcTUzKOI3FkUUJAHX2uX0TPiX1c7SDz5c) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
                
                [2015-08-14 15:30:44] (ERROR @ /index.php) getYoutube() - Channel API request not recognised
                [2015-08-14 15:30:44] (ERROR @ /home/c/cx75511/public_html/core/components/getyoutube/model/getyoutube/search.class.php : 41) PHP warning: Invalid argument supplied for foreach()
                


                my next error log with a modified channel and other google account:
                [2015-08-14 16:38:43] (ERROR @ /home/c/cx75511/public_html/core/components/getyoutube/model/getyoutube/search.class.php : 24) PHP warning: file_get_contents(https://www.googleapis.com/youtube/v3/search?part=id,snippet&channelId=UCc7Pxi_ksLztQffLknCaKwQ&type=video&safeSearch=none&maxResults=50&order=date&pageToken=&key=AIzaSyDcTUzKOI3FkUUJAHX2uX0TPiX1c7SDz5c) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
                
                [2015-08-14 16:38:43] (ERROR @ /index.php) getYoutube() - Channel API request not recognised
                [2015-08-14 16:38:43] (ERROR @ /home/c/cx75511/public_html/core/components/getyoutube/model/getyoutube/search.class.php : 41) PHP warning: Invalid argument supplied for foreach()
                [2015-08-14 16:38:47] (ERROR @ /assets/components/gallery/connector.php) Error caching lexicon topic lexicon/ru/gallery/default
                
                
                [ed. note: FRo_OG last edited this post 8 years, 8 months ago.]
                  • 34890
                  • 10 Posts
                  Quote from: tasianmedia at Sep 02, 2014, 02:07 PM
                  Check the error log and see if you have an entry like the one below:
                  [2014-09-02 15:04:51] (ERROR @ /index.php) getYoutube() - Channel API request not recognised

                  help me