Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items created from branches on core database looses layout on sync #318

Closed
mortenengel opened this issue Nov 20, 2018 · 9 comments
Closed
Assignees
Labels

Comments

@mortenengel
Copy link

mortenengel commented Nov 20, 2018

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Creating an item from a master on the core database and then adding a layout to it, serializes nicely. But when you want to sync this to another instance, the layout is gone.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Add a predicate to include core:/sitecore/content/Applications/test
  2. Load Content Editor for core database
  3. Navigate to /sitecore/content/Applications
  4. Right click the node in the tree, and insert a new application named "test"
  5. Go to layout details and choose any layout
  6. Backup the serialized test item (copy/paste)
  7. Delete the test item in Sitecore
  8. Reinstate the backup
  9. Run a Unicorn sync
  10. You have the item again, but the layout is gone.

This seems to happen anywhere on the core database, from any item that is created from the masters under core:/sitecore/masters. I have done a workaround and just created my template directly from the template rather than from the branch - or simply by removing the following line from the .yml before syncing:
BranchID: "1f0770ea-8b77-4110-91aa-cc00dee102dd"

What is the expected behavior?
Having the item, but with the layout.

Please mention your Sitecore version and Unicorn version.
Tested on Sitecore 8.2 and 9.0, Unicorn 4.0.3

Took me a while to find the exact cause of this bug, unfortunately I don't have time to find a code solution right now, but if you'd like me to, let me know and I'll figure it out when I have more time.

@mortenengel mortenengel changed the title Items crearted from branches on core database looses layout on sync Items created from branches on core database looses layout on sync Nov 20, 2018
@cassidydotdk
Copy link
Member

@mortenengel Please try this on Unicorn 4.0.4. 4.0.3 had a number of problems related to language fallback and enforced version presence, that could be the root cause of this. If the problem is confirmed to exist on 4.0.4, I will open an investigation.

@mortenengel
Copy link
Author

Just tested, The bug still happens in Unicorn 4.0.4

@cassidydotdk
Copy link
Member

Aight, thanks :-) Will dig into it.

@cassidydotdk cassidydotdk self-assigned this Nov 20, 2018
@cassidydotdk
Copy link
Member

cassidydotdk commented Nov 20, 2018

Confirmed. The following YAML does indeed re-create the item, with blank presentation details.

Additionally, as described, removing the BranchID from the YAML, re-creates the item including the layout details.


---
ID: "332b4c61-42b6-4036-97c7-69ef1b841ff8"
Parent: "c74ac643-53c8-4f1e-9508-840cdc72aaca"
Template: "eb06cec0-5e2d-4dc4-875b-01adcc577d13"
Path: /sitecore/content/Applications/test
DB: core
BranchID: "1f0770ea-8b77-4110-91aa-cc00dee102dd"
SharedFields:
- ID: "06d5295c-ed2f-4a54-9bf2-26228d113318"
  Hint: __Icon
  Value: /sitecore/shell/themes/standard/Software/16x16/application.png
- ID: "094829c2-d7a7-4c38-b025-b99ff2001b56"
  Hint: Disable close
  Type: checkbox
  Value: 0
- ID: "2b3ecbbc-432a-4cea-bb75-ce481b644ff8"
  Hint: Disable resize
  Type: checkbox
  Value: 0
- ID: "b4e951ee-906f-4249-b2c6-68e31c82e118"
  Hint: Disable maximize
  Type: checkbox
  Value: 0
- ID: "ba3f86a2-4a1c-4d78-b63d-91c2779c1b5e"
  Hint: __Sortorder
  Value: 0
- ID: "f1a1fe9e-a60c-4ddb-a3a0-bb5b29fe732e"
  Hint: __Renderings
  Type: layout
  Value: |
    <r xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <d
        id="{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}"
        l="{2C248BB8-6521-4147-AD49-46463AA768BA}" />
    </r>
- ID: "f54c1557-f8ce-4130-90a7-b89575c4cdbe"
  Hint: Disable minimize
  Type: checkbox
  Value: 0
- ID: "f6d8a61c-2f84-4401-bd24-52d2068172bc"
  Hint: __Originator
  Value: "{35517498-AD36-493A-B91B-2C3D4D375B37}"
- ID: "fc2b18b3-1631-4c3f-9e47-51df05030026"
  Hint: Icon
  Value: Software/32x32/application.png
Languages:
- Language: en
  Versions:
  - Version: 1
    Fields:
    - ID: "25bed78c-4957-4165-998a-ca1b52f67497"
      Hint: __Created
      Value: 20181120T142119Z
    - ID: "5dd74568-4d4b-44c1-b513-0af5f4cda34f"
      Hint: __Created by
      Value: |
        sitecore\admin
    - ID: "67b6378b-c9f1-47c7-9cac-bfa79b0727d9"
      Hint: Display name
      Value: test

