<![CDATA[ error log is filling more since 2.6 - My Forums]]> https://forums.modx.com/thread/?thread=103871 <![CDATA[error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-558632
I upgraded from 2.56 to 2.5.8 then 2.6 then 2.6.3

I saw my modx error log getting filled by tons of new errors
including large part of the code of the pages whatever they are. And a few page not rendering as they should.

I notice a few clues about output modifers

I changed back optimized syntaxe into old one and this solved those rendering issues
[[!+myDocList:is=``:then=`[[*content]]`:else=`[[$marque-contenu-docs0]]`]]

[[[[-!+myDocList:is=``:
then=`*content`:
else=`$marque-contenu-docs0`]]]]


Regarding the error log after : some extract
 ... [2018-05-18 15:33:49] (ERROR @ /xxxxxxx/httpdocs/core/xpdo/om/xpdoquery.class.php : 764) Encountered empty IN condition with key id
[2018-05-18 15:33:49] (ERROR @ /xxxxxxxx/httpdocs/core/model/modx/modparser.class.php : 540) Could not find snippet with name #1.pagetitle.
[2018-05-18 15:33:49] (ERROR in resource 13 @ /xxxxxxxx/httpdocs/core/model/modx/modparser.class.php : 1373) Bad link tag `[[~]]` encountered
[2018-05-18 15:33:50] (ERROR @ /xxxxxxxxx/httpdocs/core/model/modx/modparser.class.php : 540) Could not find snippet with name #27.tv.footCol1.
[2018-05-18 15:33:50] (ERROR @ /xxxxxxxxxx/httpdocs/core/model/modx/modparser.class.php : 540) Could not find snippet with name #27.tv.footCol2.
[2018-05-18 15:33:50] (ERROR @ /xxxxxxxx/httpdocs/core/model/modx/modparser.class.php : 540) Could not find snippet with name #27.tv.footCol3.
[2018-05-18 15:33:50] (ERROR @ /xxxxxxxx/httpdocs/core/model/modx/modparser.class.php : 540) Could not find snippet with name #41.longtitle.
[2018-05-18 15:33:50] (ERROR @ /xxxxxxxx/httpdocs/core/model/modx/modparser.class.php : 540) Could not find snippet with name #72.longtitle.
[2018-05-18 15:33:50] (ERROR @ /xxxxxxxxx/httpdocs/core/model/modx/modparser.class.php : 540) Could not find snippet with name #74.longtitle.
]]>
elz064 May 18, 2018, 12:52 PM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-558632
<![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559086

[[If? &subject=`[[+modx.user.id]]` &operator=`EQ` &operand=`0` &then=`[[$call_Login]]`    &else=`[[!$qui-est-la]]` ]]



The exclamation point on the inner chunk tag will delay the processing of that tag, so the intended content won't be available when the If snippet runs. What the If snippet gets as an argument will likely be the tag itself which can blow up during error processing.

So, three options to stop that error:

1) No exclamation points -- should be fine unless the chunk is often being altered dynamically in code.
[[If? &subject=`[[+modx.user.id]]` &operator=`EQ` &operand=`0` &then=`[[$call_Login]]`    &else=`[[$qui-est-la]]` ]]


2) One Exclamation point -- Results will be up-to-date if chunk is up-to-date.
[[!If? &subject=`[[+modx.user.id]]` &operator=`EQ` &operand=`0` &then=`[[$call_Login]]`    &else=`[[$qui-est-la]]` ]]


