Skip to content

Commit

Permalink
Prepare 1.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
luke- committed Apr 20, 2023
1 parent 0f3f879 commit 5e1f48d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.5.0 (April 20, 2023)
---------------------
- Enh: Support for `1.14` soft delete

1.4.0 (August 8, 2022)
---------------------
- Enh #105: Allow users to have galleries sorted by creation date
Expand Down
4 changes: 2 additions & 2 deletions models/CustomGallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ public function getPreviewImageUrl()
return $this->getDefaultPreviewImageUrl();
}

public function afterDelete()
public function afterSoftDelete()
{
foreach ($this->getMediaList() as $media) {
$media->delete();
}

return parent::afterDelete();
return parent::afterSoftDelete();
}

public function getItemId()
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "Gallery",
"description": "Adds galleries to Spaces and profiles.",
"keywords": ["gallery", "photo", "organisation"],
"version": "1.4.0",
"version": "1.5.0",
"humhub": {
"minVersion": "1.10"
"minVersion": "1.14"
},
"homepage": "https://github.com/humhub-contrib/gallery",
"authors": [
Expand Down
5 changes: 3 additions & 2 deletions tests/codeception/unit/CustomGalleryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use humhub\modules\gallery\models\CustomGallery;
use humhub\modules\gallery\models\Media;
use humhub\modules\space\models\Space;
use humhub\modules\user\models\User;
use tests\codeception\_support\HumHubDbTestCase;

class CustomGalleryTest extends HumHubDbTestCase
Expand Down Expand Up @@ -55,8 +56,8 @@ public function testDeleteGallery()
$this->assertTrue($media->save());

$gallery->refresh();
$this->assertEquals(1, $gallery->delete());
$this->assertTrue($gallery->delete());

$this->assertCount(0, Media::find()->all());
$this->assertCount(0, Media::find()->readable(User::findOne(['username' => 'User1']))->all());
}
}

0 comments on commit 5e1f48d

Please sign in to comment.