Notifications
Clear all

modules/challenges/challenges.php bug re authors

3 Posts
2 Users
0 Reactions
2,001 Views
(@ardath)
Posts: 8
Active Member
Topic starter
 

I've come across a bug in challenges.php that I think is similar to the authors.php bug I brought up a bit ago.

Specifically, when you are in this mode: challenges.php?action=respond&stories=others&chalid=2 -- ie responding to the challenge as an admin and selecting other authors' works -- the author listing has bad links in it.  Authors who are listed as coauthors on someone else's works link not to their own story lists, but that other author's story list.

On my site, that'd be http://www.art-of-vin-diesel.com/archive/modules/challenges/challenges.php?action=respond&stories=others&chalid=2 but I suspect that will only open for you if you're a logged-in admin.  Still, I suspect you'll see the same on your copy of the program.

I think that whatever you changed in authors.php to fix it will be a guide in what needs changing here.

Thanks!


 
Posted : 07/12/2006 5:12 pm
(@ardath)
Posts: 8
Active Member
Topic starter
 

Here's the fix.  In modules/challenges/challenges.php:

FIND

$authorquery = "SELECT count(stories.sid) as stories, "._PENNAMEFIELD." as penname, stories.uid FROM "._AUTHORTABLE.", ".$tableprefix."fanfiction_stories as stories WHERE stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR "._UIDFIELD." = stories.uid) ".(isset($letter) ? " AND $letter" : "")." GROUP BY "._UIDFIELD;

REPLACE WITH

$authorquery = "SELECT count(stories.sid) as stories, "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid FROM "._AUTHORTABLE.", ".$tableprefix."fanfiction_stories as stories WHERE stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR "._UIDFIELD." = stories.uid) ".(isset($letter) ? " AND $letter" : "")." GROUP BY "._UIDFIELD;

That replicates the fix that was made to authors.php, and solves the bug.


 
Posted : 09/12/2006 2:55 pm
(@tammy)
Posts: 2577
Member Moderator
 

This fix is actually wrong as was the one it replicated.  However, the correct fix was released with 3.0.2.  Marking this solved.


 
Posted : 29/12/2006 8:33 pm
Share: