Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instagram\Model\Media::toArray() specifies wrong property name #369

Open
petertornstrand opened this issue Jan 10, 2024 · 1 comment
Open
Assignees
Labels
need-investigations Need investigations to classify

Comments

@petertornstrand
Copy link

petertornstrand commented Jan 10, 2024

Version(s) affected: 7.0

Description

Instagram\Model\Media::toArray() specifies wrong property name:

'shortcode' => $this->shortCode

This produces an error:

Deprecated function: Creation of dynamic property Instagram\Model\Media::$shortcode is deprecated

How to reproduce

Serialize/unserialize an Media object.

Possible Solution

Fix key name in returned array.

'shortCode' => $this->shortCode

@petertornstrand petertornstrand added the need-investigations Need investigations to classify label Jan 10, 2024
@blackcatxhan
Copy link

Version(s) affected: 7.0.0

I think same issue when I using Media sample from here https://github.com/pgrimaud/instagram-user-feed/blob/master/examples/media-detailed.php

Warning: Undefined property: stdClass::$items in Instagram/vendor/pgrimaud/instagram-user-feed/src/Instagram/Transport/JsonMediaDetailedDataFeed.php on line 23 Fatal error: Uncaught TypeError: current(): Argument #1 ($array) must be of type array, null given in Instagram/vendor/pgrimaud/instagram-user-feed/src/Instagram/Transport/JsonMediaDetailedDataFeed.php:23 Stack trace: #0 Instagram/vendor/pgrimaud/instagram-user-feed/src/Instagram/Transport/JsonMediaDetailedDataFeed.php(23): current(NULL) #1 Instagram/vendor/pgrimaud/instagram-user-feed/src/Instagram/Api.php(407): Instagram\Transport\JsonMediaDetailedDataFeed->fetchData(Object(Instagram\Model\Media)) #2 Instagram/media-download.php(24): Instagram\Api->getMediaDetailed(Object(Instagram\Model\Media)) #3 {main} thrown in Instagram/vendor/pgrimaud/instagram-user-feed/src/Instagram/Transport/JsonMediaDetailedDataFeed.php on line 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-investigations Need investigations to classify
Projects
None yet
Development

No branches or pull requests

3 participants