#42: BibEdit: crash when empty history
---------------------+------------------------------------------------------
Reporter: simko | Owner:
Type: defect | Status: new
Priority: minor | Milestone: v1.0
Component: BibEdit | Version:
Keywords: |
---------------------+------------------------------------------------------
!BibEdit produces traceback if for some reason there are no MARCXML
historical versions for the given record in hstRECORD table. !BibEdit
should simply continue gracefully in these cases, the History panel
being empty.
How to reproduce:
{{{
$ echo "TRUNCATE hstRECORD" | /opt/cds-invenio/bin/dbexec
}}}
and then edit a record.
The traceback is:
{{{
File "/usr/lib/python2.5/site-packages/invenio/bibedit_engine.py", line
527, in perform_request_record
record_revision, record = create_cache_file(recid, uid)
File "/usr/lib/python2.5/site-packages/invenio/bibedit_utils.py", line
104, in create_cache_file
record_revision = get_record_last_modification_date(recid)
File "/usr/lib/python2.5/site-packages/invenio/bibedit_dblayer.py", line
61, in get_record_last_modification_date
return run_sql("SELECT max(job_date) FROM hstRECORD WHERE
id_bibrec=%s", (recid, ))[0][0].timetuple();
AttributeError: 'NoneType' object has no attribute 'timetuple'
}}}
--
Ticket URL: <http://cdswaredev.cern.ch/invenio/ticket/42>
Invenio <http://cdswaredev.cern.ch/invenio>