Vote/Polling issues working after 1.5.9 update

adegutis

Joined: 2004-09-10
Posts: 34
Posted: Mon, 2008-10-06 20:32

Gallery version: 1.5.9

Updated to v1.5.9 and discovered that you can only vote if you open the individual image and click the vote radio button while there. If you go back to the gallery and try to vote at the radio button on the thumbnail and then click the vote square button, the choice is erased. In other words, the thumbnail buttons and/or square "vote" buttons on the thumbnail page are not working.

Is this by design or a bug?
Thanks
Ak

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Tue, 2008-10-07 12:10

Hello AK,

i am a little confused...

1) Voting from photoview works?
2a) Voting from thumbsview erases votings?
2b) Voting from thumbsview does not work?

Which voting type does the album have? "critique" or "rank" ?

Jens
--
Gallery Developer

 
adegutis

Joined: 2004-09-10
Posts: 34
Posted: Tue, 2008-10-07 13:18

Jens,

The answer to all three is Yes.

1) Voting from photoview works? = Yes
2a) Voting from thumbsview erases votings? = Yes
2b) Voting from thumbsview does not work? = Yes

We have it set to Rank with the number voting option set to 1 (points set to 1 also). We are tallying for the most number of votes.

Thanks
Al
(not AK as I mistyped it previously)

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Sun, 2008-10-12 18:32

Hello,

please try this patch:

Quote:
Index: classes/Album.php
===================================================================
--- classes/Album.php (Revision 18020)
+++ classes/Album.php (Arbeitskopie)
@@ -3394,16 +3394,13 @@
}

function getVotingIdByIndex($index) {
- $albumName = $this->getAlbumName($index);
+ $photo = $this->getPhoto($index);

- if($albumName === null) {
- $vote_id = null;
+ if ($photo->isAlbum()) {
+ $vote_id = 'album.' . $photo->getAlbumName();
}
- elseif (!empty($albumName)) {
- $vote_id = "album.$albumName";
- }
else {
- $vote_id = "item.".$this->getPhotoId($index);
+ $vote_id = 'item.' . $photo->getPhotoId();
}

return $vote_id;

- Jens

 
adegutis

Joined: 2004-09-10
Posts: 34
Posted: Tue, 2008-10-14 14:23

There appears to be a closing bracket missing. I added one to close out the "if ($photo->isAlbum()) {" condition. It appears to be working, but will do some more testing.

Thanks
Al