Skip to content

OBGM-516 Unable to run inventory by location report#4112

Merged
awalkowiak merged 2 commits intofeature/upgrade-to-grails-3.3.10from
OBGM-516
Jun 19, 2023
Merged

OBGM-516 Unable to run inventory by location report#4112
awalkowiak merged 2 commits intofeature/upgrade-to-grails-3.3.10from
OBGM-516

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

…getters in MultiLocationInventoryReportCommand
Comment on lines 38 to 42
return actionButton?.equalsIgnoreCase("run") ?: false
}

Boolean getIsActionDownload() {
return actionButton?.equalsIgnoreCase("download")
return actionButton?.equalsIgnoreCase("download") ?: false
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This part was throwing that isActionRun and isActionDownload cannot be null, so as a solution, I am returning false when actionButton is null.


Boolean getIsActionRun() {
return actionButton?.equalsIgnoreCase("run")
return actionButton?.equalsIgnoreCase("run") ?: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

@alannadolny by default all Grails properties are nullable: false. To make it work "in a clean way", you need to add the transients to the constraints and mark them as nullable: true.
So to add:

static constraints = {
...
isActionRun(nullable: true)
isActionDownload(nullable: true)
}

@alannadolny alannadolny requested a review from kchelstowski June 19, 2023 07:23
categories(nullable: true)
includeSubcategories(nullable: true)
actionButton(nullable: true, inList: ["run", "download"])
isActionRun(nullable: true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these two lines should not be here. I think you said, that adding ?: false to getters was enough.

@awalkowiak awalkowiak merged commit 88daf0b into feature/upgrade-to-grails-3.3.10 Jun 19, 2023
@awalkowiak awalkowiak deleted the OBGM-516 branch June 19, 2023 13:28
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