Skip to content

Commit 7d4e463

Browse files
fix(ftm): working version of a piece of content can be seen in live mode dotCMS#31367 (dotCMS#31431)
### Proposed Changes * Modified `ContentletLoader.java` to ensure the Live page always displays the published version of content, regardless of the Time Machine state. * Added new Karate tests to validate the behavior of future-published content, including cases with VTL code like banners. * Updated existing test scenarios to include banner content and additional edge cases. ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable) ### Additional Info This PR addresses an issue where content authors editing content with future publish dates would see the working version on the Live page instead of the currently published version. The fix ensures that the Live page always displays the correct published content, even when future content is scheduled.
1 parent d5f65f9 commit 7d4e463

File tree

11 files changed

+736
-9
lines changed

11 files changed

+736
-9
lines changed

dotCMS/src/main/java/com/dotcms/rendering/velocity/services/ContentletLoader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,8 @@ public InputStream writeObject(final VelocityResourceKey key)
646646
throw new ResourceNotFoundException("cannot find content version info for key: " + key);
647647
}
648648

649-
//if time machine is running, we need to force get the latest working version to guarantee the correct rendered content matching the json portion of the response
650649
final ContentletVersionInfo contentletVersionInfo = info.get();
651-
final String inode = (key.mode.showLive && TimeMachineUtil.isNotRunning() )
650+
final String inode = key.mode.showLive
652651
? contentletVersionInfo.getLiveInode()
653652
: contentletVersionInfo.getWorkingInode();
654653

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Feature: Delete a Folder
2+
Scenario: Delete a folder on the given path if exists
3+
Given url baseUrl + '/api/v1/folder/default'
4+
And headers commonHeaders
5+
And request
6+
"""
7+
["#(path)"]
8+
"""
9+
When method DELETE
10+
Then status 200
11+
* def errors = call extractErrors response
12+
* match errors == []

0 commit comments

Comments
 (0)