Cyberduck Mountain Duck CLI

#5095 closed defect (fixed)

The "Edit With" Menu Is Empty For Some File Types

Reported by: simonm Owned by: dkocher
Priority: normal Milestone: 3.6
Component: core Version: 3.5.1
Severity: normal Keywords:
Cc: Architecture: Intel
Platform: Mac OS X 10.6

Description

I love TextMate, except for this one issue:

I'm connecting to a SFTP server that holds a bunch of text files, which I am editing using TextMate. (It's the current version of TextMate, and I have the "Always use this application" checkbox turned on in Cyberduck's editor preferences.)

Some of the text files have names ending with the extension ".mhtml", and contain HTML::Mason source code. (However, the same extension is also sometimes used for MIME HTML, a Microsoft-introduced format for packing HTML and and associated assets into a single file, and if I download one of these files and look at in the Finder, its "Open with" menu gives me the choice of opening it in Microsoft Word.)

When I have one of those ".mhtml" files selected, the "Edit with" menu is empty, and the command-K keyboard shortcut does not work. In order to edit these files I must make the window toolbar visible, and use the "Edit" button shown there.

I am guessing that the "Edit with" menu is looking for applications which are registered for the ".mhtml" file type, finding an unsupported editor (Microsoft Word) and bailing out. However, I think the "Always use this application" checkbox should still be respected in this situation, so that I can hit command-K to edit the file in TextMate.

Thank you for your consideration,

-Simon

Attachments (1)

cyberduck-ticket-5095.png (39.4 KB) - added by simonm on Aug 12, 2010 at 6:09:17 PM.
Screenshot showing empty "Edit With" menu and working "Edit" button in toolbar.

Download all attachments as: .zip

Change History (13)

comment:1 Changed on Aug 11, 2010 at 7:52:11 PM by dkocher

Thanks for the detailed bug report. Can you please test with the latest snapshot build available. I cannot reproduce the issue here. The default editor choosen should always be included in the list of available editors.

comment:2 Changed on Aug 12, 2010 at 6:08:15 PM by simonm

I have downloaded and am now testing on Version 3.6 (6609) but continue to see the same symptoms.

Moreover, I've found that I can reproduce the problem by renaming a text file to end in ".doc", a common Microsoft Word extension, or ".xls", a common Microsoft Excel extension.

If I select a file with a .mhtml or .doc or .xls extension, the Cyberduck File menu's "Edit With", and the popup context menu's "Edit With" lists are both empty, and the command-K keyboard shortcut does not function.

For what it's worth, I do have Microsoft Word and Excel installed, as part of Microsoft Office 2004.

I do not see the "No external editor available" message described on the "Common Problems" page, but I did follow the "rebuild the LaunchServicesdatabase" procedure? it describes before I opened this ticket, to no avail.

I'll try to attach a screenshot as well, in case that's any help; let me know if there's anything else I can do to facilitate debugging this.

Screenshot showing empty "Edit With" menu and working "Edit" button in toolbar.

Thanks,

-Simon

Last edited on Aug 13, 2010 at 7:41:53 AM by dkocher (previous) (diff)

Changed on Aug 12, 2010 at 6:09:17 PM by simonm

Screenshot showing empty "Edit With" menu and working "Edit" button in toolbar.

comment:3 Changed on Aug 20, 2010 at 5:45:56 PM by simonm

I can confirm that this is still happening after upgrading to version 3.6 (6629).

comment:4 Changed on Aug 21, 2010 at 10:24:19 AM by dkocher

At the very least there should be a single item in the menu titled No external editor available. Cannot figure out what is going wrong here.

comment:5 Changed on Aug 22, 2010 at 5:12:13 PM by dkocher

Maybe resetting the editing preferences helps if you have ever changed these:

defaults delete  ch.sudo.cyberduck editor.kqueue.enable
defaults delete  ch.sudo.cyberduck editor.odb.enable

comment:6 Changed on Aug 22, 2010 at 10:05:26 PM by simonm

Running those two lines in Terminal reports that the "defaults have not been changed":

% defaults delete ch.sudo.cyberduck editor.kqueue.enable
2010-08-22 18:00:52.615 defaults[49391:903] 
There is no (editor.kqueue.enable) default for the (ch.sudo.cyberduck) domain.
Defaults have not been changed.

% defaults delete ch.sudo.cyberduck editor.odb.enable
2010-08-22 18:00:59.661 defaults[49393:903] 
There is no (editor.odb.enable) default for the (ch.sudo.cyberduck) domain.
Defaults have not been changed.

comment:7 follow-up: Changed on Aug 25, 2010 at 5:52:48 PM by simonm

I found the below messages in the system error log:

[main] ERROR org.rococoa.callback - Exception calling method for selector numberOfItemsInMenu:
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.rococoa.internal.OCInvocationCallbacks.callMethod(OCInvocationCallbacks.java:154)
	at org.rococoa.internal.OCInvocationCallbacks.access$200(OCInvocationCallbacks.java:52)
	at org.rococoa.internal.OCInvocationCallbacks$2.callback(OCInvocationCallbacks.java:82)
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:384)
	at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:414)
	at com.sun.jna.Function.invokeVoid(Native Method)
	at com.sun.jna.Function.invoke(Function.java:283)
	at com.sun.jna.Function.invoke(Function.java:231)
	at org.rococoa.internal.MsgSendHandler.invoke(MsgSendHandler.java:111)
	at com.sun.jna.Library$Handler.invoke(Library.java:214)
	at $Proxy0.syntheticSendMessage(Unknown Source)
	at org.rococoa.Foundation.send(Foundation.java:200)
	at org.rococoa.Foundation.send(Foundation.java:187)
	at org.rococoa.internal.ObjCObjectInvocationHandler.sendOnThisOrMainThread(ObjCObjectInvocationHandler.java:254)
	at org.rococoa.internal.ObjCObjectInvocationHandler.invokeCocoa(ObjCObjectInvocationHandler.java:222)
	at org.rococoa.internal.ObjCObjectInvocationHandler.intercept(ObjCObjectInvocationHandler.java:185)
	at ch.cyberduck.ui.cocoa.application.NSApplication$$ByRococoa.run(<generated>)
	at ch.cyberduck.ui.cocoa.MainApplication.main(MainApplication.java:108)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at apple.launcher.LaunchRunner.run(LaunchRunner.java:115)
	at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
	at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
