{"action":"opened","number":19972,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/19972","id":177228433,"html_url":"https://github.com/joomla/joomla-cms/pull/19972","diff_url":"https://github.com/joomla/joomla-cms/pull/19972.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/19972.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/19972","number":19972,"state":"open","locked":false,"title":"Merge Script Options recursive","user":{"login":"bembelimen","id":1229869,"avatar_url":"https://avatars0.githubusercontent.com/u/1229869?v=4","gravatar_id":"","url":"https://api.github.com/users/bembelimen","html_url":"https://github.com/bembelimen","followers_url":"https://api.github.com/users/bembelimen/followers","following_url":"https://api.github.com/users/bembelimen/following{/other_user}","gists_url":"https://api.github.com/users/bembelimen/gists{/gist_id}","starred_url":"https://api.github.com/users/bembelimen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bembelimen/subscriptions","organizations_url":"https://api.github.com/users/bembelimen/orgs","repos_url":"https://api.github.com/users/bembelimen/repos","events_url":"https://api.github.com/users/bembelimen/events{/privacy}","received_events_url":"https://api.github.com/users/bembelimen/received_events","type":"User","site_admin":false},"body":"### Summary of Changes\r\nWith the JDocument::addScriptOptions method it's possible to change script parameters like the TinyMCE plugin parameters from outside (like with a plugin). This functionality was implemented with the following PR: https://github.com/joomla/joomla-cms/pull/3072 and in the TinyMCE here: https://github.com/joomla/joomla-cms/pull/11157 (with examples)\r\n\r\nThe problem at the moment is, that the \"new parameters\" will only be merged on the first level, so for example for the TinyMCE you cannot change parameters of deeper level in an easy way.\r\n\r\n### Testing Instructions\r\n\r\nAdd the following code into your template index file:\r\n\r\n```\r\n$options = [\r\n    'foo' => [\r\n        'bar' => [\r\n\t\t\t'bla' => 1,\r\n\t\t],\r\n\t\t'baz' => [\r\n\t\t\t'blub' => 2\r\n\t\t]\r\n    ]\r\n];\r\n\r\nJFactory::getDocument()->addScriptOptions('Foobar', $options);\r\n\r\n// Update the foo => bar => bla value\r\n$options = [\r\n\t'foo' => [\r\n        \t'bar' => [\r\n\t\t\t'bla' => 2,\r\n\t\t]\r\n\t]\r\n];\r\n\r\nJFactory::getDocument()->addScriptOptions('Foobar', $options);\r\n```\r\n\r\n### Expected result\r\n```\r\n    \"Foobar\": {\r\n        \"foo\": {\r\n            \"bar\": {\r\n                \"bla\": 2\r\n            },\r\n            \"baz\": {\r\n                \"blub\": 2\r\n            }\r\n        }\r\n    }\r\n```\r\n\r\n### Actual result\r\n```\r\n    \"Foobar\": {\r\n        \"foo\": {\r\n            \"bar\": {\r\n                \"bla\": 2\r\n            }\r\n        }\r\n    }\r\n```\r\n\r\n### More description\r\nThis example is very small, but e.g. the tinyMCE has somewhere about 50 parameters with a level of 3 or more. If you want to change one parameter in the depth, you have to rebuild the whole tree (or load the current tree, setup the variables  and then set again), which makes the \"merge\" a bit useless.\r\n\r\nPerhaps @Fedik and @dgt41 could look over this functionality, because they worked with it.\r\n\r\n","created_at":"2018-03-24T09:16:34Z","updated_at":"2018-03-24T09:16:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/19972/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/19972/comments","review_comment_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/19972/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/d8b3c510f05f19e7d225b2d5f5650b0ca4e06220","head":{"label":"bembelimen:patch-39","ref":"patch-39","sha":"d8b3c510f05f19e7d225b2d5f5650b0ca4e06220","user":{"login":"bembelimen","id":1229869,"avatar_url":"https://avatars0.githubusercontent.com/u/1229869?v=4","gravatar_id":"","url":"https://api.github.com/users/bembelimen","html_url":"https://github.com/bembelimen","followers_url":"https://api.github.com/users/bembelimen/followers","following_url":"https://api.github.com/users/bembelimen/following{/other_user}","gists_url":"https://api.github.com/users/bembelimen/gists{/gist_id}","starred_url":"https://api.github.com/users/bembelimen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bembelimen/subscriptions","organizations_url":"https://api.github.com/users/bembelimen/orgs","repos_url":"https://api.github.com/users/bembelimen/repos","events_url":"https://api.github.com/users/bembelimen/events{/privacy}","received_events_url":"https://api.github.com/users/bembelimen/received_events","type":"User","site_admin":false},"repo":{"id":19490472,"name":"joomla-cms","full_name":"bembelimen/joomla-cms","owner":{"login":"bembelimen","id":1229869,"avatar_url":"https://avatars0.githubusercontent.com/u/1229869?v=4","gravatar_id":"","url":"https://api.github.com/users/bembelimen","html_url":"https://github.com/bembelimen","followers_url":"https://api.github.com/users/bembelimen/followers","following_url":"https://api.github.com/users/bembelimen/following{/other_user}","gists_url":"https://api.github.com/users/bembelimen/gists{/gist_id}","starred_url":"https://api.github.com/users/bembelimen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bembelimen/subscriptions","organizations_url":"https://api.github.com/users/bembelimen/orgs","repos_url":"https://api.github.com/users/bembelimen/repos","events_url":"https://api.github.com/users/bembelimen/events{/privacy}","received_events_url":"https://api.github.com/users/bembelimen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bembelimen/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/bembelimen/joomla-cms","forks_url":"https://api.github.com/repos/bembelimen/joomla-cms/forks","keys_url":"https://api.github.com/repos/bembelimen/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bembelimen/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bembelimen/joomla-cms/teams","hooks_url":"https://api.github.com/repos/bembelimen/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/bembelimen/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/bembelimen/joomla-cms/events","assignees_url":"https://api.github.com/repos/bembelimen/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/bembelimen/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/bembelimen/joomla-cms/tags","blobs_url":"https://api.github.com/repos/bembelimen/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bembelimen/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bembelimen/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/bembelimen/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bembelimen/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/bembelimen/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/bembelimen/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/bembelimen/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/bembelimen/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/bembelimen/joomla-cms/subscription","commits_url":"https://api.github.com/repos/bembelimen/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/bembelimen/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/bembelimen/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/bembelimen/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/bembelimen/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/bembelimen/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bembelimen/joomla-cms/merges","archive_url":"https://api.github.com/repos/bembelimen/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bembelimen/joomla-cms/downloads","issues_url":"https://api.github.com/repos/bembelimen/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/bembelimen/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/bembelimen/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/bembelimen/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bembelimen/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/bembelimen/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/bembelimen/joomla-cms/deployments","created_at":"2014-05-06T10:36:06Z","updated_at":"2016-04-08T23:00:12Z","pushed_at":"2018-03-24T09:10:55Z","git_url":"git://github.com/bembelimen/joomla-cms.git","ssh_url":"git@github.com:bembelimen/joomla-cms.git","clone_url":"https://github.com/bembelimen/joomla-cms.git","svn_url":"https://github.com/bembelimen/joomla-cms","homepage":"http://joomla.org","size":221544,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"staging"}},"base":{"label":"joomla:staging","ref":"staging","sha":"b56a9d017b97cf00f9b229d121d2fb57d1e630fe","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars3.githubusercontent.com/u/751633?v=4","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"repo":{"id":2464908,"name":"joomla-cms","full_name":"joomla/joomla-cms","owner":{"login":"joomla","id":751633,"avatar_url":"https://avatars3.githubusercontent.com/u/751633?v=4","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joomla/joomla-cms","description":"Home of the Joomla! Content Management System","fork":false,"url":"https://api.github.com/repos/joomla/joomla-cms","forks_url":"https://api.github.com/repos/joomla/joomla-cms/forks","keys_url":"https://api.github.com/repos/joomla/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla/joomla-cms/teams","hooks_url":"https://api.github.com/repos/joomla/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/joomla/joomla-cms/events","assignees_url":"https://api.github.com/repos/joomla/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/joomla/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/joomla/joomla-cms/tags","blobs_url":"https://api.github.com/repos/joomla/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/joomla/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/joomla/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/joomla/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/joomla/joomla-cms/subscription","commits_url":"https://api.github.com/repos/joomla/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/joomla/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla/joomla-cms/merges","archive_url":"https://api.github.com/repos/joomla/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla/joomla-cms/downloads","issues_url":"https://api.github.com/repos/joomla/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/joomla/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/joomla/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/joomla/joomla-cms/deployments","created_at":"2011-09-27T02:07:38Z","updated_at":"2018-03-23T18:49:06Z","pushed_at":"2018-03-23T20:56:43Z","git_url":"git://github.com/joomla/joomla-cms.git","ssh_url":"git@github.com:joomla/joomla-cms.git","clone_url":"https://github.com/joomla/joomla-cms.git","svn_url":"https://github.com/joomla/joomla-cms","homepage":"https://www.joomla.org","size":227389,"stargazers_count":2683,"watchers_count":2683,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2664,"mirror_url":null,"archived":false,"open_issues_count":891,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":2664,"open_issues":891,"watchers":2683,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/19972"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/19972"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/19972"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/19972/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/19972/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/19972/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/d8b3c510f05f19e7d225b2d5f5650b0ca4e06220"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":1,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"bembelimen"}}