Extension talk:Poll2

From MediaWiki.org
Jump to navigation Jump to search

Hi there, I'm trying to install this extension and it looks like the initial SQL tables aren't being setup. I'm not really a PHP guy but it looks to me (from looking at Poll.php) that the tables should be automatically created when I first fire up the special:poll page. What am I doing wrong?

Here's the error I get when trying to load the special page:

Database error
From my.domain.com wiki	 A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
(SQL query hidden)
from within function "Database::select". MySQL returned error "1146: Table 'mydbname.mw_poll' doesn't exist (localhost)".

thoughts?

Really need an installer for this.[edit]

The last comment is experiencing the same problem as me. Ive tracked down what the problem is and infact for most users its impossible to install this extension. The problem is that as well as putting the files into the extensions directory and adding the line to the localsettings.php, you also need to run the sql program poll.sql in the archives - which is impossible if you dont have a remote terminal with the server - for example rlogin rather than cpanel or ftp.

Im not sure how you go about executing an sql "file" using php (im sure its possible), but can I just extend the installation instructions which I have leached from the poll1 extension, to take account of the further problems about having to EDIT EACH AND EVERY SQL FILE in archives. This looks like an extension I want but it really needs some extra work - anyone good with php AND sql?

Installation[edit]

  • install the latest version from svn
cd /PATH_TO_MEDIAWIKI/extensions
svn export http://mediawiki.svn.sourceforge.net/svnroot/mediawiki/trunk/extensions/Poll/
  • edit each sql file in the poll/archives directory to reflect the proper database name you are using.
  • execute the file Poll.sql in order to create required tables (sorry no auto-install, fell free to add it yourself)
PATH_TO_MYSQL/mysql -h <host> -u <username> -D <database name> --password=<password> < <path to Poll.sql file>
  • add require_once("{$IP}/extensions/Poll/Poll.php"); to LocalSettings.php

By Hand[edit]

# mysql -h <host> -u <username> --password=<password> <database name> < <mediawiki install>/extensions/Poll/archives/Poll.sql
# mysql -h <host> -u <username> --password=<password> <database name> < <mediawiki install>/extensions/Poll/archives/patch-creater.sql
# mysql -h <host> -u <username> --password=<password> <database name> < <mediawiki install>/extensions/Poll/archives/patch-dis.sql
# mysql -h <host> -u <username> --password=<password> <database name> < <mediawiki install>/extensions/Poll/archives/patch-multi.sql
# mysql -h <host> -u <username> --password=<password> <database name> < <mediawiki install>/extensions/Poll/archives/Poll-answer.sql
# mysql -h <host> -u <username> --password=<password> <database name> < <mediawiki install>/extensions/Poll/archives/patch-user.sql
# mysql -h <host> -u <username> --password=<password> <database name> < <mediawiki install>/extensions/Poll/archives/patch-vote_other.sql

Poll-Admins can't change Polls[edit]

I use your extension, but today I tried to change a poll an user created and always got the: "Your not the creator and dont have the 'poll-admin' permission" error, even tough the wikis user grouprights stated I had this right. After some searching I found the bug in Poll_body.php in line 406 inside of the change() function:

Is:

if ( $wgUser->getName() != $creater ) { 

Should be:

if ( $wgUser->getName() != $creater ) && !$wgUser->isAllowed( 'poll-admin' ) { 

Where can I download?[edit]

It seems any poll extensions I try to download are missing from the extensions drop down. It keeps saying there is no "Poll"