Date Formatting Bug in Anime with Only a Year
Found this in the server error logs:
PHP Fatal error: Call to a member function format() on a non-object in ***/src/Atarashii/APIBundle/Parser/AnimeParser.php on line 131
That's the start date parser.
Looking at the access logs, I'm not seeing any anime detail requests around that time, but I do see a search for "no no pessimist". Since that returns a single result (anime #23029), the standard anime parser would be run. That show only has a year listed, so it looks like that's tripping up the parser.
Comments (11)
-
-
Can you put me in charge of this issue? I found a few other exceptions & I got the feeling that you're busy.
-
reporter You can take it over if you want.
-
-
assigned issue to
-
assigned issue to
-
I took it over ;) I will take care of this tomorrow.
-
- changed status to resolved
Fixed in commit 58c964e.
-
reporter - changed status to open
Not fully fixed. Dates with only a year now return the current month and day. I'm not sure if we want to do this.
-
reporter The old Ruby API just returns the year. Maybe we should do so as well.
Actually, ISO 8601 allows for just a year, so it would be valid for the future as well. We'd just need to make sure that returning a reduced date will work properly in our reference application (Atarashii).
-
The same problem exists with the result that only return the month. The formatter is also returning the day.
I'm not sure how Atarashii is formatting the dates. If we change it into a year the formatter will probably crash.
I can create a simpleformatter that is using the switch method depending on the date length for Atarashii. We could release then the beta 2 an push a few days later the fix to the server.
Note: I think atarashii isn't using the dates...I will test it later.
-
reporter I don't think the dates are used for the anime. Manga doesn't currently provide dates, although it would be nice to do so once the API starts changing.
-
- changed status to resolved
Change year format output into 'Y' for compatibility sake.
This commit will change the "D M d 00:00:00 O Y" for the year into "Y" (Fixes
#32).→ <<cset da3b1be1d57c>>
- Log in to comment
d-sko send me an anime with only a year and no "to" and and date. link: http://myanimelist.net/anime/23063
this is one of the very rare cases...