When you uncheck the 'Publishable' checkbox in the metadata of a structure group and then try and publish a page within it you get an immediate 'Success' status in the publishing queue. However, as expected, the page has not been published. Is this a bug or can anyone provide a valid reason why this might occur?
Try to explain this to the Business User: It shows success because it processed correctly every item that this publishing transaction was resolved to.
It is unfortunately not as easy to change this behavior as one would think (without performance impacts, which we all know is not what the Publishing Queue needs right now).
- You send ItemX to the queue.
- Publisher process picks it up
- Resolver determines there's nothing to publish because of any reason and creates a List<ResolvedItem> with 0 items
- Renderer loops through all items in the list, and there's no errors.
- Transaction ends with # of errors = 0
Nevertheless, this is something that we will try to address soon. It would also be incorrect to show it as a failure, because it did not fail, so probably a warning status with "There were no items to publish" message would be the better way to handle it.
If you're curious, this is what the Resolver has to say about it:
18:58:39.0317 <4204> Using resolver [Tridion.ContentManager.Publishing.Resolving.StructureGroupResolver] 18:58:39.3256 <4204> Resolving the structure groups [tcm:5-350-4] took 00:00:00.2853292 18:58:39.3285 <4204> StructureGroup tcm:5-350-4 resolved to 0 items. Resolving took: 00:00:00.3327755 18:58:39.3461 <4204> Updating the publish transaction with the list of processed items 18:58:39.3881 <4204> The number of processed items is zero, don't send an empty transport package
The Publish Status is related to the Publish Transaction and everything in it, if that does not raise any warnings or errors, it ends up as successful.
The funny (and sometimes annoying) result of this is that an empty Publish Transaction, will always return successful instantly.
When publishing a Page in a non publishable Structure Group, the Publish Transaction will basically be created without any Pages in there, so it is an empty Publish Transaction, which will thus show up as being successful.
I am just adding my 2 cents - I don't think it would be right to disable publish on "unpublishable" Structure Groups, because they can have child Structure Groups which are publishable. As such it is possible that publishing the SG will publish grandchild items even though it's children will not be published. I agree that it would be noce if the publish ever "Successfully did nothing" that the status was "Warning" rather than "Success" - This confuses my clients also. Perhaos file this as an ER (Although I think I already did many years ago)
You could create a custom resolver that you use as the last resolver in the chain that checks if the set of resolved items has 0 length... Needless to say it would be much nicer if the product gracefully handled this situation itself but if your customer is insisting something should be done there are options...