https://www.icyphoenix.com/viewtopic.php?f=35&t=9028
-----------------------------------
spirit22
Fri 03 May, 2013 16:46

Double Options Of Polls With The New Update
-----------------------------------
With the new update I have doubled all survey options.

Anyone know why? How i can correct it? Thanks.


 [img]http://www.icyphoenix.com/files/images/11000/doublepolls.jpg[/img]


-----------------------------------
Limun
Fri 03 May, 2013 20:10

Re: Double Options Of Polls With The New Update
-----------------------------------
can you please check [i]ip_poll_options[/i] table


-----------------------------------
spirit22
Fri 03 May, 2013 23:16

Re: Double Options Of Polls With The New Update
-----------------------------------
Hi Limun, I searched this table everywhere and can't find it. Where is it?


-----------------------------------
Limun
Sat 04 May, 2013 06:23

Re: Double Options Of Polls With The New Update
-----------------------------------
try search
ip_3poll_options


-----------------------------------
Mighty Gorgon
Sat 04 May, 2013 13:18

Re: Double Options Of Polls With The New Update
-----------------------------------
Maybe you didn't update properly... it could be tricky to fix this.

How many old polls do you have?

If you create a new poll, does it work properly?


-----------------------------------
spirit22
Mon 06 May, 2013 00:39

Re: Double Options Of Polls With The New Update
-----------------------------------
Hi guys.


Here is the ip_3poll_options

IMAGE DELETED



I have about 30 or 40 old polls.

When I create new works perfectly, The fail It's only with the old polls.


-----------------------------------
Joshua203
Mon 06 May, 2013 02:49

Re: Double Options Of Polls With The New Update
-----------------------------------
I guess you simply have not done the DB checks (like I said in another thread)... acp >> Database Maintenance.

Otherwise, have you tried edttng manually, one by one? (probably mg's next response :oops: )

Also.. yes MG, it was a messy install withmany repair tries.


-----------------------------------
Mighty Gorgon
Mon 06 May, 2013 22:56

Re: Double Options Of Polls With The New Update
-----------------------------------
It is very tough to fix now honestly... I think best solution is to remove old options manually.

The code to fix Polls is as follow, but it works only on old DB, it would mess up everything on IP 2.0.

[codeblock]##### POLL CONVERSION - BEGIN
# Table: 'phpbb_poll_options'
CREATE TABLE `phpbb_poll_options` (
	poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
	topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
	poll_option_text text NOT NULL,
	poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
	KEY poll_opt_id (poll_option_id),
	KEY topic_id (topic_id)
);

# Table: 'phpbb_poll_votes'
CREATE TABLE `phpbb_poll_votes` (
	topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
	poll_option_id tinyint(4) DEFAULT '0' NOT NULL,
	vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
	vote_user_ip varchar(40) DEFAULT '' NOT NULL,
	KEY topic_id (topic_id),
	KEY vote_user_id (vote_user_id),
	KEY vote_user_ip (vote_user_ip)
);

##ADD
ALTER TABLE `phpbb_topics` ADD `poll_title` varchar(255) DEFAULT '' NOT NULL AFTER `topic_type`;
ALTER TABLE `phpbb_topics` ADD `poll_start` int(11) UNSIGNED DEFAULT '0' NOT NULL AFTER `poll_title`;
ALTER TABLE `phpbb_topics` ADD `poll_length` int(11) UNSIGNED DEFAULT '0' NOT NULL AFTER `poll_start`;
ALTER TABLE `phpbb_topics` ADD `poll_max_options` tinyint(4) DEFAULT '1' NOT NULL AFTER `poll_length`;
ALTER TABLE `phpbb_topics` ADD `poll_last_vote` int(11) UNSIGNED DEFAULT '0' NOT NULL AFTER `poll_max_options`;
ALTER TABLE `phpbb_topics` ADD `poll_vote_change` tinyint(1) UNSIGNED DEFAULT '0' NOT NULL AFTER `poll_last_vote`;

UPDATE phpbb_topics t, phpbb_vote_desc vd
SET t.poll_title = vd.vote_text, t.poll_start = vd.vote_start, t.poll_length = vd.vote_length, t.poll_max_options = 1, t.poll_vote_change = 0
WHERE t.topic_vote = 1
AND vd.topic_id = t.topic_id;

INSERT INTO `phpbb_poll_options`
SELECT vr.vote_option_id, vd.topic_id, vr.vote_option_text, vr.vote_result
FROM `phpbb_vote_desc` vd, `phpbb_vote_results` vr
WHERE vr.vote_id = vd.vote_id
ORDER BY vd.topic_id ASC, vd.vote_id ASC, vr.vote_option_id ASC;

INSERT INTO `phpbb_poll_votes`
SELECT vd.topic_id, vv.vote_cast, vv.vote_user_id, vv.vote_user_ip
FROM `phpbb_vote_desc` vd, `phpbb_vote_voters` vv
WHERE vd.vote_id = vv.vote_id
ORDER BY vd.topic_id ASC, vv.vote_user_id ASC;

##REMOVE
ALTER TABLE `phpbb_topics` DROP `topic_vote`;
DROP TABLE `phpbb_vote_desc`;
DROP TABLE `phpbb_vote_results`;
DROP TABLE `phpbb_vote_voters`;
##### POLL CONVERSION - END[/codeblock]


-----------------------------------
spirit22
Tue 07 May, 2013 19:17

Re: Double Options Of Polls With The New Update
-----------------------------------
Ok, no problem. I will remove the old options and put them back. Thanks guys.


-----------------------------------
Joshua203
Tue 07 May, 2013 22:04

Re: Double Options Of Polls With The New Update
-----------------------------------
Just remove the doubles, nothing to put back :wink:


