There is a use case when importing python code and saving the resulting diagram which results in an unreadable file. The version of the program is reported as 0.13.0.
Details:
- Imported an 18 file python project (~1600 loc, ~25 classes) via import option
- Saved resulting diagram
- Restarted gaphor
- Resulting error text looks as follows:
2008-01-15 07:45:06,768 ERROR Invalid ID for reference (DCE:530420CA-C1C3-11DC-B62A-00173188FB55) for element Property.presentation
2008-01-15 07:45:06,768 ERROR Invalid ID for reference (DCE:5350E6E4-C1C3-11DC-B62A-00173188FB55) for element Property.presentation
2008-01-15 07:45:06,769 ERROR Invalid ID for reference (DCE:5350E8F6-C1C3-11DC-B62A-00173188FB55) for element Property.presentation
...around 100 lines of this...
Reproducing:
I can't reproduce the error with a smaller set of files. When I have some time I'll sit down and figure out exactly what is causing it in the larger set, then post the example files.
Workaround:
pathch for: gaphor/storage/storage.py:
247c247,249
< raise ValueError, 'Invalid ID for reference (%s) for element %s.%s' % (refid, elem.type, name)
---
> ref = None
> log.error('Invalid ID for reference (%s) for element %s.%s' % (refid, elem.type, name))
> #raise ValueError, 'Invalid ID for reference (%s) for element %s.%s' % (refid, elem.type, name)
Possible Fixes:
During save check that references being written actually exist.