We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    Ok I am looking deeply into ClassExtender as a better solution for user data.

    The relevant relationship between the two are in the update profile page, although it looks like ClassExtender can be used at registration as well, but let's stick to update profile rather than registration. I have a 2-step process for registration, and the confirmation email leads the new user to the second step, which is using the update profile snippet.

    ClassExtender asks us to add a snippet to this page, like so:

    [[!ExtUserUpdateProfile]]
    [[!UpdateProfile]]

    but Discuss is already asking us to add in its snippet for updating the user profile:

    [[!DiscussUpdateProfileLoader]]

    Both these snippets go and get the user object and modify the contents of it. It seems ClassExtender will also *make* the user profile if it does not exist as well.

    Ho ho! Will everything play along nicely? I seriously doubt it! But, I don't think I have to find out.

    Rather than deal with this potential issue, there are a couple of reasonable workarounds.

    1. Because Discuss doesn't do much with the user object other than a couple things like show email, show online and display name, I can put these values in another step in the process. Other stuff like tracking posts, IP and last login shouldn't be affected at all.

    2. Also, maybe I could have both snippets in the same form if the Discuss snippet was later and only dealt with the Discuss values I mentioned in 1.

    3. Finally, because I will keep my working registration form, I might be able to put the Discuss snippet there, but its not there now and not sure if I can do that.

    This is also a potential issue, but I would think not, its a posthook so shouldn't affect the sending of the data by submission, right?

    &postHooks=`postHook.DiscussUpdateProfile`

    So, I don't know if I am headed the right way, but these seem to be the issues. I would say the first option is probably the best, its a pain for the user to still have an extra step but its not the end of the world.
      • 3749
      • 24,544 Posts
      I think all three snippet tags could be on the same page (as long as the $_POST values are there for them). ClassExtender's code will only update its own table, and I suspect that the DiscueeUpdateProfileLoader will do the same.

      Similarly, setUserPlaceholders and the Discuss analog to it could also be on the same page, as long as there are no conflicting placeholder names.
        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
        • 46886
        • 1,154 Posts
        Hmm good point. Right now I don't know how I will deal with this exactly, but will feedback. Anyway its good to know that there is less chance for conflict.

        Given that the lazy way is just to add in the CE snippet and contents into the working form with the other snippets, I may just do that and work from there.