Opened 11 years ago

Closed 10 years ago

#4380 closed defect (fixed)

Journal: when the documents path can not be retrieved, Palettes can not be displayed, detail view does not work correctly

Reported by: erikos Owned by: erikos
Priority: Normal Milestone: Unspecified
Component: Sugar Version: 0.98.x
Severity: Major Keywords:
Cc: dsd, godiard Distribution/OS: OLPC
Bug Status: Unconfirmed

Description

Today I have seen the following: In the Journal I was not able to reveal a Palette by hovering or right clicking on one of the icons, nor the detail view of any entry had any information about the entry.

In the logs I found:

Traceback (most recent call last):
  File "/home/erikos/new-sugar-build/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 1414, in __motion_notify_ev
ent_cb
    self.notify_mouse_enter()
  File "/home/erikos/new-sugar-build/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 965, in notify_mouse_enter
    self._ensure_palette_exists()
  File "/home/erikos/new-sugar-build/install/lib/python2.7/site-packages/sugar3/graphics/palettewindow.py", line 960, in _ensure_palette_exi
sts
    palette = self.parent.create_palette()
  File "/home/erikos/new-sugar-build/install/lib/python2.7/site-packages/jarabe/journal/listview.py", line 656, in create_palette
    palette = ObjectPalette(metadata, detail=True)
  File "/home/erikos/new-sugar-build/install/lib/python2.7/site-packages/jarabe/journal/palettes.py", line 102, in __init__
    copy_menu = CopyMenu(metadata)
  File "/home/erikos/new-sugar-build/install/lib/python2.7/site-packages/jarabe/journal/palettes.py", line 228, in __init__
    if not self._metadata['uid'].startswith(documents_path):
TypeError: startswith first arg must be str, unicode, or tuple, not NoneType

It looks like the path to the documents folder can not be retrieved. We could be more defensive here, for example:

diff --git a/src/jarabe/journal/palettes.py b/src/jarabe/journal/palettes.py
index 200240f..3d7adbd 100644
--- a/src/jarabe/journal/palettes.py
+++ b/src/jarabe/journal/palettes.py
@@ -225,7 +225,8 @@ class CopyMenu(Gtk.Menu):
             journal_menu.show()
 
         documents_path = model.get_documents_path()
-        if not self._metadata['uid'].startswith(documents_path):
+        if documents_path and \
+                not self._metadata['uid'].startswith(documents_path):
             documents_menu = VolumeMenu(self._metadata, _('Documents'),
                                         documents_path)
             documents_menu.set_image(Icon(icon_name='user-documents',

We have to check now, why the documents path can not be retrieved.

Change History (4)

comment:1 Changed 11 years ago by dsd

  • Cc dsd godiard added

Was this in sugar-build or on the XO?

comment:2 Changed 11 years ago by walter

In sugar-build, the problem is fixed by adding user-dir.dirs to state/home/default/config

But we should make Sugar more robust in light of this error.

I've been having an additional problem in sugar-build: when I change an entry in the detail view and then change a second journal item, the metadata gets copied from one to the other.

Haven't been able to reproduce this in OLPC os28 (Sugar 0.98).

comment:3 Changed 11 years ago by dnarvaez

  • Milestone changed from 0.98 to Unspecified

comment:4 Changed 10 years ago by dnarvaez

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

Issue with sugar-build that was fixed.

Note: See TracTickets for help on using tickets.