mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Use integer format for Content columns "visibility" and "state" right after creating (#6373)
This commit is contained in:
parent
1b3219582f
commit
0f5ef6b2f3
@ -6,6 +6,7 @@ HumHub Changelog
|
||||
- Fix #6345: Fix updating of post on wall stream
|
||||
- Fix #6351: Error when config `defaultReloadableScripts` is not array
|
||||
- Fix #6359: Avoid double call of `afterSave` on creating of a published content
|
||||
- Fix #6373: Use integer format for Content columns "visibility" and "state" right after creating
|
||||
|
||||
1.14.2 (May 22, 2023)
|
||||
----------------------
|
||||
|
@ -113,11 +113,13 @@ class ContentStateService extends Component
|
||||
*/
|
||||
public function set($state, array $options = []): bool
|
||||
{
|
||||
$state = (int) $state;
|
||||
|
||||
if (!$this->canChange($state)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((int) $state === Content::STATE_SCHEDULED) {
|
||||
if ($state === Content::STATE_SCHEDULED) {
|
||||
if (empty($options['scheduled_at'])) {
|
||||
return false;
|
||||
}
|
||||
|
@ -107,8 +107,8 @@ abstract class WallCreateContentForm extends Widget
|
||||
{
|
||||
Yii::$app->response->format = 'json';
|
||||
|
||||
$visibility = Yii::$app->request->post('visibility', Content::VISIBILITY_PRIVATE);
|
||||
if ($visibility == Content::VISIBILITY_PUBLIC && !$contentContainer->can(CreatePublicContent::class)) {
|
||||
$visibility = (int) Yii::$app->request->post('visibility', Content::VISIBILITY_PRIVATE);
|
||||
if ($visibility === Content::VISIBILITY_PUBLIC && !$contentContainer->can(CreatePublicContent::class)) {
|
||||
$visibility = Content::VISIBILITY_PRIVATE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user