OpenGraph Plugin has a mysql error for some article urls

OpenGraph Plugin has a mysql error for some article urls

I am using Joomla 3.8.1 and JFBConnect 7.2.2. This error happened in previous versions of Joomla and JFBConnect as well.

Google has been reporting some weird urls to me lately like:

www.example.com/component/content/article?id=103:article-alias

I have menu items setup for these pages which work. Anyways that is beside the point because this above url on my site returns a 500 error (see below for call stack). Looking at the code it looks like it is the function isValidArticle for one of your plugins is failing.

For some reason it is determining that the id of the article is 'article' which is causing the error. For now I have added the following code in the function to get around the error:

Code:

if ($id == 'article') { return false;}

Can you please look into this error and post a proper fix.

Thanks

Tom


Unknown column 'article' in 'where clause'

Call stack
#     Function     Location
1     ()     JROOT\libraries\joomla\database\driver\mysqli.php:650
2     JDatabaseDriverMysqli->execute()     JROOT\libraries\joomla\database\driver.php:1652
3     JDatabaseDriver->loadObject()     JROOT\plugins\opengraph\content\content.php:226
4     plgOpenGraphContent->isValidArticle()     JROOT\plugins\opengraph\content\content.php:47
5     plgOpenGraphContent->findObjectType()     JROOT\libraries\sourcecoast\openGraphPlugin.php:82
6     OpenGraphPlugin->onOpenGraphAfterDispatch()     JROOT\libraries\joomla\event\event.php:70
7     JEvent->update()     JROOT\libraries\joomla\event\dispatcher.php:160
8     JEventDispatcher->trigger()     JROOT\libraries\src\Application\BaseApplication.php:108
9     Joomla\CMS\Application\BaseApplication->triggerEvent()     JROOT\plugins\system\jfbcsystem\jfbcsystem.php:153
10     plgSystemJFBCSystem->onAfterDispatch()     JROOT\libraries\joomla\event\event.php:70
11     JEvent->update()     JROOT\libraries\joomla\event\dispatcher.php:160
12     JEventDispatcher->trigger()     JROOT\libraries\src\Application\BaseApplication.php:108
13     Joomla\CMS\Application\BaseApplication->triggerEvent()     JROOT\libraries\src\Application\SiteApplication.php:199
14     Joomla\CMS\Application\SiteApplication->dispatch()     JROOT\libraries\src\Application\SiteApplication.php:233
15     Joomla\CMS\Application\SiteApplication->doExecute()     JROOT\libraries\src\Application\CMSApplication.php:267
16     Joomla\CMS\Application\CMSApplication->execute()     JROOT\index.php:49

Edited by: eSilverStrike - Oct-12-17 10:34:12
eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Is anyone looking into this issue?

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

I have read the thread and was planning on trying to recreate the issue on my test site. If you could answer these questions, it'd help:

* Are you using an extension for SEF routing like SH404 or are you just using standard SEF settings in Joomla 3.8 to add the alias to the URL?
* Are you using any extensions such as JReviews that use the Joomla article system? We've had some conflicts in the last few Joomla versions related to this.
* Are there any other Open Graph plugins enabled on your site?

In thinking through this more, that URL is definitely invalid. JFBConnect may be able to handle it better if a completely wrong article URL is generated, however, we'd highly recommend investigating where that URL is being generated in the first place. Usually Google will show the 'referrer' page which is where the link is being used. I'd investigate that referring page to figure out where the wrong URL with id=103:article-alias is being created and diagnose how to fix that. That way, bad URLs aren't being created in the first place. I don't think the bad URLs are being created by JFBConnect in the first place, our extension may just be having a hard time processing them.

-Melissa

Want to stay up-to-date on new releases and development efforts?
Follow us on Twitter @sourcecoast and @mandreae

mel
Melissa
useravatar
Offline
3502 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Thanks Mel.

I am using the latest version of JReviews with the JReviews SEF plugin along with the regular Joomla SEF plugin.

The JFB Connect Open Graph plugin is the only one enabled (The JReviews one is disabled).

No I agree that JFBConnect is not generating the url. I am not sure where it is coming from. Google search console reports that it is being linked from itself (It just lists the same url). I have even seen this type of url being listed in the search results.

This is one thing the REALLY frustrates me about Joomla. They have too many ways of generating a url for a page AND canonical tags do not work. The canonical tags for articles always just repeat what the url is and not what the preferred url should be for accessing the page (for example the menu item). This has been a problem for years and I do not understand why it has not been fixed or why other Joomla web admins are not up in arms about this. Duplicate content is a major issue to Google and canonical tags are way to solve this. (end of rant :-)

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Any word on this issue? Where you able to reproduce it?

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

We're having difficulties installing the latest version of jReviews. We have an earlier version that was meant for Joomla 3.7 but can't seem to get our license to work with Joomla 3.8.

