{"action":"created","issue":{"url":"https://api.github.com/repos/Bruno17/MIGX/issues/252","repository_url":"https://api.github.com/repos/Bruno17/MIGX","labels_url":"https://api.github.com/repos/Bruno17/MIGX/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/Bruno17/MIGX/issues/252/comments","events_url":"https://api.github.com/repos/Bruno17/MIGX/issues/252/events","html_url":"https://github.com/Bruno17/MIGX/issues/252","id":136358746,"number":252,"title":"issue with modx operators after editing existing migx feilds","user":{"login":"scorchsoft","id":10031309,"avatar_url":"https://avatars.githubusercontent.com/u/10031309?v=3","gravatar_id":"","url":"https://api.github.com/users/scorchsoft","html_url":"https://github.com/scorchsoft","followers_url":"https://api.github.com/users/scorchsoft/followers","following_url":"https://api.github.com/users/scorchsoft/following{/other_user}","gists_url":"https://api.github.com/users/scorchsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/scorchsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scorchsoft/subscriptions","organizations_url":"https://api.github.com/users/scorchsoft/orgs","repos_url":"https://api.github.com/users/scorchsoft/repos","events_url":"https://api.github.com/users/scorchsoft/events{/privacy}","received_events_url":"https://api.github.com/users/scorchsoft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-25T11:21:32Z","updated_at":"2016-02-25T13:30:48Z","closed_at":null,"body":"If you add a new feild to a migx TV within form tabs, and you try to run an opperator on that new feild then migx fails to display or process those chunks correctly. You have to manually open every single migx item on every single page and re-save it.\r\n\r\nFor example if we went started with this and added a few resources that use the migx TV and have a few rows set for it:\r\n```\r\n[\r\n\t{\r\n\t  \"formname\":\"block-general\",\r\n\t  \"formtabs\":[\r\n\t\t{\r\n\t\t\t\"caption\":\"Our Work Items\", \r\n\t\t\t\"fields\": [\r\n\t\t\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\"field\":\"feild01\",\r\n\t\t\t\t\t\"caption\":\"Our Work Title\",\r\n\t\t\t\t\t\"inputTV\":\"migxInput\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t  ]\r\n\t}\r\n] \r\n```\r\n\r\nAnd then at some point in the future we change it to add feild02:\r\n```\r\n[\r\n\t{\r\n\t  \"formname\":\"block-general\",\r\n\t  \"formtabs\":[\r\n\t\t{\r\n\t\t\t\"caption\":\"Our Work Items\", \r\n\t\t\t\"fields\": [\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\"field\":\"feild01\",\r\n\t\t\t\t\t\"caption\":\"Our Work Title\",\r\n\t\t\t\t\t\"inputTV\":\"migxInput\"\r\n\t\t\t\t},\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\"field\":\"feild02\",\r\n\t\t\t\t\t\"caption\":\"Our Work Title\",\r\n\t\t\t\t\t\"inputTV\":\"migxInput\"\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t  ]\r\n\t}\r\n] \r\n```\r\n\r\n\r\nNext imagine we have a chunk that getImageList is calling a chunk that used to look like this:\r\n```\r\n<div>\r\n   <h1>[[+feild01]]</h1>\r\n</div>\r\n```\r\nand then we change it to add a modx operator on our new feild02:\r\n```\r\n<div>\r\n   <h1>[[+feild01]]</h1>\r\n   [[+feild02:isnot=``:then=`\r\n      <span>[[+feild02]]</span>\r\n   `]]\r\n</div>\r\n```\r\nThe changed version fails to render properly when the chunk has been changed to perform an operation on the new feild. You have to then go in and re-save every item in the list within the migx TV on every page to fix the problem (which it looks like creates the database records for feild02, which is why this fixes it).\r\n\r\nWhat looks to be happening is that because the record has been added, then MigX has been altered, the database record for 'feild02' was never stored against each item. So when you try and run an operator on it, it doesn't know what to do because it cannot even find a blank record.\r\n\r\nWhat should happen instead: if an operator is attempted to be run on a truly non-existent database record then it should detect that and treat it as if it is happening on an empty string.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Bruno17/MIGX/issues/comments/188786252","html_url":"https://github.com/Bruno17/MIGX/issues/252#issuecomment-188786252","issue_url":"https://api.github.com/repos/Bruno17/MIGX/issues/252","id":188786252,"user":{"login":"Bruno17","id":148223,"avatar_url":"https://avatars.githubusercontent.com/u/148223?v=3","gravatar_id":"","url":"https://api.github.com/users/Bruno17","html_url":"https://github.com/Bruno17","followers_url":"https://api.github.com/users/Bruno17/followers","following_url":"https://api.github.com/users/Bruno17/following{/other_user}","gists_url":"https://api.github.com/users/Bruno17/gists{/gist_id}","starred_url":"https://api.github.com/users/Bruno17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bruno17/subscriptions","organizations_url":"https://api.github.com/users/Bruno17/orgs","repos_url":"https://api.github.com/users/Bruno17/repos","events_url":"https://api.github.com/users/Bruno17/events{/privacy}","received_events_url":"https://api.github.com/users/Bruno17/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T13:30:48Z","updated_at":"2016-02-25T13:30:48Z","body":"this has nothing todo with MIGX. An not existing placeholder doesn't get parsed by the MODX-parser and will stay as unparsed tag, at the time, when the ouput-filter gets parsed.\r\nTry, if you get somewhere, with an else.\r\nIf not, you will need to check against the placeholder, too.\r\nMaybe with a custom-outputfilter or a snippet."}}