mrackley / StratusForms

Lightweight InfoPath alternative for SharePoint 2007,2010,2013,2016,2019 and Office 365
82 stars 36 forks source link

People Picker Field - Saving causes the "\" to duplicate #5

Open timmermang opened 6 years ago

timmermang commented 6 years ago

Hi Marc, Thank you for the support on the previous issue ... Still loving the product !

Can you please check the People Picker field ? When I first time save a people field, it saves "CORP\USER1". If I modify the item and save it again, it will be saved as "CORP\USER1". Next time will be "CORP\\USER1" ...

mrackley commented 6 years ago

hmm... and this is with version 1.5? What version of SharePoint are you using? I'll look into it.

timmermang commented 6 years ago

Hi Mark, It's indeed version 1.5 and SharePoint 2016. I'll check it again tomorrow just to be sure but I've tested it twice

timmermang commented 6 years ago

Hi Mark, Just finished testing and I can confirm that it happens with version 1.5. I switched back to version 1.4 and I didn't have the issue. I do have to correct myself. The first submit of the people picker item contains already 2 backslashes

mrackley commented 6 years ago

Thanks, I'm trying to find an environment I can reproduce it on.

mrackley commented 6 years ago

Does it save the "\\" in the StratusFormsData object or does it just display it in the form field?

timmermang commented 6 years ago

It's saved into the StatusFormsData but it is not visible in the form itself because of the Peoplepicker translation

mrackley commented 6 years ago

I just confirmed in my on prem environment that it is storing the user as Domain\user, but the people picker is still functioning properly and resolving the user. Is it possible to get me access to your dev environment to see what's going on?

timmermang commented 6 years ago

I duplicated the site collection to another environment and I still have the same issue. How do I provide you the credentials to that environment ?

mrackley commented 6 years ago

Shoot me an email at mrackley@gmail.com and we'll get this sorted. Are you using something other than Windows authentication?

mrackley commented 6 years ago

the reason it wasn't working is because you were not waiting for the client side scripts to load. When using SharePoint's client side scripts for things like PeoplePickers you have to wait for them to load before you can use them. When creating a new item, they have plenty of time to load before you start to fill out the people picker, however when you are loading a new page, the the people picker was getting set before the client libraries were loaded. Causing the error you saw. Make you use "ExecuteOrDelayUntilScriptLoaded" instead jQuery document ready when using the PeoplePickers. I updated the Documentation on the StratusForms site to make this more clear.

davidcfk commented 6 years ago

Oops. I wrote a line of code that fixes that waiting on a pull-request... basically drops the double slash back to one when resolving, the final decoding call will cleanse the data out (just in case) and revert to doubleslash... but at least it doesn't then continue to add slashes on each re-save.