Fixes editing and pinning a post (#19425)
PR https://github.com/mattermost/mattermost-server/pull/19404 fixed the replies on posts by casting StringArray to a string. This PR fixes editing and pinning a post by casting StringArray, and StringInterface to a string as well. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -80,7 +80,7 @@ func (sa StringArray) Value() (driver.Value, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// non utf8 characters are not supported
|
||||
// non utf8 characters are not supported https://mattermost.atlassian.net/browse/MM-41066
|
||||
return string(j), err
|
||||
}
|
||||
|
||||
@@ -124,7 +124,12 @@ func (m *StringMap) Scan(value interface{}) error {
|
||||
|
||||
// Value converts StringMap to database value
|
||||
func (m StringMap) Value() (driver.Value, error) {
|
||||
return json.Marshal(m)
|
||||
j, err := json.Marshal(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// non utf8 characters are not supported https://mattermost.atlassian.net/browse/MM-41066
|
||||
return string(j), err
|
||||
}
|
||||
|
||||
func (si *StringInterface) Scan(value interface{}) error {
|
||||
@@ -147,7 +152,12 @@ func (si *StringInterface) Scan(value interface{}) error {
|
||||
|
||||
// Value converts StringInterface to database value
|
||||
func (si StringInterface) Value() (driver.Value, error) {
|
||||
return json.Marshal(si)
|
||||
j, err := json.Marshal(si)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// non utf8 characters are not supported https://mattermost.atlassian.net/browse/MM-41066
|
||||
return string(j), err
|
||||
}
|
||||
|
||||
var translateFunc i18n.TranslateFunc
|
||||
|
||||
Ссылка в новой задаче
Block a user