getRelated Extra not Working

The GetRelated was working perfectly on my development site. As soon as I moved it to live It won’t find any related resources. I tried reinstalling the extra as well. Has anyone seen this issue? Mainly posting here to see if anyone has seen this issue before.

I know it’s a dated extra, but it normally works great.

[[getRelated?
&tplRow=`blogRelated-tpl`
&tplOuter=`blogRelatedOuter-tpl`
&fields=`pagetitle:3,introtext:2,tv.contentRelated:2`
]]

Modx 2.7.0
getRelated 1.2.0 (Only Version dated 2012)
I used ModxCloud to inject my snapshot directly into live site. They were both on same versions

Anything in the MODX error log?

So some pages work? If I navigate to blogs I know have related blogs, one may show, but the similar ones don’t. But this error repeats continuously. Not even sure it’s related.

[2019-04-02 14:10:22] (ERROR @ /paas/c2290/www/core/model/modx/modparser.class.php : 541) Could not find snippet with name 'id', '56d08402abe53d7819c30f69'],
         ['mark', 'firstbyte', (new Date()).getTime().

edit: This error shows on Dev site as well. However, the pages that don’t work on live site, do work on dev.

That error probably comes from something else; judging from the text “mark firstbyte”, it sounds like some RUM monitoring, perhaps you use Pingdom? It’s JavaScript code needs a space between the [[ at the start to not get evaluated as a snippet.

If it works on some, but not others, try adding debug=1 to the snippet call to get some debug information about what it’s looking for and finding.

I think this is a different type of issue that is going on. I will keep debugging. Thanks for your quick response though. I really like using your extras!

I was going to try and delete this thread because it was basically useless, but the new restriction won’t allow me to. Feel free if you want to remove for clutter reasons. :wink: Thanks Again!

You’re most welcome! :slight_smile:

Greetings,

My apologies for reactivating an old thread. I am trying to implement the getRelated extra for the first time, and am having problems. Essentially, the extra never finds any related pages.

Here is my snippet call:

[[getRelated?
	&parents=`8`
	&limit=`6`
	&fields=`tv.Product_Subject:8, description:4, introtext:1`
	&returnFields=`pagetitle`
	&returnTVs=`Product_Price, Product_Image`
	&tplOuter=`getRelated-Products-Outer-Tpl`
	&tplRow=`getRelated-Products-Row-Tpl`
	&debug=`1`
]]

And here is the error log:

[2022-06-02 09:53:31] (ERROR @ /home3/upcreek/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S22 executing statement: 
Array
(
    [0] => 42S22
    [1] => 1054
    [2] => Unknown column 'modResource. description' in 'where clause'
)

[2022-06-02 09:53:32] (ERROR @ /home3/upcreek/public_html/core/model/modx/modx.class.php : 1037) `[[+id]]` is not a valid integer and may not be passed to makeUrl()
[2022-06-02 09:53:32] (ERROR in resource 112 @ /home3/upcreek/public_html/core/model/modx/modparser.class.php : 1373) Bad link tag `[[~[[+id]]]]` encountered
[2022-06-02 09:53:32] (ERROR @ /home3/upcreek/public_html/core/model/modx/modx.class.php : 1037) `[[+id]]` is not a valid integer and may not be passed to makeUrl()
[2022-06-02 09:53:32] (ERROR in resource 112 @ /home3/upcreek/public_html/core/model/modx/modparser.class.php : 1373) Bad link tag `[[~[[+id]]]]` encountered
[2022-06-02 09:53:32] (ERROR @ /home3/upcreek/public_html/core/model/modx/modx.class.php : 1037) `[[+id]]` is not a valid integer and may not be passed to makeUrl()
[2022-06-02 09:53:32] (ERROR in resource 112 @ /home3/upcreek/public_html/core/model/modx/modparser.class.php : 1373) Bad link tag `[[~[[+id]]]]` encountered
[2022-06-02 09:53:32] (ERROR @ /home3/upcreek/public_html/core/model/modx/modx.class.php : 1037) `[[+id]]` is not a valid integer and may not be passed to makeUrl()
[2022-06-02 09:53:32] (ERROR in resource 112 @ /home3/upcreek/public_html/core/model/modx/modparser.class.php : 1373) Bad link tag `[[~[[+id]]]]` encountered

I don’t know what any of this means, so any help would be much appreciated.

I am on modx revo 2.8.4

Thank you!

Does it help if you remove the spaces from the &fields configuration? It seems there’s an extra space where there shouldn’t be in the query, maybe that’s where it’s coming from.

[[getRelated?
	&parents=`8`
	&limit=`6`
	&fields=`tv.Product_Subject:8,description:4,introtext:1`
	&returnFields=`pagetitle`
	&returnTVs=`Product_Price, Product_Image`
	&tplOuter=`getRelated-Products-Outer-Tpl`
	&tplRow=`getRelated-Products-Row-Tpl`
	&debug=`1`
]]

That does indeed help! Thanks Mark!

1 Like