{"action":"created","issue":{"url":"https://api.github.com/repos/siteorigin/siteorigin-panels/issues/587","repository_url":"https://api.github.com/repos/siteorigin/siteorigin-panels","labels_url":"https://api.github.com/repos/siteorigin/siteorigin-panels/issues/587/labels{/name}","comments_url":"https://api.github.com/repos/siteorigin/siteorigin-panels/issues/587/comments","events_url":"https://api.github.com/repos/siteorigin/siteorigin-panels/issues/587/events","html_url":"https://github.com/siteorigin/siteorigin-panels/pull/587","id":368171581,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNDA4NjEy","number":587,"title":"Max Mega Menu: Prevent layout builder duplication","user":{"login":"AlexGStapleton","id":17275120,"node_id":"MDQ6VXNlcjE3Mjc1MTIw","avatar_url":"https://avatars3.githubusercontent.com/u/17275120?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexGStapleton","html_url":"https://github.com/AlexGStapleton","followers_url":"https://api.github.com/users/AlexGStapleton/followers","following_url":"https://api.github.com/users/AlexGStapleton/following{/other_user}","gists_url":"https://api.github.com/users/AlexGStapleton/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexGStapleton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexGStapleton/subscriptions","organizations_url":"https://api.github.com/users/AlexGStapleton/orgs","repos_url":"https://api.github.com/users/AlexGStapleton/repos","events_url":"https://api.github.com/users/AlexGStapleton/events{/privacy}","received_events_url":"https://api.github.com/users/AlexGStapleton/received_events","type":"User","site_admin":false},"labels":[{"id":156138835,"node_id":"MDU6TGFiZWwxNTYxMzg4MzU=","url":"https://api.github.com/repos/siteorigin/siteorigin-panels/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-09T11:50:43Z","updated_at":"2018-10-10T21:18:17Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/siteorigin/siteorigin-panels/pulls/587","html_url":"https://github.com/siteorigin/siteorigin-panels/pull/587","diff_url":"https://github.com/siteorigin/siteorigin-panels/pull/587.diff","patch_url":"https://github.com/siteorigin/siteorigin-panels/pull/587.patch"},"body":"Resolve #573 \r\n\r\nMax Mega Menu loads the full widget form which includes the `soPanelsSetupBuilderWidget();` setup code in inc/widgets/layout.php.\r\n\r\nMax Mega Menu always triggers `widget-added` upon succesful widget load. This is good but as we run `soPanelsSetupBuilderWidget();` when that event is triggered it results in mutiple instances of SiteOrigin Page Builder being setup\r\n\r\n[](https://github.com/siteorigin/siteorigin-panels/blob/2.8.2/js/siteorigin-panels/main.js#L145) widget-added on load. "},"comment":{"url":"https://api.github.com/repos/siteorigin/siteorigin-panels/issues/comments/428735497","html_url":"https://github.com/siteorigin/siteorigin-panels/pull/587#issuecomment-428735497","issue_url":"https://api.github.com/repos/siteorigin/siteorigin-panels/issues/587","id":428735497,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODczNTQ5Nw==","user":{"login":"braamgenis","id":3822928,"node_id":"MDQ6VXNlcjM4MjI5Mjg=","avatar_url":"https://avatars0.githubusercontent.com/u/3822928?v=4","gravatar_id":"","url":"https://api.github.com/users/braamgenis","html_url":"https://github.com/braamgenis","followers_url":"https://api.github.com/users/braamgenis/followers","following_url":"https://api.github.com/users/braamgenis/following{/other_user}","gists_url":"https://api.github.com/users/braamgenis/gists{/gist_id}","starred_url":"https://api.github.com/users/braamgenis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/braamgenis/subscriptions","organizations_url":"https://api.github.com/users/braamgenis/orgs","repos_url":"https://api.github.com/users/braamgenis/repos","events_url":"https://api.github.com/users/braamgenis/events{/privacy}","received_events_url":"https://api.github.com/users/braamgenis/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T21:18:17Z","updated_at":"2018-10-10T21:18:17Z","author_association":"MEMBER","body":"> I'm personally not too worried about that situation happening as this is the first time this sort of issue has come up (it only happened after they changed how they load widget forms).\r\n\r\nIs it the first time it's come up? Why do we also have a check in place there for the customizer? Regardless, a good solution should fix the reported issue and try to prevent possible future issues, within reason. Just adding a check for `megamenu_enabled` will only solve the problem for the reported issue. If another 3rd party plugin has a widget area which triggers `widget-added`, the problem will occur again.\r\n\r\n> I understand your reasoning, but I think it would be a better idea to remove `soPanelsSetupBuilderWidget` from layouts.php and instead trigger `widgets-added` - have all instances of SiteOrigin Page Builder be triggered by the same event.\r\n\r\nThat's a much better solution than just adding more and more checks here for plugins. However, the potential for triggering multiple setups of Page Builder widgets remains. We can't control always control when `widget-added` is triggered, and we can't prevent `soPanelsSetupBuilderWidget` from being called directly multiple times for a particular widget. A more robust solution is to have a way of checking and resetting the _initialized_ state of Layout Builder widgets."}}
{"actor":{"display_login":"braamgenis"}}