Merge pull request #13870 from annando/channel-languages

Fix: Saving of channel languages
This commit is contained in:
Hypolite Petovan 2024-02-04 09:18:02 -05:00 committed by GitHub
commit d9d42105d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -134,7 +134,7 @@ class UserDefinedChannel extends \Friendica\BaseRepository
'max-size' => $Channel->maxSize,
'full-text-search' => $Channel->fullTextSearch,
'media-type' => $Channel->mediaType,
'languages' => serialize($Channel->languages),
'languages' => !empty($Channel->languages) ? serialize($Channel->languages) : null,
'publish' => $Channel->publish,
'valid' => $this->isValid($Channel->fullTextSearch),
];

View file

@ -101,7 +101,7 @@ class Channels extends BaseSettings
continue;
}
if (!array_diff((array)$request['languages'][$id], $channel_languages)) {
if (!array_diff((array)$request['languages'][$id], $channel_languages) && (count((array)$request['languages'][$id]) == count($channel_languages))) {
$request['languages'][$id] = null;
}