Bug? Resyncing file locations after moving folders

DRLDEV

Member
Licensed User
Hi Erel,

I had cause to move an application folder into a sub-folder to keep things tidy.

Project folder

... moved to ...

New Folder
|
+--------- Project Folder
|
+--------- Other resources for the project


After moving, the application could not locate the layout file (only one layout file in this instance).

In the Designer, I opened the file navigator and used "Open File" to locate the missing layout file (which was located as expected in the project's Files sub-folder).

I selected the layout and was prompted that the layout file would be copied to the project Files sub-folder - even though that is where it already was.

Once the file was copied (to itself one assumes) I continued the project and made changes to the layout, but they did not have any effect. It appeared that I was working on a phantom copy of the layout - the WYSIWYG Designer showed the changes that I'd made (and saved), but when the app was run the layout was still the original.


Workaround:

I saved the app and restarted B4J. On restart, B4J now picked up the location of the layout file correctly, and, all of the changes that I'd made appeared both in the WYSIWYG Designer and in the running app. Everything was in sync again.


Ideas about possible causes (?):

The path between the project root folder and the Files folder appears as if it might have been absolute rather than relative, which would explain why the layout wasn't found after I'd moved the whole project to a new folder, i.e. the path was originally E:\B4J\Project and became E:\B4J\New folder\Project.

The Visual Designer path to the layout file wasn't updated to the new location until a restart of B4J.


(I'd hate for paths to be absolute as this used to cause problems with Visual Studio whenever projects were moved).

Hope that makes sense Erel, and is enough detail to easily find the cause.

All the best,

Dave
 

DRLDEV

Member
Licensed User
Hi Erel.

Thanks again for the quick reply. I'm only reporting what happened because it was clearly not what I was expecting from the excellent B4J.

I made a mental note in the past that moving projects didn't cause issues and was very grateful of this, so when it did cause a problem this time, and because I know you have done stuff with being able to share files between projects, I wanted to let you know in case there were other hidden issues with finding files (I assume that shared files have to be absolute paths because there's no way of knowing where they are otherwise).

Perhaps the most relevant symptom was that B4J could not find the layout file in the Files folder, until I located it manually in the file finder. This might imply that it is how the path to the layout file is stored. Anyway, not a problem for me as I know how to get around it, but thought I should mention it just in case it wasn't some peculiarity with my setup here.

Thanks again.

All the best

Dave
 

DRLDEV

Member
Licensed User
Hi Erel,

I'm unable to reproduce it too which may mean that I've possibly wasted your time with this one. My apologies for that. While the bug was happening it was a very definite and identifiable situation, but I'm unable to make it happen again. Restarting B4J did resolve the symptoms which seems to indicate that it might have been a B4J based issue... but I can't be 100% sure.

Perhaps it was a one-off caused by an unlikely combination of events. I was running TeamViewer to remote onto a second machine which had Xampp running, to sort out a PHP backend to my B4J front end, and had been jumping repeatedly between debug mode and editing.

I had also opened multiple instances of B4J on several occasions that day to copy/paste sections of code between a couple of projects, and I am aware that B4J doesn't like multiple instances, but only if more than one instance is actually running in debug mode - B4J does seem to cope fine if one instance is in debug and the other in release, and indeed, I have used that when playing with client server scenarios, but I wasn't doing that on this occasion - I only had one instance open when the problem with the layout file happened. I don't know... just a glitch on my machine?

I will keep an eye open for any reoccurrence of similar symptoms, and do my best to give you a repeatable example to work with. I realise it's impossible without.

Thanks for looking into this and, again, my apologies if this is a phantom bug.

Dave
 
Top