We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26560
    • 7 Posts
    after a bit of experimentation and being able to find the web users form within modx , I’ve been able to add a new field to the form , I have the field setup in the database as well , the only problem seems to be saving the value.

    I have edited save_web_user.processor.php to alter the sql sent to the DB (both insert and update ) , and set a variable to contain the data but everytime I try it nothing seems to be saved.

    Is there another section that I need to alter here ?

    I have altered line 165 (INSERT into $dbase) and line 315 (UPDATE $dbase) but no luck.

    All I am trying to do is to add a website field into the form , does anyone maybe know of something that i can do to add it via plugin , snippet etc ?

    MODx version is 0.9.6.1 , do I need to include any more info ?

      • 29019 ☆ A M B ☆
      • 104 Posts
      Well going that far back I only have modx-0.9.6 and modx-0.9.6.1p2, so this information may not be entirely accurate (in either case, I’d highly recommend upgrading - it’s a pretty painless process), but you might want to make sure you assigned your $website value at the top of the file (where all of the other web user variables are assigned - about line 36 in mine) before you try to insert it into the database, unless you’re pulling them straight from $_POST in the query. Make sure your values are posting correctly at that point, and it wouldn’t hurt to sanitize them before you throw them into a query, even though none of the other values are. Mine has the actual web_user_attributes insertion at line 143, so you might want to make sure you’re editing the right query, but besides that I’m not sure what could be going wrong.
        www.darkstardesign.com

        Are you in the Nashville area? Join us for our next MODX meetup!
        • 3749
        • 24,544 Posts
        Generally speaking, you should never add fields to the MODx database tables.

        The WebLoginPE snippet will let you add custom user fields or you can add a separate table of your own to contain the extra user fields.

        In MODx Revolution, you can add extra user fields easily in the Manager.
          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
          • 26560
          • 7 Posts
          I figure it has something to do with the $_POST variable, I have it set in the script to catch what is posted (names aligned correctly) but it doesn’t seem to be gathering the value that is sent.

          The site does have webloginPE installed , but I am unsure how it actually works with the site I have , if it all , it is using the Weblogin snippet and the value is changable there but the site doesn’t need users logging in to change the value themselves (most won’t ) so my client want to be able to change this themselves via the backend.

          If I used webloginPE to change the web users form (is this possible ?) but still kept things the same with weblogin (theres not much use for it seeing as users don’t login) would I be able to include a new form field (website) using webloginPE ?