2) Two exclamation points -- slows page loads but could be necessary on rare occasions:
[[!If? &subject=`[[+modx.user.id]]` &operator=`EQ` &operand=`0` &then=`[[$call_Login]]`    &else=`[[!$qui-est-la]]` ]]



]]>
BobRay Jun 14, 2018, 09:43 PM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559086
<![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559073
Quote from: BobRay at Jun 13, 2018, 09:21 PM
If I'm understanding you, everything is working fine except for the annoyance of the error log entries? Is that correct?
]]>
elz064 Jun 14, 2018, 06:47 AM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559073
<![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559063 BobRay Jun 13, 2018, 09:21 PM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559063 <![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559053
Quote from: BobRay at Jun 12, 2018, 09:47 PM
OK,

Just put this on a page that has a translated version and view it with different values for &resourceId:
<p>Babel gives this ID: [[!BabelTranslation? &contextKey=`[[*context_key]]` &resourceId=`27`]]</p>

and see if it gives you the correct resource ID (or anything at all).

This syntax is what is used since the site is online (2013)

Whatever I used,
Either your try with this:
 [[getTVValue? &docId=`[[BabelTranslation? &contextKey=`[[*context_key]]` &resourceId=`27`]]` &tv=`footCol2`]]
	 


Or this, that was the original code:
 
	  [[[[BabelTranslation? &contextKey=`[[*context_key]]` &resourceId=`27`]].tv.footCol2]]


Everything is correctly 'Babelized' (here and at every part of the site).

Quote from: BobRay at Jun 12, 2018, 09:47 PM

Just a thought. The context_key your sending is the one for the current resource. Is that what Babel wants?

Absolutely. Keep in mind this log issue came with Revo upgrades.

Quote from: BobRay at Jun 12, 2018, 09:47 PM

By the way, getResourceField snippet does not call the babel snippet directly. My code above calls the babel snippet with runSnippet() because that will usually avoid any problems caused by caching, nesting, and parsing order.
hmmm not sure to understand this...
]]>
elz064 Jun 13, 2018, 06:21 AM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559053
<![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559046
Just put this on a page that has a translated version and view it with different values for &resourceId:


<p>Babel gives this ID: [[!BabelTranslation? &contextKey=`[[*context_key]]` &resourceId=`27`]]</p>


and see if it gives you the correct resource ID (or anything at all).

Just a thought. The context_key your sending is the one for the current resource. Is that what Babel wants?

By the way, getResourceField snippet does not call the babel snippet directly. My code above calls the babel snippet with runSnippet() because that will usually avoid any problems caused by caching, nesting, and parsing order.

]]>
BobRay Jun 12, 2018, 09:47 PM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559046
<![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559029
Same issue, it comes from BAbel call]]>
elz064 Jun 11, 2018, 01:09 PM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559029
<![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559028
Blank return

]]>
elz064 Jun 11, 2018, 12:41 PM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6?page=2#dis-post-559028
<![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6#dis-post-559022
Thank you


I'll write you what it gave here.

]]>
elz064 Jun 11, 2018, 06:39 AM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6#dis-post-559022
<![CDATA[Re: error log is filling more since 2.6]]> https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6#dis-post-559003
Your tags are deeply nested, and all are called cached. You have a resource field tag, inside a snippet tag, inside another snippet tag, inside a chunk inside a content tag. I wouldn't expect them to work reliably. 

I would be inclined to try something like this, which should be faster and more reliable (notice the only snippet call is uncached):

[[!getTVValue? &docId=`27` &tv=`footCol2` &contextKey=`[[*context_key]]` ]]
/* getTVValue snippet */
$tvObj = $modx->getObject('modTemplateVar', array('name' => $tv));
$finalDocId = $modx->runSnippet('BabelTranslation', array('context_key' => $contextKey, 'resourceId' => $docId)));
return $tvObj->renderOutput($finalDocId);
I would first try it like this to see if it's returning the correct ID HTML
<p>DocId returned from BabelTranslation: [[!getTVValue? &docId=`27` &tv=`footCol2` &contextKey=`[[*context_key]]` ]]


Snippet
/* getTVValue (just one line)*/
return $modx->runSnippet('BabelTranslation', array('context_key' => $contextKey, 'resourceId' => $docId)));


If that works, switch to the code at the top.]]>
BobRay Jun 09, 2018, 06:07 PM https://forums.modx.com/thread/103871/error-log-is-filling-more-since-2-6#dis-post-559003