SitecoreUnicorn/Unicorn

Title Field Value Set to "Lorem ipsum dolor"

unstab1e opened this issue · 3 comments

Is this an intended "feature"?

Sitecore v10.0, Unicorn v4.1.1, Visual Studio (VS) Enterprise 2019 (v16.7.6)

Fields named "Title", regardless of whether they are defined in a data template or are in the Sitecore standard templates (i.e. Rich Text->Data->Title or Image->Information->Title) are having their values set to "Lorem ipsum dolor"

Repeatable:

  1. Get latest master code from Azure Repository
  2. Verify .yml files in VS have correct, blank values for Title
  3. Clean and Rebuild solution. Publish project
  4. Verify .yml files in Notepad++ have correct, blank values for Title
  5. Refresh and log into Sitecore as admin
  6. Perform Unicorn Sync
  7. Check items in Sitecore, they have "Lorem Ipsum dolor" as Title value.

Verified targetDataStore physicalRootPath in all copies of Unicorn.config file point to the correct location.

image

Unicorn.config.txt

This is standard functionality, from the Field Transformers. If you send me the real config and not just a copy of the vanilla Unicorn config, I can show you where. So that would be the file that defined Media.Library-SLHP.

Field Transformers were introduced here: https://intothecloud.blog/2019/05/26/Rise-of-the-Unicorn-Transformers/

In other words you need to look in that config for something like this:

fieldTransforms=";Title"

My guess is, someone used ; as a separator in a transform and not ,

Thank you. I think I found the issue in the following lines of the attached file. I'm concerned about this text ( /* Predicate transforms apply, but "Title" gets ignored on this include definition */), will that cause a problem?
Unicorn.Configs.Default.config.txt

/* Predicate transforms apply, but "Title" gets ignored on this include definition */

Looks like you are modifying the example config directly. You really shouldn't. If you just uncomment that big block of example information there's a very real chance things will blow up for you with a configuration error.

So what you have done is adopt this part of the example config:

<predicate fieldTransforms=";Title,:Text,!Include In Sitemap,+Api Endpoint[{$apiEndPoint$}],?Default Product">

This is where your Lorem Ipsum comes from. That piece of config is only meant as an example and you should not build real configurations on top of it in this manner.

Anyway, remove this:

<predicate fieldTransforms=";Title,:Text,!Include In Sitemap,+Api Endpoint[{$apiEndPoint$}],?Default Product">
    <!-- include name="Sample Data" database="master" path="/sitecore/content/global/sample" fieldTransforms="-Title" / --> /* Predicate transforms apply, but "Title" gets ignored on this include definition */
</predicate>


<!-- Clear Workflow fields on local development environments, but force a specific state upstream -->
<predicate>
    <!-- include role:require="Standalone" name="Sample Data" database="master" path="/sitecore/content/global/sample" fieldTransforms="!Workflow,!Workflow State" / -->
    <!-- include role:require="ContentManagement" name="Sample Data" database="master" path="/sitecore/content/global/sample" fieldTransforms="+Workflow[{2DE02B52-B95F-404A-A955-C36B290F1B57}],+Workflow State[{5ACE9C7F-8A18-4C77-BC30-03BE5A40E6B6}]"/-->
</predicate>

Both of these predicates are examples of FieldTransforms in use, they're not meant to be included as-is in your project.

Better yet, create your own configuration file that defines a configuration with only what you need, and restore this ootb configuration file back to default.