News:

Wondering if this will always be free?  See why free is better.

Main Menu

Additional Polls

Started by Windy, January 06, 2009, 08:12:57 AM

Previous topic - Next topic

Windy

Quote from: nosferatu on January 11, 2009, 06:26:21 AM
I unistalled the mod and attempted to reinstall but now get the following:

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ID_POLL = 10' at line 3
File: /home/southwalesuk/public_html/forum/Packages/temp/code.php
Line: 59

This hasn't affected my forum as it hasn't installed. Any ideas?
I'd say that error might be due to the initial pre-existing polls issue that I fixed, where you've deleted a poll that existing before the mod was installed, but due to that the pre-existing poll issue, the poll wasn't properly removed from the database, therefore when the mod installs and tries to find that polls associated topic it won't find anything, causing that sql error.

I'll probably put the necessary code to delete those troublesome polls so that issue won't occur once we figure out what's causing this other issue.

QuoteEither that poll doesn't exist, the poll has been locked, or you tried to vote twice.
^^ As for those having that issue, I could really use some more information as I can't seem to replicate it.
the following would be quite useful
- version of the mod you're using
- whether the poll existed before you installed the mod
- using phpmyadmin or whatever other tool you've got access to view the databases tables and tell me what that poll has set for ID_TOPIC (you can get the poll id from one of the polls urls)
- giving me step by step actions of what you did and the changes reflected in the polls table in the database
- attach your poll.php so I can check for conflicts

the more information provided, the better I can debug the issue.
All unsolicited PM's will be ignored.  Any support requests should go in their topics.

My Mods


Image Zoom Tag
Image Quote Removal
Color Picker
Additional Polls
Simple Awards System

Mods are only updated to the latest same major version of smf on request.

LinK187

#21
Quote from: Windy on January 11, 2009, 09:56:15 AM
Quote from: nosferatu on January 11, 2009, 06:26:21 AM
I unistalled the mod and attempted to reinstall but now get the following:

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ID_POLL = 10' at line 3
File: /home/southwalesuk/public_html/forum/Packages/temp/code.php
Line: 59

This hasn't affected my forum as it hasn't installed. Any ideas?
I'd say that error might be due to the initial pre-existing polls issue that I fixed, where you've deleted a poll that existing before the mod was installed, but due to that the pre-existing poll issue, the poll wasn't properly removed from the database, therefore when the mod installs and tries to find that polls associated topic it won't find anything, causing that sql error.

I'll probably put the necessary code to delete those troublesome polls so that issue won't occur once we figure out what's causing this other issue.

QuoteEither that poll doesn't exist, the poll has been locked, or you tried to vote twice.
^^ As for those having that issue, I could really use some more information as I can't seem to replicate it.
the following would be quite useful
- version of the mod you're using
- whether the poll existed before you installed the mod
- using phpmyadmin or whatever other tool you've got access to view the databases tables and tell me what that poll has set for ID_TOPIC (you can get the poll id from one of the polls urls)
- giving me step by step actions of what you did and the changes reflected in the polls table in the database
- attach your poll.php so I can check for conflicts

the more information provided, the better I can debug the issue.

Ok:

SMF: 1.1.7
Your Mod: whatever was new 30 minutes ago

How to create the error:
-From a thread list when one clicks on "Post New Poll" it will take you to the post/poll creation page. After you post that poll is unvotable and produces the error: "Either that poll doesn't exist, the poll has been locked, or you tried to vote twice.". This only seems to effect polls created after the mod was installed.

However, if you are already viewing the thread and click "Add Poll", you can add as many polls as you want and they work great. However that thread starter poll is f00ked.

It's as if the creation of the poll is executed differently server side based on which you click.

However it is kinda of annoying that you have to create a thread first and then add the poll in order for it to work proper.

Edit: attached my poll.php

Windy

Ok, I've been able to recreate the issue, it appears to be isolated to polls that are created through the "Post New Poll", I guess these polls are created differently, shouldn't be too difficult to fix.
All unsolicited PM's will be ignored.  Any support requests should go in their topics.

