instagram icon indicating copy to clipboard operation
instagram copied to clipboard

Undefined variable in PrepareFeed.php

Open schokomeldra opened this issue 2 years ago • 6 comments

Since today it is so that after the scheduler task has started, an error message comes and I receive an e-mail with the following error message: Message: PHP Warning: Undefined array key "thumbnail_url" in /home/webserver/typo3v11.martini-klinik.de/www/docs/typo3conf/ext/instagram/Classes/Domain/Service/PrepareFeed.php line 69 (1476107295)

Latest version and we haven't changed anything for weeks. It ran completely problem free so far.

schokomeldra avatar Aug 25 '23 15:08 schokomeldra

Hi, the feed include items without media url. The extension can't handle this.

[2]=> array(7) { ["caption"]=> string(289) "**************" ["media_type"]=> string(14) "CAROUSEL_ALBUM" ["permalink"]=> string(40) "*****************************" ["timestamp"]=> string(24) "2023-08-23T12:51:23+0000" ["username"]=> string(11) "**************" ["children"]=> array(1) { ["data"]=> array(7) { [0]=> array(1) { ["id"]=> string(17) "17970182639372027" } [1]=> array(1) { ["id"]=> string(17) "17893420808857988" } [2]=> array(1) { ["id"]=> string(17) "17993395694138322" } [3]=> array(1) { ["id"]=> string(17) "18006874648788584" } [4]=> array(1) { ["id"]=> string(17) "18029343532590281" } [5]=> array(1) { ["id"]=> string(17) "17950661387663875" } [6]=> array(1) { ["id"]=> string(17) "18057949537448587" } } } ["id"]=> string(17) "18012544600692981" }

Please update PrepareFeed to handle items without media URL

kiwivision avatar Aug 31 '23 08:08 kiwivision

Is the same issue like #34 #24 and the solution is already in the pull requests

https://github.com/in2code-de/instagram/pull/26

kiwivision avatar Aug 31 '23 08:08 kiwivision

Same here.

Here's the failing post: https://www.instagram.com/p/CxxD0LRtKvi

      {
         "id": "17936169296635732",
         "caption": "Spannender Morgen am Aareufer mit der 3. und 4. Klasse! \ud83c\udf0a Dank den Biberexperten von \u0040pro_natura_de tauchten die Sch\u00fcler*innen in die Welt des gr\u00f6ssten Nagetiers der Schweiz ein. Wissen trifft Spass \u2013 ein unvergesslicher Tag! \ud83c\udf3f #nmsbern #bildungimzentrum #BiberWissen #pronatura #AareAbenteuer",
         "media_type": "CAROUSEL_ALBUM",
         "permalink": "https://www.instagram.com/p/Cxe1AlTtbzj/",
         "timestamp": "2023-09-22T05:04:12+0000"
      },

sturmundbraem avatar Oct 15 '23 16:10 sturmundbraem

@kiwivision Are you using the fork or how do you work around the issue?

sturmundbraem avatar Oct 15 '23 16:10 sturmundbraem

We use the current master and add the bugfix from #26 from MattiasNilsson manualy

kiwivision avatar Oct 16 '23 06:10 kiwivision

Thanks! We've done it like this:

  • required https://github.com/cweagans/composer-patches
  • Added the patch for the bugfix to packages in the repo at packages/instagram/Resources/Private/Patches/in2code-de-instagram-pull-26.patch
  • Added the following to composer.json
	"extra": {
	        [....]
		"patches": {
			"in2code/instagram": {
				"instagram-carousel-fix": "packages/instagram/Resources/Private/Patches/in2code-de-instagram-pull-26.patch"
			}
		}
	},

Does the trick!

sturmundbraem avatar Oct 17 '23 09:10 sturmundbraem