Topic: edit profile not working  (Read 4256 times)

Pages: [1] 2  All   Go Down

#1: 26-Jan-2008, 09:07 AM

betoranaldi
Posts: 260

When i try to edit a profile, i change the passwords and click save, the password doesn't change. when i put in two different passwords and click save, it doesn't come up with any error message, just brings you back to the successful login page. This is all with the default form (not a custom form)

What could be wrong?

#2: 28-Jan-2008, 07:01 AM

Soshite
Posts: 925

WWW
When i try to edit a profile, i change the passwords and click save, the password doesn't change. when i put in two different passwords and click save, it doesn't come up with any error message, just brings you back to the successful login page. This is all with the default form (not a custom form)

What could be wrong?

Hmm...sounds oddly like the issue I had where it wouldn't display the error message above the account info (it just looked like it refreshed the page).

IIRC, I had to do something like call the lang.php file directly into WLPE. I'll take a look at what I did exactally in a few days for ya (very, very busy ATM).
My Snippets
-> PopUpChunk v1.0

#3: 28-Jan-2008, 10:13 AM

betoranaldi
Posts: 260

If you could look into that, (in a few days) that would be great.

The strange thing is I have another instance of the snippet running as a registration form and it works fine, spits out the missing fields text no problem.

The login form I have works fine, but once you click the profile button that appears you can't change passwords or anything (even if I fill out ever field on the form) the database still is not updated.

#4: 30-Jan-2008, 05:26 PM

betoranaldi
Posts: 260

This is driving me nuts.

At first i just through it was WebLoginPE's profile editor. I would fill out the form and hit submit, nothing would stick. I would update the password and purposely put in to incorrect passwords and it would just refresh the page and not update the password in the database. The weird thing is every other part of WebLoginPE is working correctly (that I can tell (I get error messages when I leave parts out of the form).) I even tried using the default profile form and it didn't help.

Today I got an idea to try and see if WebEditProfile. Same thing, the page just refreshes and nothing gets updated, no error messages.

I am totally lost with this and a webuser will need to be able to update their profile and password.

Does anyone have any other ideas?

#5: 31-Jan-2008, 06:04 AM

Soshite
Posts: 925

WWW
This is driving me nuts.

At first i just through it was WebLoginPE's profile editor. I would fill out the form and hit submit, nothing would stick. I would update the password and purposely put in to incorrect passwords and it would just refresh the page and not update the password in the database. The weird thing is every other part of WebLoginPE is working correctly (that I can tell (I get error messages when I leave parts out of the form).) I even tried using the default profile form and it didn't help.

Today I got an idea to try and see if WebEditProfile. Same thing, the page just refreshes and nothing gets updated, no error messages.

I am totally lost with this and a webuser will need to be able to update their profile and password.

Does anyone have any other ideas?

Hmm...this sounds like a different issue, since my problem was that NO error messages appeared. Dunno what's causing your issue, then...
My Snippets
-> PopUpChunk v1.0

#6: 31-Jan-2008, 07:05 AM

betoranaldi
Posts: 260

I finally figured this out... Once I created a custom form I changed the save button's value="saveprofile" to value="saveprofilesimple" and it started working.

#7: 31-Jan-2008, 11:48 AM

Soshite
Posts: 925

WWW
I finally figured this out... Once I created a custom form I changed the save button's value="saveprofile" to value="saveprofilesimple" and it started working.

Ahh, that old problem.  Cheesy
My Snippets
-> PopUpChunk v1.0

#8: 1-Feb-2008, 05:09 PM

daystarjustice
Posts: 7

is it letting you change your password though??  I'm in the same boat as you guys were, after adding 'simple' to the end of those button labels i was able to edit parts of my profile, but not my password.  it's like a curse.

are you able to change your password now??

#9: 1-Feb-2008, 05:52 PM

betoranaldi
Posts: 260

crap... your right.

It turns out nothing updates although it says that it does. (I though it was working but I suppose I was wrong)

Can someone post a form that works for them? It's strange that the standard forms that came with WebLoginPE doesn't even work.

My site is suppose to launch on Monday :/ I just wanna cry


« Last Edit: 1-Feb-2008, 06:06 PM by betoranaldi »

#10: 1-Feb-2008, 06:19 PM

betoranaldi
Posts: 260

is it letting you change your password though??  I'm in the same boat as you guys were, after adding 'simple' to the end of those button labels i was able to edit parts of my profile, but not my password.  it's like a curse.

are you able to change your password now??

I found a fix for this... if you change name="password.confirm" to name="passwordconfirm" on the last password txt field it seem to fix the problem.

I still cannot get anything else to update though. Sad or rather, I can add stuff to blank fields and it will save. but when I try to clear out the blank field or replace it with something else it will not save. I have to put a blank space in, in order for it to "remove" it.

I found out that WebLoginPE is indeed supposed to work like this...

Quote
No.
This is just the way WebLoginPE works to make sure that data you have not provided in a form does not get overwritten.

