Commit d888d9c9 authored by Ben Hayward's avatar Ben Hayward

Fixed breaking media and blogs

1 merge request!384[Sprint/QuietQuail](fix): Blog & media edit updated to new nsfw system #1936
Pipeline #97365924 running with stages
......@@ -502,6 +502,7 @@ class Blog extends RepositoryEntity
}
}
$this->nsfw = $array;
$this->markAsDirty('nsfw');
return $this;
}
......
......@@ -296,7 +296,7 @@ class Image extends File
if ($field == 'access_id') {
$data[$field] = (int) $data[$field];
} elseif ($field == 'nsfw') {
$this->setFlag('nsfw', !is_array($data['nsfw']) ? json_decode($data['nsfw']) : $data['nsfw']);
$this->nsfw = !is_array($data['nsfw']) ? json_decode($data['nsfw']) : $data['nsfw'];
continue;
}
......
......@@ -187,7 +187,7 @@ class Video extends MindsObject
'title' => null,
'description' => null,
'license' => null,
'mature' => null,
'nsfw' => null,
'boost_rejection_reason' => null,
'hidden' => null,
'access_id' => null,
......@@ -204,7 +204,7 @@ class Video extends MindsObject
'hidden',
'access_id',
'container_guid',
'mature',
'nsfw',
'boost_rejection_reason',
'rating',
'time_sent',
......@@ -218,11 +218,15 @@ class Video extends MindsObject
if ($field == 'access_id') {
$data[$field] = (int) $data[$field];
} elseif (in_array($field, ['mature', 'full_hd'], true)) {
} elseif (in_array($field, ['full_hd'], true)) {
$this->setFlag($field, !!$data[$field]);
continue;
}
if (in_array($field, ['nsfw'], true)) {
$this->nsfw = !is_array($data['nsfw']) ? json_decode($data['nsfw']) : $data['nsfw'];
}
$this->$field = $data[$field];
}
......
Please register or to comment