My Mods


Image Zoom Tag
Image Quote Removal
Color Picker
Additional Polls
Simple Awards System

Mods are only updated to the latest same major version of smf on request.

LinK187

Quote from: Windy on January 12, 2009, 11:39:29 AM
Ok, I've been able to recreate the issue, it appears to be isolated to polls that are created through the "Post New Poll", I guess these polls are created differently, shouldn't be too difficult to fix.

Seeing as no fix has been posted yet, I'm assuming it's harder to fix than originally anticipated or the dev for this mod hasn't even seen my post yet.

As a short term fix, how would I disable the button "Post New Poll" ? That way I don't have to worry about users making botched polls until this mod is actually fixed.

Windy

Quote from: LinK187 on January 14, 2009, 11:36:05 AM
Quote from: Windy on January 12, 2009, 11:39:29 AM
Ok, I've been able to recreate the issue, it appears to be isolated to polls that are created through the "Post New Poll", I guess these polls are created differently, shouldn't be too difficult to fix.

Seeing as no fix has been posted yet, I'm assuming it's harder to fix than originally anticipated or the dev for this mod hasn't even seen my post yet.

As a short term fix, how would I disable the button "Post New Poll" ? That way I don't have to worry about users making botched polls until this mod is actually fixed.
I did see your post, you led me to believe that it was an issue when using that particular method to create a poll :)

Open Post-Subs.php
Code (Find) Select

