-
Notifications
You must be signed in to change notification settings - Fork 205
Cached and nested snippets not working in EVO 1.2 #1089
Comments
I am not a back-end Dev, but the question arises - do your custom snippets still use deprecated MYSQL functions, as 1.2 supports MYSQLI I have just checked my sites that have nested snippets, all of them work as expected. An example: I use "IF" in combination with Ditoo for IDs and other conditionals - all work perfectly OK |
Hi modxuser, thanks for your reply. No, the custom snippets in question don't make any database calls. Can you confirm that switching your cached [[Ditto? ... ]] call for a cached [!Ditto? ... !] call still works? |
I have since updated my nested "IF" calls with the new built-in modifiers, but changing the Ditto snippet call from cached to uncached doesn't make any difference, it all still works. |
@vinelandit Thank you for your information, I will fix it later |
always should be expand [!no-cache!] In the snippet call
This all ok But if change to [[Ditto not work ((( need normal work: |
This call will not work. Because it can not recognize the value nest. As with programming with PHP, you need to use different quotes.
For example, write like these. |
But all this work on 1.1
Its work from 1.0.9 or 1.0.8
And this big problem for update.
Need or fixed or write what need do.
Отправлено с iPhone
… 13 дек. 2016 г., в 23:35, yamamoto ***@***.***> написал(а):
&year=`[[date_filter? &type=`year`]]`
This call will not work. Because it can not recognize the value nest. As with programming with PHP, you need to use different quotes.
&year="[[date_filter? &type='year']]"
For example, write like this.
By changing the specification like this, it is now possible to include characters such as " = ? & ` " in the value.
But it may be improved further. I will think about it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
ok, I will fix it later |
with [[ [[ work but with [! [! still not work but i newer used [! [! i think now all ok and can close |
@yama 10 is not too small? upd. deleted (a wrong determination of the perpetrator .. looking for.. ) |
Founded:
not work more - give error "Nesting level too deep" |
It's possible, but it is maybe bug. Wait a moment. |
maybe fix |
it's kind of helped .. |
immediately I do not quite understand this block, but in the call the snippet may be missing ` in values, and settings can be & and & |
Question. How does this work? I thought it was a magical snippet call. |
here is meant commented out |
Comment out? That's an interesting idea. |
7a2d630 |
new trouble:
after update MODX get "Illegal value of... "
|
Easily rewritten and tried it, but the problem did not happen. Are there other hints? |
Does this reproduce the problem? |
when I delete accidentally nonessential (skiped) deleted tilde
the problem temporarily solved the method proposed above (return array() instead exit |
Is it related to the nesting of snippet calls? |
I think yes, snippet [[If]] should not call nested Ditto, if the condition does not match |
But snippet-rendering works recursive from inside to outside, means "snippetIn" will always be rendered before snippetOut to provide a result (for example when using ¶m=[[ultimateParent]] you need a result first).
To get around this ¶m must be able to accept a chunk with snippetIn inside, which will only get parsed by snippetOut if true.
|
I think in this case it is necessary to solve both ways
|
evolution/manager/includes/document.parser.class.inc.php Lines 932 to 937 in 90d3cdc
Maybe these lines are unnecessary. Because nest processing is done in $modx->getParamsFromString() . |
document.parser.class.inc.zip |
660163d |
Found new nest pattern
Not work |
test this:
[[if?
&is=`1:not:2`
&then=`
[[if? &is=`1:not:3` &then=`
[[if?
&is=`1:is:4`
&then=`aaa`
&else=`ccc`
]]
`]]
`
&else=`bbb`
]]
От 26 декабря 2016 г. в 12:23:23, yamamoto (notifications@github.com)
написал:
[[if?
&is=`1:not:2`
&then=`
[[if? &is=`1:not:3` &then=`
[[if?
&is=`1:is:4`
&then=`aaa`
]]
`]]
`
&else=`bbb`
]]
|
It's work. |
if not use ccc. nothing to show )
От 26 декабря 2016 г. в 12:36:22, yamamoto (notifications@github.com)
написал:
It's work.
But, remove "&else=`ccc`” will malfunction
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1089 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAo3M5teahS6Kvc47nvHYfREnUgi7wZmks5rL5ikgaJpZM4LJAxj>
.
|
In fact, a broken character string "aaa`]]`]] "is output. I think this is a malfunction of parser. |
What is the issue? For me it seems to be working correct. I get result "bbb" for
|
before update after update to last version on git not work |
Is this a code that does not work? |
Tested all ok [[if? &is= [!if? &is= [[if? &is= [[if? &is= [!if? &is= on new parser yes |
a) Snippets called in [!snippetName!] format are not parsed, and just return the literal [[snippetName]] (replacing the [!!] brackets with [[]])
b) Nested snippets in alternating cached/uncached format, i.e. [!outerSnippet? ¶m='[[innerSnippet]]'!] are not parsed, and nested snippets using uncached format throughout throw a MySQL error.
(Backticks replaced with quotes in sample calls to avoid being marked up)
Example call:
[[Ditto? &documents='[[getVal? &docid='1' &field='featurePanel1']]' &tpl='homePanel' &extenders='summary' &truncLen='180' &truncOffset='90' ]]
Example error (similar error occurs when the inner snippet is called in uncached format, and the whole call unparsed and returned literally when the outer snippet is in uncached format):
« MODX Parse Error »
Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[[getVal?&docid=) AND sc.published=1 AND sc.deleted=0) AND (sc.privateweb=0) GRO' at line 1
SQL > SELECT DISTINCT sc.id FROM 'ajfadmin_modx'.'modx_site_content' sc LEFT JOIN 'ajfadmin_modx'.'modx_document_groups' dg on dg.document = sc.id WHERE (sc.id IN ([[getVal?&docid=) AND sc.published=1 AND sc.deleted=0) AND (sc.privateweb=0) GROUP BY sc.id
Error information
Current Snippet Ditto ... etc.
The text was updated successfully, but these errors were encountered: