We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    This has me stumped. I can update an existing user, but if I try to create a new user, the whole panel is completely blank.

    The thing is, it’s happening on two separate installs of MODx and in multiple browsers.

    One of the installs is fairly minimal, with no components and few add-ons. I’ve disabled all plugins, cleared the cache, and flushed permissions and sessions. There are no form-customization rules and no ACL entries except the original ones.

    The Administrator policy is original and has all the necessary permissions.

    The action is there, as is the controller file.

    My only clue is that on one install, the user/create and user/update actions had the wrong parents, but fixing that didn’t solve the problem.

    I’ve been testing xPDO code for the book and I’m afraid I did something that made this happen. I’d like to make sure it’s not some code that’s actually in the book.

    I haven’t messed with any actions in code, but I have created users and user groups. I haven’t been able to find anything wrong with the DB, so maybe I can work backwards if I ask what could I have done to make this happen?

    Is there anything suspicious in this code:
    <?php
    $group = $modx->newObject('modUserGroup',array('name'=>'PhotoEditors'));
    $user = $modx->NewObject('modUser', array('username'=>'BillSmith'));
    $profile = $modx->NewObject('modUserProfile');
    $profile->set('fullname','Bill Smith');
    $profile->set('email','[email protected]');
    $user->addOne($profile);
    $role = $modx->newObject('modUserGroupRole', array('name'=>'PhotoEditor','authority'=>'7'));
    $intersect = $modx->newObject('modUserGroupMember');
    $intersect->addOne($user);
    $intersect->addOne($group);
    $intersect->addOne($role);
    $intersect->save()
    ?>


      Did I help you? Buy me a beer
      Get my Book: MODX:The Official Guide
      MODX info for everyone: http://bobsguides.com/modx.html
      My MODX Extras
      Bob's Guides is now hosted at A2 MODX Hosting
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I see a missing ; on that last line...
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 26903
        • 1,336 Posts
        Also, you seem to be mixing ’$modx->NewObject’ with ’$modx->newObject’ in various places, it should be the latter I believe.
          Use MODx, or the cat gets it!
          • 3749
          • 24,544 Posts
          Quote from: shamblett at Aug 19, 2010, 02:03 AM

          Also, you seem to be mixing ’$modx->NewObject’ with ’$modx->newObject’ in various places, it should be the latter I believe.

          The missing ; is just bad pasting, it’s there in the code.

          Good catch on NewObject. It’s definitely newObject(). That should cause a PHP error on $profile->set() or $user->addOne(), though. Even if it executed, I can’t see why it would affect the New User manager panel. The users and user groups look fine and I can update an existing user with the same panel. Hmm . . . that gives me the idea of doing a diff on the user create.php and update.php to see if I can see why one would work but not the other.

          [update]
          I found a missing JS reference in the create.php file -- went to report it and found this:

          http://bugs.modx.com/browse/MODX-2168

          [sound of hand hitting head]
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting