Broke my web project in a way that I can't fix

I believe I accidentally Cmd+D duplicated my Session object. Probably fat-fingered Cmd+S to save.

My project will no longer run, and there’s no ability to delete the duplicate Session object. There’s no “Delete” option on the context menu for it, and “Cut” does nothing.

Any ideas?

You go back to your latest version in backup/SVN/Git? If you don’t have that think about at least a backup.

Save the project as XML and then find the Session1 object.

1 Like

Going back to a previous version would mean throwing away a day’s worth of work. Doable but not ideal.

I tried removing it via a “Xojo Project,” which appears to be a text file, but I must have removed something else important because now the one I modified won’t open at all. Will try playing around with the XML format.

  • Right Click on Session1
  • Choose “Make External”
  • Save Session1 e.g. to Desktop
  • now you can delete the external project item Session1 in the Xojo Project as usual
3 Likes

Cmd-Z does not worked ?

@Jürg_Otter This did it! Thank you! Appreciate you taking the time to format the text in your comment appropriately too!

I have opened Issue 79010 as Duplicate should be disabled on Session.

@Emile_Schwarz If I had caught it right away, Undo would probably work. But I didn’t discover it until after shutting down and re-opening Xojo today.

3 Likes

Sorry.

This solution looks weird…
What does “make external” do to “un-prevent” the deletion?

When you reopen the project, it’ll complain that it’s missing, which you ignore.

It converts it from a Session element that can’t be deleted to an external component that can be deleted.

The steps don’t say “delete the actual file” but the reference in the project. After that you can save it and open it as usual (without it complaining). No?

FWIW, my assumption was the same as Greg’s but I understood Jürg’s instructions the way Alberto described. Merely curious, but would like to know what the actual process is.

This is what I understood:

Make External

Save to Desktop

Delete the external item

Project without Session1 ready to save

Of course we can delete the .xojo_binary file from Desktop.

2 Likes

@AlbertoD is correct, the reference to the external file is what you delete, then you can delete the external file and then the project opens without complaining.

@Beatrix_Willius’s solution would also work, if you are able to remove the markup for the duplicate Session object without deleting something else important. I tried to do this with the xojo_code format and failed, my next step was going to try a xojo_xml_project with an XML editor, but @Jürg_Otter posted his solution before I got to it.