WebLoginPE uses an array of all the columns in the default attributes table, then loops $_POST to see if those columns are in there. if they ARE NOT, then they are not posted to the db. so if you previously filled out the zipcode, then set it to ""(blank), well that value will not end up in the $_POST Array and thus not end up being saved into the database.

Using the "Zip code" example:
Let's say you have a userprofile form where you DO NOT let them edit the zip code, so you do not provide a text input named "zip". If WebLoginPE did not work the way it does, the zip column in the database would be set to blank everytime the user saved their profile since no value was passed for it. That is why I had it loop through and get rid of fields with no value before saving to the db.

You can change the value to whatever you want, just not (Blank). This  is simple data protection 101.

-sD-
Dr. Scotty Delicious, DFPA

« Last Edit: 1-Feb-2008, 06:25 PM by betoranaldi »

#11: 19-Feb-2008, 08:58 AM

daria
Posts: 11

I love MODx!

I found a fix for this... if you change name="password.confirm" to name="passwordconfirm" on the last password txt field it seem to fix the problem.

I still cannot get anything else to update though. Sad or rather, I can add stuff to blank fields and it will save. but when I try to clear out the blank field or replace it with something else it will not save. I have to put a blank space in, in order for it to "remove" it.

I found out that WebLoginPE is indeed supposed to work like this...

Did you find anything about the profile update ? The password update work, and the profile update also work but only if I replace with text. If I leave blank a field it is just ignored.

Thanks

#12: 19-Feb-2008, 12:00 PM

betoranaldi
Posts: 260


Did you find anything about the profile update ? The password update work, and the profile update also work but only if I replace with text. If I leave blank a field it is just ignored.

Thanks

There is nothing to fix... this is how it is supposed to function.

see this quote...

Quote
No.
This is just the way WebLoginPE works to make sure that data you have not provided in a form does not get overwritten.

WebLoginPE uses an array of all the columns in the default attributes table, then loops $_POST to see if those columns are in there. if they ARE NOT, then they are not posted to the db. so if you previously filled out the zipcode, then set it to ""(blank), well that value will not end up in the $_POST Array and thus not end up being saved into the database.

Using the "Zip code" example:
Let's say you have a userprofile form where you DO NOT let them edit the zip code, so you do not provide a text input named "zip". If WebLoginPE did not work the way it does, the zip column in the database would be set to blank everytime the user saved their profile since no value was passed for it. That is why I had it loop through and get rid of fields with no value before saving to the db.

You can change the value to whatever you want, just not (Blank). This  is simple data protection 101.

-sD-
Dr. Scotty Delicious, DFPA

#13: 3-Mar-2009, 04:09 AM


therebechips
Posts: 386

WWW
Sorry to bump this old thread, but I experienced this problem with the default install of WebLoginPE 1.31 (bugfix) in Firefox 3 (Mac).

The problem is the use of the multiple <button> elements for the form submit, and the associated javascript that fixes a bug with buttons in IE. The javascript throws an error in Firefox 3, and so the form does not submit the form data.

One solution is to comment out this line 95 in webloginpe.snippet.php (that you copied into the manager):
/* $modx->regClientStartupScript('assets/snippets/webloginpe/js/ieButtonFix.js'); */

And then add the script back in to the head of your document template using IE conditional comments:
Code:
<!--[if IE]>
<script type="text/javascript" src="assets/snippets/webloginpe/js/ieButtonFix.js"></script>
<![endif]-->


If you would rather not rely on JS for the form submission in IE, the solution is to make the 'save' button an <input type="submit" value="save" />, create a hidden input with the name 'service' and the value 'saveprofilesimple', and then make the other buttons anchors with the service appended as a query string instead (eg <a href="[~[*id*]~]?service=cancel">Cancel</a>). (Edit: Note that this approach is considered bad practice as RESTful links are meant to be 'safe', ie not perform a delete/add/edit action).

« Last Edit: 3-Mar-2009, 04:58 AM by therebechips »
Snippets: GoogleMap | FileDetails | Related Plugin: SSL

#14: 26-Mar-2009, 03:53 PM

versifier
Posts: 5

For those who are not able to get WebLoginPE Profile Editing to work, I just wanted to share my experience with this problem and what finally ended up working for me... Hopefully this will help end hours of frustration. The solution to my problem ended up being rather simple.

I am using &type=`simple` and using the $wlpeProfileTpl form template found in webloginpe.templates.php to allow users to edit their own profiles. As many users experienced, I was not able to save any data entered in the form to my database. In testing my login facility I noticed that the Forgot Password & Reset Password functions were working (aka saving the new password to the database). Why does this work and not the Profile Editor?

The Forgot Password / Reset Password uses the $wlpeActivateTpl form, which uses the following form element.

<input type="hidden" name="userid" value="[+request.userid+]" />

This form element is missing from the $wlpeProfileTpl form template. When I added it, the Profile Editor saved all user profile edits to my MODx database. I'm working with a pretty vanilla install of MODx and the WebLoginPE plugin, so I didn't have to do anything else. No FURLS issues, no JavaScript workarounds, etc. That's all I did. Smiley

#15: 20-Apr-2009, 07:00 PM


Everett
Posts: 1,004

WWW
I've read through this thread and I still can't get the profile editing to work. I'm on a Mac running Safari 3.2.1.  I added the userid form element to the webloginpe.templates.php, but that didn't change anything... when viewing the form, the value never populated.  Even when I hard-coded the value with a userid, the profile would not update.  I also tried commenting out the IE button fix, but that had no effect either.

This is pretty frustrating.  What else could be going on here?  My Snippet call looks like this:
Code:
[!WebLoginPE? &type=`simple` &registerTpl=`registerTpl` &regType=`verify`!]

I've verified that the data is not making it into the database... the fields aren't updating at all.

Thanks.

#16: 21-Apr-2009, 03:32 AM


therebechips
Posts: 386

WWW
@Everett

Try adding this to the bottom of your register template, in place of the existing buttons:

Code:
<input type="hidden" name="service" value="register" />
<button type="submit">Register</button>
Snippets: GoogleMap | FileDetails | Related Plugin: SSL

#17: 21-Apr-2009, 11:58 AM


Everett
Posts: 1,004

WWW
I'm not having trouble registering users... that part is working fine.  I did try editing my profileTpl in the manner you outlined.  But it still doesn't work... I don't see how it can if it isn't reading the userid value.

Here's what I put in my profileTpl:

Code:
<fieldset id="wlpeUserProfileButtons">
<input type="submit" id="wlpeUserProfileButtons"  name="service"  value="saveprofile"/>
<input type="submit" id="wlpeProfileDoneButton" name="service" value="cancel"/>
<input type="submit" id="wlpeProfileLogoutButton" name="service" value="logout"/>
<input type="submit" id="wlpeProfileDeleteButton" name="service" value="deleteprofile"/>
</fieldset>

Just for kicks, I put in a Snippet that does a print_r($_REQUEST), and the edit profile page coughs up this stuff:
Code:
Array (
[q] => simple
[serviceButtonValue] => profile
[service] => profile
[WebLoginPE] => 96c7b01c8aa73837972478aedd41a6bc|323030efb5036e6d91b7c8465c8f91bb
[webfxtab_resourcesPane] => 2
[SN49ece1a413e53] => ffed8f5d62347a009cd58b881a43c02f
[QE_linksShown] => 1
 )

Is the userid in the session or cookie?  Otherwise I don't see how this is supposed to work.  Any other ideas?

#18: 21-Apr-2009, 12:35 PM


therebechips
Posts: 386

WWW
@Everett

So you tried this right?
Code:
<input type="hidden" name="service" value="saveprofile" />
<button type="submit">Save</button>

Note that using multiple input submit buttons will fail in IE without the javascript hack that you commented out before. (But with the hack it will fail in Firefox 3 - hence I don't use multiple submit buttons!)

« Last Edit: 21-Apr-2009, 12:38 PM by therebechips »
Snippets: GoogleMap | FileDetails | Related Plugin: SSL

#19: 21-Apr-2009, 12:59 PM


Everett
Posts: 1,004

WWW
Thanks for the response.  Nope, that doesn't work.  Just to make sure I'm doing what you suggested: I made a custom chunk and referenced it in profileTpl and removed all the submit buttons except for this one:
Code:
<input type="hidden" name="service" value="saveprofile" />
<button type="submit">Save</button>

I'm calling the Snippet and the profile chunk using this:
Code:
[!WebLoginPE? &type=`simple` &profileTpl=`profileTpl`!]

I also tried adding the userid field:
Code:
<input type="hidden" name="userid" value="[+request.userid+]" />


But when the form is rendered, the value is always empty:
Code:
<input type="hidden" name="userid" value="" />

So long as the userid never makes it through, I don't see how this can possibly work.  The Snippet needs to know the userid, otherwise it can't update the database.  Even if I HARDCODE the userid, this thing fails.  I think this Snippet is critically flawed... I'm about at the point where I just code my own solution, but I'm still holding on to some hope because I need login functionality for about 3 or 4 other sites.

Frustrated... -_-

#20: 21-Apr-2009, 02:23 PM


Everett
Posts: 1,004

WWW
Ok, if I call the Snippet using the type=`profile`, I can update the profile:
Code:
This works:
[!WebLoginPE? &type=`profile` !]

If I call the Snippet using type=`simple`, I can NOT update the profile:
Code:
This does NOT work:
[!WebLoginPE? &type=`simple`!]

Even if I specify the "corrected" version of the profileTpl, the type=`simple` fails.  At least now I can make this work somehow for my site.

Anyone have any ideas as to why this Snippet fails under these conditions?
Pages: [1] 2  All   Go Up
0 Members and 1 Guest are viewing this topic.