• Home
  • Get help
  • Ask a question
Last post 36 min ago
Posts last week 82
Average response time last week 34 min
All time posts 68071
All time tickets 10515
All time avg. posts per day 20

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#1597 – 404 Error Page not displaying (sometimes)

Posted in ‘sh404SEF’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Monday, 04 January 2016 12:51 UTC
altitudes
Hello

On my site, sh404SEF is set to handle 404 error pages, but sometimes it does not (page with empty component area is displayed instead of expected page/itemid)

I really could not figure out when it is working and when not... At the time writting this message, the following URL is not working:
http://www.xxxx.fr/wrong/path
and this one is working:
http://www.xxxx.fr/presentation/wrong/path

Maybe you will have to test some other URLs.

I suppose you will need access to my site, how do I provide it to you?

Regards
Monday, 04 January 2016 13:01 UTC
wb_weeblr
Hi

Please note that the error page from sh404SEF seems to work fine in both cases.

http://www.xxxx.fr/presentation/wrong/path working means that Joomla is selecting an Itemid to display the error page (probably because "presentation" is matching one of your menu items)

http://www.xxxx.fr/wrong/path "not working" means Joomla doesn't find an Iitemid and so it defaults to using the home page template and modules, and your template probably removes the main "component" area on the home page.

Most likely, what you need to do is select an Itemid to display the error page, under the corresponding sh404SEF "Error page" tab of configuration.

Rgds
 
Monday, 04 January 2016 13:18 UTC
altitudes
Thanks for your reply.

Yes indeed, my template removes the component contents from the homepage. This is quite recent, and as I never had issues before on 404 error page, I suppose you have the right explanation.

Regarding your suggested solution, an itemid is already set in sh404SEF error page configuration, as you can see in the attached snapshot. This menu item is a "Single Article" menu.
Monday, 04 January 2016 14:45 UTC
wb_weeblr
Hi

OK, so your template is probably messing up more than that. Could you please provide us with superadmin credentials to your website. You can create a temporary account, and delete it afterwards, but it must have superuser level.

Thanks and regards
 
Monday, 04 January 2016 15:12 UTC
altitudes
There we go...

Username: xxxx
Password: xxxx
Monday, 04 January 2016 15:25 UTC
wb_weeblr
Hi

sh404SEF version 4.6.0???? please update.

You also had 2 languages published for your content (under the "Content" tab of Joomla language manager), which fools sh404SEF or other extensions thinking the site is multilingual. I disabled English just in case.

Rgds
 
Monday, 04 January 2016 16:20 UTC
altitudes
Sorry for that and thank you for setting languages.

I have updated sh404SEF and checked issue is still there (it is ;)
Monday, 04 January 2016 16:38 UTC
wb_weeblr
Hi

So this is your template causing this, all is fine with Joomla default templates. I'll try playing a bit with the templates settings, they very unfortunately tend to try do everything and the rest these days....
Rgds
 
Monday, 04 January 2016 17:55 UTC
wb_weeblr
Hi

