Fatal Error: Unsupported operand types router.php

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
ahuppert
Joomla! Apprentice
Joomla! Apprentice
Posts: 42
Joined: Sat Feb 09, 2008 5:45 am

Fatal Error: Unsupported operand types router.php

Post by ahuppert » Sat Feb 16, 2008 1:57 am

I have no idea what happened, but I created a new user in my registration screen and went to login as that person (to test the system) and now when I click "Login", whether I enter a username and password or not, I get the following error:

Fatal error: Unsupported operand types in /home/ahuppert/public_html/popchurch/includes/router.php on line 141

Line 141 reads: $vars = $vars + $item->query;

I have looked all through Google and various support sites for Joomla... I'm not sure where to go as no one has posted a fix for this. Any suggestions?

If you want to see the error live, goto https://74.54.176.146/~ahuppert/popchurch/ and click on LOGIN at the bottom LEFT, or simply go to the following link:

https://74.54.176.146/~ahuppert/popchur ... d=usermenu

Andrew

ahuppert
Joomla! Apprentice
Joomla! Apprentice
Posts: 42
Joined: Sat Feb 09, 2008 5:45 am

Re: Fatal Error: Unsupported operand types router.php

Post by ahuppert » Sat Feb 16, 2008 6:14 pm

SOLUTION:

For anyone else running into this problem, I figured it out on my own. What happened was that in the MOD_LOGIN I had set the login redirect to a menu-item that I had created. The problem was that the menu-item was set to ARTICLE and the actual article it was linked to had been deleted in housekeeping. So, the code is correct, it is simply trying to return a VALUE that does not exist. Instead of returning an error or a 404 not found, it returns the ominous message that an operand type is unsupported.

All I had to do was link that menu item to another article and the code worked like a charm. I hope this helps anyone else looking for a solution to this problem.

I happened to notice that many of the other people with this same problem also used COMMUNITY BUILDER. Check your CB page pointers for once the person logs on correctly or incorrectly... perhaps it is pointing to a menu or an article or a form that simply does not exist..

Andrew

April_Floyd
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 245
Joined: Wed Mar 29, 2006 10:13 am

Re: Fatal Error: Unsupported operand types router.php

Post by April_Floyd » Thu Feb 28, 2008 5:39 pm

I get this type of error when I use the contac form, but only in firefox 2, not in ie7, or opera ior ie6

Run4it
Joomla! Explorer
Joomla! Explorer
Posts: 267
Joined: Mon Mar 12, 2007 7:41 pm

Re: Fatal Error: Unsupported operand types router.php

Post by Run4it » Fri Mar 07, 2008 5:39 pm

I am getting this error with the contact form also and the browser doesn't matter. I need a contact form. Does anyone have a solution, or even a path to look down? I am not a .php programmer so I am really in the dark on this one.

User avatar
BernardE
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Tue May 09, 2006 5:18 pm
Location: South Africa
Contact:

Re: Fatal Error: Unsupported operand types router.php

Post by BernardE » Sun Mar 09, 2008 9:36 pm

Thanks a lot Andrew, this is just the problem I had. I ever tried to reinstall. Just shows you - check the forum first!
http://www.webflash.co.za - Joomla Web design and development, Template Design

User avatar
wadscookin
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Fri Jun 09, 2006 12:02 am
Location: Northampton, UK
Contact:

Re: Fatal Error: Unsupported operand types router.php

Post by wadscookin » Tue Mar 18, 2008 5:49 pm

Hi Andrew, after much frustration I finally Googled the net and found your solution to this error! Many thanks for this and I kick myself for not checking the forums sooner. :)
If Jesus is your co-pilot, change seats.

User avatar
bas123
Joomla! Intern
Joomla! Intern
Posts: 67
Joined: Fri May 09, 2008 2:49 pm

Re: Fatal Error: Unsupported operand types router.php

Post by bas123 » Tue Sep 16, 2008 11:05 pm

I just came across this error:
Fatal error: Unsupported operand types in JROOT/includes/router.php on line 140
The only time this happened was when trying to login while the page was showing search results.

I am not quite sure how I'd resolve this with Andrew's (ahuppert) solution.

Anyone else have a thought?
Listen... and Keep to the point! :)

quiquedcode
Joomla! Ace
Joomla! Ace
Posts: 1378
Joined: Thu Aug 18, 2005 10:11 pm
Location: San Juan - Argentina
Contact:

Re: Fatal Error: Unsupported operand types router.php

Post by quiquedcode » Mon Sep 22, 2008 5:51 pm

Hi bas123
I've also had this error this morning (sent by a client) and then googled and found this thread.

As far I've read in some forums, etc. it seems it is a problem related to SEF. Disable it, or change the way sef urls are generated, and this should solve the problem.

Let us know if this worked (it did for me)
@kabeza
Freelance Joomla/CodeIgniter Developer
Home: http://www.beza.com.ar

sreekanth
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Oct 06, 2008 1:53 am

Re: Fatal Error: Unsupported operand types router.php

Post by sreekanth » Mon Jan 12, 2009 3:29 am

Andrew,
Thanks much. I had the same problem and was able to find the reason with your helpful note.
Thanks for sharing.
-Sreekanth

User avatar
matew
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Sep 27, 2008 10:51 am

Re: Fatal Error: Unsupported operand types router.php

Post by matew » Fri Feb 13, 2009 5:46 am

I got the same problem when I tried to send a mail in " Enquiry about the Product", in virtuemart.
As I got many Errors with virtuemart and joomla!, So I used a Patch Package of joomla to upgrade my current joomla.It Helped me to fix alot of bugs.But now again got an error saying that "Fatal error: Unsupported operand types in includes/router.php on line 148". Any Solution......

Thanks In advance. ;)
Regards,

Mathew

cb3
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Wed Apr 30, 2008 4:30 pm

Re: Fatal Error: Unsupported operand types router.php

Post by cb3 » Mon Feb 16, 2009 8:41 pm

fixed it for me too, thanks very much

HeinzAhoy
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Fri Dec 05, 2008 6:03 pm
Location: spain

Re: Fatal Error: Unsupported operand types router.php

Post by HeinzAhoy » Wed Mar 04, 2009 6:11 pm

This really IS cool: finding such a solution (on a silver plate) just when you needed it!!!
Thanks so much Andrew!!

Santander
Joomla! Apprentice
Joomla! Apprentice
Posts: 31
Joined: Sat Nov 22, 2008 7:41 pm

Re: Fatal Error: Unsupported operand types router.php

Post by Santander » Fri Mar 13, 2009 2:45 pm

Great idea Guy !
Same problem and it was a confilct between Community Builder Login module and some other module which remainded after I had uninstalled CB.

Everything works perfect now
Many thanks

Gianluca949
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Mar 23, 2009 11:03 am

Re: Fatal Error: Unsupported operand types router.php

Post by Gianluca949 » Mon Mar 30, 2009 10:57 am

Andrew, You are my hero!!! I had this problem and now it is OK ...... Thanks

colorado2rein
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sun Feb 08, 2009 5:13 am
Location: Lafayette, CO USA

Re: Fatal Error: Unsupported operand types router.php

Post by colorado2rein » Mon Mar 30, 2009 3:22 pm

Yep, links issue. Mine was not related to login, but general housekeeping and deleting old articles/menu items/cats/sections. Thanks for a quick point in the right direction for us newbs!

Kotsolis
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 198
Joined: Mon Oct 27, 2008 6:38 pm

Re: Fatal Error: Unsupported operand types router.php

Post by Kotsolis » Fri Apr 03, 2009 7:47 am

All I had to do was link that menu item to another article and the code worked like a charm. I hope this helps anyone else looking for a solution to this problem.

I happened to notice that many of the other people with this same problem also used COMMUNITY BUILDER. Check your CB page pointers for once the person logs on correctly or incorrectly... perhaps it is pointing to a menu or an article or a form that simply does not exist..
Hi, can you tell me how to do all this stuff as I'm a noob? I didn't even realised what you're telling here.

magic22
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Tue Mar 27, 2007 2:19 pm

Re: Fatal Error: Unsupported operand types router.php

Post by magic22 » Tue Apr 28, 2009 8:58 am

Andrew, You made my day. Thank you.

Just to add that in my case, the article was there (and published), but the menu item that my login was redirected to, was disabled. Changed that and all is working fine.

Thanks again. This is the true and ideal society, helping each other without return expectations!

/MajicMan

User avatar
dannette
Joomla! Intern
Joomla! Intern
Posts: 97
Joined: Sat Apr 28, 2007 9:47 pm
Location: Allentown, PA
Contact:

Re: Fatal Error: Unsupported operand types router.php

Post by dannette » Fri May 29, 2009 6:07 pm

For those with the problem and the contact form - I had the problem too but found I couldn't just link to the contact form without it actually being a menu item first.

azhararmar
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Mar 23, 2009 8:12 pm

Re: Fatal Error: Unsupported operand types router.php

Post by azhararmar » Sun May 31, 2009 4:02 pm

ahuppert wrote:SOLUTION:

