{"comment":{"url":"https://api.github.com/repos/Fabrik/fabrik/comments/10836555","html_url":"https://github.com/Fabrik/fabrik/commit/b22878dbd04938433506d1dbda3aa12defcb8495#commitcomment-10836555","id":10836555,"user":{"login":"bauer-git","id":2026714,"avatar_url":"https://avatars.githubusercontent.com/u/2026714?v=3","gravatar_id":"","url":"https://api.github.com/users/bauer-git","html_url":"https://github.com/bauer-git","followers_url":"https://api.github.com/users/bauer-git/followers","following_url":"https://api.github.com/users/bauer-git/following{/other_user}","gists_url":"https://api.github.com/users/bauer-git/gists{/gist_id}","starred_url":"https://api.github.com/users/bauer-git/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bauer-git/subscriptions","organizations_url":"https://api.github.com/users/bauer-git/orgs","repos_url":"https://api.github.com/users/bauer-git/repos","events_url":"https://api.github.com/users/bauer-git/events{/privacy}","received_events_url":"https://api.github.com/users/bauer-git/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"b22878dbd04938433506d1dbda3aa12defcb8495","created_at":"2015-04-21T23:24:28Z","updated_at":"2015-04-21T23:24:28Z","body":"Good timing – I was just pulling my hair out earlier today over this.\n\n \n\nIn a dbjoin element I tried moving a Where condition down from the ‘Joins where’  to the ‘Filters where’.\n\nIt is already working as expected if in the ‘Joins where’. It was only when I moved it to the ‘Filters where’ (an yes, without including the ‘WHERE’ part) when I had a problem. It seems like the ‘Filters where’ will not parse the || (OR condition) in a placeholder – and always returns blank if the || condition is included – so triggers an error in the query.\n\n \n\nSo the problem wasn’t because I was using the placeholder - it was because I was using the || condition in the placeholder.  But without the || condition, the result could very well be blank - so at times, would also give an error. \n\n \n\nI gave up on trying to figure that placeholder code. But what was happening with the dbjoins, from what I could tell, was that initially the data being used to search for the placeholder value was not using the form model data – but rather the list model data (at least the first time the form was opened from the list). So it was never finding the element and returning an empty string. \n\n \n\n \n\nFrom: Hugh Messenger [mailto:notifications@github.com] \nSent: Tuesday, April 21, 2015 1:53 PM\nTo: Fabrik/fabrik\nCc: bauer-git\nSubject: Re: [fabrik] Added parseMessageForRepeats() to main helper, which handles replacing (b22878d)\n\n \n\nYup, that's exactly what the new function does. Of course, it only does it\nfor elements in the same repeat group. I'll try and find some time today\nor tomorrow to apply it to the database WHERE clause.\n\n-- hugh\n\n\nOn Sat, Apr 18, 2015 at 8:20 PM, bauer-git <notifications@github.com> wrote:\n\n> What I need is a placeholder that can be used in the databasejoin element\n> WHERE condition that will return the value from another element in the same\n> current row of the repeat group - but NOT a comma delimited string of all\n> the repeat groups values - just the value for that element in the same row\n> the database join element is in.\n>\n> If there is a way you can figure to do that - it would be a godsend to me.\n>\n> For example I have a dbj element in a repeat group (e.g.\n> fb_organizations___dbj_element )\n> If I try to use this...\n> WHERE {thistable}.id IN ( SELECT parent_id FROM\n> membership_form_setup_repeat_include_with WHERE parent_id={thistable}.id\n> AND include_with={fb_organizations___facility_type_id_raw} )\n>\n> There will be a 500 and 404 error generated because\n> {fb_organizations___facility_type_id_raw} is being returned as a comma\n> delimited string of values rather than just the single value of\n> {fb_organizations___facility_type_id_raw} in that same row (repeat group)\n> only.\n>\n> Why does a repeat group placeholder work correctly (as I expect it anyhow)\n> when used in a calc element but not in a dbjoin?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/Fabrik/fabrik/commit/b22878dbd04938433506d1dbda3aa12defcb8495#commitcomment-10790423>\n> .\n>\n\n\n\n—\nReply to this email directly or view it on GitHub <https://github.com/Fabrik/fabrik/commit/b22878dbd04938433506d1dbda3aa12defcb8495#commitcomment-10830680> .  <https://github.com/notifications/beacon/AB7s2uJWGi9Pp5nqjP8npCbTbeAbw30yks5oBoYUgaJpZM4EC7rc.gif> \n\n"}}