Skip to content

Issue 53306: Some LKS forms don't distinguish between fields properly #6804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

labkey-jeckels
Copy link
Contributor

Rationale

Some <input> fields are using name attributes that don't differentiate from similarly named fields.

Changes

  • Eliminate ColumnInfo.getPropertyName()

@labkey-jeckels labkey-jeckels marked this pull request as ready for review July 10, 2025 22:14
@labkey-jeckels labkey-jeckels requested review from a team and labkey-matthewb July 10, 2025 22:14
@@ -215,12 +215,6 @@ public boolean isShouldLog()
return delegate.isShouldLog();
}

@Override
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah!

@@ -721,7 +721,7 @@ public JSONArray getIssues()
/**
* Parse out the issues forms from the JSON data
*/
public List<IssuesForm> getIssueForms()
public List<IssuesForm> getIssueForms(User user, Container container)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Initializing a shared object here _issueForms with non-constant values for user and container could result in an improper result.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Initializing a shared object here _issueForms with non-constant values for user and container could result in an improper result.

Which objects are shared?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _issueForms is shared but created given variable input.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But IssuesApiForm is allocated per request.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe your point is that User and Container don't need to be passed in at all?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point is that there are multiple calls to getIssueForms(User user, Container container) that currently all pass in the same container/user. However, if one did not, and it was different, say an admin user or something, it could end up returning an instance that is not initialized with the admin user but then continuing work assuming it is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, which is why we have getViewContext() for Action classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make IssuesApiForm non-static so it can get the user and container from the ViewContext. This more clearly binds it to an individual request.

"priority", "1",
Maps.of("Type", "UFO",
"Area", "Area51",
"Priority", "1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is "Comments" capitalized in mothership but then "comments" here in issues? Does matching case actually matter I guess is what I'm really asking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love the mix, but the issues form is custom-coded. It now has a mix of camel and capitalized fields, depending on whether they're lookups or not. Mothership is generated by a more standard update form codepath.

Copy link
Contributor

@labkey-matthewb labkey-matthewb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. My only thought is that the remaining usages of propNameFromName seem to be for id attributes? Maybe we can put that last nail in this coffin by consolidating with PageConfig.makeId()?? Maybe PageConfig.makeIdFromName()?

@labkey-jeckels
Copy link
Contributor Author

This looks great. My only thought is that the remaining usages of propNameFromName seem to be for id attributes? Maybe we can put that last nail in this coffin by consolidating with PageConfig.makeId()?? Maybe PageConfig.makeIdFromName()?

Yes, plus for making script-friendly names in a couple of places in report code. I moved it from ColumnInfo to PageConfig and renamed it. I didn't attempt to make them all unique though. See my most recent commit in this FB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants