Invalid argument supplied for foreach()

14 years 8 months ago #5144 by Greg
Hello,

as I don't really know if this is exactly SefAdvance related, I just ask it here, to know...

When the request link is for a category but with a wrong article call:
/news/hardware/-2005042930.html

the right category is return (header200) but without any article inside, only the pagenavigation instead.
Also the canonical link in this case is the same link of the page:
/news/hardware/-2005042930.html
But it should be the good link of the category:
news/hardware.html

And my error log , in this case tell me this:

PHP Warning:  Invalid argument supplied for foreach() in /home/www/client/www/components/com_content/models/category.php on line 339

And if we try this link:
news/hardware/
In this case, the category page is ok, and the canonical is ok too:
news/hardware.html

Thanks to consider

Joomla 3.4.3 / SefAdvance 1.8.0 / AJAX Register 1.8.8 / virtuemart 3.0.9.4 / PHP 5.4.43

Please Log in or Create an account to join the conversation.

14 years 5 months ago #5319 by Greg
Hi,

have you seen this one ?

Joomla 3.4.3 / SefAdvance 1.8.0 / AJAX Register 1.8.8 / virtuemart 3.0.9.4 / PHP 5.4.43

Please Log in or Create an account to join the conversation.

14 years 5 months ago #5320 by Saka
I don't understand. Why would you call wrong URLs like /news/hardware/-2005042930.html ?

Is such link generated anywhere?

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

14 years 5 months ago #5322 by Greg
Hi Emir,

This is because sometimes, google (for example) try to reach the url for a category, but he don't understand the url that missed the title.(I suppose)
So he probably consider the unique tag (-2005042930.html) as a parameter (?)


Joomla 3.4.3 / SefAdvance 1.8.0 / AJAX Register 1.8.8 / virtuemart 3.0.9.4 / PHP 5.4.43

Please Log in or Create an account to join the conversation.

14 years 5 months ago #5323 by Saka
Google should not visit an URL unless a link to it is posted somewhere. There are many examples where different, made-up URLs would produce warnings, both in combination with SEF and without it. SEF Advance can't possibly cover all of them. The main thing is that faulty links are not generated.

If this is a problem for you put a redirect in .htaccess or something.

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch