Two innocuous little questions

LabKey Support Forum (Inactive)
Two innocuous little questions Leo Dashevskiy  2017-09-01 12:37
Status: Closed
 
Hello all!

1.
Do LABKEY.user.isGuest and LABKEY.user.isSignedIn always have opposite values or are there some exceptions?

2.
Wanted to see if it's a bug or a feature on your guys' end.
We've got a table column initially called: "study_time_t0_event"
Your caption engine converts it to "Study Time T0Event".

For some reason we query it with colNameOpt = 'caption' (and not 'rname') and then "munge" it:
lowercase it and replace "_" with " ", but that results in: "study_time_t0event", which is different from the original, and that creates some problems that are resolved manually...
So my question is: is it intended in your case instead of replacing "_" with a " " to drop the "_" after a numeric?

Thanks and good Friday to all!
-Leo
 
 
Jon (LabKey DevOps) responded:  2017-09-02 00:05
Hi Leo,

I'm not sure I understand the first question. The setting for those usually is set to TRUE for "isGuest" if the user is the guest (anonymous) user and "isSignedIn" if this user is signed in. Since guests don't actually login, it would make sense that the isSignedIn is set to FALSE for isGuest users.

Regarding the second question, I'm not seeing the behavior you're describing.

I created a list and created a column called "study_time_t0_event" and it appears as the header label as "Study Time T0 Event", so it should just replace all underscores with spaces, regardless of whether there is a number or not.

When I did this testing, it was in Trunk. What version of LabKey did you notice this behavior on?

Regards,

Jon
 
Leo Dashevskiy responded:  2017-09-05 14:49
Hi, Jon!

1.
My question here was, is my assumption correct that there are only 2 configurations (not 4 like in generic case) for these 2 variables: either isGuest == true && isSignedIn == false or isGuest == false && isSignedIn == true ?
You said that isGuest == true && isSignedIn == true is not possible, which makes sense.
But neither is isGuest == false && isSignedIn == false, correct? If one is not signed in is their "role" automatically set to "guest"?

2.
Please, see: https://test.immunespace.org/study/Studies/SDY269/dataset.view?datasetId=5014&Dataset.viewName=full
I don't believe you're registered, but we have self-registration available there.
Let me know via ldashevs@fhcrc.org if you have any further questions...

Thanks.
-Leo
 
Jon (LabKey DevOps) responded:  2017-09-07 13:37
Hi Leo,

Correct. If the user isn't actually logged in, the system automatically assumes they are a guest user and only allows guest privileges if they are actually applied in the permissions. If the guest user isn't assigned any permissions to read anything, then all the user gets is a login prompt no matter what page they try to access until they do log in.

Checking the other issue, I do see the field spelled out as "Study Time T0Event", but I have no ability to check the dataset configuration or to see the version of LabKey the server is running on due to my permission level.

If you do have Site Admin permissions, can you go to Admin > Site > Admin Console and confirm the version of LabKey the test server is running by going to the middle of the page and clicking the + sign next to where it lists the "Core" module? It should show a version number next to the word "Core" and expanding the section should also show a Build Number.

Regards,

Jon
 
Leo Dashevskiy responded:  2017-09-07 14:24
Jon,

It's great that you are able to see the column Caption. When hovering over it, though, were you able to see the underlying column name as "study_time_t0_event"?

The build number of LK from the Core module is 53240.42

Hm, you know what, I looked at the dataset definition and it had "Study Time T0Event" specified for the Label of that column. I was able to just add the space... I'll follow up with Matt shortly to see if he knows how the missing space came about - my assumption is that these Labels were generated programmatically somehow...

Thanks.
-Leo
 
Jon (LabKey DevOps) responded:  2017-09-07 14:30
Thanks Leo,

I do see the field name with the underscores. If the label is specified as such, it will render that way. But if the field label is blank, it should treat the values as spaces in lieu of underscores regardless of what values are next to it.

I'll test this out in a test version of LabKey using a version that is closer to the one you're running, but I suspect that this may have been user error since I can't reproduce the conditions so far beyond manually setting the Label of the field that way intentionally.

Regards,

Jon
 
Leo Dashevskiy responded:  2017-09-07 16:09