For anyone else running into this problem, I figured it out on my own. What happened was that in the MOD_LOGIN I had set the login redirect to a menu-item that I had created. The problem was that the menu-item was set to ARTICLE and the actual article it was linked to had been deleted in housekeeping. So, the code is correct, it is simply trying to return a VALUE that does not exist. Instead of returning an error or a 404 not found, it returns the ominous message that an operand type is unsupported.

All I had to do was link that menu item to another article and the code worked like a charm. I hope this helps anyone else looking for a solution to this problem.

I happened to notice that many of the other people with this same problem also used COMMUNITY BUILDER. Check your CB page pointers for once the person logs on correctly or incorrectly... perhaps it is pointing to a menu or an article or a form that simply does not exist..

Andrew

Wow, i had the exact problem.. i was redirecting the login module to the link that was deleted.. thanks for bringing it to notice.. everything is working fine now....:)

User avatar
carterx
Joomla! Intern
Joomla! Intern
Posts: 60
Joined: Sat Jan 24, 2009 8:34 am

Re: Fatal Error: Unsupported operand types router.php

Post by carterx » Mon Jun 15, 2009 3:45 am

ahuppert wrote:SOLUTION:

For anyone else running into this problem, I figured it out on my own. What happened was that in the MOD_LOGIN I had set the login redirect to a menu-item that I had created. The problem was that the menu-item was set to ARTICLE and the actual article it was linked to had been deleted in housekeeping. So, the code is correct, it is simply trying to return a VALUE that does not exist. Instead of returning an error or a 404 not found, it returns the ominous message that an operand type is unsupported.

All I had to do was link that menu item to another article and the code worked like a charm. I hope this helps anyone else looking for a solution to this problem.

I happened to notice that many of the other people with this same problem also used COMMUNITY BUILDER. Check your CB page pointers for once the person logs on correctly or incorrectly... perhaps it is pointing to a menu or an article or a form that simply does not exist..

Andrew

Thanks, this was my issue.

fcsites
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Jun 16, 2009 7:48 am

Re: Fatal Error: Unsupported operand types router.php

Post by fcsites » Tue Jun 16, 2009 7:54 am

On my site, using JForms I´d unpublished a menu element linked also from a content article, so the form was visible and the visitors could see it (the form was published) but when they submitted the form... got the error.

Thanks.

farrowz
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Mar 25, 2008 1:36 pm

Re: Fatal Error: Unsupported operand types router.php

Post by farrowz » Thu Jul 09, 2009 8:29 pm

Thanks for the hint Andrew, but I didn't like your solution as it doesn't fix all cases. I therefore decided to modify the code. Here is the original function.

Code: Select all

	
function _parseRawRoute(&$uri)
	{
		$vars   = array();

		$menu =& JSite::getMenu(true);

		//Handle an empty URL (special case)
		if(!$uri->getVar('Itemid') && !$uri->getVar('option'))
		{
			$item = $menu->getDefault();
			if(!is_object($item)) return $vars; // No default item set

			//Set the information in the request
			$vars = $item->query;

			//Get the itemid
			$vars['Itemid'] = $item->id;

			// Set the active menu item
			$menu->setActive($vars['Itemid']);

			return $vars;
		}

		//Get the variables from the uri
		$this->setVars($uri->getQuery(true));

		//Get the itemid, if it hasn't been set force it to null
		$this->setVar('Itemid', JRequest::getInt('Itemid', null));

		//Only an Itemid ? Get the full information from the itemid
		if(count($this->getVars()) == 1)
		{
			$item = $menu->getItem($this->getVar('Itemid'));
ERROR---->	$vars = $vars + $item->query;
		}

		// Set the active menu item
		$menu->setActive($this->getVar('Itemid'));

		return $vars;
	}
If you notice above the offending line, the function handles the "empty URL" case that redirects the user to the default menu. By modifying the original code, I tested for a valid object $item. If it is not valid (causing the error) I then redirect to the default page.

Here is the modified code:

Code: Select all

	function _parseRawRoute(&$uri)
	{
		$vars   = array();

		$menu =& JSite::getMenu(true);

		//Handle an empty URL (special case)
		if(!$uri->getVar('Itemid') && !$uri->getVar('option'))
		{
			$item = $menu->getDefault();
			if(!is_object($item)) return $vars; // No default item set

			//Set the information in the request
			$vars = $item->query;

			//Get the itemid
			$vars['Itemid'] = $item->id;

			// Set the active menu item
			$menu->setActive($vars['Itemid']);

			return $vars;
		}

		//Get the variables from the uri
		$this->setVars($uri->getQuery(true));

		//Get the itemid, if it hasn't been set force it to null
		$this->setVar('Itemid', JRequest::getInt('Itemid', null));

		//Only an Itemid ? Get the full information from the itemid
		if(count($this->getVars()) == 1)
		{
			$item = $menu->getItem($this->getVar('Itemid'));
// --- START OF NEW CODE ---
			if(!is_object($item)) {
				$item = $menu->getDefault();
				if(!is_object($item)) return $vars; // No default item set

				//Set the information in the request
				$vars = $item->query;

				//Get the itemid
				$vars['Itemid'] = $item->id;

				// Set the active menu item
				$menu->setActive($vars['Itemid']);

				return $vars;
			}
// --- END OF NEW CODE ---
			$vars = $vars + $item->query;
		}

		// Set the active menu item
		$menu->setActive($this->getVar('Itemid'));

		return $vars;
	}