Actually, after much digging, downloading a backup and debugging step by step, I found it's not the template. It's JFBConnect causing this (though I don't blame them entirely, the Joomla router is not doing a proper job there).

The full story is this:

- JFB has an OpenGraph plugin. This plugin is fired when the document is rendered, probably to insert OpenGraph meta data
- on line 214 of the file /components/com_jfbconnect/models/opengraphaction.php, they do:
$queryVars = $router->parse($juri);

This causes the Joomla router to reset the Itemid. So instead of using our 404 error page Itemid, JFBConnect causes the Itemid to be reset to the home page, and the content is not displayed.

This can be fixed by replacing the above code with, for instance:
$queryVars = JFactory::getApplication()->input->get->getArray();

which is the correct way according to Joomla API.

I wish I was not the one having to spend hours on debugging other people code :(

Rgds
 
Monday, 04 January 2016 19:58 UTC
altitudes
Thank you very much, sorry it took so much time to analyse :(

I have reported the issue to SourceCoast:
https://www.sourcecoast.com/forums/jfbconnect/jfbconnect-joomla-3x-support/11387-compatibility-issue-with-sh404sef-error-page-handling

Wait and see...
Tuesday, 05 January 2016 08:26 UTC
wb_weeblr
Hi

Please note this is NOT a compatibility issue with sh404SEF (contrary to your thread title there). It's a pure bug, they just should use the Joomla API.

Also, while debugging, I noticed that the mod_easysocial_login module is using pretty much the same code; it's not causing issues right now, due to the fact that modules are processed differently by Joomla, but it's a pretty common problem.

Rgds
 
Tuesday, 05 January 2016 09:07 UTC
altitudes
I'm just trying to be diplomatic ;)
Tuesday, 05 January 2016 09:37 UTC
wb_weeblr
Hi

I understand that, but in the end, because sh404SEF Is right in the middle of this, and "problem only appear when sh404SEF is enabled", publicly it always end up being sh404SEF fault.

When people start to understand that because the problem occurs when you enable sh404SEF doesn't mean at all that sh404SEF causes it, I will have made huge progress!

Rgds
 
Monday, 18 January 2016 11:24 UTC
altitudes
Hello

After some investigation, SourceCoast disagrees with you code change suggestion and says issue may be on sh404SEF side.

Can you please check that answer here (last message)? To make it short, the modified code introduced a regression in JFBCconnect (regression thread is linked in Alezander's message).

Can you tell me what you think? And maybe prepare an answer that I can post to their support forum?

Thank you

(I must say all this is a bit beyond my skills ;)
Monday, 18 January 2016 13:45 UTC
wb_weeblr
Hi

Indeed, here is what can be said. Please post this, and then suggest they contact me directly after that. But please post this publicly, as otherwise their version will be the public one:

It seems like sh404SEF is overriding the core-Joomla router, but not doing a full implementation.
nope, we do NOT override the core router. We follow Joomla API and only set up buildRules and parseRules.

However, we do a lot of work to get the information about the current route first and then we use the setVars() function to reset the router back to its previous state. sh404SEF's router seems to ignore the setVars call.
We do not ignore it. As per the above, you are actually calling Joomla original setVars() function, in Joomla router. This method is not modified or altered in any way by sh404SEF.

The problem is that calling setVars is NOT enough. It does reset (some) of the router state, but the router is unfortunately not "self-contained".When you do that, you only reset the router internal storage of variables, but you basically don't do anything else.
The problem is that the parse() method has side effects, external to the router itself:

$queryVars = $router->parse($juri);

This code actually reset the active menu in the Joomla menu object. In other words, you reset the current active menu globally for the whole app. Yes, Joomla should not to do that probably, but that's how it works. It's done in JRouterSite, in various locations:

if (isset($vars['Itemid']))
{
$this->menu->setActive($vars['Itemid']);
}

From reading your code, I understand the only you need is the current page query vars, which can be obtained safely through the Joomla API using:

$queryVars = JFactory::getApplication()->input->get->getArray();

I'm not sure what problem this very safe, read only method is causing to you. But I have spent quite some times stepping through the PHP code to be sure changing the currently active menu is causing the problem here.
As an alternate solution, maybe you could keep your current code, but in addition also reset the Itemid?

$router->setVars($origVars);
if(!empty($origVars['Itemid'])
{
JFactory::getApplication()->getMenu()->setActive($origVars['Itemid']);
}


Rgds

 
Monday, 18 January 2016 13:52 UTC
altitudes
OK, I will post this and add that a technical debate seems to be needed, and that they should contact you directly.

Maybe you can give an email I will give them in a private message?
Monday, 18 January 2016 14:06 UTC
wb_weeblr
Hi

Sure, they can talk to me at [email protected]

Regards
 
Wednesday, 20 January 2016 22:50 UTC
altitudes
Hello

SourceCoast says (still there) that they will work on this... when they have time.

In the meantime, I tried to use your last code suggestion (resetting Itemid). It does not seem to work... I still have an empty 404 error page. Would you please test it?

Thank you
Thursday, 21 January 2016 10:37 UTC
wb_weeblr
Hi

I still have an empty 404 error page. Would you please test it?
I'm sorry but this thread is entirely and totally solved for us. We spent several hours debugging another extension bugs, we found the bug, we provided a working solution to a bug in another extension. There are limits to being nice and fixing other people problems.

Rgds
 
Thursday, 21 January 2016 10:55 UTC
altitudes
Hello

I can understand that. But the last code change you suggested does not seem to work. They said this will be the first solution they will test when they have time, and I was also hoping that this would allow me to have a site working by the time they fix all this (if ever they do).

Maybe just a minor tuning is needed on this code (or maybe not), and I do not have the skills to investigate it. If you could spend just a few more minutes of your time to investigate why your suggested code is not working I would be thankful. If not that's OK too ;)

Note: I can give you access to my online dev site if you like, where you will be able to do whatever you want ;)
Thursday, 21 January 2016 11:35 UTC
wb_weeblr
Hi

But the last code change you suggested does not seem to work.
It was working very well for me, on the backup of your site I downloaded and used to debug.

I am talking about this, which is the only solution that complies with Joomla API:


$queryVars = JFactory::getApplication()->input->get->getArray();


Rgds

 
Friday, 05 February 2016 05:34 UTC
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.