Error "Call to member function display() on null" when deleting child site

When I delete a child site from my dashboard using the remove button on top of a single child overview page, this process is hanging and after waiting a while I go back to the manage sites page, the child is indeed removed, but I’ve received an error notification via email:

Foutdetails
===========
Een fout van het type E_ERROR werd veroorzaakt op regelnummer 1154 van het bestand /.../wp-content/plugins/mainwp/pages/page-mainwp-manage-sites.php. Foutmelding: Uncaught Error: Call to a member function display() on null in /.../wp-content/plugins/mainwp/pages/page-mainwp-manage-sites.php:1154
Stack trace:
#0 /.../wp-content/plugins/mainwp/pages/page-mainwp-manage-sites.php(1273): MainWP\Dashboard\MainWP_Manage_Sites::render_all_sites()
#1 /.../wp-includes/class-wp-hook.php(303): MainWP\Dashboard\MainWP_Manage_Sites::render_manage_sites()
#2 /.../wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
#3 /.../wp-includes/plugin.php(470): WP_Hook->do_action()
#4 /.../wp-admin/admin.php(259): do_action()
#5 {main}
  thrown

My MainWP dashboard status:


### Server Info                    Required                                               Detected                                     Status   ###

MainWP Dashboard                   
MainWP Dashboard Version           4.1.10.3                                               4.1.10.3                                     Pass        
MainWP Upload Directory            Writable                                               Writable                                     Pass        
MainWP Extensions                  
Activity Log for MainWP            1.7.0                                                                                                           
Advanced Uptime Monitor Extension  5.2.2                                                  API License Active                           Pass        
MainWP Clean and Lock Extension    4.0.1.1                                                API License Active                           Pass        
MainWP Client Reports Extension    4.0.9                                                  API License Active                           Pass        
MainWP Code Snippets Extension     4.0.1                                                  API License Active                           Pass        
MainWP Comments Extension          4.0.3                                                  API License Active                           Pass        
MainWP Custom Dashboard Extension  4.0.2                                                  API License Active                           Pass        
MainWP Favorites Extension         4.0.7                                                  API License Active                           Pass        
MainWP File Uploader Extension     4.1                                                    API License Active                           Pass        
MainWP Google Analytics Extension  4.0.4                                                  API License Active                           Pass        
MainWP Maintenance Extension       4.1.1                                                  API License Active                           Pass        
MainWP Page Speed Extension        4.0.1.1                                                API License Active                           Pass        
MainWP Staging Extension           4.0.1                                                  API License Active                           Pass        
MainWP Sucuri Extension            4.0.8.1                                                API License Active                           Pass        
MainWP UpdraftPlus Extension       4.0.4                                                  API License Active                           Pass        
MainWP Wordfence Extension         4.0.5                                                  API License Active                           Pass        
WordPress                          
WordPress Version                  >=3.6                                                  5.8.2                                        Pass        
WordPress Memory Limit             >=64M                                                  256M                                         Pass        
MultiSite Disabled                 =true                                                  true                                         Pass        
FileSystem Method                  = direct                                               direct                                       Pass        
PHP                                
PHP Version                        >=7.0                                                  7.4.26                                       Pass        
PHP Safe Mode Disabled             =true                                                  true                                         Pass        
PHP Max Execution Time             >=30 seconds                                           30                                           Pass        
PHP Max Input Time                 >=30 seconds                                           60                                           Pass        
PHP Memory Limit                   >=128M                                                 256M                                         Pass        
PCRE Backtracking Limit            >=10000                                                1000000                                      Pass        
PHP Upload Max Filesize            >=2M                                                   64M                                          Pass        
PHP Post Max Size                  >=2M                                                   64M                                          Pass        
SSL Extension Enabled              =true                                                  true                                         Pass        
SSL Warnings                       = empty                                                                                             Pass        
cURL Extension Enabled             =true                                                  true                                         Pass        
cURL Timeout                       >=300 seconds                                          300                                          Pass        
cURL Version                       >=7.18.1                                               7.61.1                                       Pass        
cURL SSL Version                   >=OpenSSL/1.1.0                                        OpenSSL/1.1.1k                               Pass        
PHP Allow URL fopen                NO                                                     
PHP Exif Support                   YES ( V7.4.)                                           
PHP IPTC Support                   YES                                                    
PHP XML Support                    YES                                                    
PHP Disabled Functions             No functions disabled.                                 
PHP Loaded Extensions              Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imagick, intl, ionCube Loader, json, libxml, litespeed, mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, posix, session, soap, sockets, sodium, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib
MySQL                              
MySQL Version                      >=5.0                                                  10.5.13-MariaDB                              Pass        
MySQL Mode                         ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
MySQL Client Encoding              utf8                                                   
Server Info                        
Server Software                    LiteSpeed                                              
Operating System                   Linux                                                  
Architecture                       64		 bit                                               
Server Protocol                    HTTP/1.1                                               
HTTPS                              ON                                                     
Server self connect                Response Test O.K.                                     
User Agent                         Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36
Gateway Interface                                                                         
Memory Usage                       22.54 MB                                               
Request Time                       1639391121                                             
Accept Content                     text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Charset Content             N/A                                                    
MainWP Settings                    
Number Of Child Sites              235                                                    
Use WP-Cron                        Yes                                                    
Optimize for Shared Hosting or Big NetworksYes                                                    
Automatic Daily Update             Disabled                                               
Abandoned Plugins/Themes Tolerance 365                                                    
Maximum number of posts to return  50                                                     
Maximum number of pages to return  50                                                     
Maximum Number of Comments         50                                                     
Primary Backup System              MainWP UpdraftPlus Extension                           
Maximum simultaneous requests      8                                                      
Minimum delay between requests     200                                                    
Maximum simultaneous requests per ip1                                                      
Minimum delay between requests to the same ip2000                                                   
Maximum simultaneous sync requests 8                                                      
Maximum simultaneous install and update requests3                                                      
Active Plugins                     
Activity Log for MainWP            1.7.0                                                  Active                                       
MainWP Child                       4.1.8                                                  Active                                       
MainWP Dashboard                   4.1.10.3                                               Active                                       
MainWP Lighthouse Extension        4.0-beta2                                              Inactive                                     
UpdraftPlus - Backup/Restore       2.16.66.25                                             Active                                       
Wordfence Security                 7.5.7                                                  Active                                       

