Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cyberduck opened this issue Aug 11, 2010 · 12 comments
Closed

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

cyberduck opened this issue Aug 11, 2010 · 12 comments

Comments

@cyberduck
Copy link
Collaborator

@cyberduck cyberduck commented Aug 11, 2010

0df4748 created the issue

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

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 11, 2010

@dkocher commented

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.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 12, 2010

0df4748 commented

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.

cyberduck-ticket-5095.png

Thanks,

-Simon

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 20, 2010

0df4748 commented

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

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 21, 2010

@dkocher commented

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.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 22, 2010

@dkocher commented

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

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 23, 2010

0df4748 commented

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.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 25, 2010

0df4748 commented

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

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 25, 2010

0df4748 commented

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

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 25, 2010

@dkocher commented

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

Loading

@cyberduck cyberduck closed this Aug 25, 2010
@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 25, 2010

@dkocher commented

Replying to [comment:7 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.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 29, 2010

0df4748 commented

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

-Simon

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 29, 2010

@dkocher commented

Replying to [comment:11 simonm]:

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

-Simon

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

Loading

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants