File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
app/code/Magento/Backend/Block/Widget Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -237,19 +237,16 @@ protected function _beforeToHtml()
237237 {
238238 $ this ->_tabs = $ this ->reorderTabs ();
239239
240- if ($ this ->_activeTab === null ) {
241- /** @var TabInterface $tab */
242- foreach ($ this ->_tabs as $ tab ) {
243- $ this ->_activeTab = $ tab ->getId ();
244- break ;
245- }
246- }
247-
248240 if ($ activeTab = $ this ->getRequest ()->getParam ('active_tab ' )) {
249241 $ this ->setActiveTab ($ activeTab );
250242 } elseif ($ activeTabId = $ this ->_authSession ->getActiveTabId ()) {
251243 $ this ->_setActiveTab ($ activeTabId );
252244 }
245+
246+ if ($ this ->_activeTab === null && !empty ($ this ->_tabs )) {
247+ /** @var TabInterface $tab */
248+ $ this ->_activeTab = (reset ($ this ->_tabs ))->getId ();
249+ }
253250
254251 $ this ->assign ('tabs ' , $ this ->_tabs );
255252 return parent ::_beforeToHtml ();
@@ -259,7 +256,7 @@ protected function _beforeToHtml()
259256 /**
260257 * @return array
261258 */
262- protected function reorderTabs ()
259+ private function reorderTabs ()
263260 {
264261 $ orderByIdentity = [];
265262 $ orderByPosition = [];
You can’t perform that action at this time.
0 commit comments