From f1044089682d96760f6027afdc6c153bc69d5987 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 27 May 2014 15:10:53 +0100 Subject: [PATCH] 7712: Cherry-pick [321821] and [2dd0c9] from master. --- gramps/gui/editors/editmedia.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gramps/gui/editors/editmedia.py b/gramps/gui/editors/editmedia.py index 6b173c254..4e96d14ef 100644 --- a/gramps/gui/editors/editmedia.py +++ b/gramps/gui/editors/editmedia.py @@ -290,11 +290,8 @@ class EditMedia(EditPrimary): return path = conv_to_unicode(self.file_path.get_text()) - ref_obj = self.dbstate.db.get_object_from_handle(self.obj.handle) - if ref_obj: - media_path = media_path_full(self.dbstate.db, - ref_obj.get_path()) - if os.path.exists(os.path.join(os.path.dirname(media_path), path)): + full_path = media_path_full(self.db, path) + if os.path.isfile(full_path): self.determine_mime() else: msg1 = _("There is no media matching the current path value!") @@ -306,7 +303,7 @@ class EditMedia(EditPrimary): self.ok_button.set_sensitive(True) return - self.obj.set_path(conv_to_unicode(path)) + self.obj.set_path(path) with DbTxn('', self.db) as trans: if not self.obj.get_handle():