We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    Quote from: Soshite at Jun 13, 2007, 11:32 PM

    Quote from: doze at Jun 13, 2007, 10:19 PM

    Have you tried calling eForm uncached? or is the document uncached?

    IIRC, I had the !! codes around it.
    In your example, it’s running cached..


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 28033
      • 925 Posts
      Okay, fixing that cached issue solved the validation errors. But when I tried to signup, I got this error...

      « MODx Parse Error »MODx encountered the following error while attempting to parse the requested resource:
      « PHP Parse Error »

      PHP error debug
      Error: Invalid argument supplied for foreach()
      Error type/ Nr.: Warning - 2
      File: /hsphere/local/home/tales/tales.rpgplanet.gamespy.com/assets/snippets/efreg/efreg.inc.php
      Line: 92
      Line 92 source: foreach($efreg_inputs_opt as $name => $value) {

      Parser timing
      MySQL: 0.0062 s (3 Requests)
      PHP: 0.4318 s
      Total: 0.4379 s

      Seems like it’s having an issue interpreting the username field as a value?
        My Snippets
        -> PopUpChunk v1.0
        • 31037
        • 358 Posts
        I would guess there is a input name that isn’t correct, but could you please post your eFreg and eFrom call and also your current form template? I guess you have made some changes to it since last time.

        Edit: The user name has already been saved when you arrive at that line, now it’s trying to save attributes, but it can’t find any data. That’s why my guess is that there could be some naming error in the template which would cause this error.
          • 28033
          • 925 Posts
          No problem --- here ya go.

          [!eFreg? &wGroups=`Registered Users` &input_prefix=`efreg_` &otherTables=`web_user_mysymphonic: webuser: fullname, avatar, avatar_desc, mysh_member`!]
          [!eForm? &formid=`efregfrm` &tpl=`NewNewAccount` &noemail=`1` &eFormOnValidate=`efreg_validate` &eFormOnBeforeMailSent=`efreg_register`!]



          <span style="color:#900;">[+validationmessage+]</span>
          
          <form method="post" name="efregfrm" id="efregfrm" action="/[~[*id*]~]">
          <table border="0" cellpadding="2">
          <tr><td>
          	<table border="0" width="100%"><tr>
          		<td>LogIn Name</td>
          		<td><input type="text" name="efreg_username" id="efreg_username" eform="Username:string:1" class="inputBox" style="width:300px" /></td>
          	</tr><tr>
          		<td>Display Name</td>
          		<td><input type="text" name="efreg_fullname" id="efreg_fullname" eform="Fullname:string:1" class="inputBox" style="width:300px" /></td>
          	</tr><tr>
          		<td>E-Mail Address</td>
          		<td><input type="text" name="efreg_email" id="efreg_email" eform="E-mail:e-mail:1" class="inputBox" style="width:300px" /></td>
          	</tr><tr>
          		<td><input type="hidden" name="efreg_avatar" id="efreg_avatar" eform="Avatar::1" value="default.png" /><input type="hidden" name="efreg_avatar_desc" id="efreg_avatar_desc" eform="AvatarDesc::1" value="No Avatar Selected" /><input type="hidden" name="efreg_mysh_member" id="efreg_mysh_member" eform="mysh_member::1" value="mySymphonic Member" /></td>
          	</tr><tr>
          		<td>Password</td>
          		<td><input type="password" name="efreg_password" id="efreg_password" eform="Password:string:1:Must be at least 6 characters:#REGEX /^.{6,}$/" class="inputBox" style="width:300px" /></td>
          	</tr><tr>
          		<td>Retype Password   </td>
          		<td><input type="password" name="efreg_confirmpassword" id="efreg_confirmpassword" eform="Confirm Password:string:1" class="inputBox" style="width:300px" /></td>
          	</tr></table>
          </td></tr>
          	<tr>
          		<td align="right"><input type="submit" value="Create a mySymphonic account!" name="cmd_signup" /></td>
          	</tr>
          </table>
          
          </form>


          In case you need it, here’s the custom fields I have in web_user_mysymphonic...

          List of placeholders for selected custom table "web_user_mysymphonic":Placeholder name: Value for you (if any):
          webuser 8
          favtalesgame Tales of the Abyss
          otherfavgame Illusion of Gaia
          website Symphonic Heaven
          website_url www.symphonicheaven.com
          avatar_desc Albel Nox
          avatar albel.png
          aim SDeusMachina
          icq
          msn [email protected]
          yahoo symphonicheaven
          forum Albel
          oekaki Albel
          bio As you can tell, I like the play the games in the Tales series. I started out with Tales of Symphonia, and I have gotten the English versions since (except for the PSP port of Tales of Eternia, since I do not have a PSP). I also like other RPG’s (such as the Final Fantasy and Star Ocean series), but I enjoy to play platformers, puzzle, and some racing games. Throughout high school, I was pretty much a talkative kind of person, making friends with most of my classmates. So unless you piss me off for no good reason, we will get along. Music wise, I like most any kind of music, except for songs that just swear throughout, with no real basis for the lyrics. And one of my hobbies is playing the Pokemon TCG. So if you need any questions, feel free to ask me. That’s pretty much a good run through of everything about me. See you on the site!
          location United States
          mysh_member mySymphonic Member
          blog_betatester mySH Blog Beta Tester
          blog Albel

          BTW, thanks for taking the time to help me debug this. smiley
            My Snippets
            -> PopUpChunk v1.0
            • 31037
            • 358 Posts
            Ahhh here I see a problem:

            &otherTables=`web_user_mysymphonic: webuser: fullname, avatar, avatar_desc, mysh_member`

            You don’t have a field in your custom table called "fullname", that one is in the default attributes table and should not be listed in the otherTables parameter.

            Change to &otherTables=`web_user_mysymphonic: webuser: avatar, avatar_desc, mysh_member` and check again.

            However, this should have generated an error later in the script execution, but still, try change it and see what happens. Maybe there is one more problem, but check this one first.
              • 28033
              • 925 Posts
              Same error w/ that change. x_x

              I wonder what attribute is messing it up?
                My Snippets
                -> PopUpChunk v1.0
                • 31037
                • 358 Posts
                I’m short on time atm, but if you could add print_r($efreg_inputs_opt); on line 90 in efreg.inc.php and disable line 92 to 97 and line 104 and then check what the output will be and post it here or send it to me in a pm. I’m sure it is some simple problem, but we need to find it! smiley
                  • 28033
                  • 925 Posts
                  « MODx Parse Error »
                  MODx encountered the following error while attempting to parse the requested resource:
                  « PHP Parse Error »
                   
                  PHP error debug
                    Error: 	implode(): Bad arguments.	 
                    Error type/ Nr.: 	Warning - 2	 
                    File: 	/hsphere/local/home/tales/tales.rpgplanet.gamespy.com/assets/snippets/efreg/efreg.inc.php	 
                    Line: 	98	 
                    Line 98 source: 	$preparedFieldNames = implode(', ', $valuesFields); 	 
                   
                  Parser timing
                    MySQL: 	0.0053 s	(3 Requests)
                    PHP: 	0.5067 s	 
                    Total: 	0.5120 s


                  Apparently it goes to the next piece of code. BTW, you sure it wasn’t supposed to be after $k=0;?

                  And as you said, it does create a new webuser in modx_web_users --- so we at least know it’s creating the account, just it can’t save any attributes. However, that code "fix" did alert me that the username was already taken, which before, it would error before I even saw that message. Methinks we are getting close to whatever is causing the issue. smiley
                    My Snippets
                    -> PopUpChunk v1.0
                    • 31037
                    • 358 Posts
                    Soshite, sorry, my last suggestion was no good, we should have disabled line 90 to 111.

                    I’ve started to make a new version of efreg with a debug option for you. But while checking your error messages I found something that could be causing the problem.

                    If you could please add as a test an new input in your form for the field "phone", would be something like
                    <td><input type="text" name="efreg_phone" id="efreg_phone" eform="Phone:string:1" class="inputBox" style="width:300px" /></td>
                    and see what happens.

                    Please use the original snippet, not the one we’ve edited. Do not add the phone field to your efreg otherTables option, as this is from attributes table and that field is handled automatically when present as an input.

                    If the problem is what I believe, and there is no other problem, it may actually work this time. Small chance... smiley

                    Otherwise, I’ll continue working on the debug version tomorrow.

                    EDIT: I’ve successfully managed to get the same error now, so IF there is no other problem too it may work when adding that input field as suggested above. I’ll update efreg as soon as I get the time.
                      • 28033
                      • 925 Posts
                      Yep, works with that added. I’m going to test to see if I can make that field hidden, and see if it still works...

                      EDIT: After "creating" the new member, all of the data got saved like it should (I can see it in phpMyAdmin). But I don’t see it in the list at all. And when I manually go to his ID# page, it shows no data.

                      I noticed that with deleting the extra "members" I made by testing this script, the ID and Internal Keys of the members are out of whack (i.e., Testing Account, the one I just did, has a ID of 70, but an internal key of 74)...is that why it isn’t showing up right?

                      If so, I would probably need to delete all members that have a mismatched Key/ID, and reset the auto_increment, correct? If you happen to know the code to run in phpMyAdmin, I can do that in a snap.


                      UPDATE: Yep, that is the reason why. In the web_users table, that account has a ID of 74. In web_user_attributes, it has an ID of 70 (and a Internal Key of 74). If you can give me a "skeleton" framework of how to reset the autoincrement value, I can run that on all of the needed tables.
                        My Snippets
                        -> PopUpChunk v1.0