You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Module install/remove: "Undefined array key" warnings from getUsersWithRole() and "Failed to remove module permission object" #548
Installing or removing any module logs these on 5.0.0-rc3 (master 8727ad5c, with full error reporting):
PHP Warning: Undefined array key 1 in classes/w2p/Database/Query.class.php on line 1289
PHP Warning: Undefined array key "" in classes/w2p/Database/Query.class.php on line 1289
classes/w2p/Extensions/Permissions.class.php(221): Failed to remove module permission object (remove only)
Causes
w2p_Extensions_Permissions::getUsersWithRole() calls loadHashList() on a one-column query (DISTINCT(g.aro_id)). With one column, loadHashList() reads $keys[1], which doesn't exist. It is called from recalcPermissions(), so every install, remove and full recalc logs the pair (about 10 times per request). The keys still come out right, so it is noise, not wrong data. Use loadColumn() and array_flip(), or select the column twice.
A module's setup.phpremove() ends with parent::remove(). w2p_System_Setup::remove() calls unregisterModule(), which deletes the gacl_axo row. Then domodsql calls w2p_System_Module::remove() → deleteModule(), which can't find the row any more and logs the failure. Only one of the two should remove it.
Recommended Fix
Have deleteModule() should remove the gacl_axo row.
Found while testing the Notebook add-on's install and remove.
Activity