revolution
revolution copied to clipboard
Delete user error (Could not get table class or name for class: modAccess)
When deleting multiple Users at a time (via the User grid, and performing Bulk Actions > Delete Selected), the users appear to be deleted as expected, but the following errors are logged.
Seems like a missing table (or invalid table reference)?
NOTE: This was tested using [2.3].
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Could not get table class for class: modAccess
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Could not get table name for class: modAccess
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Error 42000 executing statement:
Array
(
[0] => 42000
[1] => 1064
[2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `modAccess` WHERE `modAccess`.`principal` = 3' at line 1
)
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Could not get table class for class: modAccess
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Could not get table name for class: modAccess
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Error 42000 executing statement:
Array
(
[0] => 42000
[1] => 1064
[2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `modAccess` WHERE `modAccess`.`principal` = 4' at line 1
)
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Could not get table class for class: modAccess
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Could not get table name for class: modAccess
[2014-04-11 15:11:40] (ERROR @ /connectors/index.php) Error 42000 executing statement:
Array
(
[0] => 42000
[1] => 1064
[2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS `modAccess` WHERE `modAccess`.`principal` = 5' at line 1
)
Seems to happen when deleting even a single user, not specific to Bulk Actions > Delete.
This is the result of an abstract relation to modAccess, which all modAccess* classes extend. This has been a problem since the beginning and likely needs some attention deep inside xPDO. It is harmless, but annoying.
Good to know, thanks Jason. Worth leaving this issue open?
Yes, lest we forget about it.
Is this fixed?
not yet fixed
@opengeek may be just remove extending between modPrincipal and modUser? Since User is not a Principal itself but only through modUserGroup.
modUser is a principal, it's just not implemented in the ACL tables yet, so that is not a valid solution.
There's still problem with removing users (i'm using extUser class instead of normal modUser). Just a small reminder :)
Still an issue in 2.4.0-pl
Getting these in 2.4.2 when doing just about anything with users.
How To fix
[2016-02-11 00:10:43] (ERROR @ /inc/index.php) Could not get table class for class: modAccess
[2016-02-11 00:10:43] (ERROR @ /inc/index.php) Could not get table name for class: modAccess
[2016-02-11 00:10:43] (ERROR @ /inc/index.php) Error 42000 executing statement:
Array
(
[0] => 42000
[1] => 1064
[2] => You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AS `modAccess` WHERE `modAccess`.`principal` = 111' at line 1
)
Also got this error when deleting one user (MODX 2.5.0):
[2016-10-10 11:41:13](ERROR @ /home/mySite/public_html/core/xpdo/xpdo.class.php : 1318) Could not get table class for class: modAccess
[2016-10-10 11:41:13](ERROR @ /home/mySite/public_html/core/xpdo/xpdo.class.php : 1287) Could not get table name for class: modAccess
[2016-10-10 11:41:13](ERROR @ /home/mySite/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42000 executing statement:
Array
(
[0] => 42000
[1] => 1064
[2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS modAccess
WHERE modAccess
.principal
= 35' at line 1
)
Ah, I've just come across this when creating a user-centric extra. (MODX 2.5.6) The error does not occur when using the core user management panel however. Is it known what exactly is setting it off?
Still an issue in 2.6.0-pl
Just bit me in 2.7.2.
This is a workaround:
$modx->runProcessor('security/user/delete',
array('id' => $userId));
[Update] This does not work reliably.
Just bit me in 2.7.2.
This is a workaround:
$modx->runProcessor('security/user/delete', array('id' => $userId));
@opengeek Is this a solution?
Sorry, I thought that was a solution, but it doesn't actually work.
This issue has been mentioned on MODX Community. There might be relevant details there:
https://community.modx.com/t/register-mail-to-cc/5894/18
I've just gotten this error in 2.8.4 during a call to createObjectContainer()
. Debugging the process shows that the table name is really not being found, and because of this, createObjectContainer()
fails. Not sure if this is related to this issue or not.
Just hit this again in a unit test. The ten-year anniversary of this issue was last week ;)
Let's not make it 20. Which unit test?
One of my own for CustomSearch. It creates, then later deletes several users.