{"action":"created","issue":{"url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1545","repository_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons","labels_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1545/labels{/name}","comments_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1545/comments","events_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1545/events","html_url":"https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1545","id":377530938,"node_id":"MDU6SXNzdWUzNzc1MzA5Mzg=","number":1545,"title":"Parsys Limit code prevents adding components in AEM 6.4.2.0 (SP2)","user":{"login":"ahmed-musallam","id":13037215,"node_id":"MDQ6VXNlcjEzMDM3MjE1","avatar_url":"https://avatars2.githubusercontent.com/u/13037215?v=4","gravatar_id":"","url":"https://api.github.com/users/ahmed-musallam","html_url":"https://github.com/ahmed-musallam","followers_url":"https://api.github.com/users/ahmed-musallam/followers","following_url":"https://api.github.com/users/ahmed-musallam/following{/other_user}","gists_url":"https://api.github.com/users/ahmed-musallam/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmed-musallam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmed-musallam/subscriptions","organizations_url":"https://api.github.com/users/ahmed-musallam/orgs","repos_url":"https://api.github.com/users/ahmed-musallam/repos","events_url":"https://api.github.com/users/ahmed-musallam/events{/privacy}","received_events_url":"https://api.github.com/users/ahmed-musallam/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-05T18:42:37Z","updated_at":"2018-11-21T19:20:48Z","closed_at":"2018-11-21T19:20:48Z","author_association":"CONTRIBUTOR","body":"## NOTE: Reporting this issue here as an FYI, the fix for this should probably be done by adobe in a CFP.\r\n\r\n## Required Information\r\n\r\n* [x] AEM Version, including Service Packs, Cumulative Fix Packs, etc: ___*AEM 6.4.2.0 (SP2)*____\r\n* [x] ACS AEM Commons Version: __*3.19 - but i imagine it happens for earlier versions*___\r\n* [x] Reproducible on Latest? *yes*\r\n\r\n\r\n### Expected Behavior\r\n\r\n1. Create a new Page that has a responsive grid\r\n2. Add an Experience Fragment to the page - to any responsive grid (if multiple)\r\n3. Try to add a component using the \"+\" editor action in the editor bar for the responsive grid\r\n4. The component picker dialog should show\r\n\r\n### Actual Behavior\r\n\r\nThe following error is thrown and the component picker does not show:\r\n```\r\nAn error has occured during execution of the selected action: code.indexOf is not a function -> TypeError: code.indexOf is not a function\r\n    at Object.ns.util.sanitizeCQHandler (/libs/cq/gui/components/authoring/editors/clientlibs/sites/page.js:31462:62)\r\n    at /libs/cq/gui/components/authoring/editors/clientlibs/core.js:7508:46\r\n    at Array.forEach (<anonymous>)\r\n    at cleanActions (/libs/cq/gui/components/authoring/editors/clientlibs/core.js:7491:21)\r\n    at cleanEditableActions (/libs/cq/gui/components/authoring/editors/clientlibs/core.js:7476:38)\r\n    at Object.ns.configParser (/libs/cq/gui/components/authoring/editors/clientlibs/core.js:7664:9)\r\n    at new constructor (/libs/cq/gui/components/authoring/editors/clientlibs/core.js:8822:29)\r\n    at HTMLUnknownElement.<anonymous> (/libs/cq/gui/components/authoring/editors/clientlibs/core.js:35820:36)\r\n    at Function.each /etc.clientlibs/clientlibs/granite/jquery.js:370:19)\r\n    at jQuery.fn.init.each (/etc.clientlibs/clientlibs/granite/jquery.js:137:17)\r\n```\r\n\r\n### Steps to Reproduce\r\n\r\nsame as \"Actual Behavior\" above\r\na specific example:\r\n\r\n1. go to [http://localhost:4502/editor.html/content/we-retail/language-masters/en.html](http://localhost:4502/editor.html/content/we-retail/language-masters/en.html)\r\n2. Add an experience fragment component.\r\n3. try to add any other component with the \"+\" editor action.\r\n\r\n\r\n### Why is this issue occurring:\r\n\r\nThe issue starts at this line: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/abefa62b366de3a010471d4022bc9416d79fdfad/content/src/main/content/jcr_root/apps/acs-commons/touchui-widgets/configure-limit-parsys/touchui-limit-parsys.js#L103\r\n\r\nWhere a call to `Granite.author.edit.findEditables()` is made which finds all editable on the page. In the process this finds an experience fragment editable then calls `ns.util.sanitizeCQHandler` on all its configured actions.\r\n`ns.util.sanitizeCQHandler` expects a string but it passed a function causing the error.\r\n\r\nIt seems like, when the config attribute for the experience fragment editable is parsed, the `handler` property is mapped to the function instead of keeping it as a string and I have no idea where exactly that mapping is happening.\r\n\r\nThis would not cause issues typically because when clicking the \"+\" action on parsys, vanilla AEM does not make a call to  `Granite.author.edit.findEditables()`. Even thought this issue may occur in other parts of the editor, it is amplified by the parsys limiter code. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/comments/440781261","html_url":"https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1545#issuecomment-440781261","issue_url":"https://api.github.com/repos/Adobe-Consulting-Services/acs-aem-commons/issues/1545","id":440781261,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDc4MTI2MQ==","user":{"login":"ahmed-musallam","id":13037215,"node_id":"MDQ6VXNlcjEzMDM3MjE1","avatar_url":"https://avatars2.githubusercontent.com/u/13037215?v=4","gravatar_id":"","url":"https://api.github.com/users/ahmed-musallam","html_url":"https://github.com/ahmed-musallam","followers_url":"https://api.github.com/users/ahmed-musallam/followers","following_url":"https://api.github.com/users/ahmed-musallam/following{/other_user}","gists_url":"https://api.github.com/users/ahmed-musallam/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmed-musallam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmed-musallam/subscriptions","organizations_url":"https://api.github.com/users/ahmed-musallam/orgs","repos_url":"https://api.github.com/users/ahmed-musallam/repos","events_url":"https://api.github.com/users/ahmed-musallam/events{/privacy}","received_events_url":"https://api.github.com/users/ahmed-musallam/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T19:20:48Z","updated_at":"2018-11-21T19:20:48Z","author_association":"CONTRIBUTOR","body":"Closing this issue as I have provided a small fix to mitigate it, but the real fix should come from Adobe in AEM 6.4 SP3 package."}}
{"actor":{"display_login":"ahmed-musallam"}}