GUACAMOLE-1728: Allow Null User Object attributes to be saved.#783
Merged
mike-jumper merged 1 commit intoapache:masterfrom Dec 29, 2022
Merged
GUACAMOLE-1728: Allow Null User Object attributes to be saved.#783mike-jumper merged 1 commit intoapache:masterfrom
mike-jumper merged 1 commit intoapache:masterfrom
Conversation
necouchman
requested changes
Dec 28, 2022
guacamole/src/main/java/org/apache/guacamole/rest/user/UserResource.java
Outdated
Show resolved
Hide resolved
Contributor
|
What does `setAttributes()` receive when the timezone field has been
cleared?
…On Wed, Dec 28, 2022, 1:02 PM Alexander Leitner ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
guacamole/src/main/java/org/apache/guacamole/rest/user/UserResource.java
<#783 (comment)>
:
> @@ -150,6 +150,10 @@ public void updateObject(APIUser modifiedObject) throws GuacamoleException {
throw e;
}
+ /* Force updateObject to save the timezone when it is empty */
+ if (modifiedObject.getAttributes().get("timezone") == null)
+ modifiedObject.getAttributes().put("timezone", "");
+
The alternative that I can think of would be to have the empty timezone be
represented as an empty string rather than null on the javascript side
—
Reply to this email directly, view it on GitHub
<#783 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDLCSMFKYP3RUYWQZTOG6DWPSTHDANCNFSM6AAAAAATLRDYLM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
mike-jumper
requested changes
Dec 29, 2022
Contributor
mike-jumper
left a comment
There was a problem hiding this comment.
Please update your commit message to reflect the high-level nature of the change.
guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectTranslator.java
Outdated
Show resolved
Hide resolved
mike-jumper
approved these changes
Dec 29, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attributes with a value of
nullget filtered out when saving objects. An emptytimezoneattribute isnull, but we want to save null value attributes.