Home › Forums › Ticket Products › Event Tickets Plus › tribe_events_count_available_tickets()
- This topic has 5 replies, 3 voices, and was last updated 9 years ago by
Lou Anne.
-
AuthorPosts
-
May 12, 2017 at 7:01 am #1282936
Lou Anne
ParticipantJust wanted to point out that the stock() class method returns an empty string if no value is set, so starting in PHP7 it throws a warning here:
foreach ( Tribe__Tickets__Tickets::get_all_event_tickets( $event->ID ) as $ticket ) { $count += $ticket->stock(); }I know it’s coercing an integer value, but maybe we should be explicitly converting? Not sure if that would be an issue in the future.
May 12, 2017 at 8:29 am #1282986Nico
MemberThanks for the report Lou Anne!
While I’m not a versed developer I cannot grasp the solution, but the report sounds legit and something we can ‘fix’. Let me share this with a developer and get back to you!
Best,
NicoMay 12, 2017 at 1:34 pm #1283262Nico
MemberHey Lou Anne,
I’ve reached out and discussed this with one of our devs. Apparently the fix is not so straightforward as it seems. In some cases (ie: unlimited stock) stock function can return an empty string, and we should account for that and document the output of such functions to reflect this. Long story short, I just logged a bug ticket to get this fixed, and QA’d properly.
If you would like to contribute with a fix for this, you can do it in Event Tickets GitHub repo: https://github.com/moderntribe/event-tickets (more info: Modern Tribe Products Engineering)
Please let me know if there’s anything else I can do for you,
Best,
NicoSeptember 21, 2017 at 11:26 am #1352907Victor
MemberHi Lou Anne!
Just wanted to share with you that a new maintenance release (for the Week of 18 September 2017) is out, including a fix for this issue 🙂
Find out more about this release → https://theeventscalendar.com/maintenance-release-week-18-september-2017/
Please update the plugins and let us know if the fix works for your site.
Best,
VictorOctober 13, 2017 at 9:35 am #1363306Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘tribe_events_count_available_tickets()’ is closed to new replies.
