We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38769
    • 6 Posts
    let's say I want to create a new user with certain access privileges to the frontend, for a limited time only. So I create this user with the necessary data and fill in a "blocked after" date, but then it is not possible to save the page.

    If the user is created with an empty "blocked after" field, however, it can be saved all right. Once the user has been created, it can be edited later by filling in the "blocked after" field and saving, no problem.

    This in Revo 2.2.4. Is it the expected behaviour?
      • 38769
      • 6 Posts
      Looking further into this, we have found that the same thing happens with the "date of birth" field. It seems that if you fill in any date field in the new user form, the form cannot be saved. If you leave them blank, you can save and edit these fields later.

      It is like the variables $birthdate, $blockeduntil, and $blockedafter lose their value from one line to the next, in validation.php.

      Has anyone else seen this, or it is just us?
        • 3749
        • 24,544 Posts
        The DOB thing sounds like a bug in the user/create processor. I think it's assumed that a newly created user would not be blocked, so that's more of a "feature." Could you just make the user inactive rather than blocked?

        The DBO thing could possibly be solved with a plugin that captures the DOB in OnBeforeDocFormSave and wrote it in OnDocFormSave. I guess you could do the same with the blocked fields if 'active' doesn't work for you.

        Please report the DOB thing at http://bugs.modx.com

        Another thought: Since both involve dates, this could possibly be caused by a mismatch between the date/timezone setting for MODX, MySQL, and/or PhP.
          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
          • 38769
          • 6 Posts
          Hi Bob, thanks for the insight. Before filing a possible bug I will try to make sure it is not caused by a possible mismatch, as you point out. Or thinking along these lines, and seeing that this website's main language is Spanish, will try to rule out a mismatch in the date format.

          If this does not work, we will probably follow the plugin suggestion and report a bug.