News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Voter Visibility

Started by Ray Cardillo, May 02, 2012, 12:25:01 PM

Previous topic - Next topic

bsmither

Examining your database directly, look at the table details for the table 'polls'. The columns 'vote_visibility' and 'allow_comments' should have Allow NULL not checked and have a default value of '0'.

Then look at 'poll_choices'. The column 'requires_comment' should have Allow NULL not checked and have a default value of '0'.

If these columns are not already set this way, these incorrect settings may have existed from the first time this package was installed.

(phpMyAdmin may show NOT NULL instead of Allow NULL.)

bsmither

#121
Nope. This one. (I wish I could edit my previous post.)

bsmither

#122
I think I caught them all. (Hope?)

FrizzleFried

OK... used last change above...

...and I get this error when I attempt to install:

1. Adapt Database database_211.php File not found

EDIT: Wait... I just followed the txt file which didn't mention the database.211.php file that i noticed was sitting there so I just moved it over and included it int eh package...trying again.

:)

FrizzleFried

Yeah... I am doing something wrong or have done something wrong as I am getting a HTTP error 500 every time I attempt to install the mod.  It simply will not install.

FrizzleFried

I figure I just might not quite know enough about WTF I am doing to be of service.  If anyone else who knows more than I willing to step up and help this guy out... that would be fantastic!!

:)

bsmither

#126
Oh My! I thought I was being smart.

I did not remove the original array element:
'null' => 'false',
which then causes problems in smf_db_change_column().

So, again...


FrizzleFried

#127
Same situation.  I keep getting an error 500 when I attempt to install the package.
FWIW ... I just installed a fresh install of 2.1.1 and I am still getting that 500 error.


bsmither

If the PHP processor is tied to the web server, then the web server could be sending a 500 ISE because PHP crashed (as well as something the web server didn't like when going about doing it's job - which might be logged somewhere else).

Still, if the error is actually a PHP error, there should be an error logged somewhere.

If not SMF's admin, Maintenance, Logs, Error Log, then maybe PHP is logging errors in a file named 'error_log' in the root directory of this site.

bsmither

FrizzleFried got the adaptation installation straightened out, and reports that the Voter Visibility package is operating as remembered when having used it with SMF20.

bsmither

(If a moderator would please delete all of my prior file uploads.)

This one, I believe, will be the gold version to get the Voter Visibility package, originally for SMF2.0, to be adapted for SMF2.1.

(There *might* still be an issue when the package is uninstalled, but the databased data is retained, then an attempt is made to re-install, but I've tracked the code and can confidently place the blame on SMF code. There are some Github issues that discuss this.)

Kindred

this is one reason why we do not usually allow (and never encourage) mods to be uploaded as attachments.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Diego Andrés

Technically the user is only uploading the instructions, not the mod itself :P (for anyone not following the disc)

SMF Tricks - Free & Premium Responsive Themes for SMF.

Kindred

Quote from: Diego Andrés on March 29, 2022, 04:14:24 PMTechnically the user is only uploading the instructions, not the mod itself :P (for anyone not following the disc)

true... but the same issue applies (???)  attachments of multiple versions
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FrizzleFried

OK... following bsmithers instructions I have this mod up and running about 99%.  Everything seems to work as it is supposed to EXCEPT I am getting these errors (which seem to have no affect on the user side)...

https://www.NOFOLLOW.com/index.php?action=votelog;topic=35166
 /home/ahaforum/public_html/Sources/VoteLog.php (Line 65)  Backtrace information

Type of error: General
Error messageSelect
8: Trying to access array offset on value of type null

Backtrace info:

#0: smf_error_handler()
Called from /home/ahaforum/public_html/Sources/VoteLog.php on line 65
#1: VoteLog()
Called from /home/ahaforum/public_html/index.php on line 187

https://www.NOFOLLOW.com/index.php?action=votelog;topic=35166
 /home/ahaforum/public_html/Sources/VoteLog.php (Line 65)  Backtrace information

Type of error: Undefined
Error messageSelect
8: Undefined index: poll

Backtrace:

#0: smf_error_handler()
Called from /home/ahaforum/public_html/Sources/VoteLog.php on line 65
#1: VoteLog()
Called from /home/ahaforum/public_html/index.php on line 187

Seem related being both are generated at the same time.  Both also are related to viewing the Vote Log (part of the mod).   I BELIEVE they are related to permissions for viewing said vote log... as the error is NOT generated if I choose the option to make the vote log available to all.

bsmithers has done so much to get this mod working with 2.1.x ... and this is just a very tiny things that pops up semi-rarely on the log... but it would be nice to track down,  squash,  and be able to say "Follow these directions and you can get this mod running 100% on 2.1.1...)

FrizzleFried

Oh... here is the code in question...

// This is almost the same as the code in Display.php because you should not see voters if you cannot see the poll
60: // You're allowed to view the results if:
61: // 1. you're just a super-nice-guy, or
62: // 2. anyone can see them (hide_results == 0), or
63: // 3. you can see them after you voted (hide_results == 1), or
64: // 4. you've waited long enough for the poll to expire. (whether hide_results is 1 or 2.)
==>65: $context['allow_poll_view'] = allowedTo('moderate_board') || $pollinfo['hide_results'] == 0 || ($pollinfo['hide_results'] == 1 && $context['poll']['has_voted']) || $context['poll']['is_expired'];
66: $context['poll']['show_results'] = $context['allow_poll_view'] && (isset($_REQUEST['viewresults']) || isset($_REQUEST['viewResults']));
67: $context['poll']['question'] = $pollinfo['question'];
68: $context['poll']['is_locked'] = !empty($pollinfo['voting_locked']);
69: $context['poll']['vvis'] = $pollinfo['vote_visibility'];

Tyrsson

What's line 65 of that file? The error references an undefined index error. Which means there needs to be a slight change in the code. Most likely, if it works as expected, there just needs to be a check to make sure it's set.

The script is trying to access $someVar['poll'] with poll being the index. May just need a isset($someVar['poll']) but it's hard to say without seeing it.
PM at your own risk, some I answer, if they are interesting, some I ignore.

FrizzleFried

Quote from: Joey Smith™ on April 27, 2022, 11:59:29 AMWhat's line 65 of that file? The error references an undefined index error. Which means there needs to be a slight change in the code. Most likely, if it works as expected, there just needs to be a check to make sure it's set.

The script is trying to access $someVar['poll'] with poll being the index. May just need a isset($someVar['poll']) but it's hard to say without seeing it.

I posted the code above.  The specific line in question (65) reads:

==>65:      $context['allow_poll_view'] = allowedTo('moderate_board') || $pollinfo['hide_results'] == 0 || ($pollinfo['hide_results'] == 1 && $context['poll']['has_voted']) || $context['poll']['is_expired'];

Kindred

so, the problem would appear to be this...

$context['poll']['has_voted']) || $context['poll']['is_expired'];
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

FrizzleFried

I figured it was close to that.  As to how to FIX said problem... err...

I wonder what happens if I simply REMOVE that code (being I can't find what it's doing negative to the mod anyway to be honest... again,  I think it has something to do with whether or not to allow someone to see that page.)

Advertisement: