Comments (9)
Can you attach your config and an example scenario where excludes aren't working?
On Oct 10, 2014, at 2:29 AM, tommyhawk520 [email protected] wrote:
I have unicorn 2.0.4 set up in sitecore 7.2, the config is standard but i have added a few extra include and exclude rules. unicorn seems to ignore the exclude rules when i publish an item or create it programmatically. if i just create an item in content editor it doesnt get created
—
Reply to this email directly or view it on GitHub.
from unicorn.
I've noticed the same behavior with the Schedule definition. I have <exclude path="/sitecore/system/Tasks/Schedules" />
in my config but whenever a schedule item is updated by Sitecore (when the LastRun
field value changes) a corresponding item is created on the disk. I've also tried excluding the same item based on template id but it behaves exactly the same.
from unicorn.
this is my config...
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<unicorn>
<configurations>
<configuration name="Default Configuration">
<predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
<include database="core" path="/sitecore/system/Field types"/>
<include database="core" path="/sitecore/system/Settings" />
<include database="core" path="/sitecore/content/Documents and settings/All users"/>
<include database="core" path="/sitecore/content/Applications"/>
<include database="master" path="/sitecore/templates/Personalization Tracker" />
<include database="master" path="/sitecore/templates/Redirect Module" />
<include database="master" path="/sitecore/templates/Web Forms for Marketers" />
<include database="master" path="/sitecore/templates/modules" />
<include database="master" path="/sitecore/templates/System/Modules"/>
<include database="master" path="/sitecore/templates/Branches"/>
<include database="master" path="/sitecore/content/audi">
<exclude path="/sitecore/content/audi/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/bmw">
<exclude path="/sitecore/content/bmw/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/jaguar">
<exclude path="/sitecore/content/jaguar/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/experience explorer"/>
<include database="master" path="/sitecore/content/test">
<exclude path="/sitecore/content/test/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/vw">
<exclude path="/sitecore/content/vw/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/toyota">
<exclude path="/sitecore/content/toyota/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/mini">
<exclude path="/sitecore/content/mini/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/mercedesbenz">
<exclude path="/sitecore/content/mercedesbenz/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/lexus">
<exclude path="/sitecore/content/lexus/home/vehicles" />
</include>
<include database="master" path="/sitecore/content/landrover">
<exclude path="/sitecore/content/landrover/home/vehicles" />
</include>
<include database="master" path="/sitecore/Media Library"/>
<include database="master" path="/sitecore/layout"/>
<include database="master" path="/sitecore/system">
<exclude path="/sitecore/system/Aliases"/>
<exclude path="/sitecore/system/Marketing Center"/>
<exclude path="/sitecore/system/Publishing targets" />
<exclude path="/sitecore/system/Modules/Web Forms for Marketers/Website" />
<exclude path="/sitecore/system/Modules/Web Forms for Marketers/Local Forms" />
<exclude path="/sitecore/system/Modules/Web Forms for Marketers/Sample forms" />
<exclude path="/sitecore/system/Modules/Azure" />
</include>
</predicate>
</configuration>
</configurations>
<defaults>
<sourceDataProvider type="Unicorn.Data.SitecoreSourceDataProvider, Unicorn" singleInstance="true" />
<evaluator type="Unicorn.Evaluators.SerializedAsMasterEvaluator, Unicorn" singleInstance="true" />
<evaluatorLogger type="Unicorn.Evaluators.DefaultSerializedAsMasterEvaluatorLogger, Unicorn" singleInstance="true" />
<predicate type="null" />
<fieldPredicate type="Unicorn.Predicates.ConfigurationFieldPredicate, Unicorn" singleInstance="true">
</fieldPredicate>
<loaderLogger type="Unicorn.Loader.DefaultSerializationLoaderLogger, Unicorn" singleInstance="true" />
<loaderConsistencyChecker type="Unicorn.Loader.DuplicateIdConsistencyChecker, Unicorn" />
<loaderConsistencyCheckerLogger type="Unicorn.Loader.DefaultDuplicateIdConsistencyCheckerLogger, Unicorn" singleInstance="false" />
<loaderDeserializeFailureRetryer type="Unicorn.Loader.DeserializeFailureRetryer, Unicorn" singleInstance="false" />
<serializationProvider type="Unicorn.Serialization.Sitecore.Fiat.FiatSitecoreSerializationProvider, Unicorn" rootPath="default" singleInstance="true" />
<serializationProviderLogger type="Unicorn.Serialization.Sitecore.Fiat.DefaultFiatDeserializerLogger, Unicorn" singleInstance="true" />
<dataProvider type="Unicorn.DefaultUnicornDataProviderLogger, Unicorn" singleInstance="true" />
<logger type="Unicorn.Logging.PubSubLogger, Unicorn" singleInstance="true" />
</defaults>
<configurationProvider type="Unicorn.Configuration.XmlConfigurationProvider, Unicorn" />
</unicorn>
<processors>
<saveUI>
<processor patch:before="*[@type='Sitecore.Pipelines.Save.Save, Sitecore.Kernel']" mode="on" type="Unicorn.SerializationConflictProcessor, Unicorn"/>
</saveUI>
</processors>
<pipelines>
<httpRequestBegin>
<processor patch:after="*[@type='Sitecore.Pipelines.HttpRequest.UserResolver, Sitecore.Kernel']" type="Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor">
<param desc="activationUrl">/sync-database.aspx</param>
</processor>
</httpRequestBegin>
<filterItem>
<processor patch:before="*[@type='Sitecore.Pipelines.FilterItem.CheckIfFilteringIsActive, Sitecore.Kernel']" type="Unicorn.ControlPanel.CheckIfFilterDisablerIsActive, Unicorn" />
</filterItem>
</pipelines>
<dataProviders>
<unicorn type="Unicorn.Unicorn$(database)DataProvider, Unicorn">
<param connectionStringName="$(1)"/>
<Name>$(1)</Name>
</unicorn>
</dataProviders>
<databases>
<database id="master">
<dataProviders>
<dataProvider>
<patch:attribute name="ref">dataProviders/unicorn</patch:attribute>
</dataProvider>
</dataProviders>
</database>
<database id="core">
<dataProviders>
<dataProvider>
<patch:attribute name="ref">dataProviders/unicorn</patch:attribute>
</dataProvider>
</dataProviders>
</database>
</databases>
</sitecore>
</configuration>
and with this config i get items under vehicles for all sites even though they are excluded when i create the items programmatically and as part of that if i run a publish with code i get items from the web database saved to disk even though at no point is unicorn bound as a data provider for the web db
from unicorn.
You're getting web items serialized when you publish? (eg in serialization/web) Or are the master items being serialized as they get published to web?
I'll take a look at the exclude issue - I have test coverage on that so I thought it was working, but tests are only so much of a safety net ;)
Sorry for the delay in doing anything in depth; I'm in the middle of moving!
from unicorn.
if i run a publish programmatically then the items that are in master get published and as they are published they get items created for them on disk in serialization/web. the items i am publishing this way are the same items i am importing that should be excluded. when i publish the same items from within sitecore they do not get web items created
from unicorn.
What's the code you're using to programmatically publish?
On Thu, Oct 16, 2014 at 7:20 AM, tommyhawk520 [email protected]
wrote:
if i run a publish programmatically then the items that are in master get
published and as they are published they get items created for them on disk
in serialization/web. the items i am publishing this way are the same items
i am importing that should be excluded. when i publish the same items from
within sitecore they do not get web items created—
Reply to this email directly or view it on GitHub
#33 (comment).
from unicorn.
the code i'm using is...
public static void Publish(string itemPath, bool includeSubitems)
{
using (new Sitecore.SecurityModel.SecurityDisabler())
{
var masterDb = Sitecore.Configuration.Factory.GetDatabase("master");
var webDb = Sitecore.Configuration.Factory.GetDatabase("web");
var language = Sitecore.Context.Language;
var publishTime = DateTime.Now;
var item = masterDb.Items[itemPath];
var options = new PublishOptions(masterDb, webDb, PublishMode.Smart, language, publishTime);
var publisher = new Publisher(options);
publisher.Options.RootItem = item;
publisher.Options.Deep = true;
publisher.Publish();
}
}
from unicorn.
I've retested the exclusion part of this issue and am unable to reproduce it in several different scenario tries. It's worth noting that Sitecore 8 defaults to having schedule items in the database like @RaYell mentioned above that change their last run field. I've got those excluded in several production or in-development Sitecore 8 sites without issue.
I've also tried programmatically creating items in excluded locations:
using (new SecurityDisabler())
{
var db = Factory.GetDatabase("master");
var item = db.GetItem("/sitecore/system/publishing targets");
item.Add("cats", new TemplateID(TemplateIDs.Alias));
}
No items were written either time.
I'll see if I can replicate the publishing piece.
from unicorn.
Ok I tested using the exact publishing code from two comments ago, and I can't replicate that issue either. I tried publishing both with a root item that is excluded and one that is included, and no web database serialization occurred.
My best guess is that there's some kind of event handler, pipeline processor, etc that is doing something unexpected to the way Sitecore works. But without reproduction, I'm going to close this for now.
from unicorn.
Related Issues (20)
- security Vulnerabilities in Unicorn.SharedSecret.config file HOT 1
- Dilithium + Unicorn.DataProvider.10.1 HOT 3
- Sitecore 10.1 uses Sitecore.Kernel 16.0.0.0 version which does not have attribute 'UsedImplicitlyAttribute' and unicorn uses this attribute HOT 3
- Syncing Unchecked Shared field checkbox is not performing the movement of data from SharedFields to VersionFields tables HOT 10
- Unicorn.aspx indicates Transparent Sync is enabled on configs but TS is not working and does not display in Content Editor warning HOT 4
- Unicorn.DataProvider.10.1.config role:require setting prevents the config from being loaded on XM0 HOT 2
- Error message during Unicorn Sync "The statement terminated. The maximum recursion 100 has been exhausted before statement completion." HOT 2
- Performing a sync on a configuration with Transparant Sync breaks stuff?? HOT 3
- Unicorn added <site> breaks Sitecore on ContentDelivery roles in 10.1.2 HOT 5
- DuplicateItemName exception HOT 2
- UnauthorizedAccessException with SyncSilent HOT 2
- When we are deploying the changes on the Sitecore DEV site by using Azure Paas we are getting this error HOT 1
- Unicorn RainbowCodeGeneration is not supporting Sitecore 10.2 for serializing model HOT 3
- Verb - Reserialize ERROR: The remote host closed the connection. The error code is 0x800704CD.
- Not possible to config patch the fieldFilter exclude list HOT 4
- Moved item can end up deleted on sync HOT 1
- Sync Challenge Issue
- Serialization issue in cloned items HOT 1
- *feature* Is Unicorn supporting Sitecore 10.3? HOT 3
- Moving items results in deleted items
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unicorn.