jquery.SPServices-2014.01BETA2.js has not solved SPGetCurrentUser and SPGetCurrentSite bugs

Dec 8, 2014 at 2:16 PM
Edited Dec 9, 2014 at 5:42 AM
Hi,

I was having problem with SPGetCurrentSite returing / and SPGetCurrentUser returning blank for all fields of the current user and came across a post saying that that's a bug in the versions 2013.01, 2013.02, and 2014.01 so I downloaded and used jquery.SPServices-2014.01BETA2.js but the problem persists.

Shall we wait for the final release? or if the beta version has definitely fixed those bugs, then what else should I do to get my code working?(I'm on SP 2013)

Thanks

Farfalla
Coordinator
Dec 8, 2014 at 2:48 PM
Edited Dec 9, 2014 at 2:18 PM
Farfalla:

Both those functions should work in all versions. I'm not sure where you read that there were bugs, but that was incorrect.

My guess is that the scripts aren't loading in the page correctly. Please read the General Instructions to be sure you have things set up correctly.
M.
Dec 9, 2014 at 5:25 AM
Edited Dec 9, 2014 at 5:43 AM
Thanks.

I read it here in Codeplex wikipage.

And as for referencing JQuery and SPServices , I've loaded the libraries according to your own post (http://sympmarc.com/2011/07/08/adding-jqueryspservices-to-a-sharepoint-page-step-one-always/) but alert($().SPServices.SPGetCurrentSite()); returns / and SPGetCurrentUser returns blank for all fields ( I edited my original post)



Farfalla
Coordinator
Dec 9, 2014 at 2:19 PM
Farfalla:

Ah, yes. That's my note. ;+) It's a "bug" if you don't handle it in your own code.

Can you show your code? The "/" is correct if you're in the root site, given the caveat above.

M.
Dec 10, 2014 at 5:54 AM
I added WebURL="http://mysite" to SPGetCurrentUser() and it worked ! :D


This is the syntax,in case anyone needs it:
Var UserValues;
$(document).ready(function(){

UserValues=$()SPServices.SPGetCurrentUser({

WebURL:"http://mysite",
fieldName:"Department",
debug:false
});
Thanks anyway for all your posts everywhere! They've been a big help.

Farfalla
Coordinator
Dec 10, 2014 at 2:14 PM
Honestly, that shouldn't have made any difference, but I'm glad you got things working.

M.
Coordinator
Dec 11, 2014 at 4:25 PM
Edited Dec 11, 2014 at 4:26 PM
I just realized that I had uploaded the wrong file as the most current beta.

I had uploaded

jquery.SPServices-2014.01BETA2.js

instead of

jquery.SPServices-2014.02BETA2.js

Sorry for the trouble. The right version is there now.

M.
Dec 14, 2014 at 11:03 AM
As a matter of fact, I had been scratching my head for a while as to why the version of the latest file was 01BETA2 and not 02BETA2 :D

Thanks
Coordinator
Dec 14, 2014 at 4:49 PM
Sorry about that. Are you all set?

M.
Dec 15, 2014 at 5:48 AM
Edited Dec 15, 2014 at 5:52 AM
Yes,thanks.

Adding WebURL to my site solved the problem even when using jquery.SPServices-2014.01.js which is supposed to have a bug.

I'm a bit confused but the code is working anyway.

Thanks again.
Dec 19, 2014 at 7:56 AM
In 2014.02 doesn't retrieve any data, even when specifying webURL, it seems that the $(thisUserDisp.responseText).find("table.ms-formtable td[id^='SPField']").each part of the code doesn't retrieves anything
Coordinator
Dec 19, 2014 at 1:55 PM
vsampedro:

The function is working for me and I haven't gotten any other reports of issues. Can you please start a new discussion with more details?

M.