Skip to content

Conversation

@omanikhi
Copy link

@omanikhi omanikhi commented Aug 20, 2025

@simonsoft-buildbot
Copy link

Can one of the admins verify this patch?

@omanikhi omanikhi requested a review from takesson September 18, 2025 05:39
@omanikhi omanikhi requested a review from takesson October 21, 2025 08:01
final CmsItem location = itemLookup.getItem(repository.getItemId(relPath, null));
final CmsItemProperties locationProps = location.getProperties();
final boolean isShardParent = isCmsClass(locationProps, CMS_CLASS_SHARDPARENT);
final boolean hasNamePattern = locationProps.containsProperty(PROPNAME_CONFIG_ITEMNAMEPATTERN);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If isShardParent, then we can require hasNamePattern.

Error message from cms-fonto:

if (!locationProps.containsProperty(PROPNAME_CONFIG_ITEMNAMEPATTERN)) {
	 		String msg = MessageFormatter.format("Location does not define a name pattern: {}", parentFolder).getMessage();
			logger.error(msg);
			throw new IllegalArgumentException(msg);
	 	}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplifies the code below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better?

Copy link
Member

@takesson takesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change.

final CmsItem location = itemLookup.getItem(repository.getItemId(relPath, null));
final CmsItemProperties locationProps = location.getProperties();
final boolean isShardParent = isCmsClass(locationProps, CMS_CLASS_SHARDPARENT);
final boolean hasNamePattern = locationProps.containsProperty(PROPNAME_CONFIG_ITEMNAMEPATTERN);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplifies the code below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants