user3034243
user3034243

Reputation: 145

Sitecore publishing to webcm database hangs

I have customized the publishing process of a sitecore content item by making sure its related media items in /sitecore/media library/ directory are published whenever the content item itself is published. The problem is, the related media items publish fine to web database, but hang when being published to webcm database. Any reason for this?

here's my code for publishing a content item's related media item to web and webcm database:

    private void PublishItemAsynchronously(ref Item sourceItem, ref Item mediaItem, PublishItemContext context)
    {
        String databaseName = "webCM";
        try
        {

            if (Sitecore.Configuration.Factory.GetDatabase(databaseName) != null)
            {
                PublishOptions options = new PublishOptions(mediaItem.Database, Factory.GetDatabase(databaseName),
                                                            PublishMode.Smart, mediaItem.Language, DateTime.Now);
                options.RootItem = mediaItem;
                options.Deep = false;
                new Publisher(options).PublishAsync();

                Sitecore.Diagnostics.Log.Info("___________  Inside PublishRelationsAction::PublishItemAsynchronously(...), just published from webCM ", this);
            }

            databaseName = "web";
            PublishOptions options2 = new PublishOptions(mediaItem.Database, Factory.GetDatabase(databaseName),
                                                         PublishMode.Smart, mediaItem.Language, DateTime.Now);
            options2.RootItem = mediaItem;
            options2.Deep = false;
            new Publisher(options2).PublishAsync();

            Sitecore.Diagnostics.Log.Info("___________  Inside PublishRelationsAction::PublishItemAsynchronously(...), just published from web ", this);
        }
        catch (Exception ex)
        {
            ....
        }
    }

Any idea why webcm database publishes hang, while all publishes to web database work fine? Both of the above logging statements appear in my log file.

Upvotes: 0

Views: 158

Answers (1)

pavan
pavan

Reputation: 1

Disabling publishing status manager resolves this issue. You can disable it by commenting out the content of /App_Config/Include/Sitecore.SharedSource.AdvancedPublishDialog.config

Upvotes: 0

Related Questions