Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,8 @@ public Contentlet find(final String inode, String variant) throws DotStateExcept
* Contentlets, if applicable.
*/
private Contentlet processCachedContentlet(final Contentlet cachedContentlet) {
if (REFRESH_BLOCK_EDITOR_REFERENCES && null != cachedContentlet.getContentType() && cachedContentlet.getContentType().hasStoryBlockFields()) {
final ContentType contentType = cachedContentlet.getContentType();
if (REFRESH_BLOCK_EDITOR_REFERENCES && null != contentType && contentType.hasStoryBlockFields()) {
final StoryBlockReferenceResult storyBlockRefreshedResult =
APILocator.getStoryBlockAPI().refreshReferences(cachedContentlet);
if (storyBlockRefreshedResult.isRefreshed()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.dotcms.contenttype.model.field.Field;
import com.dotcms.contenttype.model.field.StoryBlockField;
import com.dotcms.contenttype.model.field.TagField;
import com.dotcms.contenttype.model.type.ContentType;
import com.dotcms.cost.RequestCost;
import com.dotcms.cost.RequestPrices.Price;
import com.dotcms.exception.ExceptionUtil;
Expand Down Expand Up @@ -138,8 +139,9 @@ public class StoryBlockAPIImpl implements StoryBlockAPI {
public StoryBlockReferenceResult refreshReferences(final Contentlet contentlet) {
final MutableBoolean refreshed = new MutableBoolean(false);
final boolean inTransaction = DbConnectionFactory.inTransaction();
if (!inTransaction && null != contentlet && null != contentlet.getContentType() &&
contentlet.getContentType().hasStoryBlockFields()) {
final ContentType contentType = null != contentlet ? contentlet.getContentType() : null;
if (!inTransaction && null != contentlet && null != contentType &&
contentType.hasStoryBlockFields()) {

final HttpServletRequest request = HttpServletRequestThreadLocal.INSTANCE.getRequest();
final int initialDepthValue = this.getCurrentDepthValue(request);
Expand All @@ -155,7 +157,7 @@ public StoryBlockReferenceResult refreshReferences(final Contentlet contentlet)
return new StoryBlockReferenceResult(false, contentlet);
}

contentlet.getContentType().fields(StoryBlockField.class)
contentType.fields(StoryBlockField.class)
.forEach(field -> {

final Object storyBlockValue = contentlet.get(field.variable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static com.dotmarketing.portlets.templates.model.Template.SYSTEM_TEMPLATE;

import com.dotcms.contenttype.business.StoryBlockAPI;
import com.dotcms.contenttype.model.type.ContentType;
import com.dotcms.contenttype.transform.contenttype.StructureTransformer;
import com.dotcms.experiments.model.Experiment;
import com.dotcms.languagevariable.business.LanguageVariableAPI;
Expand Down Expand Up @@ -602,7 +603,8 @@ private void processContentDependency(final Contentlet contentlet)
* @param contentlet The {@link Contentlet} whose Story Block fields will be analyzed.
*/
private void processStoryBockDependencies(final Contentlet contentlet) {
if (contentlet.getContentType().hasStoryBlockFields()) {
final ContentType contentType = contentlet.getContentType();
if (null != contentType && contentType.hasStoryBlockFields()) {
this.storyBlockAPI.get().getDependencies(contentlet).forEach(dependency -> {
Contentlet contentInStoryBlock = new Contentlet();
try {
Expand Down
Loading