GithubHelp home page GithubHelp logo

Comments (12)

geoffreysmith avatar geoffreysmith commented on July 19, 2024 1

Our dev environments have sample content in them, sometimes if there's a bug we'll bring down real content and serialize enough to capture the bug.

We remove /content/* from the config when we push to any content entry environments.

Especially early in development, having sample content helps on larger features which require lots of different content to complete.

from unicorn.

kamsar avatar kamsar commented on July 19, 2024

That's odd. The behaviour you're seeing is consistent with having an EventDisabler active, which would prevent Unicorn from seeing the newly created bucket items. I did a quick test on a site I had lying around that was on 7.0 130424 and Unicorn 1.0.6 and the bucket children appeared to get serialized correctly.

Here's what I did:

  • Create a new item and mark it a bucket
  • Create a test template, and mark it as bucketable on its standard values
  • Verify that that root item was serialized as expected (it was)
  • Add an item of the test template type to the bucket

The hierarchy to the item, both folder and .item file, was all present on disk after I did that. Are you using EventDisabler anywhere, possibly in a custom bucket hierarchy configuration? It might also be worth a shot to see if the out of the box serialization event handler (outlined in the Serialization Guide on SDN) catches the bucket updates, since it hooks to event handlers like Unicorn does.

It's worth noting that if the problem is an EventDisabler, the upcoming Unicorn 2.0 (in the extensibility branch) no longer uses eventing so it avoids the problem, if it's what I think it is. Unicorn 2 is not stable enough to use in production yet however - I'm still working on it.

from unicorn.

jgoyvaerts avatar jgoyvaerts commented on July 19, 2024

Thanks for the quick reply, maybe I didn't explain our problem properly enough:

The items and folder structure are being created on disk upon adding the item to the bucket, however, the .item files from the folder hierarchy are not, which prevents the eventual item from being added because it's parents aren't being added.

I just tested the steps you suggested (on our installation, not on a clean one), and so it fails after "Add an item of the test template type to the bucket", because the structure of folders is being generated (2014->01->07->11->12->testitem.item), but the respective folder items (2014.item, 01.item, 07.item, etc) are missing.

from unicorn.

kamsar avatar kamsar commented on July 19, 2024

In my testing I did get the 2014.item and the other children. What version of Sitecore are you on? Are you using any sort of custom bucket extensions, such as modifying the generated URL strategy (http://blog.horizontalintegration.com/2013/07/30/sitecore-item-buckets-with-different-indexing-strategies/)?

from unicorn.

jgoyvaerts avatar jgoyvaerts commented on July 19, 2024

We're running on 7.1, no custom bucket extensions.

Only other notable thing is Glass.Mapper.sc plugin. If you want I can send you relevant .config files or listings of dlls and their versions if that would help to solve this.

from unicorn.

kamsar avatar kamsar commented on July 19, 2024

Please send me your serialization.config; I'll see if I can debug it when I get a chance.

from unicorn.

jgoyvaerts avatar jgoyvaerts commented on July 19, 2024
<!--
Serialization Settings Patch File for Unicorn

This file adds pipeline items to support serializing the content tree to disk in more advanced ways than the default,
specifies which items to auto-serialize, and adds a saveUI handler to prevent overwriting changed serialized files on disk.
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
        <serialization>
            <default>
                <include database="master" path="/sitecore/Content">
                    <exclude path="/sitecore/Content/Data/Imports/Families" />
                    <exclude path="/sitecore/Content/Data/Imports/Contacts" />
                    <exclude path="/sitecore/Content/Data/Imports/Items" />
                    <exclude path="/sitecore/Content/Data/Imports/Koppelingen" />
                    <exclude path="/sitecore/Content/Data/Imports/SalesChannels" />
                    <exclude path="/sitecore/Content/Data/Imports/SubjectArea" />
                    <exclude path="/sitecore/Content/Data/Imports/UserGroups" />
                    <exclude path="/sitecore/Content/Data/Imports/ImportTest" />
                </include>
                <include database="master" path="/sitecore/templates/Acco"/>
                <include database="master" path="/sitecore/layout/Sublayouts/Acco" />
                <include database="master" path="/sitecore/layout/Layouts/Acco" />
                <include database="master" path="/sitecore/layout/Renderings/Acco" />
                <include database="master" path="/sitecore/templates/Branches/Acco" />
                <include database="master" path="/sitecore/media library/Acco" />
                <include database="master" path="/sitecore/system/Languages" />
                <include database="master" path="/sitecore/system/Workflows" />

        <!--
                <include database="master" path="/sitecore/templates/Acco">
                    Each include can also have several types of exclusion added under them to exclude specific subitems:
                    <exclude path="/sitecore/content" />
                    <exclude template="Page" />
                    <exclude templateid="{8EF706F3-71D1-4EE2-BADF-99018AF186C9}" />
                    <exclude id="{8EF706F3-71D1-4EE2-BADF-99018AF186C9}" />
                </include>
        -->

      </default>
        </serialization>

        <processors>
            <saveUI>
                <processor patch:before="*[@type='Sitecore.Pipelines.Save.Save, Sitecore.Kernel']" mode="on" type="Unicorn.SerializationConflictProcessor, Unicorn"/>
            </saveUI>
        </processors>

        <events>
            <event name="item:saved">
                <handler type="Unicorn.FilteredItemHandler, Unicorn" method="OnItemSaved"/>
            </event>
            <event name="item:copied">
                <handler type="Unicorn.FilteredItemHandler, Unicorn" method="OnItemCopied"/>
            </event>
            <event name="item:renamed">
                <handler type="Unicorn.FilteredItemHandler, Unicorn" method="OnItemRenamed"/>
            </event>
            <event name="item:deleted">
                <handler type="Unicorn.FilteredItemHandler, Unicorn" method="OnItemDeleted"/>
            </event>
            <event name="item:moved">
                <handler type="Unicorn.FilteredItemHandler, Unicorn" method="OnItemMoved"/>
            </event>
            <event name="item:versionRemoved">
                <handler type="Unicorn.FilteredItemHandler, Unicorn" method="OnItemVersionRemoved"/>
            </event>
        </events>
    </sitecore>
</configuration>

from unicorn.

geoffreysmith avatar geoffreysmith commented on July 19, 2024

I am also seeing this, with the exact same problem and setup as the original user. no custom bucket extensions.

from unicorn.

geoffreysmith avatar geoffreysmith commented on July 19, 2024

I should add this is not happening when serializing from /sitecore/admin/serialization.aspx, I correctly get the folders with the .item.

from unicorn.

kamsar avatar kamsar commented on July 19, 2024

Hi guys,

I did some spelunking and my original hypothesis is correct: the bucketing system is utilizing the EventDisabler class while it creates its hierarchy. Have a look at Sitecore.Buckets.Managers.BucketProvider with your favorite decompiler, specifically the CreateAndReturnBucketFolderDestination() method.

You've got two options to work around this:

  • Implement your own bucket provider and override CreateAndReturnBucketFolderDestination, removing the EventDisabler from it (Note: this could have some sort of side effects if bucketing used this for non-performance reasons)
  • Wait for Unicorn 2, which is immune to EventDisabler - or port the DataProvider stuff from Unicorn 2 to use the original Unicorn APIs. It's getting significantly more stable recently, but is still beta quality.

Out of curiosity, why is something that is in a bucket being stored in Unicorn in your setup? Unicorn is no good for any sort of versioned or workflowed content - it's prone to make content editors lose data if used in that way. It's designed to be used with templates and renderings or global site metadata (e.g. multilist source folders and such) that only a developer would edit. That may change with v2 to some minor extent, as I want to experiment with evaluators that may for example only create new, non-existing content items that might work well to push new required test content.

from unicorn.

kamsar avatar kamsar commented on July 19, 2024

@geoffreysmith Agreed, there is definitely a place for sample/test content, as long as you're aware of the bad things that can happen and can work around them. On my last project we kept a manually serialized/deserialized copy of the content tree that we could use (via the admin, as opposed to Unicorn) to force our content into a consistent state with what content entry folks were doing on the deployed site. Worked decently but could be more automated :)

I'm going to close this ticket as unfortunately there is no good way to fix this for v1, but as previously mentioned v2 will solve this out of the box. The readme.md for v2 is now updated to be accurate, other than that there's no v2 NuGet package yet.

from unicorn.

jgoyvaerts avatar jgoyvaerts commented on July 19, 2024

Yea same reason for us, we just used it with sample content during development. Thanks for looking into this!

from unicorn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.