If we test with the Open Graph - Content plugin enabled on a site without jReviews installed, we get a standard 404 error. That seems to indicate that there's some conflict between jReviews itself and our plugin.. and possibly jReviews is the cause. We'll try to investigate, but jReviews is encrypted, as you probably know, which means we may not be able to fully diagnose this on our own.

With that said, if you can Private Message us FTP credentials for your site along with admin credentials for the backend, we'll gladly try to take a look to investigate further on your site. You can PM me by clicking the mail icon under my name to the left.

Thanks,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23659 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Thanks, PM sent.

Surprised you got a 404 error. When I tried on the latest build of Joomla (using just the sample data I didn't get a 404 error.

I also am currently having this issue: https://www.sourcecoast.com/forums/jfbc … a-381-upda

Not sure if you want to double check anything regarding that while you are on my site but I will respond about the other issue in its forum topic.

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Surprised you got a 404 error. When I tried on the latest build of Joomla (using just the sample data I didn't get a 404 error.

What do you get? I'm assuming if you don't get a 404 error, then you're getting the 500 error since the page doesn't actually exist?

Just trying to understand the differences between what you see and what we get when we test on a bare Joomla site.

Thanks,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23659 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

I sent you a private message with my site and login details so you can see, didn't you get it?

I was getting a SQL error and when I added the code to fix the sql error it then goes to the listing. (not my preferred URL as I have no idea how google found it). Maybe it is the JReviews SEF plugin rerouting it? When I tried the weird url the demo site on JReviews it does take me to the listing as well (no error).

I tested on my bare bone Joomla site (the latest in the Joomla repository so it is newer than Joomla 3.8.1) the url didn't produce a 404 error. It went to the article page
.

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Hi Alex,

Have you been able to look at the issue yet on my site from the PM I sent you?

Thanks

Tom

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Alright.. so first off, we tested again while using our brains, and we're not getting a 404 error. I blindly copied the relative URL you posted above into my Joomla 3.8 site and yeah, of course it gave a 404 error. When testing with a real article in the default Joomla install and adding any SEF alias, like id=3:some-crazy-alias, the page loads properly without any errors.

I logged into the admin area of your site to understand more as well as tried some modifications through FTP to debug things. However, none of the changes I made through FTP had any effect. For example, in the opengraph/content/content.php file, I added the following in the findObjectType function:

Code:

            print_r($queryVars);exit;

That should print things out and exit further execution.. leaving a blank white page with whatever is in $queryVars. Unfortunately, the page loaded as if nothing changed.

Do you have some sort of caching or other feature on the site that would be skipping the changes I'm making? Without being able to debug and diagnose things, there's not much headway I can make to even reproduce the error. What I was hoping to do was:
* Remove the line of code you implemented
* Verify the error happened
* Turn of SEF on the site. Check if the error goes away
* If so, then re-enable SEF and start disabling parts of JReviews to see if that fixed the problem
* If the problem goes away, it means there's some interaction with jReviews specifically causing the problem. We may need to get them involved to help fix or help get our subscription upgraded.. as noted though, JReviews is encrypted so there may be only a limited amount we could do to fix it.

Feel free to try the above or help us understand how to make changes in FTP apply.

Thanks,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23659 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

I only have the Joomla cache plugin enabled which clearing the cache should have rerun the php pages. I have disabled the plugin for now while we test.

I also commented out my change so you should see the error now. I'll PM you a link to a regular blog post (not a JReviews Listing (which is also an article) that will produce the error.

I also turned off the Joomla SEF plugin and JReviews SEF plugin (just temporarily cuz the site needs them active) and the error was still produced.

Tom

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Any word on this?

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Bump

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

We just had some time to investigate this further. I'm still unsure why or how that URL is being generated, but here's what we've found.

On the URL with an id=article, these are the query parameters that Joomla is finding:

Code:

Array ( [id] => article [option] => com_content [Itemid] => [view] => article )

On the correct article, the parameters are:

Code:

Array ( [Itemid] => 158 [option] => com_content [view] => article [id] => 284 [catid] => 20 )

Obviously, that id should be a number and not 'article', as you noted above.

The preferred solution that we've come up with is similar to yours but to do the following check:

Code:

        if (!is_int($id))

            return false;

That will solve the issue if any other word comes in, not just 'article'.

We'll include a similar fix in the next release of JFBConnect. I hope that helps get things going for you, but if you need anything else, just let us know.

Thanks,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23659 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

Thanks for looking into the issue and including the fix.

eSilverStrike
useravatar
Offline
31 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: OpenGraph Plugin has a mysql error for some article urls

I've checked the new code in for the next release. If you encounter the error again or any similar problems, please let us know.

-Melissa

Want to stay up-to-date on new releases and development efforts?
Follow us on Twitter @sourcecoast and @mandreae

mel
Melissa
useravatar
Offline
3502 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11407
Total Polls:
0
Total Posts:
48071
Posts today:
2
User Info
 
Total Users:
47248
Newest User:
kafeti
Members Online:
1
Guests Online:
922

Online: 
relso
Social Stream
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program