I realize this is a core hack, but it solves my problems. Hope it helps :)

User avatar
Webbman66
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Apr 14, 2008 11:56 pm

Re: Fatal Error: Unsupported operand types router.php

Post by Webbman66 » Thu Jul 23, 2009 3:11 pm

Thanks to everyone trying to come up with fixes on this issue. I tried all possible solutions posted here but to no avail.
The only solution that worked for me was farrowz core hack. Thanks everyone!

Using J 1.5.12 with Chronoforms
Cheers,
Steve

"Fail to Plan - Plan to Fail"

charleyhankins
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 179
Joined: Fri Oct 12, 2007 7:07 pm

Re: Fatal Error: Unsupported operand types router.php

Post by charleyhankins » Thu Sep 17, 2009 8:01 pm

I am getting the same error message when I try to enter a new event in JCal. I can enter an event from the admin section, but when I try from the front end, I receive that error. Any other thoughts?

Thanks,
CH

hearingv
Joomla! Intern
Joomla! Intern
Posts: 64
Joined: Mon Aug 31, 2009 2:14 am

Re: Fatal Error: Unsupported operand types router.php

Post by hearingv » Sat Sep 26, 2009 1:26 am

Kotsolis wrote:
All I had to do was link that menu item to another article and the code worked like a charm. I hope this helps anyone else looking for a solution to this problem.
perhaps it is pointing to a menu or an article or a form that simply does not exist..
Hi, can you tell me how to do all this stuff as I'm a noob? I didn't even realised what you're telling here.
I found the same problem ,
Fatal error: Unsupported operand types in /home/hearingv/public_html/includes/router.php on line 148
I couldnt understand why, as I had directed it to the forum page which did exist
However When I checked, I found that there was two links for the forum in the menu selection for th log in module. I had clicked on the old one. Once I changed it to the new correct one I was okay.
If is a problem with the login- click Extensions/ then module manager. Click on "Log In Form" ( edit) Look at the Log In redirection setting on the Right hand side. There is one for Log in and one for Log Out. Ensure the menu item it is directed to DOES EXIST. That you havent since moved it or replaced it. Change it to one that does. CLick SAve. Then go and see what happens when you log in/ or out. Hopefully it will work. Mine does :)

User avatar
masoesa
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Mon Sep 26, 2005 7:11 pm
Location: Brooklyn NY
Contact:

Re: Fatal Error: Unsupported operand types router.php

Post by masoesa » Tue Sep 29, 2009 4:54 am

Thanks! It worked for me.
http://going-natural.com
The site where Natural Beauty Shines

jotch_14
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Nov 09, 2009 5:22 am

Re: Fatal Error: Unsupported operand types router.php

Post by jotch_14 » Mon Nov 09, 2009 7:25 am

the best answer

aalonie
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Dec 03, 2009 5:08 am

Re: Fatal Error: Unsupported operand types router.php

Post by aalonie » Fri Dec 04, 2009 8:33 pm

This is EXACTLY what I needed! Much thanx

solikatir
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Dec 04, 2009 9:25 pm
Location: Israel
Contact:

Re: Fatal Error: Unsupported operand types router.php

Post by solikatir » Fri Dec 04, 2009 9:34 pm

I have same problem with $vars = $vars + $item->query;
webmaster tool detect it but unable to find the bug.
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

kentmorrison
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Sun Jan 18, 2009 8:18 pm

Re: Fatal Error: Unsupported operand types router.php

Post by kentmorrison » Fri Dec 11, 2009 3:34 pm

I had a similar problem that started like this:

I created a new contact, for a special purpose.
Since I always have a TERRIBLE time figuring out the URL of such pages, I turned SEO OFF so that the real mangled numeric URL was visible.

I had neglected to turn the SEO back on.

When I turned it back on, the email contact form worked.
But it still does not send the Contact Form User to a THANK YOU FOR THE MESSAGE page... :(

Thanks to all for the expert help!

Regards,
Kent Morrison


Locked

Return to “Administration 1.5”