{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/11184","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11184/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11184/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11184/events","html_url":"https://github.com/joomla/joomla-cms/pull/11184","id":166210095,"number":11184,"title":"Reorder tables with single SQL query (all DBs compatible), allows to fix B/C break with new article ordering, and performance / race-condition issues when re-ordering in large sites","user":{"login":"ggppdk","id":5092940,"avatar_url":"https://avatars.githubusercontent.com/u/5092940?v=3","gravatar_id":"","url":"https://api.github.com/users/ggppdk","html_url":"https://github.com/ggppdk","followers_url":"https://api.github.com/users/ggppdk/followers","following_url":"https://api.github.com/users/ggppdk/following{/other_user}","gists_url":"https://api.github.com/users/ggppdk/gists{/gist_id}","starred_url":"https://api.github.com/users/ggppdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggppdk/subscriptions","organizations_url":"https://api.github.com/users/ggppdk/orgs","repos_url":"https://api.github.com/users/ggppdk/repos","events_url":"https://api.github.com/users/ggppdk/events{/privacy}","received_events_url":"https://api.github.com/users/ggppdk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-18T22:40:06Z","updated_at":"2016-07-19T06:50:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/11184","html_url":"https://github.com/joomla/joomla-cms/pull/11184","diff_url":"https://github.com/joomla/joomla-cms/pull/11184.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/11184.patch"},"body":"Pull Request for Issue\r\n#11103 \r\nbecause by fixing performance of JTable::reorder(),\r\n- we can revert changes that use last order as new ordering for articles due to reorder performance issue that cause the B/C break\r\n\r\nAlso should fix or minimized race-condition issues like:\r\n#4303\r\n\r\nThe change should work in all Database servers, (someone please confirm it is good for sqlazure too)\r\n\r\n#### Summary of Changes\r\nReplace multiple reordering SQL queries with single 1\r\n\r\nUpdate 10,000 records per query during re-ordering\r\n\r\n#### Testing Instructions\r\n\r\nAdd CSS to your backend template file:    **/templates/isis/css/template.css**\r\nThis is for seeing new ordering value in article manager listing,\r\n**WARNING:** To use drag and drop order, remove this CSS, since this CSS breaks it\r\n```\r\nbody  .text-area-order {\r\n  display: inline !important;\r\n}\r\n```\r\n\r\nThis PR reverts using last order as ordering for new articles:\r\nhttps://github.com/joomla/joomla-cms/commit/584440d6ad9a1d40d945c166b790e1031023d60e\r\n(you don't have to do it yourself)\r\n\r\nYou may want to add (or add a similar for logger):\r\n```\r\nif ($uses_single_key) JFactory::getApplication()->enqueueMessage('<b>SQL reorder() QUERY</b>:<br/>'.$query, 'message');\r\n```\r\njust before JTable::reorder() final return;\r\nhttps://github.com/joomla/joomla-cms/pull/11184/files#diff-8254e2c441a41d3fa26f0f83fbbb3043R1431\r\n\r\nThen create new article and click \"Save and close\" (not \"Save\", since we want to see the enqueued message and also list the orderings in article manager) see an example in picture\r\n\r\n![table_reorder_single_query](https://cloud.githubusercontent.com/assets/5092940/16932698/c9703da8-4d50-11e6-9d12-f0e983f62494.png)\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/233546638","html_url":"https://github.com/joomla/joomla-cms/pull/11184#issuecomment-233546638","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/11184","id":233546638,"user":{"login":"ggppdk","id":5092940,"avatar_url":"https://avatars.githubusercontent.com/u/5092940?v=3","gravatar_id":"","url":"https://api.github.com/users/ggppdk","html_url":"https://github.com/ggppdk","followers_url":"https://api.github.com/users/ggppdk/followers","following_url":"https://api.github.com/users/ggppdk/following{/other_user}","gists_url":"https://api.github.com/users/ggppdk/gists{/gist_id}","starred_url":"https://api.github.com/users/ggppdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggppdk/subscriptions","organizations_url":"https://api.github.com/users/ggppdk/orgs","repos_url":"https://api.github.com/users/ggppdk/repos","events_url":"https://api.github.com/users/ggppdk/events{/privacy}","received_events_url":"https://api.github.com/users/ggppdk/received_events","type":"User","site_admin":false},"created_at":"2016-07-19T06:50:13Z","updated_at":"2016-07-19T06:50:13Z","body":"Anyone testing, \r\nif you want to test drag and drop ordering, please be warned to remove the CSS change\r\n```\r\nbody  .text-area-order {\r\n  display: inline !important;\r\n}\r\n```\r\nas it breaks drag and drop ordering (does the JS selector need the input elements to be hidden ?)\r\n"}}
{"actor":{"display_login":"ggppdk"}}