diff --git a/admin/javascript/LeftAndMain.js b/admin/javascript/LeftAndMain.js index 487467118..f065eb0d9 100644 --- a/admin/javascript/LeftAndMain.js +++ b/admin/javascript/LeftAndMain.js @@ -1081,7 +1081,7 @@ jQuery.noConflict(); this._super(); }, onremove: function() { - if(this.data('button')) this.button('destroy'); + if(!this.data('button')) this.button('destroy'); this._super(); } }); diff --git a/security/Member.php b/security/Member.php index ed2a63c53..d3e54929b 100644 --- a/security/Member.php +++ b/security/Member.php @@ -841,8 +841,9 @@ class Member extends DataObject implements TemplateGlobalProvider { $id = Member::currentUserID(); if($id) { - return Member::get()->byId($id); + return DataObject::get_by_id('Member', $id); } + return null; } /**