Jump to content

NAWAC

Clients
  • Posts

    43
  • Joined

  • Last visited

Recent Profile Visitors

390 profile views

NAWAC's Achievements

  1. Is it possible to create a group using the API Rest tools? I see no documentation for group creation, only functions for group deletion and getting group information.
  2. 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.
  3. I just confirmed and this is indeed the case. I reconfigured the string, using phpMyAdmin, in the core_polls table to the following for this poll: {"1":{"question":"Choose ","multi":0,"choice":{"1":"Yes","2":"No"},"votes":{"1":0,"2":1}}} And it worked successfully and tallied the votes correctly. However, when the core_polls table field is set to this... {"1":{"question":"Please place your vote.","multi":0,"choice":["Yes","No"],"votes":[0,1]}} it does not work! So, @Stuart Silvester's example, no longer works as of about February 2023. When creating a poll via API, you cannot put this below (note the 'answers' array keys)... /* poll variables below */ ,'poll_title' => 'Cast your vote' // poll_options: Array of objects with keys 'title' (string), 'answers' (array of objects with key 'value' set to the choice) and 'multichoice' (bool) ,'poll_options[1][title]' => urlencode('Make your choice, either Yes or No:') ,'poll_options[1][answers][0][value]' => 'Yes' ,'poll_options[1][answers][1][value]' => 'No' ,'poll_options[1][multichoice]' => '0' ,'poll_public' => '0' // bool Make the poll public ,'poll_only' => '0' // bool Make this a poll-only topic You must put this below (again, note the 'answers' array keys)... /* poll variables below */ ,'poll_title' => 'Cast your vote' // poll_options: Array of objects with keys 'title' (string), 'answers' (array of objects with key 'value' set to the choice) and 'multichoice' (bool) ,'poll_options[1][title]' => urlencode('Make your choice, either Yes or No:') ,'poll_options[1][answers][1][value]' => 'Yes' ,'poll_options[1][answers][2][value]' => 'No' ,'poll_options[1][multichoice]' => '0' ,'poll_public' => '0' // bool Make the poll public ,'poll_only' => '0' // bool Make this a poll-only topic This appears to be a bug with the code as it worked before, and now it doesn't unless it is configured as I've shown. You cannot have the array key starting with poll_options[1][answers][0][value] because the '0' is submitted to the system and it doesn't know how to handle or count the the '0' as a legitimate value or response when someone votes.
  4. I don't know why, but your string inside the database is different than mine. And your choices are not the same as mine. Note, you have 1 for Yes, and 2 for No. {"1":{"question":"Choose ","multi":0,"choice":{"1":"Yes","2":"No"},"votes":{"1":2,"2":1}}} Mine is a simple Yes, No. It was configured this way due to a post submitted, here. Where @Stuart Silvester explains how to create Yes/No polls using API. And in his post he states, /* poll variables below */ ,'poll_title' => 'Cast your vote' // poll_options: Array of objects with keys 'title' (string), 'answers' (array of objects with key 'value' set to the choice) and 'multichoice' (bool) ,'poll_options[1][title]' => urlencode('Make your choice, either Yes or No:') ,'poll_options[1][answers][0][value]' => 'Yes' ,'poll_options[1][answers][1][value]' => 'No' ,'poll_options[1][multichoice]' => '0' ,'poll_public' => '0' // bool Make the poll public ,'poll_only' => '0' // bool Make this a poll-only topic Note the answers are configured with the answer array starting with 0 for Yes, and 1 for the No answer. 'poll_options[1][answers][0][value]' => 'Yes' 'poll_options[1][answers][1][value]' => 'No' Is it possible that if someone votes Yes (which is sent as a "0" to the system to process), the system doesn't know what to do with the "0"? Should the poll be set up like this in order to count the vote? 'poll_options[1][answers][1][value]' => 'Yes' 'poll_options[1][answers][2][value]' => 'No'
  5. I've disabled all plugins and 3rd party customizations during the testing and it still happens. I can create a separate Admin account for them giving them access to the points of interest...I've done it before.
  6. So, I really don't know what to do from here. This is no longer random, but every instance on a simple Yes/No poll, the Yes votes are no longer getting tallied. I'm a paying customer but I don't know why I can't get support from the developer of this software. I'm a little frustrated at this point. I've done everything told I should do, yet the bug exists.
  7. After further research, I noticed that it seems like "Yes" votes are not getting recorded or tallied, but "No" votes are. In the database "Yes" votes are recorded as "0" and "No" votes are recorded as "1", simply because the "Yes" is the first choice and "No" is the second choice. It seems these "0" aren't getting counted and added properly in the database. Please refer back to my original post in this thread... {"1":{"question":"Please place your vote.","multi":0,"choice":["Yes","No"],"votes":[0,1]}}
  8. Update: The first time I saw this occur was February 26, 2023, not March 15.
  9. The first time I found this happening was March 15, 2023. Was there an update near this date that could have caused it? I looked in the Admin logs and I found I did a Community Update on March 08, 2023.
  10. I disabled all the third party apps on our site and tried it, and still didn't work correctly.
  11. Sorry, the above should have said, "However, over the last month we've had two separate polls that have not work correctly."
  12. We use a lot of polls, with a simply Yes or No vote. Most of the time, they work perfectly. However, over the last month we've had two separate polls. When a person places their vote, it shows to that person that their vote has been cast, but it does not tally it in the results. Using phpMyAdmin, and after researching inside the core_polls database table, I see the following: choices field {"1":{"question":"Please place your vote.","multi":0,"choice":["Yes","No"],"votes":[0,1]}} votes field: 5 As you can see, these do not equate in terms of number of votes. There should be a sum total of 5 votes in the choices field. In other words, it should look something like the following in order for the tally to be be shown correctly in the poll on the forum. {"1":{"question":"Please place your vote.","multi":0,"choice":["Yes","No"],"votes":[4,1]}} This has happened twice now, but it is random. Most polls work, but now, two have not, and have had this problem occur in both instances. Seems like it could be a bug. Please help. Thank you.
  13. Turn off Enhanced accuracy setting by going to: Samsung Keboard>More Typing Options>Enhanced accuracy (labs) It worked for me.
  14. 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.
×
×
  • Create New...