Caused by: java.lang.NullPointerException
	at ch.cyberduck.ui.cocoa.odb.EditorFactory.getApplicationName(EditorFactory.java:231)
	at ch.cyberduck.ui.cocoa.odb.EditorFactory.getInstalledEditors(EditorFactory.java:190)
	at ch.cyberduck.ui.cocoa.delegate.EditMenuDelegate.numberOfItemsInMenu(EditMenuDelegate.java:54)
	... 32 more

JNA: Callback org.rococoa.internal.OCInvocationCallbacks$2@61cd2 threw the following exception:
org.rococoa.RococoaException: Exception calling method for selector numberOfItemsInMenu:
	at org.rococoa.internal.OCInvocationCallbacks.callMethod(OCInvocationCallbacks.java:158)
	at org.rococoa.internal.OCInvocationCallbacks.access$200(OCInvocationCallbacks.java:52)
	at org.rococoa.internal.OCInvocationCallbacks$2.callback(OCInvocationCallbacks.java:82)
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:384)
	at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:414)
	at com.sun.jna.Function.invokeVoid(Native Method)
	at com.sun.jna.Function.invoke(Function.java:283)
	at com.sun.jna.Function.invoke(Function.java:231)
	at org.rococoa.internal.MsgSendHandler.invoke(MsgSendHandler.java:111)
	at com.sun.jna.Library$Handler.invoke(Library.java:214)
	at $Proxy0.syntheticSendMessage(Unknown Source)
	at org.rococoa.Foundation.send(Foundation.java:200)
	at org.rococoa.Foundation.send(Foundation.java:187)
	at org.rococoa.internal.ObjCObjectInvocationHandler.sendOnThisOrMainThread(ObjCObjectInvocationHandler.java:254)
	at org.rococoa.internal.ObjCObjectInvocationHandler.invokeCocoa(ObjCObjectInvocationHandler.java:222)
	at org.rococoa.internal.ObjCObjectInvocationHandler.intercept(ObjCObjectInvocationHandler.java:185)
	at ch.cyberduck.ui.cocoa.application.NSApplication$$ByRococoa.run(<generated>)
	at ch.cyberduck.ui.cocoa.MainApplication.main(MainApplication.java:108)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at apple.launcher.LaunchRunner.run(LaunchRunner.java:115)
	at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
	at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
Caused by: java.lang.NullPointerException
	at ch.cyberduck.ui.cocoa.odb.EditorFactory.getApplicationName(EditorFactory.java:231)
	at ch.cyberduck.ui.cocoa.odb.EditorFactory.getInstalledEditors(EditorFactory.java:190)
	at ch.cyberduck.ui.cocoa.delegate.EditMenuDelegate.numberOfItemsInMenu(EditMenuDelegate.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.rococoa.internal.OCInvocationCallbacks.callMethod(OCInvocationCallbacks.java:154)
	... 27 more

Hopefully someone can figure out what this means -- was there a null pointer exception on line 231 of EditorFactory.java, and if so, why?

I'm not familiar with the code but perhaps such an exception can be caught and handled by skipping that editor option and going on to the other candidates?

Thanks, -Simon

comment:8 Changed on Aug 25, 2010 at 6:00:54 PM by simonm

A quick follow-up:

Given that this only happens for file name extensions associated with my five-year-old version of Microsoft Office, and apparently is not affecting many other users, I'm guessing there's something broken about some of the file-type and/or application meta-data on my system, such that the underlying system call that getApplicationName relies on isn't returning a valid string.

I don't need to be able to edit these files in Word or Excel -- as long as the menu isn't empty and I can get to the default editor with Command-K, I'll be happy.

Thanks again,

-Simon

comment:9 Changed on Aug 25, 2010 at 9:47:39 PM by dkocher

  • Milestone set to 3.6
  • Resolution set to fixed
  • Status changed from new to closed

We have some more safeguarding checks when looking into application bundles in r6768. That should fix the issue.

comment:10 in reply to: ↑ 7 Changed on Aug 25, 2010 at 9:49:29 PM by dkocher

Replying to simonm:

I found the below messages in the system error log:

Thanks for the excellent bug reporting. A new snapshot build will be available tomorrow that should have the fix.

comment:11 follow-up: Changed on Aug 29, 2010 at 2:04:11 PM by simonm

Confirmed fixed in version 3.6 (6782) -- thanks again!

-Simon

comment:12 in reply to: ↑ 11 Changed on Aug 29, 2010 at 5:17:23 PM by dkocher

Replying to simonm:

Confirmed fixed in version 3.6 (6782) -- thanks again!

-Simon

Thanks for letting me know and again for your excellent bug reporting.

Note: See TracTickets for help on using tickets.
swiss made software