Skip to content

Commit d818ae8

Browse files
authored
Merge pull request #279 from topcoder-platform/issues-175
Issues-275, Issues-278
2 parents cef9658 + 577654f commit d818ae8

File tree

5 files changed

+479
-6
lines changed

5 files changed

+479
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN git clone https://github.com/topcoder-platform/forums-plugins.git /tmp/forum
1919

2020
# Remove SqlPlugin from PROD env
2121
RUN if [ "$ENV" = "prod" ]; \
22-
then rm -R /tmp/forums-plugins/SqlPlugin; \
22+
then rm -R /tmp/forums-plugins/DebugPlugin; \
2323
fi
2424

2525
# Copy the Filestack plugin

vanilla/applications/vanilla/controllers/class.discussioncontroller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ public function index($DiscussionID = '', $DiscussionStub = '', $Page = '') {
9090
// Define the query offset & limit.
9191
$Limit = c('Vanilla.Comments.PerPage', 30);
9292
$enableAutoOffset = c('Vanilla.Comments.AutoOffset');
93+
94+
$OffsetProvided = $Page != '';
95+
list($Offset, $Limit) = offsetLimit($Page, $Limit);
9396
// FIX: Allow plugins (ReplyTo) to change page and limit.
9497
// https://github.com/topcoder-platform/forums/issues/254
9598
// https://github.com/topcoder-platform/forums/issues/256
9699
$this->EventArguments['Discussion'] = $this->Discussion;
97-
$this->EventArguments['Page'] = & $Page;
100+
$this->EventArguments['Offset'] = & $Offset;
98101
$this->EventArguments['Limit'] = & $Limit;
99102
$this->EventArguments['EnableAutoOffset'] = & $enableAutoOffset;
100103

101104
$this->fireEvent('BeforeCalculatingOffsetLimit');
102105

103-
$OffsetProvided = $Page != '';
104-
list($Offset, $Limit) = offsetLimit($Page, $Limit);
105-
106106
// Check permissions.
107107
$Category = CategoryModel::categories($this->Discussion->CategoryID);
108108
$this->categoryPermission($Category, 'Vanilla.Discussions.View');

vanilla/applications/vanilla/models/class.categorymodel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public function follow($userID, $categoryID, $followed = null) {
359359
if (!is_array($category)) {
360360
throw new InvalidArgumentException('Category not found.');
361361
} elseif ($category['DisplayAs'] !== 'Discussions' && !$isFollowed) {
362-
throw new InvalidArgumentException('Category not configured to display as discussions.');
362+
// throw new InvalidArgumentException('Category not configured to display as discussions.');
363363
}
364364

365365
$this->SQL->replace(

vanilla/library/Vanilla/Formatting/Quill/Blots/Embeds/ExternalBlot.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Vanilla\Formatting\Quill\Blots\Embeds;
88

99
use Gdn;
10+
use Gdn_Upload;
1011
use Vanilla\EmbeddedContent\AbstractEmbed;
1112
use Vanilla\EmbeddedContent\EmbedService;
1213
use Vanilla\Formatting\Quill\Blots\AbstractBlot;
@@ -113,6 +114,14 @@ public function renderQuote(): string {
113114
} else {
114115
return "<p><a href=\"$sanitizedUrl\">$sanitizedUrl</a></p>";
115116
}
117+
} elseif ($embedType == 'file') {
118+
$fileName = $data['name'] ?? "";
119+
$size = $data['size'] ?? "";
120+
if($fileName && $size) {
121+
$formattedSize = Gdn_Upload::formatFileSize($size,2);
122+
return "<p><a href=\"$sanitizedUrl\">$fileName ($formattedSize)</a></p>";
123+
}
124+
116125
}
117126

118127
return "<p><a href=\"$sanitizedUrl\">$sanitizedUrl</a></p>";

0 commit comments

Comments
 (0)