Commit 33ae1402 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: appcache document may not exist

parent d7cd1a5f
appcache_reference = context.getLayoutProperty("configuration_manifest_url", default="gadget_erp5.appcache") appcache_reference = context.getLayoutProperty("configuration_manifest_url", default="gadget_erp5.appcache")
text_content = context.getPortalObject().portal_catalog.getResultValue( web_manifest = context.getPortalObject().portal_catalog.getResultValue(
portal_type='Web Manifest', portal_type='Web Manifest',
reference=appcache_reference).getTextContent() reference=appcache_reference)
if web_manifest is None:
text_content = ''
else:
text_content = web_manifest.getTextContent()
translation_data_url_list = [] translation_data_url_list = []
url_list = [] url_list = []
......
...@@ -7,8 +7,10 @@ error_list = [] ...@@ -7,8 +7,10 @@ error_list = []
if appcache_reference: if appcache_reference:
url_list = context.Base_getListFileFromAppcache() url_list = context.Base_getListFileFromAppcache()
# Check that the manifest is newer than all cached resources. # Check that the manifest is newer than all cached resources.
appcache_manifest = getDocumentValue(appcache_reference).getObject() appcache_manifest = getDocumentValue(appcache_reference)
appcache_manifest_modification_date = appcache_manifest.getModificationDate() if appcache_manifest is not None:
appcache_manifest = appcache_manifest.getObject()
appcache_manifest_modification_date = appcache_manifest.getModificationDate()
for url in url_list: for url in url_list:
if url: if url:
referenced_document = getDocumentValue(url) referenced_document = getDocumentValue(url)
......
  • mentioned in merge request nexedi/erp5!1026 (merged)

    Toggle commit list
  • I'm not sure I understand this one. The constraint error when the web site has configuration_manifest_url layout property set to a non existant page ? It's not good if constraint crash, but maybe something like this is enough ?

    
      appcache_manifest = getDocumentValue(appcache_reference)
      if appcache_manifest is None:
        return ['Error: Web Site references a non existant appcache']
    

    edit: is not None is None

    Edited by Jérome Perrin
  • Yes, probably.

    I just quickly fix the failing activity on my instance, but didn't think more.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment