https://bugzilla.wikimedia.org/show_bug.cgi?id=51115

       Web browser: ---
            Bug ID: 51115
           Summary: You can't foreach over database results.  No database
                    installer, other issues.
           Product: MediaWiki extensions
           Version: master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: Comments
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Warning:  Invalid argument supplied for foreach() in
extensions/Comments/CommentClass.php on line 612
Warning:  Invalid argument supplied for foreach() in
extensions/Comments/CommentClass.php on line 549
Warning:  Invalid argument supplied for foreach() in
extensions/Comments/CommentClass.php on line 1035
Warning:  Invalid argument supplied for foreach() in
extensions/Comments/SpecialCommentIgnoreList.php on line 85

This is the result of attempting to use a foreach on a database result object.  

The correct way would be to use:
while ($row = $dbr->fetchObject($res)) { ... }

It also needs a standard database installer and hooks class.

I made the fixes and new pieces in the gzip tar include.  I'm not fucking with
the Gerrit code review process that takes 3+ months for people to get around to
looking out then nit pick over long lines in commit messages.

commit 5e39c4c67f2f177a3c4c4260efc043ddfa9beada
Author: Alexia E. Smith <[email protected]>
Date:   Wed Jul 10 11:11:06 2013 -0500

    Fixed foreach calls for looping over database result sets with a standard
while loop to prevent PHP warnings.  Created a standard hooks class and added a
database installer.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to