{"action":"created","issue":{"url":"https://api.github.com/repos/aelvan/Preparse-Field-Craft/issues/36","repository_url":"https://api.github.com/repos/aelvan/Preparse-Field-Craft","labels_url":"https://api.github.com/repos/aelvan/Preparse-Field-Craft/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/aelvan/Preparse-Field-Craft/issues/36/comments","events_url":"https://api.github.com/repos/aelvan/Preparse-Field-Craft/issues/36/events","html_url":"https://github.com/aelvan/Preparse-Field-Craft/issues/36","id":321214962,"node_id":"MDU6SXNzdWUzMjEyMTQ5NjI=","number":36,"title":"Matrix query working in templates but not in preparse field.  ","user":{"login":"shornuk","id":2061819,"node_id":"MDQ6VXNlcjIwNjE4MTk=","avatar_url":"https://avatars1.githubusercontent.com/u/2061819?v=4","gravatar_id":"","url":"https://api.github.com/users/shornuk","html_url":"https://github.com/shornuk","followers_url":"https://api.github.com/users/shornuk/followers","following_url":"https://api.github.com/users/shornuk/following{/other_user}","gists_url":"https://api.github.com/users/shornuk/gists{/gist_id}","starred_url":"https://api.github.com/users/shornuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shornuk/subscriptions","organizations_url":"https://api.github.com/users/shornuk/orgs","repos_url":"https://api.github.com/users/shornuk/repos","events_url":"https://api.github.com/users/shornuk/events{/privacy}","received_events_url":"https://api.github.com/users/shornuk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-08T14:38:48Z","updated_at":"2018-07-27T09:29:40Z","closed_at":null,"author_association":"NONE","body":"Hi, \r\nThink I've found an issue. \r\n\r\nI have a simple template query for a matrix field. \r\nQueries like the following work in the templates\r\n```\r\n{{ entry.matrixField.matched('1').total() }}\r\n{{ entry.matrixField.matched('not 1').total() }}\r\n```\r\n\r\nObviously I'm trying to get the total matrix rows that match the criteria  (`matched` field is a lightswitch field)\r\nRunning this in a Preparse field doesn't work. Am I doing something wrong?"},"comment":{"url":"https://api.github.com/repos/aelvan/Preparse-Field-Craft/issues/comments/408365577","html_url":"https://github.com/aelvan/Preparse-Field-Craft/issues/36#issuecomment-408365577","issue_url":"https://api.github.com/repos/aelvan/Preparse-Field-Craft/issues/36","id":408365577,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODM2NTU3Nw==","user":{"login":"carlcs","id":7516543,"node_id":"MDQ6VXNlcjc1MTY1NDM=","avatar_url":"https://avatars1.githubusercontent.com/u/7516543?v=4","gravatar_id":"","url":"https://api.github.com/users/carlcs","html_url":"https://github.com/carlcs","followers_url":"https://api.github.com/users/carlcs/followers","following_url":"https://api.github.com/users/carlcs/following{/other_user}","gists_url":"https://api.github.com/users/carlcs/gists{/gist_id}","starred_url":"https://api.github.com/users/carlcs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlcs/subscriptions","organizations_url":"https://api.github.com/users/carlcs/orgs","repos_url":"https://api.github.com/users/carlcs/repos","events_url":"https://api.github.com/users/carlcs/events{/privacy}","received_events_url":"https://api.github.com/users/carlcs/received_events","type":"User","site_admin":false},"created_at":"2018-07-27T09:29:39Z","updated_at":"2018-07-27T09:29:39Z","author_association":"CONTRIBUTOR","body":"@wbrowar is this a typo in your example, because in the Craft 3 version the entry being saved is available via a variable named `element`?\r\n\r\nThe issue you’re running into is that applying params to an element query object isn’t cloning the element any more in Craft 3. So you need to clone the object yourself, otherwise you’re overriding the Matrix blocks set to be saved.\r\n\r\n```{{ clone (entry.matrixField).type('fieldTypeHandle').count() }}```\r\n\r\n@shornuk you on Craft 3 as well?\r\n\r\n"}}
{"actor":{"display_login":"carlcs"}}