Skip to content

Commit a34f214

Browse files
committed
Newsletter - prevent sending on post update (3.3.0.4)
1 parent 409e5b1 commit a34f214

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

BlogEngine/BlogEngine.Core/Post.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,12 +1608,24 @@ protected override void DataUpdate()
16081608
}
16091609
}
16101610

1611+
// trigger even only when post goes from unpublished to published
1612+
var updateAndPublish = false;
1613+
try
1614+
{
1615+
var isOldPublished = BlogService.SelectPost(Id).IsPublished;
1616+
if(isPublished && !isOldPublished && !isDeleted)
1617+
{
1618+
updateAndPublish = true;
1619+
}
1620+
}
1621+
catch (Exception) { }
1622+
16111623
BlogService.UpdatePost(this);
16121624
Posts.Sort();
16131625
AddRelations(Posts);
16141626
ResetNestedComments();
16151627

1616-
if (isPublished && !IsDeleted)
1628+
if (updateAndPublish)
16171629
{
16181630
OnPublished();
16191631
}

BlogEngine/BlogEngine.Core/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
[assembly: CLSCompliant(false)]
2020
[assembly: ComVisible(false)]
2121
[assembly: AllowPartiallyTrustedCallers]
22-
[assembly: AssemblyVersion("3.3.0.3")]
22+
[assembly: AssemblyVersion("3.3.0.4")]
2323
[assembly: SecurityRules(SecurityRuleSet.Level1)]

BlogEngine/BlogEngine.NET/Custom/Widgets/PageList/widget.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h4 class="WidgetHeader widget-header">@title</h4>
77
<div class="WidgetContent widget-content">
88
<ul>
9-
@foreach (var page in BlogEngine.Core.Page.Pages.Where(page => page.ShowInList && page.IsVisibleToPublic))
9+
@foreach (var page in BlogEngine.Core.Page.Pages.OrderBy(page => page.SortOrder).Where(page => page.ShowInList && page.IsVisibleToPublic))
1010
{
1111
var href = page.RelativeLink;
1212
if (BlogSettings.Instance.RemoveExtensionsFromUrls && !string.IsNullOrEmpty(BlogConfig.FileExtension))

BlogEngine/BlogEngine.NET/setup/MySQL/Archive/MySQLSetup1.6.0.sql

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,8 @@ INSERT INTO be_StopWords (StopWord) VALUES ('your');
335335
INSERT INTO be_BlogRollItems ( BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex )
336336
VALUES ( '25e4d8da-3278-4e58-b0bf-932496dabc96', 'Mads Kristensen', 'Full featured simplicity in ASP.NET and C#', 'http://madskristensen.net', 'http://feeds.feedburner.com/netslave', 'contact', 0 );
337337
INSERT INTO be_BlogRollItems ( BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex )
338-
VALUES ( 'ccc817ef-e760-482b-b82f-a6854663110f', 'Al Nyveldt', 'Adventures in Code and Other Stories', 'http://www.nyveldt.com/blog/', 'http://feeds.feedburner.com/razorant', 'contact', 1 );
339-
INSERT INTO be_BlogRollItems ( BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex )
340-
VALUES ( 'dcdaa78b-0b77-4691-99f0-1bb6418945a1', 'Ruslan Tur', '.NET and Open Source: better together', 'http://rtur.net/blog/', 'http://feeds.feedburner.com/rtur', 'contact', 2 );
341-
INSERT INTO be_BlogRollItems ( BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex )
342-
VALUES ( '8a846489-b69e-4fde-b2b2-53bc6104a6fa', 'John Dyer', 'Technology and web development in ASP.NET, Flash, and JavaScript', 'http://johndyer.name/', 'http://johndyer.name/syndication.axd', 'contact', 3 );
343-
INSERT INTO be_BlogRollItems ( BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex )
344-
VALUES ( '7f906880-4316-47f1-a934-1a912fc02f8b', 'Russell van der Walt', 'an adventure in web technologies', 'http://blog.ruski.co.za/', 'http://feeds.feedburner.com/rusvdw', 'contact', 4 );
345-
INSERT INTO be_BlogRollItems ( BlogRollId, Title, Description, BlogUrl, FeedUrl, Xfn, SortIndex )
346-
VALUES ( '890f00e5-3a86-4cba-b85b-104063964a87', 'Ben Amada', 'adventures in application development', 'http://allben.net/', 'http://feeds.feedburner.com/allben', 'contact', 5 );
338+
VALUES ( 'dcdaa78b-0b77-4691-99f0-1bb6418945a1', 'Ruslan Tur', '.NET and Open Source: better together', 'http://rtur.net/blog/', 'http://feeds.feedburner.com/rtur', 'contact', 1 );
339+
347340

348341
INSERT INTO be_Categories (CategoryID, CategoryName)
349342
VALUES ('ffc26b8b-7d45-46e3-b702-7198e8847e06', 'General');

0 commit comments

Comments
 (0)