Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Editing a Member in DataObjectManager

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1543 Views
  • micahsheets
    Avatar
    Community Member
    164 Posts

    Editing a Member in DataObjectManager Link to this post

    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.

  • poblom
    Avatar
    Community Member
    25 Posts

    Re: Editing a Member in DataObjectManager Link to this post

    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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Editing a Member in DataObjectManager Link to this post

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

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Editing a Member in DataObjectManager Link to this post

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

  • micahsheets
    Avatar
    Community Member
    164 Posts

    Re: Editing a Member in DataObjectManager Link to this post

    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.

  • Terry Apodaca
    Avatar
    Community Member
    109 Posts

    Re: Editing a Member in DataObjectManager Link to this post

    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!

    1543 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.