Dragging in Modules from Text format does very bad things

So….

Twice in the past few days

I have been taking modules from one text format project and putting into other text format project. And when I say modules then Its Modules with many classes inside of them.

So method has been:

  1. Copy module, folder and files in the folder to location inside the new project.
  2. Drag in the module.
  3. Run the new application → It runs and all is good at this point.

Now the bad part……

  1. I hit save and close the project.
  2. I open the project…….
    And now i get loads of error messages that “..\…\…\…\…\” is missing.

At this point project is all sort of off, the first time it happened I was able to fix it but 2nd time project was all somehow bad and I had to revert everything through Git.

You can also get the same issue if attempting to Move Image sets from one text project to another, then all is good until you save and close and open again then you will get loads of the weird “..\…\…\…\…\” error.s

Yeah, this is an old bug that I think is logged somewhere (and I referenced recently in another forum post). When doing this, you should always open the source project in the IDE, copy the objects, open the destination project, then paste. Xojo really mangles the file paths otherwise.

3 Likes

Yea I ended up doing that.

Its a really nasty bug.

2 Likes

It is. I’ve run into that one, too.

More text project - modules chaos….

This project I have never imported from other project

It now opens totally “Flat”

as in all modules are gone and even methods and events are listing as separate files.

What is going on with the Text format ?

The project bellow is totally destroyed.

I can tell you the way I’m doing it and that works !

  1. right click on the module in the IDE and choose export, you can choose where to export it
  2. drag exported module into any project

I do that all the time with my common code ( libraries ), BUT I have all the code in a folders. I drag folder after folder into a project, if it runs, I save the project, otherwise I have to fix problems first !

if it des not work with the module, put your module in a folder.

The only way I’ve found to reliably move complex modules between projects is to let the IDE do the heavy-lifting with Copy/Paste. Always copy the module in one project’s navigator and paste it in to the other project’s navigator. I’ve been using this workflow for…well…who knows how long at this point.

I’ve never seen the project flattening, and I’ve never had anything but trouble with using filesystem drag/drop for adding these items to projects. The text project format just isn’t great and going to and from filesystem objects due to the way that modules with child objects are rendered to folders.

1 Like

This flattening thing happens because the IDE isn’t smart about a file and matching folder. That information is stored in the project manifest and without it, it has no way to set up the associations.

Note though in the flattening case then nothing had ever been imported in that project

@Björn_Eiríksson - when you say “imported” did you:

  1. File > Import > binary module file
  2. File > import > xml file
  3. File > import > text file
  4. Drag module and its folder from the finder/explorer
  5. Import an encrypted module and then save as text?
  6. Something else?

Edit: I saw your original post. Yeah, you can’t do that reliably. Your best bet is to copy & paste from the other project right in the IDE if you can. I’ve found that not working in some circumstances recently too, but can’t reproduce it on demand.

Oh wait… you don’t have something in the filter field, right? Like a space?

No was no filter, project was completly destroyed and would not run or anything.

Imported only applies to the first case, not the case of the Flattened. (In the flattening case nothing was imported, and its unclear what caused it).

In the first case when there was import then it was copied from other Text project, into correct relative folders, then dragged in. (and everything worked)…..until hitting save, close and open again. (then its gone to hell)

If you just open the first project, copy the module, go to the second project and paste the module. Then save, close and reload, does that work? Just don’t do it in Finder or Explorer.

If you scroll up to the top then that was established in the first posts that solves the first case yes.

2nd case the flattening (without any imports) is more of mystery on how to reproduce.