1
kalamata
XoopsPoll Problem
  • 2006/6/28 18:01

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,

I am having the following problem when trying to edit a poll:

The edit form is coming up fine, but in the poll options I just get the name of the last option repeated (so, if my options are foo,bar and foobar I will get foobar three times).

I had a look at the code under xoopspoll//class/index.php and it seems that the code handling that is the following:

$options_arr =& XoopsPollOption::getAllByPollId($poll->getVar("poll_id"));
$notify_value = 1;
if ( $poll->getVar("mail_status") != 0 ) {
$notify_value = 0;
}
$notify_yn = new XoopsFormRadioYN(_AM_NOTIFY, "notify", $notify_value);
$poll_form->addElement($notify_yn);
$option_tray = new XoopsFormElementTray(_AM_POLLOPTIONS, "");
$barcolor_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/xoopspoll/images/colorbars/");
$i = 0;
foreach($options_arr as $option){
$option_text = new XoopsFormText("", "option_text[]", 50, 255, $option->getVar("option_text"));
$option_tray->addElement($option_text);
$option_id_hidden = new XoopsFormHidden("option_id[]", $option->getVar("option_id"));
$option_tray->addElement($option_id_hidden);

My undertanding of that code is that it should be adding a textbox with the name of the option every time it loops through the options array. However, it only remembers the name of the last option and I could not figure out why, even after looking at class/xoopsform/elementtray.php.

Can somebody please point out what the problem is?

Thanks,
George

2
nlstart
Re: XoopsPoll Problem
  • 2006/7/17 9:20

  • nlstart

  • Just popping in

  • Posts: 7

  • Since: 2006/7/3 9


I have noticed the same behaviour. In addition to this I would like to add that adding a poll and not editing it gives the results to the (anonymous) end user.
Apparantly the edit mode retrieves the options incorrect.

Seen with XOOPS 2.0.14 and Poll version 1.

Also, I saw an old thread with the same problem? :(
Repeat of last option when editing poll

Login

Who's Online

324 user(s) are online (234 user(s) are browsing Support Forums)


Members: 1


Guests: 323


Mamba,

more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits