When I have tried to create a user via RPX, I get the following error message.

Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in /home/axisoffat/discuss.axisoffat.com/includes/common.inc on line 2157 and defined in drupal_http_build_query() (line 473 of /home/axisoffat/discuss.axisoffat.com/includes/common.inc).

Any ideas?

Cheers,

CommentFileSizeAuthor
#5 1028518-rpx.patch1 KBjide

Comments

geokat’s picture

Hi,

Thanks for the bug report. Can you provide more information so that I
can try and reproduce the bug? What RPX provider did you use to create
the account (Facebook, Twitter, etc.)? At what stage of the sign-in
process did you get the error?

Thanks,
George

nicholosophy’s picture

Hi,

I was using a twitter account to log in and it was after trying to fill out required fields on the drupal registration form. It would come up at that error and stop. Retried a couple of times and received the same error.

geokat’s picture

I can't seem to reproduce the bug. Can you try signing in with your
Twitter account on the Janrain's D7 module demo page? Does it work?

http://plugins.janrain.com/drupal7/

Thanks,
George

mgifford’s picture

This may not be a Janrain issue. I've got that error on some pages and don't have this module installed (or even downloaded).

Also see:
http://drupal.org/node/1015564


Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in /DRUPAL/includes/common.inc on line 2157 and defined in drupal_http_build_query() (line 473 of /DRUPAL/includes/common.inc).

I'm just getting this on a blog page, but have yet to dig down to see what might be different about that page.

Edit: Looks like it may be an issue with the Print Module

jide’s picture

StatusFileSize
new1 KB

I've encountered this issue as well and digged into it. It is in fact a Janrain issue.
This issue shows up when using a field with unlimited values allowed in user/profile/profile2 fields - in my own case a multiple "link" field on the user entity, not visible on the registration form. The problem is in the "rpx_user_register_submit" submit function.

When submitting the form, form['values'] are :

    [field_websites] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [_weight] => 0
                            [url] => 
                        )

                    [add_more] => Ajouter un autre élément
                )

        )

I've looked at the "user_profile_form_submit" function and the output was :

    [field_websites] => Array
        (
            [und] => Array
                (
                    [0] => Array
                        (
                            [url] => 
                            [_weight] => 0
                        )

                )

        )

The "add_more" array value is a string, which causes the problem (yes this is really not obvious when the error shows up...).
To resolve the issue, I simply used the method used in the "user_profile_form_submit" function :

  // Before updating the account entity, keep an unchanged copy for use with
  // user_save() later. This is necessary for modules implementing the user
  // hooks to be able to react on changes by comparing the values of $account
  // and $edit.
  $account_unchanged = clone $account;

  entity_form_submit_build_entity('user', $account, $form, $form_state);

  // Populate $edit with the properties of $account, which have been edited on
  // this form by taking over all values, which appear in the form values too.
  $edit = array_intersect_key((array) $account, $form_state['values']);

  user_save($account_unchanged, $edit, $category);

Also added entity_form_submit_build_entity() and the user category, not sure why it was not here in the first place.

Here is a patch that resolves the issue.

jide’s picture

Status: Active » Needs review

Changing status.

geokat’s picture

Thanks for your feedback, guys. And especially thanks for the patch :)
I'm going to test it and commit to HEAD if everything goes well.

Cheers,
George

geokat’s picture

Status: Needs review » Fixed

Committed the patch to HEAD.

Thanks jide!

Cheers,
George

Status: Fixed » Closed (fixed)
Issue tags: -drupal_http_build_query

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