Hi Jos,

Thanks for reporting this.

I tried to duplicate but I couldn’t.
I will have our dev team check this too.

I will update the thread as soon as I get a feedback from them.

1 Like

Please try this version:

Hi Bogdan,

I’ve just tested it and it seems to work in this version. :slight_smile:

However I noticed a new issue regarding the blue help notifications on top of the single site pages (and perhaps on more locations, but that would probably related). If I close it and refresh the page it’s back. It doesn’t matter if I go to another page, do a sync or whatever.

In the browser console I see this message that might be related:

[DOM] Found 2 elements with non-unique id #_wpnonce: (More info: https://goo.gl/9p2vKq) input#_wpnonceaccept: ""accessKey: ""align: ""alt: ""ariaAtomic: nullariaAutoComplete: nullariaBusy: nullariaChecked: nullariaColCount: nullariaColIndex: nullariaColSpan: nullariaCurrent: nullariaDescription: nullariaDisabled: nullariaExpanded: nullariaHasPopup: nullariaHidden: nullariaKeyShortcuts: nullariaLabel: nullariaLevel: nullariaLive: nullariaModal: nullariaMultiLine: nullariaMultiSelectable: nullariaOrientation: nullariaPlaceholder: nullariaPosInSet: nullariaPressed: nullariaReadOnly: nullariaRelevant: nullariaRequired: nullariaRoleDescription: nullariaRowCount: nullariaRowIndex: nullariaRowSpan: nullariaSelected: nullariaSetSize: nullariaSort: nullariaValueMax: nullariaValueMin: nullariaValueNow: nullariaValueText: nullassignedSlot: nullattributeStyleMap: StylePropertyMap {size: 0}attributes: NamedNodeMap {0: type, 1: id, 2: name, 3: value, type: type, id: id, name: name, value: value, length: 4}autocapitalize: ""autocomplete: ""autofocus: falsebaseURI: "https://.../wp-admin/admin.php?page=managesites&id=532"checked: falsechildElementCount: 0childNodes: NodeList []children: HTMLCollection []classList: DOMTokenList [value: '']className: ""clientHeight: 0clientLeft: 0clientTop: 0clientWidth: 0contentEditable: "inherit"dataset: DOMStringMap {}defaultChecked: falsedefaultValue: "8935043650"dir: ""dirName: ""disabled: falsedraggable: falseelementTiming: ""enterKeyHint: ""files: nullfirstChild: nullfirstElementChild: nullform: form#mainwp-overview-screen-options-formformAction: "https://.../wp-admin/admin.php?page=managesites&id=532"formEnctype: ""formMethod: ""formNoValidate: falseformTarget: ""height: 0hidden: falseid: "_wpnonce"incremental: falseindeterminate: falseinnerHTML: ""innerText: ""inputMode: ""isConnected: trueisContentEditable: falselabels: nulllang: ""lastChild: nulllastElementChild: nulllist: nulllocalName: "input"max: ""maxLength: -1min: ""minLength: -1multiple: falsename: "_wpnonce"namespaceURI: "http://www.w3.org/1999/xhtml"nextElementSibling: inputnextSibling: inputnodeName: "INPUT"nodeType: 1nodeValue: nullnonce: ""offsetHeight: 0offsetLeft: 0offsetParent: nulloffsetTop: 0offsetWidth: 0onabort: nullonanimationend: nullonanimationiteration: nullonanimationstart: nullonauxclick: nullonbeforecopy: nullonbeforecut: nullonbeforepaste: nullonbeforexrselect: nullonblur: nulloncancel: nulloncanplay: nulloncanplaythrough: nullonchange: nullonclick: nullonclose: nulloncontextmenu: nulloncopy: nulloncuechange: nulloncut: nullondblclick: nullondrag: nullondragend: nullondragenter: nullondragleave: nullondragover: nullondragstart: nullondrop: nullondurationchange: nullonemptied: nullonended: nullonerror: nullonfocus: nullonformdata: nullonfullscreenchange: nullonfullscreenerror: nullongotpointercapture: nulloninput: nulloninvalid: nullonkeydown: nullonkeypress: nullonkeyup: nullonload: nullonloadeddata: nullonloadedmetadata: nullonloadstart: nullonlostpointercapture: nullonmousedown: nullonmouseenter: nullonmouseleave: nullonmousemove: nullonmouseout: nullonmouseover: nullonmouseup: nullonmousewheel: nullonpaste: nullonpause: nullonplay: nullonplaying: nullonpointercancel: nullonpointerdown: nullonpointerenter: nullonpointerleave: nullonpointermove: nullonpointerout: nullonpointerover: nullonpointerrawupdate: nullonpointerup: nullonprogress: nullonratechange: nullonreset: nullonresize: nullonscroll: nullonsearch: nullonseeked: nullonseeking: nullonselect: nullonselectionchange: nullonselectstart: nullonstalled: nullonsubmit: nullonsuspend: nullontimeupdate: nullontoggle: nullontransitioncancel: nullontransitionend: nullontransitionrun: nullontransitionstart: nullonvolumechange: nullonwaiting: nullonwebkitanimationend: nullonwebkitanimationiteration: nullonwebkitanimationstart: nullonwebkitfullscreenchange: nullonwebkitfullscreenerror: nullonwebkittransitionend: nullonwheel: nullouterHTML: "<input type=\"hidden\" id=\"_wpnonce\" name=\"_wpnonce\" value=\"8935043650\">"outerText: ""ownerDocument: documentparentElement: form#mainwp-overview-screen-options-formparentNode: form#mainwp-overview-screen-options-formpart: DOMTokenList [value: '']pattern: ""placeholder: ""prefix: nullpreviousElementSibling: nullpreviousSibling: textreadOnly: falserequired: falsescrollHeight: 0scrollLeft: 0scrollTop: 0scrollWidth: 0selectionDirection: nullselectionEnd: nullselectionStart: nullshadowRoot: nullsize: 20slot: ""spellcheck: truesrc: ""step: ""style: CSSStyleDeclaration {accentColor: '', additiveSymbols: '', alignContent: '', alignItems: '', alignSelf: '', …}tabIndex: 0tagName: "INPUT"textContent: ""title: ""translate: truetype: "hidden"useMap: ""validationMessage: ""validity: ValidityState {valueMissing: false, typeMismatch: false, patternMismatch: false, tooLong: false, tooShort: false, …}value: "8935043650"valueAsDate: nullvalueAsNumber: NaNvirtualKeyboardPolicy: ""webkitEntries: []webkitdirectory: falsewidth: 0willValidate: false[[Prototype]]: HTMLInputElement input#_wpnonce

Actually it’s not solved yet. The test was with a new site that I added to test and it worked. But removing older sites is giving the error. So probably there’s some information that’s not set on older child sites so this action fails on a removal.

Thanks for the update.

We are checking this again.

1 Like

The problem should be fixed in this version:

I’ve just updated. But I’ll have to wait a bit before I’ll have another site to delete (probably in a few days).

1 Like

Thanks, @josklever, I will wait for your update.

The fix is included in the latest MainWP Dashboard plugin version (4.1.11) released today.

As per our testing, the problem is fully resolved.

If it occurs again on your side when you get a chance to test please let us know.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.