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
fix(groups): Hide group profile fields that don't have a value #8040
Conversation
// The group profile displays all profile fields that have a value. | ||
// We don't want to display fields with empty string value, so we | ||
// prevent it getting saved by setting the value to null. | ||
$input[$shortname] = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does setting to null actually remove metadata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just handle this where we copy $input to metadata. If it's empty string, deleteMetadata() instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ElggEntity in fact first removes the metadata: https://github.com/Elgg/Elgg/blob/1.10/engine/classes/ElggEntity.php#L412
Metadata service later ignores the null value: https://github.com/Elgg/Elgg/blob/1.10/engine/classes/Elgg/Database/MetadataTable.php#L123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using delete or unset() until #8042 is resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
The group profile displays all profile fields that have a value. We don't want to display fields with empty string value, so we now remove the metadata completely.
0b020c6
to
2bb13db
Compare
Updated to use |
LGTM |
fix(groups): Hide group profile fields that don't have a value
No description provided.