Closed ptrsmk closed 2 years ago
Thanks for letting me know! I've been updating the code with type declarations for better readability, and for a better experience in Code editors. Will fix soon, I'm busy rewriting the whole script from scratch, in OOP style, turning the engine into a class with methods.
I believe I have succeeded in rewriting the code as a class. This should make it easier to navigate the code even from within the Github interface. The development
branch is now live at https://johnromanodorazio.com/LiturgicalCalendar-staging/ . Could you perhaps take a look and see if all seems well?
I have merged the recent activity from the development branch to the main branch, so this error no longer occurs. I am currently doing even more work to separate completely the API from the Frontend. I have also created an organization https://github.com/Liturgical-Calendar/ which will make it easier to keep any and all repositories having to do with the Liturgy or the Liturgical Calendar together, forming a kind of an ecosystem. I foresee a number of projects that can be built around the Liturgical Calendar API!
fixed in PR #47
Describe the bug When attempting to retrieve a calendar from the API using a national preset paramenter, an error is returned. Making the request without the national preset parameter does not return the error.
To Reproduce Enter in browser:
https://johnromanodorazio.com/LiturgicalCalendar/LitCalEngine.php?year=2021&returntype=JSON&nationalpreset=USA
Following Error is returned:Fatal error: Uncaught Error: Typed property Festivity::$liturgicalyear must not be accessed before initialization in /var/www/vhosts/johnromanodorazio.com/httpdocs/LiturgicalCalendar/Festivity.php:70 Stack trace: #0 [internal function]: Festivity->jsonSerialize() #1 /var/www/vhosts/johnromanodorazio.com/httpdocs/LiturgicalCalendar/LitCalEngine.php(2984): json_encode() #2 /var/www/vhosts/johnromanodorazio.com/httpdocs/LiturgicalCalendar/LitCalEngine.php(2951): GenerateResponseToRequest() #3 {main} thrown in /var/www/vhosts/johnromanodorazio.com/httpdocs/LiturgicalCalendar/Festivity.php on line 70
Expected behavior JSON calendar should be returned.
Screenshots
Desktop (please complete the following information):