genxbe / kirby3-instagram

Fetch instagram photos without the need for app aproval
MIT License
48 stars 1 forks source link

Undefined constant "X\DS" #10

Open MaluNoPeleke opened 7 months ago

MaluNoPeleke commented 7 months ago

After upgrading to Kirby 4 I have a problem with the Kirby3-Instagram Plugin by @genxbe:

Error: Undefined constant "X\DS" in /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/classes/Instagram.php:17
Stack trace:
#0 /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/fetch.php(27): X\Instagram->__construct()
#1 {main}
Error: Undefined constant "X\DS" in file /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/classes/Instagram.php on line 17
Stack trace:
  1. Error->() /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/classes/Instagram.php:17
  2. X\Instagram->__construct() /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/fetch.php:27

image

How to solve it?

MaluNoPeleke commented 7 months ago

Fix: https://github.com/genxbe/kirby3-instagram/pull/11 Thanks to @textnixe

MaluNoPeleke commented 7 months ago

Follow up error

Whoops\Exception\ErrorException: Undefined array key "media" in /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/classes/Instagram.php:149 Stack trace:

0 /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/classes/Instagram.php(149): Whoops\Run->handleError(2, 'Undefined array...', '/var/www/virtua...', 149)

1 /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/fetch.php(27): X\Instagram->fetch()

2 {main}

Whoops\Exception\ErrorException: Undefined array key "media" in file /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/classes/Instagram.php on line 149 Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/classes/Instagram.php:149
  2. Whoops\Run->handleError() /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/classes/Instagram.php:149
  3. X\Instagram->fetch() /var/www/virtual/peleke7/peleke.de/site/plugins/kirby3-instagram/fetch.php:27
andykamezou commented 7 months ago

Fix: #11 Thanks to @textnixe

Your fix works. But you need to check line 140 & 153. I guess you tried to replace all "DS", so "fields" become "fielDIRECTORY_SEPARATOR" which might cause the follow-up error that you get.

MaluNoPeleke commented 7 months ago

Thanks, I fixed that in the last commit.