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

Comments

sun’s picture

Status: Active » Needs work
samtaylor’s picture

Version: 5.x-1.1 » 6.x-1.0
Priority: Normal » Critical

I'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.

andyt’s picture

Installation 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.

owen32’s picture

journal-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

sun’s picture

Title: MYSQLi with Joutnal » MySQLi with Journal
Assigned: Nessiah » Unassigned

Could someone of you please roll the necessary changes into a patch? I don't get what needs to be changed actually.

smk-ka’s picture

For 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))) {

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new1.33 KB
new1.9 KB

Please test one of the attached patches. Please note, both are against latest code in the DRUPAL-5 resp. DRUPAL-6--1 branch.

sun’s picture

StatusFileSize
new1.9 KB

Re-rolled patch for D6.

sun’s picture

Priority: Critical » Normal
StatusFileSize
new1.9 KB

Re-rolled patch for D6. Please test.

okeedoak’s picture

Patch from #7, journal-DRUPAL-5.mysqli.patch, fixes problem with D5 version. Thanks!

sun’s picture

Status: Needs review » Fixed

Thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.