Nopes 3.3.1. Works like a charm. We upgraded from 3.3.1 to 3.4.2 and that's when the errors came up. So previous version for us would be 3.3.1.
I just finished upgrading to 3.4.3 this weekend. In the testing I've done so far the Co-author/Storycount issue seems to be fixed. Horrah!
Julieann
Running 3.4.3 bridged with SMF and Coppermine
Mods: Challenges, cpg-art (not working), Limit Summary Length, Bio to Prefs, Top 20 instead of 10
Wants: Move Betareader to Prefs, Twitter
We recently upgraded to 3.4.3 - around mid-June - and have just received reports of this problem on our site as well. Recalculating stories and site stats does not make any difference, the count for an author remains at 1 (the co-authored amount) even though she has lots of fics posted.
Yes, this error definitely still exists with 3.4.3.
This story is my example. All the coauthors are listed now, but go to this user's profile, and you'll see that she has the co-authored story listed 5 times (her story count is 6 because she has co-authored another story). Go to this person's profile and you'll see that she has only one story listed when in reality she has 8 stories, including the co-authored one.
I've manually changed their numbers, but it's only a temporary solution. When they edit a story or submit a new story, the count reverts back to the number of stories coauthored, not authored total.
Just found this error and it's a simple fix:
In admin/maintenance.php
else if($maint == "stories") {
$authors = dbquery("SELECT uid, count(uid) AS count FROM ".TABLEPREFIX."fanfiction_stories WHERE validated > 0 GROUP BY uid");
while($a = dbassoc($authors)) {
$alist[$a['uid']] = $a['count'];
}
$coauthors = dbquery("SELECT uid, count(sid) AS count FROM ".TABLEPREFIX."fanfiction_coauthors GROUP BY uid");
while($ca = dbassoc($coauthors)) {
if(in_array($ca['uid'], $alist)) $alist[$ca['uid']] = $alist[$ca['uid']] + $ca['count'];
else $alist[$ca['uid']] = $ca['count'];
}
foreach($alist AS $a => $s) {
dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorprefs SET stories = '$s' WHERE uid = '$a' LIMIT 1");
}
$output .= write_message(_ACTIONSUCCESSFUL);
}
The problem is with the adding of co author stories, for some reason in_array() is being used to try and determine if the uid key is in the list, but in_array is only for checking a value in an array, not a key!
If I change:
if(in_array($ca['uid'], $alist)) $alist[$ca['uid']] = $alist[$ca['uid']] + $ca['count'];
else $alist[$ca['uid']] = $ca['count'];
to:
$alist[$ca['uid']] = $alist[$ca['uid']] + $ca['count'];
Then it calculates the stories correctly.
When I replace:
if(in_array($ca['uid'], $alist)) $alist[$ca['uid']] = $alist[$ca['uid']] + $ca['count'];
else $alist[$ca['uid']] = $ca['count'];
with
$alist[$ca['uid']] = $alist[$ca['uid']] + $ca['count'];
I'm not able to access archive maintenance.
Well, it was fixed, and now the problem is back again. I'll try your fix this weekend Foz.
How annoying.
Julieann
Running 3.4.3 bridged with SMF and Coppermine
Mods: Challenges, cpg-art (not working), Limit Summary Length, Bio to Prefs, Top 20 instead of 10
Wants: Move Betareader to Prefs, Twitter
Okay, I just tried the changes in code that you suggested, Foz, and so far it seems to be working. I had our most prolific author go from showing 2 stories to the proper 57. Yay!
So far I haven't found any side-effects of the suggestion. I'll keep watching, though. π
Julieann
Running 3.4.3 bridged with SMF and Coppermine
Mods: Challenges, cpg-art (not working), Limit Summary Length, Bio to Prefs, Top 20 instead of 10
Wants: Move Betareader to Prefs, Twitter
That worked like a charm for me too, thanks!!!
Wrong change. You'll throw notice errors if you fix it like that. Change:
if(in_array($ca['uid'], $alist))
to:
if(isset($ca['uid'], $alist))
Already done in 3.5
Can you please check and see if this is still an issue with 3.5? Thank you!
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word
No response... assumed solved.
Whoever said nothing is impossible never tried slamming a revolving door.
url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word