I always get this message when viewing this content type's main editing page:
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/content/t/r/i/user4112/html/www2/sites/all/modules/uc_upsell/uc_upsell.module on line 191.

Any help would be appreciated.

Comments

torgospizza’s picture

Sorry for the delay, I'm pretty swamped these days.

That error is interesting, I'm not sure I get this error. Does the list of Related products show up in your product edit form? If so, are there any products in it? It seems to me that what's happening is that the submit handler isn't correctly getting merged into your form for some reason. I'm pretty sure I don't get this on our site, but I will double-check.

If you can send me a screenshot of what your Related Products select list looks like, that might help.

asak’s picture

I just got this same error on: admin/content/types/product/fields

WebWonk’s picture

StatusFileSize
new35.1 KB

I just got a bunch of array warnings after removing some product associations and submitting. I started from the "Related Product Associations" screen, then clicked the "edit" link, and when the node edit was complete I was redirected back to the "Related Product Associations" page. That is where these warnings were displayed.

Attached is a screenshot.

I don't recall getting anything like this in version 1.6. Is it possible that some of code changes for version 1.7 might have caused this??

torgospizza’s picture

Version: » 5.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new912 bytes

Hi, try this patch and let me know if you still get errors. Also make sure that the functionality still works as you'd expect it to (when removing or adding products from the "Related products" select list).

WebWonk’s picture

I do appreciate the quick patch. Unfortunately, I have already reverted my site to version 1.6 of the module. This will make it difficult for me to test the patch.

Maybe I can set-up a test environment to try this out, but I can't say how quickly my workload will allow this to happen.

torgospizza’s picture

Sure, no problem. I actually have had some server issues to deal with where we had to restore from backups, so I'll need to test my own patch as well. (Again.) Feel free to update this when you are able.

torgospizza’s picture

Just FYI I have released a bugfix for 1.7, which fixes the reciprocal associations problem. Feel free to try that one out. Otherwise I'll be closing this issue.

alegacy’s picture

I get the same error and I'm using 1.7 and I re-installed version

alegacy’s picture

Also, if it should help, this warning doesn't show up in my normal edit PRODUCT TYPE but only for PRODUCT TYPES I created from the Product Class.

torgospizza’s picture

StatusFileSize
new705 bytes

Here is a patch which might solve the issue. I believe the problem has to do with the array_merge in hook_form_alter (which is how the Related Products form gets added to the Edit form). It doesn't make sense that this would only show up when trying to edit one type of product class, and not a normal product, although anything is possible.

Just FYI this patch is rolled against the latest 5.x version, which adds some new features but leaves everything else working the same. (Although you might want to double-check your block and pane settings, to make sure things such as your "upsell messages" have not been erased.)

torgospizza’s picture

Assigned: Unassigned » torgospizza
torgospizza’s picture

Status: Needs review » Fixed

I believe this issue has been fixed. Please open a new one if you encounter these errors again.

Status: Fixed » Closed (fixed)

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

xurizaemon’s picture

StatusFileSize
new981 bytes

I'm seeing this issue on 5.x-1.7 CVS at admin/content/types/product/fields

At this point in uc_upsell_form_alter(), $form['#submit'] is not set. $form['submit'] is set here, but I don't believe it's what you want.

This attached might do the trick ... I wrote this patch before finding the issue. It's late.

xurizaemon’s picture

Status: Closed (fixed) » Active

Sorry - I did say it was late.