Everything works so far, but everything breaks down when the status of the Virtual Page is changed, for example from listed to unlisted.
The page is visible only as draft in the content folder, but it is still listed in the panel. Also - and this is the bad thing - all previously assigned image elements are deleted for entries that use the page model that is responsible for the import. They are still present in the content folder, but they are no longer displayed in the panel and frontend. Also the respective media folder with the corresponding hash is empty.
Does anyone have an idea how I could get ahead here?
You would have to extend the model to make this work, or rather, you will need a model for the single page as well, to keep the virtual stuff and the stuff in the file system in sync. But I nevertheless wonder if it wouldn’t make more sense to create the pages from the csv file programmatically and if need be to update. But I don’t know your use case for using the csv data.