mraible commented on code in PR #328:
URL: https://github.com/apache/roller/pull/328#discussion_r4609099746


##########
app/src/main/java/org/apache/roller/weblogger/webservices/atomprotocol/EntryCollection.java:
##########
@@ -405,15 +425,21 @@ private void copyToRollerEntry(Entry entry, WeblogEntry 
rollerEntry) throws Webl
         }
         rollerEntry.setPubTime(pubTime);
         rollerEntry.setUpdateTime(updateTime);
-        
-        AppModule control =
-                (AppModule)entry.getModule(AppModule.URI);
-        if (control!=null && control.getDraft()) {
+
+        boolean wasPublished = 
PubStatus.PUBLISHED.equals(rollerEntry.getStatus());
+        if (isDraft(entry)) {
             rollerEntry.setStatus(PubStatus.DRAFT);
+        } else if (pubTime.after(new Date(System.currentTimeMillis() + 
RollerConstants.MIN_IN_MS))) {
+            // like the entry editor, a publish time more than a minute ahead 
schedules the entry
+            rollerEntry.setStatus(PubStatus.SCHEDULED);
         } else {
             rollerEntry.setStatus(PubStatus.PUBLISHED);
         }
-                
+        if (wasPublished != rollerEntry.isPublished()) {
+            // the entry's tags enter or leave the weblog's tag counts
+            rollerEntry.setRefreshAggregates(true);

Review Comment:
   Fixed in 096a6e2d4: saveWeblogEntry() now reconciles tag counts from the 
entry's tags before and after the edit when its publication state changes, so 
changing tag A to B while saving as a draft leaves neither counted. 
savingAsDraftWhileChangingTagsUncountsTheOldTags covers that case, alongside 
new tests for scheduling and publishing with tag changes. The same editPost fix 
as #316 is included, since 6.1.x has the same XML-RPC path.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to