We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40375
    • 12 Posts
    Apache version 2.2.23
    PHP version 5.3.17
    MySQL version 5.5.27-cll
    MODX version: 2.2.6-pl(advanced)

    In my CMP the following code causes the error:
    <?php
    //.... 
      $user = $modx->getObject('modUser', array('username'=>$line['username']));
    
      if ( $user ){
        if($line['delete']===true){
          if($user->remove()){
          $deletedCount++;
          $modx->mycmp->log('info',$this->modx->lexicon('mycmp.user.deleted',$line));
          }
        }
      }
    //....					}
    


    The log displays these messages:
    Could not get table class for class: modAccess
    Could not get table name for class: modAccess
    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` = 3135' at line 1
    )
    Removed modUserProfile instance with primary key 3135
    Removed modUserGroupMember instance with primary key 101
    Removed modUserGroupMember instance with primary key 102
    Removed modUserGroupMember instance with primary key 103
    Removed modUser instance with primary key 3135
    User "johndoe" has been deleted. (my message)
    


    The user is successfully deleted but I get these error message for each user. Is there anything I'm doing wrong or is this a bug?
      • 22303 MODX Staff
      • 10,725 Posts
      It's a known bug and is harmless. modAccess is an abstract class which all the modAccess tables use and it does not have a table itself.