// Fix the message with the topic.
db_query("
UPDATE {$db_prefix}messages
SET ID_TOPIC = $topicOptions[id]
WHERE ID_MSG = $msgOptions[id]
LIMIT 1", __FILE__, __LINE__);


Code (Add Before or After that (Doesn't really matter)) Select

// Fix the message with the topic.
db_query("
UPDATE {$db_prefix}polls
SET ID_TOPIC = $topicOptions[id]
WHERE ID_POLL = $topicOptions[poll]
LIMIT 1", __FILE__, __LINE__);


Placing and running the code.php file located in the package from your smf root directory will fix up any of those polls that got botched.

I don't have time atm to properly implement the fixes into the package.  So if you can't wait then go ahead and do that.  I'd probably recommend just uninstalling it for the time being until I am able to get round to it.
All unsolicited PM's will be ignored.  Any support requests should go in their topics.

My Mods


Image Zoom Tag
Image Quote Removal
Color Picker
Additional Polls
Simple Awards System

Mods are only updated to the latest same major version of smf on request.

LinK187

#25
<remove this post>

LinK187

#26
Quote from: Windy on January 15, 2009, 08:40:06 AM
Quote from: LinK187 on January 14, 2009, 11:36:05 AM
Quote from: Windy on January 12, 2009, 11:39:29 AM
Ok, I've been able to recreate the issue, it appears to be isolated to polls that are created through the "Post New Poll", I guess these polls are created differently, shouldn't be too difficult to fix.

Seeing as no fix has been posted yet, I'm assuming it's harder to fix than originally anticipated or the dev for this mod hasn't even seen my post yet.

As a short term fix, how would I disable the button "Post New Poll" ? That way I don't have to worry about users making botched polls until this mod is actually fixed.
I did see your post, you led me to believe that it was an issue when using that particular method to create a poll :)

Open Post-Subs.php
Code (Find) Select

// Fix the message with the topic.
db_query("
UPDATE {$db_prefix}messages
SET ID_TOPIC = $topicOptions[id]
WHERE ID_MSG = $msgOptions[id]
LIMIT 1", __FILE__, __LINE__);


Code (Add Before or After that (Doesn't really matter)) Select

// Fix the message with the topic.
db_query("
UPDATE {$db_prefix}polls
SET ID_TOPIC = $topicOptions[id]
WHERE ID_POLL = $topicOptions[poll]
LIMIT 1", __FILE__, __LINE__);


Placing and running the code.php file located in the package from your smf root directory will fix up any of those polls that got botched.

I don't have time atm to properly implement the fixes into the package.  So if you can't wait then go ahead and do that.  I'd probably recommend just uninstalling it for the time being until I am able to get round to it.

Ok this worked. However all threads started with a poll prior to this modification remain fu(ked, but all new threads started with a poll now work fine. Which is good enough.

btw it was Subs-Post.php and not Post-Subs.php which in fact, doesn't exist :P

Cheers

LinK187

#27
Quote from: LinK187 on January 15, 2009, 11:12:37 AM
Quote from: Windy on January 15, 2009, 08:40:06 AM
Quote from: LinK187 on January 14, 2009, 11:36:05 AM
Quote from: Windy on January 12, 2009, 11:39:29 AM
Ok, I've been able to recreate the issue, it appears to be isolated to polls that are created through the "Post New Poll", I guess these polls are created differently, shouldn't be too difficult to fix.

Seeing as no fix has been posted yet, I'm assuming it's harder to fix than originally anticipated or the dev for this mod hasn't even seen my post yet.

As a short term fix, how would I disable the button "Post New Poll" ? That way I don't have to worry about users making botched polls until this mod is actually fixed.
I did see your post, you led me to believe that it was an issue when using that particular method to create a poll :)

Open Post-Subs.php
Code (Find) Select

// Fix the message with the topic.
db_query("
UPDATE {$db_prefix}messages
SET ID_TOPIC = $topicOptions[id]
WHERE ID_MSG = $msgOptions[id]
LIMIT 1", __FILE__, __LINE__);


Code (Add Before or After that (Doesn't really matter)) Select

// Fix the message with the topic.
db_query("
UPDATE {$db_prefix}polls
SET ID_TOPIC = $topicOptions[id]
WHERE ID_POLL = $topicOptions[poll]
LIMIT 1", __FILE__, __LINE__);


Placing and running the code.php file located in the package from your smf root directory will fix up any of those polls that got botched.

I don't have time atm to properly implement the fixes into the package.  So if you can't wait then go ahead and do that.  I'd probably recommend just uninstalling it for the time being until I am able to get round to it.

Ok this worked. However all threads started with a poll prior to this modification remain fu(ked, but all new threads started with a poll now work fine. Which is good enough.

btw it was Subs-Post.php and not Post-Subs.php which in fact, doesn't exist :P

Cheers

Ok, new problem. This modification has produced this error:
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 4
File: /home/****/public_html/forumtest/Sources/Subs-Post.php
Line: 1579

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.7, while your database is at version 1.1.6. The above error might possibly go away if you execute the latest version of upgrade.php.

Line 1579 is the first line of the code you wanted me to add.

This error occurs when I tried to make a new thread. (regular post not poll).

I added the code before the "find" code. Would it make a diff if I moved it to after?

mgrmgr

Quote from: Windy link=topic=284435.msg1879399#msg1879399

Open Post-Subs.php
...

Placing and running the code.php file located in the package from your smf root directory will fix up any of those polls that got botched.

I don't have time atm to properly implement the fixes into the package.  So if you can't wait then go ahead and do that.  I'd probably recommend just uninstalling it for the time being until I am able to get round to it.

Thank you so much :D

It's running ok now.

You are the bestest :) :-*

LinK187

Quote from: mgrmgr on January 15, 2009, 11:43:29 AM
Quote from: Windy link=topic=284435.msg1879399#msg1879399

Open Post-Subs.php
...

Placing and running the code.php file located in the package from your smf root directory will fix up any of those polls that got botched.

I don't have time atm to properly implement the fixes into the package.  So if you can't wait then go ahead and do that.  I'd probably recommend just uninstalling it for the time being until I am able to get round to it.

Thank you so much :D

It's running ok now.

You are the bestest :) :-*

try to make a regular post, you will get a sql database error... you can reply to existing threads but making a new thread produces the error.

mgrmgr

oups - sorry! I forgot my own code change:


// Fix the poll with the topic.
if (!$topicOptions['poll'] === null)
    db_query("
UPDATE {$db_prefix}polls
SET ID_TOPIC = $topicOptions[id]
WHERE ID_POLL = $topicOptions[poll]
LIMIT 1", __FILE__, __LINE__);


Tested with create topic, reply to topic, create poll, reply to poll. Did I forget another test?

Once more: sorry

LinK187

Quote from: mgrmgr on January 15, 2009, 12:30:16 PM
oups - sorry! I forgot my own code change:


// Fix the poll with the topic.
if (!$topicOptions['poll'] === null)
   db_query("
UPDATE {$db_prefix}polls
SET ID_TOPIC = $topicOptions[id]
WHERE ID_POLL = $topicOptions[poll]
LIMIT 1", __FILE__, __LINE__);


Tested with create topic, reply to topic, create poll, reply to poll. Did I forget another test?

Once more: sorry

I'll test this when I get home, just on my way to work. So this code goes in the same place as specified above?

mgrmgr

lol - that Post-Subs.php against the real Subs-Post.php did puzzle me at first too :)

and yep - it does work at both places - I set it after the found code (without real reason :) ) and added the additional comment on top of the code :) (Commenting code: a real nightmare for a programmer. Reminds me of a part out of my "Real Programmers" collection:

Real programmers don't comment their code! What was hard to write ought to be hard to understand :)

LinK187

#33
Quote from: LinK187 on January 15, 2009, 12:36:22 PM
Quote from: mgrmgr on January 15, 2009, 12:30:16 PM
oups - sorry! I forgot my own code change:


// Fix the poll with the topic.
if (!$topicOptions['poll'] === null)
    db_query("
UPDATE {$db_prefix}polls
SET ID_TOPIC = $topicOptions[id]
WHERE ID_POLL = $topicOptions[poll]
LIMIT 1", __FILE__, __LINE__);


Tested with create topic, reply to topic, create poll, reply to poll. Did I forget another test?

Once more: sorry

I'll test this when I get home, just on my way to work. So this code goes in the same place as specified above?

this code brings back the original problem of the "post new poll" butting fu(king up the thread starter poll. additional polls added to the thread work fine. Except additional polls are added on top of the original instead of the bottom, which really makes no diff in functionality. However, it does fix the posting of a regular new thread.

I'm rolling back again while I wait for a proper fix.

KahneFan

Gotta ask: Any thoughts on making this 2.0b4 compatible?
#eric_on_twit| (video) Creating Themes for SMF | Reset Your Forum
NOTE: No PM's for support please.

Windy

Ok, new version fixing that particular issue, as well as a few others has released as version 1.0.2.

Quote from: KahneFan on January 16, 2009, 12:18:12 PM
Gotta ask: Any thoughts on making this 2.0b4 compatible?
A this particular time, no, as it would essentially require a complete rewrite.  As there maybe more issues or the possibility for more features to be discovered here, I feel that for the time being I could only really support one version of this mod at this time.
All unsolicited PM's will be ignored.  Any support requests should go in their topics.

My Mods


Image Zoom Tag
Image Quote Removal
Color Picker
Additional Polls
Simple Awards System

Mods are only updated to the latest same major version of smf on request.

LinK187

Quote from: Windy on January 16, 2009, 10:38:09 PM
Ok, new version fixing that particular issue, as well as a few others has released as version 1.0.2.

Quote from: KahneFan on January 16, 2009, 12:18:12 PM
Gotta ask: Any thoughts on making this 2.0b4 compatible?
A this particular time, no, as it would essentially require a complete rewrite.  As there maybe more issues or the possibility for more features to be discovered here, I feel that for the time being I could only really support one version of this mod at this time.

PROPA BO I TELL THEE WHAT!

it fu(kin works without a hitch! cheers! :)

nosferatu

Windy, this appears to work fine now. Thanks very much for your hard work and perseverance. Much appreciated.  O:)
There's a certain joy in being mad that only madmen know

Bancherd

Thanks for the update.  Working great!

!Hachi!

i installed both mod this and who voted what.but i can't see user names who voted in poll.in table view its missing and in select box no name just ----- this option.but when i install only who voted what it shows fine.
tried on 1.1.7 with no other mod.any thoughts/
Happy Ramadan

Advertisement: