Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

Editing a Member in DataObjectManager


Go to End


6 Posts   1997 Views

Avatar
micahsheets

Community Member, 165 Posts

1 October 2009 at 6:24am

I use DataObjectManger to edit Members. This works well except for one thing. In the editor popup I see both the fields for setting/changing the password and the link that says "Change Password". Normally the password fields would not be visible until that link is clicked. This will be confusing to the end users of the system I am creating.

Avatar
poblom

Community Member, 25 Posts

1 October 2009 at 11:48pm

I also run into this problem the other day. The reason is a js (ConfirmedPasswordField.js) that does not work since prototype and behaviour is blocked. I noticed like you that the password fields was visible and that I could not change a members password. To fix this I rewrote the script to have the same functionality as the original but using jQuery (see below).

Blocking the original script and calling my version in the DataObjectManager_Popup class constructor fixed this.

Requirements::block(SAPPHIRE_DIR . "/javascript/ConfirmedPasswordField.js");
Requirements::javascript('dataobject_manager/javascript/MyConfirmedPasswordField.js');

I'm no js guru so I imagine this script could be optimized, but it works!

Save the following code to a file "MyConfirmedPasswordField.js"

(function($) {
$(document).ready(function(){
	$(".showOnClickContainer").hide();
	$("#Password input.hidden").val(false);
	
	$(".confirmedpassword .showOnClick a").click(function(){
		$(".showOnClickContainer").toggle();
		var _v = $(".showOnClickContainer").css("display") == "block" ? true : false;
		$("#Password input.hidden").val(_v);
	});
});
})(jQuery);

Maybe something for You to checkin, UncleCheese?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

2 October 2009 at 1:27am

Perfect. Thank you. I was going to write something like that to get around this issue.

Avatar
micahsheets

Community Member, 165 Posts

2 October 2009 at 11:28am

Thanks, I implemented that change and it does indeed work.

Avatar
micahsheets

Community Member, 165 Posts

10 October 2009 at 9:41am

Uncle Cheese,

just a reminder, using the dataobjectmanager code from svn October 9th and the fix that I had put in that was working for the password fields is now not working again. I assume that you have not yet implemented your own fix for this?

I will put the fix from this thread back in and check it again after the next svn update I do.

Avatar
Terry Apodaca

Community Member, 112 Posts

21 December 2010 at 1:43pm

The fix works....in a way.

I put this code in, but when i click on the link it goes to the home page. For some reason the link isn't being written correctly. instead of the full URL like http://www.mysite.com/members/profile/edit/#

the url is just being written as http://www.mysite.com/#

have no clue, so if anyone has an idea, that would be great!