Posted: November 23, 2019 at 1:57 pm
I don’t have complete repro of this, but I wanted to bring it to your attention to see if this was a known issue. The Event API seems to ignore some preference/settings when creating events via the API. Specifically, we have seen wp_user_integration_settings auto_create_user set to 1 when the default in the system was 0. And, events created through the API seem to get RPP by default rather than the chosen system default RAP. Please let me know if we have discovered a bug or if we should be setting these values explicitly and not relying on event defaults set in the WP UI to affect API calls. Thanks! |
|
Hi, The API doesn’t use any setting values set within the site, so you will need to set those option values in the API requests. |
|
Ok. Thanks for the clarifications. “The API will not use the defaults configured in the Admin area – it will apply the global Database default values when a parameter is not sent.” Cheers! |
|
Hi, The API doesn’t apply the global database default values either. You need to specify the options in the request. |
|
What values get stored to the db tables when they are not passed via the API then? I’m thinking maybe it was a bug in the API then because my db rows were all switched to RPP when I had definitely set most or all to RAP already modifying them in the Admin UI. Is it possible that the Event API would set all values of existing rows to RPP when it is not passed a value? I don’t know how every db row could get set to RPP otherwise. Thanks! let me know. |
|
The API will not set the values, but the database models could fill those in if needed. In any case, if you need an option value set and you’re using the API to write to the database, you need to specify the option value in your write request. |
|
Thanks Josh! So, I’m still wondering how all the rows got set to RPP after I used the Event API. I think there’s a bug in there somewhere. Did: Wrote events to Events API without specifying some values of Event meta. Something like this might be involved: |
|
If you want a default reg. status for the event to be something other than RPP, you need to specify that. Are you expecting the default reg status to not be set if you don’t set it? |
|
Hi Josh, No, I understand that there may be defaults that are set when data values are not passed to the API – this is expected behavior. What I am suspecting is that something in the API code is causing a kind of update all SQL query to be run on the event metas that causes all default registrations statuses for every event to be set to RPP. This is what happened at some point to my event metas db. It was very surprising to see this. I think it would be easy to repro… I just can’t do it right now because I would have to set up a system that could be borked on purpose :-). So, I am submitting it as a possible major bug for your consideration and pondering. Thanks! |
|
Feel free to open an issue on GitHub and please include the specific steps to replicate the issue. |
|
The support post ‘Possible Bug in Event API’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.