Topic-icon Url routing error

Active Subscriptions:

None
9 years 8 months ago #59486 by espkri
Url routing error was created by espkri
Hi.

I have problem on my site where urls starting with a digit is failing (404 page). The jReview team was running a debug and says the error is caused by jfbconnect. Could you take a look, and see if there is anything you could fix on your side.

Here is the debug info from the jReview team:

I was finally able to figure out why this doesn't happen on my site, but it does on yours. It's because the problem is caused by the JFBConnect System Plugin, not by the JReviews SEF Plugin. If you disable that plugin then it works. Unfortunately, it's not possible for us to provide a fix for this inside the JReviews SEF Plugin because that means making a compromise that would cause a lot of other issues for the rest of the clients, and this issue is specific to the use of this extension. I have a much older version of JFBConnect installed in localhost and the issue doesn't happen with that old version.

I narrowed down the issue to this line specifically inside the 'onAfterDispatch' event.

ftp://yyxx//plugins/system/jfbcsystem/jfbcsystem.php
Line 153: $app->triggerEvent('onOpenGraphAfterDispatch');

So looking further inside JFBC where that event is defined in the onOpenGraphAfterDispatch method

ftp://yyxx//libraries/sourcecoast/openGraphPlugin.php

The problem is that this line:

$url = $juri->toString();

Returns the URL as you see it in the browser URL and when JFBC tries to get the correct parameters from it, it can't because the JReviews SEF plugin has not run at this point and it thinks that 6 is the article ID.

So the fix would be to have that part of the code run only AFTER all router parse actions have already finished executing. Maybe the JFBC dev knows what he needs to do. In the mean time if you want a quick fix, that may have other negative consequences you can edit this file:

ftp://yyxx//plugins/system/jreviews_sef/jreviews_sef.php

$router->attachParseRule(array($JreviewsRouter, 'parseJReviews'), JRouter::PROCESS_AFTER);

And replace it with:

$router->attachParseRule(array($JreviewsRouter, 'parseJReviews'));

However, we are not able to make this change in our distribution of JReviews, because all the other bugs we fixed related to Joomla 3.6 depend on this.
The topic has been locked.
Support Specialist
9 years 8 months ago #59490 by alzander
Replied by alzander on topic Url routing error
Hmm... that's an interesting issue. Without seeing JReviews code, it's a little difficult to know the specific fix. One thing that I think may fix things for you, but also may have some unforeseen consequences, is the change below.

Please try editing the /plugins/system/jfbcsystem.php file. Around line 153, you'll see:
$app->triggerEvent('onOpenGraphAfterDispatch');
Move that about 10 lines lower into the onBeforeRender function, so that looks like:
public function onBeforeRender()
    {
        if (!JFactory::getApplication()->isAdmin() && JFactory::getDocument()->getType() == 'html')
        {
            $app->triggerEvent('onOpenGraphAfterDispatch');  <--- Add this

            if (JFactory::getUser()->authorise('jfbconnect.opengraph.debug', 'com_jfbconnect') && JFBCFactory::config()->get('facebook_display_errors'))
                JFBCFactory::addStylesheet('jfbconnect.css');

Please test and let me know if that fixes the issues with jReviews. The things to look out for in JFBConnect is that the Open Graph tags on your pages are still set correctly. The OG tags are what set how Facebook show show your page when it's shared in a Like or Share.

I hope that helps and please keep us posted on what you find.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 8 months ago #59493 by espkri
Replied by espkri on topic Url routing error
I tried the fix, but unfortuantly it was not working. I have attaced the error here:

File Attachment:


For now i have removed this line, and now i´m able to access url´s with a digit.
The topic has been locked.
Support Specialist
9 years 8 months ago #59529 by mel
Replied by mel on topic Url routing error
FYI, we have some code / proposed changes from the JReviews team that we will be looking into incorporating into JFBConnect. I will let you know when I have any updates / timeline for a bug fix release for this issue.

Another related forum thread: www.sourcecoast.com/forums/jfbconnect/jf...ws-jfbconnect#p59528
The topic has been locked.
Support Specialist
9 years 8 months ago #59540 by mel
Replied by mel on topic Url routing error
Please try the latest build for JFBConnect 7.0.4 which incorporates the changes from the JReviews team. Let us know if you continue to have the 404 issue afterwards.

-Melissa
The topic has been locked.
Active Subscriptions:

None
9 years 8 months ago #59542 by espkri
Replied by espkri on topic Url routing error
I´m sorry to inform you that the bug is still alive after updating to 7.0.4. Any url´s starting with a digit is being redirected to a 404 page.
The topic has been locked.
Support Specialist
9 years 8 months ago #59543 by mel
Replied by mel on topic Url routing error
Ok, thanks for letting me know so quickly. We will continue to look into the issue.
The topic has been locked.
Support Specialist
9 years 8 months ago #59567 by alzander
Replied by alzander on topic Url routing error
Can you give us the following details:
* An example URL from your site that throws a 404 error
* How that page is configured - JReviews review page, Joomla Content, etc
* What the actual article ID is for the page being displayed
* What SEF extension you are using, if any

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 8 months ago #59568 by espkri
Replied by espkri on topic Url routing error
Hi.

All url starting with a digit:
www.in2city.com/news/6-reasons-to-visit-biograd-na-moru (<- 404 error)
www.in2city.com/index.php?option=com_con...view=article&id=6274 (<- works)

Native Joomla Articles with Jreview (i use jReview for my blog/news articles)

No other SEF plugins then jReview

If i add the quickfix from jReview the url with digits starts working. I also works if i remove this line: $app->triggerEvent('onOpenGraphAfterDispatch');

Let me know if you need access to our site.
The topic has been locked.
Active Subscriptions:

None
9 years 8 months ago #59590 by espkri
Replied by espkri on topic Url routing error
Hi Alex,

I had to apply the quickfix from jreview to avoid seo issues. Let me know if you like to revert the changes if you like to run more debug on our site.
The topic has been locked.