1

Sitecore Version - 10.2

CLI Version 5.1.12

During the publishing process, I receive the following error during the Build Serialized Item Package step

Error Building Package 'C:\project-longhorse\Sitecore.Build\bin\Debug\Sitecore.Build': Error converting value "/Media Folder/Buttons/Crop and Upload" to type 'Sitecore.DevEx.Serialization.Models.IItemPathMatch'. Path 'items.includes[0].rules[0].path', line 13, position 63.

This same error is present during the Serialized Items push step if I disable the package building.

I have narrowed it down to an issue with my modules that utilize rules but I have yet to find the issue after scouring the documentation and available online resources. When building, the error will occur in the first module for the first rule it encounters every time. I have tried using aliases, different relative paths, extending the path length, and escaping reserved words where they might exist. Note that these modules had no issues pulling items from Sitecore correctly and the path in the error message does exist.

I will put an example of a problem module below.

{
  "namespace": "Sitecore.Feature.Media.Core",
  "items": {
    "includes": [
      {
        "allowedPushOperations": "createUpdateAndDelete",
        "database": "core",
        "name": "Content Editor Media",
        "path": "/sitecore/content/Applications/Content Editor/Editors/Media",
        "scope": "itemAndDescendants",
        "rules": [
          {
            "path": "/Media Folder/Buttons/Crop and Upload",
            "scope": "singleItem"
          },
          {
            "path": "/Media Folder/Buttons/WebDAV Open",
            "scope": "singleItem"
          },
          {
            "path": "/Media Folder/Buttons",
            "scope": "singleItem"
          },
          {
            "path": "/Media Folder",
            "scope": "singleItem"
          },
          {
            "path": "*",
            "scope": "ignored"
          }
        ]
      },
      {
        "allowedPushOperations": "createUpdateAndDelete",
        "database": "core",
        "name": "Media Custom Experience Buttons",
        "path": "/sitecore/content/Applications/WebEdit/Custom Experience Buttons/Feature/Media",
        "scope": "itemAndDescendants"
      },
      {
        "allowedPushOperations": "createUpdateAndDelete",
        "database": "core",
        "name": "Media Edit Frame Buttons",
        "path": "/sitecore/content/Applications/WebEdit/Edit Frame Buttons/Feature/Media",
        "scope": "itemAndDescendants"
      }
    ]
  }
}
1
  • Did you try dotnet sitecore ser validate to see if it shows any errors? In case it does show any errors, you can run dotnet sitecore ser validate --fix to fix them. Commented Jun 20, 2023 at 20:37

1 Answer 1

1

The potential issue here is reserved words. There is also a list of words that needs to escape when used in the path, there words are:

  1. ancestor
  2. and
  3. child
  4. descendant
  5. div
  6. false
  7. following
  8. mod
  9. or
  10. parent
  11. preceding
  12. self
  13. true
  14. xor

A few solutions to try are.

  1. Remove and from the item name.
  2. Try alias. Rede more here
"rules": [
  {
    "path": "/Media Folder/Buttons/Crop and Upload",
    "scope": "singleItem"
    "alias": "mbcau"
  }
]
  1. Try Escaping reserved words.
 "path": "/Media Folder/Buttons/#Crop and Upload#",

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.