V
V
Vitaly2019-05-03 13:35:39
MODX
Vitaly, 2019-05-03 13:35:39

Resources are not displayed, why?

I call the snippet like this

{'[email protected]_programs' | snippet : [
    'where' => '{ "localizator.key" : "' ~ ('localizator_key' | option) ~ '" }'
]}

everything works great. Resources are shown. Here are the logs
0.0005860: pdoTools loaded
0.0000181: xPDO query object created
0.0000300: Added TVs filters
0.0001791: Included list of tvs: img, filter, version
0.0001249: leftJoined localizatorContent as localizator
0.0001030: leftJoined modTemplateVarResource as TVimg
0.0001051: leftJoined modTemplateVarResource as TVfilter
0.0000989: leftJoined modTemplateVarResource as TVversion
0.0000119: Added selection of localizatorContent: modResource.*, localizator.*, modResource.id
0.0000041: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `img`
0.0000031: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `filter`
0.0000019: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `version`
0.0000079: Replaced TV conditions
0.0002079: Processed additional conditions
0.0003731: Added where condition: localizator.key=ru, 0=((`TVfilter`.`value` = '9') OR (`TVfilter`.`value` LIKE '9||%') OR (`TVfilter`.`value` LIKE '%||9||%') OR (`TVfilter`.`value` LIKE '%||9')), modResource.parent:IN(3,11), modResource.published=1, modResource.hidemenu=0, modResource.deleted=0, modResource.context_key=web
0.0000031: Replaced TV conditions
0.0000448: Sorted by modResource.menuindex, ASC
0.0001259: SQL prepared "SELECT modResource.*, localizator.*, modResource.id, IFNULL(`TVimg`.`value`, '') AS `img`, IFNULL(`TVfilter`.`value`, '') AS `filter`, IFNULL(`TVversion`.`value`, '') AS `version` FROM `revtyt_site_content` AS `modResource` LEFT JOIN `revtyt_localizator_content` `localizator` ON localizator.resource_id = modResource.id LEFT JOIN `revtyt_site_tmplvar_contentvalues` `TVimg` ON `TVimg`.`contentid` = `modResource`.`id` AND `TVimg`.`tmplvarid` = 1 LEFT JOIN `revtyt_site_tmplvar_contentvalues` `TVfilter` ON `TVfilter`.`contentid` = `modResource`.`id` AND `TVfilter`.`tmplvarid` = 2 LEFT JOIN `revtyt_site_tmplvar_contentvalues` `TVversion` ON `TVversion`.`contentid` = `modResource`.`id` AND `TVversion`.`tmplvarid` = 3 WHERE  ( `localizator`.`key` = 'ru' AND ((`TVfilter`.`value` = '9') OR (`TVfilter`.`value` LIKE '9||%') OR (`TVfilter`.`value` LIKE '%||9||%') OR (`TVfilter`.`value` LIKE '%||9')) AND `modResource`.`parent` IN (3,11) AND `modResource`.`published` = 1 AND `modResource`.`hidemenu` = 0 AND `modResource`.`deleted` = 0 AND `modResource`.`context_key` = 'web' )  ORDER BY modResource.menuindex ASC "
0.0008061: SQL executed
0.0000110: Rows fetched
0.0000129: Returning raw data
0.0000019: Tree was built
0.0000050: Start template tree
0.0002329: Created inline "modChunk" with name "cd463ca9083d47bad7a43913e14f356a"
0.0010509: Compiled Fenom chunk with name "modchunk/cd463ca9083d47bad7a43913e14f356a"
0.0018060: End template tree
0.0000942: Created inline "modChunk" with name "ec8b37039e04f67736f3a5fc52a12983"
0.0059452: Total time
10 485 760: Memory usage

But if I call the snippet like this,
{'[email protected]_programs' | snippet }
where is taken from the parameter sets, this parameter is set there so
{"localizator.key" :""}
that nothing is displayed. Here are the logs
0.0035720: pdoTools loaded
0.0000169: xPDO query object created
0.0000341: Added TVs filters
0.0003610: Included list of tvs: img, filter, version
0.0001290: leftJoined localizatorContent as localizator
0.0003340: leftJoined modTemplateVarResource as TVimg
0.0001030: leftJoined modTemplateVarResource as TVfilter
0.0001080: leftJoined modTemplateVarResource as TVversion
0.0000541: Added selection of localizatorContent: modResource.*, localizator.*, modResource.id
0.0000050: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `img`
0.0000038: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `filter`
0.0000019: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `version`
0.0000448: Replaced TV conditions
0.0003140: Processed additional conditions
0.0005212: Added where condition: localizator.key=ru, 0=((`TVfilter`.`value` = '9') OR (`TVfilter`.`value` LIKE '9||%') OR (`TVfilter`.`value` LIKE '%||9||%') OR (`TVfilter`.`value` LIKE '%||9')), modResource.parent:IN(3,11), modResource.published=1, modResource.hidemenu=0, modResource.deleted=0, modResource.context_key=web
0.0000041: Replaced TV conditions
0.0000472: Sorted by modResource.menuindex, ASC
0.0001979: SQL prepared "SELECT modResource.*, localizator.*, modResource.id, IFNULL(`TVimg`.`value`, '') AS `img`, IFNULL(`TVfilter`.`value`, '') AS `filter`, IFNULL(`TVversion`.`value`, '') AS `version` FROM `revtyt_site_content` AS `modResource` LEFT JOIN `revtyt_localizator_content` `localizator` ON localizator.resource_id = modResource.id LEFT JOIN `revtyt_site_tmplvar_contentvalues` `TVimg` ON `TVimg`.`contentid` = `modResource`.`id` AND `TVimg`.`tmplvarid` = 1 LEFT JOIN `revtyt_site_tmplvar_contentvalues` `TVfilter` ON `TVfilter`.`contentid` = `modResource`.`id` AND `TVfilter`.`tmplvarid` = 2 LEFT JOIN `revtyt_site_tmplvar_contentvalues` `TVversion` ON `TVversion`.`contentid` = `modResource`.`id` AND `TVversion`.`tmplvarid` = 3 WHERE  ( `localizator`.`key` = 'ru' AND ((`TVfilter`.`value` = '9') OR (`TVfilter`.`value` LIKE '9||%') OR (`TVfilter`.`value` LIKE '%||9||%') OR (`TVfilter`.`value` LIKE '%||9')) AND `modResource`.`parent` IN (3,11) AND `modResource`.`published` = 1 AND `modResource`.`hidemenu` = 0 AND `modResource`.`deleted` = 0 AND `modResource`.`context_key` = 'web' )  ORDER BY modResource.menuindex ASC "
0.0009179: SQL executed
0.0000072: Rows fetched
0.0000069: Returning raw data
0.0000012: Tree was built
0.0065210: Total time
10 485 760: Memory usage

As you can see from the logs, such lines disappear
0.0000050: Start template tree
0.0002329: Created inline "modChunk" with name "cd463ca9083d47bad7a43913e14f356a"
0.0010509: Compiled Fenom chunk with name "modchunk/cd463ca9083d47bad7a43913e14f356a"
0.0018060: End template tree
0.0000942: Created inline "modChunk" with name "ec8b37039e04f67736f3a5fc52a12983"

Tell me what the problem is and how to fix it so that it would be possible to set the where parameter in the "sets of parameters"

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question