Skip to content

Commit

Permalink
#23736 Duplicate Task220825MakeSomeSystemFieldsRemovable but make it …
Browse files Browse the repository at this point in the history
…better

Return a TTL Cache of zero when the TTL field is not present for a Page content type.
  • Loading branch information
jcastro-dotcms committed Feb 10, 2023
1 parent 9f168d6 commit b5fd276
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.dotmarketing.portlets.htmlpageasset.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.Map;

import com.dotmarketing.beans.Identifier;
import com.dotmarketing.business.APILocator;
import com.dotmarketing.business.DotStateException;
Expand All @@ -15,9 +12,13 @@
import com.dotmarketing.portlets.folders.model.Folder;
import com.dotmarketing.portlets.htmlpageasset.business.HTMLPageAssetAPI;
import com.dotmarketing.util.Logger;
import com.dotmarketing.util.NumberUtil;
import com.dotmarketing.util.UtilMethods;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.liferay.portal.model.User;

import java.util.Map;

/**
* This class represents an HTML Page as a {@link Contentlet}, which is the new
* version of Content Pages in dotCMS.
Expand All @@ -35,7 +36,7 @@ public class HTMLPageAsset extends Contentlet implements IHTMLPage {

@Override
public long getCacheTTL() {
return Long.parseLong(getStringProperty(HTMLPageAssetAPI.CACHE_TTL_FIELD));
return NumberUtil.toLong(getStringProperty(HTMLPageAssetAPI.CACHE_TTL_FIELD), () -> Long.valueOf("0"));
}

@Override
Expand Down

0 comments on commit b5fd276

Please sign in to comment.