Issue 45353: LKSM/LKS users: Cannot create a naming pattern reference (with walking the lookup) cross folder

issues
Status:closed
Assigned To:Guest
Type:Feature Request
Area:Sample Manager
Priority:3
Milestone:22.03
Opened:2022-04-27 15:59 by hannahb
Changed:2022-05-05 10:59 by hannahb
Resolved:2022-05-03 12:43 by xyang
Resolution:Fixed
Support Ticket: 
Pull Requests:platform#3307
Closed:2022-05-05 10:59 by hannahb
2022-04-27 15:59 hannahb
Title»LKSM/LKS users: Cannot create a naming pattern reference (with walking the lookup) cross folder
Assigned To»Susan Hert
Notify»hannahb;cnathe;xyang
Type»Feature Request
Area»Sample Manager
Priority»3
Milestone»22.03
This may have been a TBD-ed issue, but I recall it being known.

To repro:

- Create a non LKSM folder and create a Sample Type (MySampleType) with a field called "ID".
- Create a sample with name "1234-test" and the ID "1234"
- Create another LKSM folder on the server
- Create a Source with a lookup field to the MySampleType and name it "ID"
- Define the naming pattern as ${ID/ID} --> intention is to get the source ID = "1234"
- Save and get an error: ${ID/ID} not found

When I create the MySampleType within the same folder, this works as expected


Note: I repro-ed this twice and witnessed the client repro, and when I went to do it again it didn't repro, so this may need a conversation

2022-04-29 09:54 Susan Hert
Assigned ToSusan Hert»xyang
Notifyhannahb;cnathe;xyang»hannahb;cnathe;xyang;Susan Hert

2022-04-29 13:33 xyang
To clarify, is the "non LKSM folder" the "Shared" folder?

Otherwise I'm not understanding why we should support lookup to a sample type that this container have no access to.

2022-04-29 13:35 hannahb
It's not, it's just a sibling folder. Since this is LKS, we do allow for lookups across folder types normally (although I suppose we're not using them to define IDs), so I would anticipate this to work in a similar way (and just rely on admins to ensure users have access to both).

If we don't want to do that because it's a bit of a security loophole, LMK and I can think some more about it

2022-04-29 15:42 xyang
TitleLKSM/LKS users: Cannot create a naming pattern reference (with walking the lookup) cross folder»**LKSM/LKS users: Cannot create a naming pattern reference (with walking the lookup) cross folder
Assigned Toxyang»Dan Duffek
Pull Requests»https://github.com/LabKey/platform/pull/3305
Since it's a small change, I went ahead with a fix, skipping estimate.

The PR is targeting develop. Let me know if it should go to 22.03.

2022-04-29 16:28 hannahb
Thanks Xing! Yes please for a 22.3.x release

2022-04-29 16:46 xyang
Pull Requestshttps://github.com/LabKey/platform/pull/3305»https://github.com/LabKey/platform/pull/3307
PR updated to target 22.03

2022-05-03 11:59 Dan Duffek
Assigned ToDan Duffek»xyang
I validated this in the branch.
The scenario as described below works.

However, when I create a source that has a lookup value and click on the link in the lookup filed I get a "Not Found" page. That is the link does not navigate out of the SampleManager app and open the sample overview page in LKS.

I think this navigation issue might be a larger issue in 22.3 for LKSM. As a test I create a LKSM sample type with a lookup field to a list in another folder. Clicking this link results in a client side error:
"Could not find the query 'List01' in the schema 'lists'!", success: false, exceptionClass: 'org.labkey.api.view.NotFoundException'

This same scenario (LKSM -> list in a different folder) works as expected in develop. I'm guessing/hoping that once this fix is merged into develop the link from the source to the schema in the other folder will work as expected.

2022-05-03 12:43 xyang
resolve as Fixed
Title**LKSM/LKS users: Cannot create a naming pattern reference (with walking the lookup) cross folder»LKSM/LKS users: Cannot create a naming pattern reference (with walking the lookup) cross folder
Statusopen»resolved
Assigned Toxyang»hannahb
PR merged for the name pattern issue. Will test link issue once this is merged to develop

2022-05-05 10:59 hannahb
close
Statusresolved»closed
Assigned Tohannahb»Guest
Notifyhannahb;cnathe;xyang;Susan Hert»hannahb;cnathe;xyang;Susan Hert;laurenb
Verified both the naming pattern and the link correctly resolves