Mark content as Ready to publish when using contentLib.modify

Enonic version: 7.2
OS: Ubuntu 18.04.1

Hi,

I’d like to know how can I publish recently modified objects with contentLib.modify, knowing that most of them (all of them, in my case) are not marked as ready, which prevent them of being published according to https://developer.enonic.com/docs/content-studio/master/workflow.

I did not find the answer easily, if there is one.

Context:
I have objects in production which were created using an old specification. One input field was edited to item-set, which caused all objects to stop functioning properly. I had then to create a service to replace the old objects’ modified field by the new one in draft branch, which actually worked neatly. When I then did the same for the master branch, some objects were set as Out of Date (dunno if this is the used term, it’s just the pt-br term translated) and others as Modified. I can’t rely on going to CS to do this, since these objects are spreaded and there may be others, from other types, marked as as ready to publish. This may cause to wrongly sending objects to the master branch in prod.

Hopefully there’s an easy solution for this.

Regards,
Marco

I had a similar problem, and found this post. So, to help if anyone else find this as I did, I’ll note what solved it for me:

We can use

c.workflow.state = "READY";

in the modify editor as the example shows in Content library (modify function).

My context was:
I have a similar problem, where a user might modify a content without publishing their change, and then a sync task is run that modifies the content to the correct state and tries to publish. But it won’t publish, and I guess it is because the content is not marked as ready.

Regards,
Vigdis :slight_smile:

4 Likes