@cassidydotdk
Copy link
Member

A few initial observations. The field "__Renderings" is of an invalid Field Type in the core product. This may or may not influence matters.

image

Notice how this is fine, for "__Final Renderings".

image

@cassidydotdk
Copy link
Member

Updating the item in question by reinserting the BranchID field then telling Unicorn to sync again (update the existing item) leaves the Layout intact.

@cassidydotdk
Copy link
Member

cassidydotdk commented Nov 20, 2018

Working theory is, that possibly there is some case sensitivity going on, around field names tested and rejected

@cassidydotdk
Copy link
Member

cassidydotdk commented Nov 20, 2018

So it's a bug. Just not a Rainbow/Unicorn bug.

I re-created all of the steps above, with these changes.

After creating the "test2" item, I went to "Applications" and did a Sitecore native "Serialize Tree". Then I deleted "test2" and then using Sitecore native serialization, did "Update Tree".

The "test2" item came back - with presentation details cleared. Exactly like when Unicorn does it.

image

I'll still see if there's anything we can do on our side, but the issue lies in the core product. To the best of my knowledge.

.item file as evidence.

----item----
version: 1
id: {B47809B9-9339-4D53-A4FB-9C2DF8D0BDCA}
database: core
path: /sitecore/content/Applications/test2
parent: {C74AC643-53C8-4F1E-9508-840CDC72AACA}
name: test2
master: {1F0770EA-8B77-4110-91AA-CC00DEE102DD}
template: {EB06CEC0-5E2D-4DC4-875B-01ADCC577D13}
templatekey: Application
created: 20181120T150351Z

----field----
field: {FC2B18B3-1631-4C3F-9E47-51DF05030026}
name: Icon
key: icon
content-length: 30

Software/32x32/application.png
----field----
field: {094829C2-D7A7-4C38-B025-B99FF2001B56}
name: Disable close
key: disable close
content-length: 1

0
----field----
field: {B4E951EE-906F-4249-B2C6-68E31C82E118}
name: Disable maximize
key: disable maximize
content-length: 1

0
----field----
field: {F54C1557-F8CE-4130-90A7-B89575C4CDBE}
name: Disable minimize
key: disable minimize
content-length: 1

0
----field----
field: {2B3ECBBC-432A-4CEA-BB75-CE481B644FF8}
name: Disable resize
key: disable resize
content-length: 1

0
----field----
field: {06D5295C-ED2F-4A54-9BF2-26228D113318}
name: __Icon
key: __icon
content-length: 62

/sitecore/shell/themes/standard/Software/16x16/application.png
----field----
field: {BA3F86A2-4A1C-4D78-B63D-91C2779C1B5E}
name: __Sortorder
key: __sortorder
content-length: 1

0
----field----
field: {F6D8A61C-2F84-4401-BD24-52D2068172BC}
name: __Originator
key: __originator
content-length: 38

{35517498-AD36-493A-B91B-2C3D4D375B37}
----field----
field: {F1A1FE9E-A60C-4DDB-A3A0-BB5B29FE732E}
name: __Renderings
key: __renderings
content-length: 145

<r xmlns:xsd="http://www.w3.org/2001/XMLSchema" ><d id="{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}" l="{5BC682EE-C9BC-461F-AD88-D95CA2F2D937}" /></r>
----version----
language: en
version: 1
revision: d134eb27-48e3-415f-97f9-2c25464ee63c

----field----
field: {67B6378B-C9F1-47C7-9CAC-BFA79B0727D9}
name: Display name
key: display name
content-length: 5

test2
----field----
field: {52807595-0F8F-4B20-8D2A-CB71D28C6103}
name: __Owner
key: __owner
content-length: 14

sitecore\admin
----field----
field: {25BED78C-4957-4165-998A-CA1B52F67497}
name: __Created
key: __created
content-length: 16

20181120T150351Z
----field----
field: {5DD74568-4D4B-44C1-B513-0AF5F4CDA34F}
name: __Created by
key: __created by
content-length: 14

sitecore\admin
----field----
field: {8CDC337E-A112-42FB-BBB4-4143751E123F}
name: __Revision
key: __revision
content-length: 36

d134eb27-48e3-415f-97f9-2c25464ee63c
----field----
field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
name: __Updated
key: __updated
content-length: 16

20181120T150654Z
----field----
field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
name: __Updated by
key: __updated by
content-length: 14

sitecore\admin

@cassidydotdk
Copy link
Member

cassidydotdk commented Dec 14, 2018

Duplicate of #283

@cassidydotdk cassidydotdk marked this as a duplicate of #283 Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants