Problem/Motivation

I've tested every module I've got and it seems logintoboggan is causing a PHP error. It happens just after a new user submits their registration form:

Fatal error: Unsupported operand types in .../includes/common.inc on line 2177

This happens when either the "Redirect path on registration" or "Redirect path on confirmation" paths have a query parameter in the path.

Proposed resolution

Patch proposed in #8

Remaining tasks

Review & test.

Comments

dlthomas’s picture

It mentioned on a v6 extension to logintoboggan that it has had incompatibilities with other modules in the past due to what it does.

I will aim to test it against my other modules individually to attempt to find out if that could be causing it. I'll report back with that soon.

Are there any known incompatibilities that could be causing this?

hunmonk’s picture

Status: Active » Postponed (maintainer needs more info)

a stack trace would help.

hockey2112’s picture

Version: 7.x-1.2 » 7.x-1.3
Status: Postponed (maintainer needs more info) » Active

I am having the same exact issue when users try to register on my D7 website. The message is:

Fatal error: Unsupported operand types in common.inc on line 2287

Any ideas on what might be wrong and how I an fix it? I am not using clean URLs at the moment as I am developing a new website to replace an existing one, and am developing it on the IP address of the new server (in case that matters).

Thanks!

rooby’s picture

To debug this, just before the line in common.inc that causes the problem, add this:

<?php
if (!is_array($options['query'])) {
  die(debug_print_backtrace());
}

?>

Then refresh the page where you get the error.
Copy the output to a txt file and post it here.

hockey2112’s picture

OK, here it is:

hockey2112’s picture

StatusFileSize
new469.46 KB

Sorry, here is the txt attachment.

hockey2112’s picture

The "node/add/photo-gallery-image" path is the redirect I have set up in LoginToboggan. I believe my error was the fact that I had the entire url in that redirect field, instead of just the "node/add/photo-gallery-image" path. Once I changed it to "node/add/photo-gallery-image", my problem was solved. Thanks!

rooby’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new1.08 KB

Thanks for the info.

The problem is when you enter any URL that has a query string.

The parse_url function returns a string but the url function requires an array for the query.

The solution is to use drupal_parse_url() which accounts for this and also accounts for the q parameter actually being the path.

This patch should fix it.

j0rd’s picture

Tested patch #8, works as expected and prevents a fatal error.

This should be committed asap.

j0rd’s picture

Status: Needs review » Reviewed & tested by the community

Change status.

j0rd’s picture

Issue summary: View changes

Correction

dooug’s picture

Title: Unsupported operand types error in common.inc with LoginToboggan » "Unsupported operand types" error on redirects with a query string
Issue summary: View changes

Improved title & summary for clarity.

dooug’s picture

Title: "Unsupported operand types" error on redirects with a query string » "Unsupported operand types" error on redirect paths with a query string
dooug’s picture

Status: Reviewed & tested by the community » Fixed

  • dooug committed e0a0c47 on 7.x-1.x authored by rooby
    Issue #1275048 by rooby: Fixes error on redirect paths with a query...

Status: Fixed » Closed (fixed)

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

yktdan’s picture

Patch #8 does not seem to have been applied to current version 7.x-1.5 (examined the code) and have the bug when I redirect to a path like www.example.com/?participant

It is fixed in the dev version. Please generate a 7.x-1.6. I don't like to run dev versions on production.

rooby’s picture

@yktdan:

It's not in 1.5 because it was committed after 1.5 was released.

If you want to talk about the 1.6 release you want this issue: #2481487: LoginToboggan 7.x-1.6 Release Roadmap