Catching Exception during Silva export
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Silva |
Fix Released
|
Low
|
Eric Casteleijn |
Bug Description
On our sites when trying a 'Silva Full-Media Export', we frequently experience a
failure (caused by an AttributeError). After analyzing the situation, I found
out that the problem was caused by changes in our custom metadata sets we
applied in the past.
Say we have two metadata sets 'my_container_set' and 'my_author_set'. During the
first period, the element 'force_https' was part of set 'my_container_set'.
After a while, however, we found out that this element needs to be member of the
set 'my_author_set'. Applying this change doesn't lead to any problems in the
productive site, i.e. the pages are displayed as expected.
However, such a change can lead to problems if such a site is exported using
'Silva Full-Media Export'. During the first period, objects are created and
stored to the ZODB making references to the metadata element 'force_https' in
the set 'my_container_set'. In the subsequent period ('force_https' member of
'my_author_set') when preparing the Silva export, a metadata item is retrieved
with the key 'force_https'. Then, the system tries to look up the metadata
field, calling Binding.
inevitably results in an AttributeError.
Therefore, my suggestion is to make this export more stable by catching the
AttributeError in Silva.silvaxml.
---
for key, value in items:
---
I'm sort of hesitant to introduce this sort of defensive coding, since it may
end up cloaking other more serious bugs. I'll have a look to see why the key is
looked up in the wrong metadata set in the first place.
If I understand correctly, the element was moved from set1 to set2, but on
export it is still looked up on set1, right?