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

🐛 Anime::getBroadcastAttribute() function causes an error when adapting the "broadcast" attribute value #542

Closed
1 task done
nicodg73 opened this issue Jun 18, 2024 · 1 comment · Fixed by #543
Closed
1 task done
Labels

Comments

@nicodg73
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The API has returned an error:
TypeError
Status code: 0
Message: App\Anime::adaptBroadcastValue(): Argument #1 ($broadcast) must be of type array|string|null, MongoDB\Model\BSONDocument given, called in /app/app/Anime.php on line 120
Trace: /app/app/Anime.php on line 410

Expected Behavior

The API should have returned a successful response with data.

Steps To Reproduce

Http Request: `GET /v4/random/anime

Environment

- OS: Debian 12
- Browser: Chrome 126
- Docker: 26.1.4

Anything else?

My api is in a docker container and got data (i executed the indexer and anime fetching was done).

Get random manga works
Get random characters return the same one

@pushrbx
Copy link
Collaborator

pushrbx commented Jun 18, 2024

We recently made a change to Jikan lib which changed the type of the broadcast attribute. However in the db we still have instances where the old version exists, so this fails.
/app/app/Anime.php on line 120 <-- around this line we need a type check whether the value for the broadcast attribute from the db is the old or the new one. Or we don't need the call to the adaptBroadcastValue function. 🤔

@pushrbx pushrbx changed the title 🐛 [HOSTED-RR] Generated Issue: TypeError 🐛 Anime::getBroadcastAttribute() function causes an error when adapting the "broadcast" attribute value Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants