"Publish pages changes" button does not apear after placeholder.clear()

Hi all. I use cms api for recreating page’s content. The problem: The “Publish page changes” button does not appear in toolbar after clearing placeholder with placeholder.clear() method and after adding plugins too. So it’s impossible to publish changes 'till i make changes manually. Is there a way to make draft version of page dirty by code? I can use page.publish() method but i want to see draft version before publishing