Kaju admin app crashing

I’m working through the Read Me to integrate Kaju and step 3 of the Step By Step guide is failing.

That doesn’t work; I can’t save a new document; the app crashes with an UnsupportedFormatException in this section of code:

[code]Function Resolve() As FolderItem
if zSaveInfo.LenB = 0 then
return nil
else
Dim f As New FolderItem( zSaveInfo )
return f
end if

End Function[/code]

The crash is on the “Dim f As New FolderItem( zSaveInfo )” line.

I have no idea how to work around this.

That’s an exception and not a crash. Mac, Windows or Linux? Where are you saving the document to?

Must be a 2019r3 problem. I get the exception, too.

macOS 10.14.6 (Mojave). It doesn’t matter where I try to save the document to — Documents, Desktop, secondary drive, all yield the same problem. I’m using Xojo 2019r3.

Well, then try the debugger. As far as I can see the SaveInfo is the problem.

Yes, I already stepped through it in the debugger. The SaveInfo is the problem. Trying to create a FolderItem with it causes the exception. But I don’t know how to fix that. I mean, I could probably figure out how to create the FolderItem in a different way, one that doesn’t crash, but I don’t understand the Kaju code well enough to know why it’s the way it is or what changes would be prudent. If that’s what it takes, I guess that’s what I’ll do, but clearly this exception shouldn’t be and hasn’t been happening, so I’m hoping someone who knows the code better (like that Kem fellow, for instance) will have some advice.

Ah, didn’t notice this. Perhaps it is an r3 problem. I had it working earlier in the week on a different machine, but my default Xojo on that machine is an earlier version.

Not sure if this is a Xojo bug or just a gotcha. At least it used to work in former versions of Xojo.

Try the following code:

[code]dim f as FolderItem = SpecialFolder.Desktop.Child(“blabla”)
dim s as String = f.SaveInfo(volume(0))

f = SpecialFolder.Desktop
s = f.SaveInfo(volume(0))[/code]

For the first test the folderitem doesn’t exist and you get the result you see in Kaju Admin. The second test works because the folderitem exists.

The main window in Kaju Admin works with the problematic FolderitemAlias class. Therefore, writing to the document and then making the SaveInfo wouldn’t work. I’m going to remove the SaveInfo and use a NativePath instead.

This here works for FolderitemAlias:

[code]Public Sub Constructor(f As FolderItem)
myNativePath = f.NativePath
End Sub

Public Function Resolve() as FolderItem

if myNativePath = “” then
Return Nil
else
dim f as new FolderItem(myNativePath, FolderItem.PathTypeNative)
Return f
end if

End Function[/code]

Perfect. Thank you!

That may work but defeats the purpose of using SaveInfo (to track the file as an alias).

I’m going to look at the whole package to get it up to speed with the latest version of Xojo and Catalina, hopefully this week.

Sounds good. Thanks!

The last time I checked the SaveInfo it didn’t work anyways when the file was moved.

There was a bug that had been fixed, I thought. But anyway, I’ll check it and work around it if needed, even if I have to use system calls.