Hi, I get those errors after viewing a node that doesn't have any referrer yet:
warning: array_filter() [function.array-filter]: The first argument should be an array in /var/www/maw/sites/all/modules/nodereferrer/nodereferrer.module on line 162.
warning: array_values() [function.array-values]: The argument should be an array in /var/www/maw/sites/all/modules/nodereferrer/nodereferrer.module on line 162.
warning: array_filter() [function.array-filter]: The first argument should be an array in /var/www/maw/sites/all/modules/nodereferrer/nodereferrer.module on line 163.
warning: array_values() [function.array-values]: The argument should be an array in /var/www/maw/sites/all/modules/nodereferrer/nodereferrer.module on line 163.
using last 1.x dev.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | nodereferrer-invalid_argument_type-777384-14.patch | 1.12 KB | esolano |
Comments
Comment #1
mesr01 commentedI also experience this bug. It's worth mentioning that I get this message for lines 135-136 as well as 162-163. My version is 6.x-1.0-rc2 (with a PostgreSQL database backend).
Comment #2
fourmi4x commentedI have the same issue.
Comment #3
thadwheeler commentedI am seeing same issue with 6.x-1.0-rc2. It appears only on nodes without a referrer it seems
Comment #4
alexgreyhead commentedSame here, 6.x-1.0-rc2:
warning: array_filter() [function.array-filter]: The first argument should be an array in
/sites/all/modules/nodereferrer/nodereferrer.module on line 135.
warning: array_values() [function.array-values]: The argument should be an array in
/sites/all/modules/nodereferrer/nodereferrer.module on line 135.
warning: array_filter() [function.array-filter]: The first argument should be an array in
/sites/all/modules/nodereferrer/nodereferrer.module on line 136.
warning: array_values() [function.array-values]: The argument should be an array in
/sites/all/modules/nodereferrer/nodereferrer.module on line 136.
Comment #5
andypostPlease explain a steps to reproduce this bug
Comment #6
Anonymous (not verified) commentedSame issue in 6.x-1.0-rc2 here too.
In my setup, we have two content types, "Project" and "Portfolio Item" which refer to another content type "Client". Client has a nodereferrer field.
Maybe it's something to do with the fact that two content types are referring one.
After setting up the second node reference I forgot to check the box for that content type under "Referring Node Types:" as well as "Referring fields", but I have corrected that now and it doesn't seem to be related to this issue.
Comment #7
andypostIs this still an issue? Please test against current 6-dev
Comment #8
pareen commentedIts still an issue with rc2. Havent tried it with dev.
But I think it is because I am using node reference url widget. Error disappears if I select the autocomplete widget (or any other default ones).
Anyone else using this module?
Comment #9
bramface commentedI'm having the issue, but not using reference URL widget.
Comment #10
Anonymous (not verified) commentedSame issue with RC2.
Comment #11
Anonymous (not verified) commentedI have tested this against the current dev version dated 2011-Feb-25 and I can confirm that this is still an issue.
PHP version 5.3.6
Error message:
warning: array_values() expects parameter 1 to be array, null given in /home/bjncom/public_html/sites/all/modules/nodereferrer/nodereferrer.module on line 134.
warning: array_filter() expects parameter 1 to be array, string given in /home/bjncom/public_html/sites/all/modules/nodereferrer/nodereferrer.module on line 135.
Comment #12
jvieille commentedSame issue, lines 135, 136 with nodereferrer-6.x-1.0-rc2
- on nodes without refering nodes
Comment #13
jvieille commentedThis seems to come with latest php versions that are more strict about data type.
I solved the issue by modifying lines 135-136 as follow
Current code
Modified code
Idem for lines 162-163
Current code
Modified code
Comment #14
andypostcan you provide a patch? also suppose we just need to change isset() to !empty() in both cases
Comment #15
jvieille commentedI don't know how to create a patch. (I installed Tortoie svn/cvs on my windows pc, but it looks like a piece of crap, or I did not spent enough time to gets the logic.)
I haven(t tried to change isset only, but the code breaks before, while evaluating the arguments, so I don't think your proposal would make it.
Comment #16
jvieille commentedIs it possible to fix this?
Thanks
Comment #17
spydmobile commentedbump?
Comment #18
esolano commentedHi! Here's a patch that might work for comment #14
Comment #19
andypostany reviews?