We have an event handler that publishes the certain type of pages to the different publications (we have the list of publications) and its working as expected but the problem here is the order in which it sends to the publishing queue. Yes it will send the pages as ordered in the list but the original tcm value in which we are only replacing the pub id is sent at the last of publicaition. For example when we send a page (tcm:5-1234-64)
EventSystem.Subscribe<RepositoryLocalObject, PublishEventArgs>(OnPageItemPre, EventPhases.Initiated);
private void OnPageItemPre(RepositoryLocalObject item, PublishEventArgs args, EventPhases phase){
List <int>pubIDList = new List(){31,32,34,35};
List<IdentifiableObject> itemToPublish = new List<IdentifiableObject>();
foreach (var pubId in pubIdList)
{
itemToPublish.Add(item.Session.GetObject($"tcm:{pubId}-{pg.Id.ItemId}-64"));
}
PublishEngine.Publish(itemToPublish, args.PublishInstruction, publicationTargets, args.Priority.Value);
}
result: order in which the pages are published.
tcm:31-1234-64
tcm:32-1234-64
tcm:33-1234-64
tcm:34-1234-64
tcm:5-1234-64
how can we put tcm:5-1234-64 at the top of the queue?