NAWAC Posted January 18, 2023 Posted January 18, 2023 (edited) We run statistics on poll data on our site. I am GETting the poll data on topics via an API call. I notice that the only poll sent back from the API is something similar to the following (as an example): [poll] => Array ( [id] => 255 [title] => Cast your vote [votes] => 8 [questions] => Array ( [0] => Array ( [question] => Cast your vote, either Yes or No. [options] => Array ( [Yes] => 5 [No] => 3 ) ) ) ) It would be nice if the other poll data was also sent back. Example, like the pole_closed field (from the core_polls table). It would be nice to know if the value of the pole_closed field is either set to "0" or "1". It would also be nice to even include the value of the poll_close_date. It could look something like: [poll] => Array ( [id] => 255 [closed] => 1 [close_date] => 2023-01-08 08:30:00 [title] => Cast your vote [votes] => 8 [questions] => Array ( [0] => Array ( [question] => Cast your vote, either Yes or No. [options] => Array ( [Yes] => 5 [No] => 3 ) ) ) ) Thanks. Edited January 18, 2023 by NAWAC
Stuart Silvester Posted January 19, 2023 Posted January 19, 2023 Yes, I think we should be able to do that. It feels like more of an oversight than a feature. NAWAC 1
Marc Posted March 10, 2023 Posted March 10, 2023 Just a quick update to let you know that was added in the recent 4.7.8 release of our platform. Please upgrade your site to resolve this issue. NAWAC 1
NAWAC Posted April 10, 2023 Author Posted April 10, 2023 (edited) On 3/10/2023 at 2:15 AM, Marc Stridgen said: Just a quick update to let you know that was added in the recent 4.7.8 release of our platform. Please upgrade your site to resolve this issue. I've noticed that when GETting the topic information via an API call, if the poll is closed (i.e. [closed] => 1) the poll data (topic) is not returned in the call (nothing is returned). Even if the poll is closed, the API call should still return poll data from topic. However, if the poll is still open (i.e., [closed] => ), the API call returns poll data back to the calling script just fine. Edited April 10, 2023 by NAWAC
Daniel F Posted April 14, 2023 Posted April 14, 2023 On 4/10/2023 at 6:41 PM, NAWAC said: I've noticed that when GETting the topic information via an API call, if the poll is closed (i.e. [closed] => 1) the poll data (topic) is not returned in the call (nothing is returned). Even if the poll is closed, the API call should still return poll data from topic. However, if the poll is still open (i.e., [closed] => ), the API call returns poll data back to the calling script just fine. Thanks, I have logged this in our bugtracker.
Andy Millne Posted June 6, 2023 Posted June 6, 2023 We're not actually able to reproduce this. Could you please provide more info on the specific API request you are making and the output you see? In testing, the poll data is always included whether the poll is closed or open. SeNioR- 1
Recommended Posts