Undefined Index issues with SEF URLs enabled

The support for Joomla 2.5 ended on December 31, 2014. Possible bugs in Joomla 2.5 will not be patched anymore. This forum has been closed. Please update your website to Joomla 3.x

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
User avatar
pixed
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Sun Mar 16, 2008 1:03 pm
Location: Denmark

Undefined Index issues with SEF URLs enabled

Post by pixed » Wed Feb 16, 2011 3:54 pm

I'm using the official J1.6 release.

When I enable Search Engine Friendly URLs under SEO Settings in Global Configuration I get some error notifications from PHP on some pages:
Notice: Undefined index: view in /home/www/components/com_content/router.php on line 49
On some pages I get several of them in row - as soon as I disable SEF URLs the problem goes away.

Line 48-49 in com_content/router.php:

Code: Select all

// are we dealing with an article or category that is attached to a menu item?
if ($menuItem->query['view'] == $query['view'] && isset($query['id']) && $menuItem->query['id'] == intval($query['id'])) {
So either this is related to $menuItem->query['view'] or $query['view']. The question is if the error is that the variables are not checked with an isset() before indexed or if the SEF functionality does not initialize them properly.

And then again it could be something I need to configure somewhere - any ideas?

User avatar
Leftfield
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4438
Joined: Fri Dec 08, 2006 3:33 am
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by Leftfield » Wed Feb 16, 2011 6:21 pm

What is you server config (php, mysql, apache...)? Anyway, you can turn off "notice" :). It's just a notice, not an error.

User avatar
pixed
Joomla! Apprentice
Joomla! Apprentice
Posts: 34
Joined: Sun Mar 16, 2008 1:03 pm
Location: Denmark

Re: Undefined Index issues with SEF URLs enabled

Post by pixed » Wed Feb 16, 2011 6:54 pm

Yeah, I know I can just turn it off - I like to keep my dev server on max alert state so I can fix possible issues before they evolve into real problems :)

Sys info (my dev/test server):

PHP Built On: Linux .. 2.6.35-25-generic-pae #44-Ubuntu SMP Fri Jan 21 19:01:46 UTC 2011 i686
Database Version: 5.1.49-1ubuntu8.1
Database Collation: utf8_general_ci
PHP Version: 5.3.3-1ubuntu9.3
Web Server: Apache/2.2.16 (Ubuntu)
WebServer to PHP Interface: apache2handler
Joomla! Version: Joomla! 1.6.0 Stable [ Onward ] 10-Jan-2011 23:00 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13

User avatar
Leftfield
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4438
Joined: Fri Dec 08, 2006 3:33 am
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by Leftfield » Wed Feb 16, 2011 9:59 pm

Hmm, maybe it is some minor bug, I am not sure. The best way is to report it: http://docs.joomla.org/How_do_you_report_a_bug%3F

User avatar
Soren Jensen
Joomla! Explorer
Joomla! Explorer
Posts: 290
Joined: Fri Nov 11, 2005 8:53 am
Location: Granada, Spain
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by Soren Jensen » Thu Feb 17, 2011 10:27 am

I am getting this too - was this bug ever reported?
Soren Beck Jensenhttp://www.component-creator.com/ - Build Joomla Components fast and easy

User avatar
Leftfield
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4438
Joined: Fri Dec 08, 2006 3:33 am
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by Leftfield » Thu Feb 17, 2011 1:18 pm

No, it isn't reported yet.

User avatar
Leftfield
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4438
Joined: Fri Dec 08, 2006 3:33 am
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by Leftfield » Thu Feb 17, 2011 1:30 pm

Mod Edit: Moved from SEO Forum.

cyberpasta
Joomla! Intern
Joomla! Intern
Posts: 81
Joined: Fri Feb 20, 2009 12:30 am

Re: Undefined Index issues with SEF URLs enabled

Post by cyberpasta » Fri Apr 15, 2011 10:14 am

I get that notice when there is a link to an article inserted using article editor button and the article is being viewed outside com_content (in my case in community builder profile). Through that button the link inserted is no formated using JRoute nor ContentHelperRoute and hasn't a menu item attached. If you follow the link you go to the correct article but the link is different depending where you are viewing it.

I've made overrides for three core files and the problem is totally fixed:

File: administrator/components/com_content/models/articles.php Line 158, added select the category_alias.

Code: Select all

$query->select('c.title AS category_title,a.alias as category_alias');
File: administrator/components/com_content/views/articles/tmpl/modal.php
- Import ContentHelperRoute class
- In the foreach loop, the onclick function is now:

Code: Select all

onclick="if (window.parent) window.parent.<?php echo $function;?>('<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->id.':'.$item->article_alias,$item->catid.':'.$item->category_aliase)); ?>', '<?php echo $this->escape(addslashes($item->title)); ?>');"
File: plugins/editors-xtd/article/article.php, the javascript function is now:

Code: Select all

		$js = "
		function jSelectArticle(article_route, title, object) {
			var tag = '<a href='+'\"'+article_route+'\">'+title+'</a>';
			jInsertEditorText(tag, '".$name."');
			SqueezeBox.close();
		}";

Anubis69
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Mar 13, 2007 7:28 am

Re: Undefined Index issues with SEF URLs enabled

Post by Anubis69 » Thu May 26, 2011 6:45 pm

I also use community builder 1.4 on Joomla 1.6 and have php5.3 with host.
Also have this problem but noticed that this only occures when you add the administrator or super user to this member list.
The other member profiles (registred users) dont have this problem.
I tryed to add the administrator to the registred group but still the same error above the profile page.

So as long the administrator is not in this list you will not have problems for now i think?

raustin1
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Oct 20, 2010 2:19 pm
Location: Notre Dame, IN
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by raustin1 » Fri Nov 18, 2011 7:32 pm

Has this made its way into the bug tracker? I'm having the issue with Joomla 1.7.3

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Undefined Index issues with SEF URLs enabled

Post by infograf768 » Sat Nov 19, 2011 6:43 am

I do not remember seing this issue in bug tracker.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

User avatar
jkor
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Fri Nov 25, 2011 8:42 am

Re: Undefined Index issues with SEF URLs enabled

Post by jkor » Mon Feb 27, 2012 12:29 pm

Anyone found a solution this one?
I have a similar notice on a J2.5 site that also reporte Error 413 Request Entity Too Large..
Notice: Undefined index: view in /customers/2/3/a/jkwebdesign.no/httpd.www/components/com_content/router.php on line 48

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Undefined Index issues with SEF URLs enabled

Post by infograf768 » Mon Feb 27, 2012 3:07 pm

A 413 is a different error from the one noted in the beginning of this post.
It is usually related to a webserver issue.

As for http://forum.joomla.org/viewtopic.php?f ... 2#p2475291

The code has changed alot since 1.6.0 and we just corrected again to get the right urls when using the Article button (this last chnage will be available in 2.5.2)
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

petsoukos
Joomla! Intern
Joomla! Intern
Posts: 53
Joined: Tue Sep 01, 2009 2:04 pm
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by petsoukos » Fri Aug 24, 2012 12:08 pm

What is the ordering in the $segments array when you develop a custom component? Does it have to do with the order the URI is processed? Does task come first then view?

Sorry for resurrecting this old post...

User avatar
AndyGaskell
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Fri Oct 31, 2008 3:12 pm
Location: Aberdeen
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by AndyGaskell » Thu Oct 10, 2013 9:20 am

Just curious, has anyone seen this, or anything similar in Joomla 3.x?

I'm occasionally getting...
Notice: Undefined index: view in /<mypath>/components/com_content/router.php on line 59

Joomla! 3.1.5
PHP Version 5.4.20
Use URL rewriting - yes
Search Engine Friendly URLs - yes

