Closed (fixed)
Project:
Journal
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2008 at 10:32 UTC
Updated:
17 May 2008 at 16:21 UTC
Jump to comment: Most recent file
Line 207 with MYSQLi give error at me:
warning: array_shift() [function.array-shift]: The argument should be an array in /var/www/html/drupal/sites/all/modules/journal/journal.module
change Line to
while ($entry = ( is_object($journal) ? db_fetch_object($journal) : array_shift($journal))) {
works fine now
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | journal-DRUPAL-6--1.mysqli.patch | 1.9 KB | sun |
| #8 | journal-DRUPAL-6--1.mysqli.patch | 1.9 KB | sun |
| #7 | journal-DRUPAL-5.mysqli.patch | 1.9 KB | sun |
| #7 | journal-DRUPAL-6--1.mysqli.patch | 1.33 KB | sun |
Comments
Comment #1
sunComment #2
samtaylor commentedI'm getting a similar error but in line 203; that code fixed it. This needs to be updated!
EDIT: I'm also getting these errors when writing a page:
warning: in_array() [function.in-array]: Wrong datatype for second argument in /nfsn/content/flaglerama/public/modules/journal/journal.module on line 72.
warning: array_unshift() [function.array-unshift]: The first argument should be an array in /nfsn/content/flaglerama/public/modules/journal/journal.module on line 85.
I don't know PHP but will try to hack out a fix for these if this doesn't get updated before then.
Comment #3
andyt commentedInstallation of 6.1 with Journal 6.x-1.0 (release date 2008-Feb-13) gave the same error for line 203. The fix worked.
I have not seen any other errors.
Comment #4
owen32 commentedjournal-6.x-1.0.tar.gz
Same Errors:
warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\webs\North\modules\journal\journal.module on line 72.
warning: array_unshift() [function.array-unshift]: The first argument should be an array in C:\webs\North\modules\journal\journal.module on line 85.
Drupal 6.1
win2k3 R2 with all SPs and fixes
MySQL Server 5.0.11
PHP Version 5.2.5
Microsoft-IIS/6.0
Comment #5
sunCould someone of you please roll the necessary changes into a patch? I don't get what needs to be changed actually.
Comment #6
smk-ka commentedFor some reason MySQLi seems to not return a resource anymore but an object. However, the proposed fix surely breaks legacy MySQL, because that'll still return a resource. A patch working for both worlds could look like this:
while ($entry = (is_array($journal) ? array_shift($journal) : db_fetch_object($journal))) {Comment #7
sunPlease test one of the attached patches. Please note, both are against latest code in the DRUPAL-5 resp. DRUPAL-6--1 branch.
Comment #8
sunRe-rolled patch for D6.
Comment #9
sunRe-rolled patch for D6. Please test.
Comment #10
okeedoak commentedPatch from #7, journal-DRUPAL-5.mysqli.patch, fixes problem with D5 version. Thanks!
Comment #11
sunThanks, committed.
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.