mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Fix #4715: Call to Content::canArchive()
throws error on global content
This commit is contained in:
parent
18edbc0e26
commit
e359659529
@ -6,7 +6,9 @@ HumHub Changelog
|
||||
- Fix #4668: table-responsive tables do not overflow due to default word break style
|
||||
- Fix #4679: Richtext extension scan does not include full title if title contains a `)`
|
||||
- Fix #4714: Use HTTPS protocol for default OEmbed endpoint URLs
|
||||
- Fix #4649: SSuccess message although password save error
|
||||
- Fix #4649: Success message rendered although password validation failed
|
||||
- Fix #4717: Repsonsive layout alignment issue on small screens
|
||||
- Fix #4715: Call to `Content::canArchive()` throws error on global content
|
||||
|
||||
|
||||
1.7.1 (November 27, 2020)
|
||||
|
@ -409,6 +409,16 @@ class Content extends ActiveRecord implements Movable, ContentOwner
|
||||
*/
|
||||
public function canArchive()
|
||||
{
|
||||
// Currently global content can not be archived
|
||||
if(!$this->contentcontainer_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// No need to archive content on an archived container, content is marked as archived already
|
||||
if($this->content->content->getContainer()->isArchived()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->getContainer()->permissionManager->can(new ManageContent());
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,8 @@ class ArchiveLink extends \yii\base\Widget
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
if (!$this->content->content->canArchive() || $this->content->content->getContainer()->isArchived()) {
|
||||
return;
|
||||
if (!$this->content->content->canArchive()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->render('archiveLink', [
|
||||
|
Loading…
x
Reference in New Issue
Block a user