I did see an old bug on the bugsquad mailing list at...
https://groups.google.com/forum/#!topic ... AcpFO0FOHA
...but that is years old, so probably not relevant.
My work: http://www.ssofb.co.uk.
Twitter: https://twitter.com/AndyGasman.
I'm a programmer at Software Systems: Open For Business in Aberdeen Scotland doing LAMP web development.

JenOhl
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Nov 30, 2013 9:35 am

Re: Undefined Index issues with SEF URLs enabled

Post by JenOhl » Sat Nov 30, 2013 9:41 am

Hey Andy

did you find a solution?

I just have the same problem:

If I turn on SEF I receive an error
"Notice: Undefined index: view in C:\xampp\htdocs\[mypage]\components\com_content\router.php on line 59"

on a page that is (with SEF off)
"http://localhost/[mypage]/index.php?opt ... Itemid=515"

Someone any idea?

Regards
Jens

User avatar
AndyGaskell
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Fri Oct 31, 2008 3:12 pm
Location: Aberdeen
Contact:

Re: Undefined Index issues with SEF URLs enabled

Post by AndyGaskell » Sat Nov 30, 2013 8:57 pm

Hi Jens

I think, for me, this issue just went away. It is hard to say, as it was intermittent anyway. It may have been resolved by a Joomla update, a change in file permissions or something else. I got it whilst developing a site, so the set-up and code were changing daily. I'd not seen it on any other site, or seen it since.

Are you using 3.2? If you're on 3.1 like I was then, I'd say it is worth updating. On the same site I hit a bug, http://joomlacode.org/gf/project/joomla ... m_id=31036 and that was resolved by the 3.2 update, though I think that is unrelated to this one.

Sorry not to be able to better help.

Andy
My work: http://www.ssofb.co.uk.
Twitter: https://twitter.com/AndyGasman.
I'm a programmer at Software Systems: Open For Business in Aberdeen Scotland doing LAMP web development.

JenOhl
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sat Nov 30, 2013 9:35 am

Re: Undefined Index issues with SEF URLs enabled

Post by JenOhl » Thu Dec 05, 2013 1:37 pm

Hi Andy,

thx for your answer. I just re-created the affected sites and the error went away, too. But as you suggest I should better update to 3.2.

Regards
Jens

amns
Joomla! Intern
Joomla! Intern
Posts: 93
Joined: Thu Oct 15, 2009 11:20 am

Re: Undefined Index issues with SEF URLs enabled

Post by amns » Fri Dec 06, 2013 3:12 pm

I recently upgraded my website to joomla 3.2, and when I create a new menu item with a link to an article,
I get also this error:
Notice: Undefined index: view in /home/www/components/com_content/router.php on line 49
When I disable SEF URLs, it disappaers, but then I receive another error:
404 - Article not found
for the URL: ../index.php?option=com_content&view=article&id=167&Itemid=704&lang=en

Any help on this?

Thanks

Simbudd
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Feb 25, 2014 12:33 am

Re: Undefined Index issues with SEF URLs enabled

Post by Simbudd » Tue Feb 25, 2014 12:40 am

Recreating the sites worked for me too.

User avatar
konczal
Joomla! Explorer
Joomla! Explorer
Posts: 271
Joined: Mon Mar 13, 2006 9:35 pm
Location: New Jersey, US

Re: Undefined Index issues with SEF URLs enabled

Post by konczal » Thu Apr 09, 2015 7:46 pm

We are seeing a similar error in Joomla! 3 web sites. On our sites the error is:

PHP Notice: Undefined index: view in /mnt/devel_web/cms/[SITE-DIRECTORY]/components/com_content/router.php on line 70

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: Undefined Index issues with SEF URLs enabled

Post by infograf768 » Fri Apr 10, 2015 7:02 am

konczal wrote:We are seeing a similar error in Joomla! 3 web sites. On our sites the error is:

PHP Notice: Undefined index: view in /mnt/devel_web/cms/[SITE-DIRECTORY]/components/com_content/router.php on line 70
Are you using 3.4.1? If not, please update.
also please post version 3.x issues in the 3.x forums.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group


Locked

Return to “Joomla! 2.5 Bug Reporting”