1. 02 Mar, 2023 24 commits
  2. 01 Mar, 2023 16 commits
    • Jérome Perrin's avatar
      e74de444
    • Jérome Perrin's avatar
      8853bce4
    • Jérome Perrin's avatar
      zope4: depend on zope.component >= 5 · 1b83eb4d
      Jérome Perrin authored
      1b83eb4d
    • Jérome Perrin's avatar
      ERP5TypeTestCase: stop copying ZopeTestCase's publish implementation · f633eb80
      Jérome Perrin authored
      Call the original method instead of copy/pasting the code
      
      We still keep the following patches:
       - user: this is an ERP5 addition and maybe we use it in customer project
         code (if we don't I'm in favor of removing the feature, it's used in
         only one place in this repo)
       - call `self.changeSkin(self.portal.getCurrentSkinName())`. Maybe this
         is needed for CMFCore tests and could be good to send upstream, I did
         not check this part
      f633eb80
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      zope4: TODO · 31a2061b
      Jérome Perrin authored
      31a2061b
    • Jérome Perrin's avatar
      patches: add a compatibility patch for `zope_quick_start` · 879e0253
      Jérome Perrin authored
      `zope_quick_start` was a dtml that was removed in Zope commit c8e4cd5ca
      (Simplify control panel objects and actually make them non-persistent.,
      2016-08-14), but it is referenced in /index_html page template, which
      contains:
      
          <tal:text tal:replace="structure context/zope_quick_start" />
      
      As a result, rendering / is an error page because of KeyError: 'zope_quick_start'
      
      In SlapOS setup, we are using / in an haproxy health check, so the
      health check fail and zope is marked as down and haproxy does not send
      requests to backend.
      
      We could have an upgrader constraint to repair this page template, but
      because of this, zope is unreachable through haproxy, so it's easier to
      ressort to monkey patching.
      879e0253
    • Tatuya Kamada's avatar
      ERP5Catalog: Fix UnicodeDecodeError on non ascii catalog search when the inituser name is unicode · eb9b366c
      Tatuya Kamada authored
      Zope4 inituser is decoded by decode('utf-8') on Zope startup and it is unicode on python2,
      therefore it raises UnicodeDecodeError when searching non ascii charater on catalog.
      
        Traceback (most recent call last):
        File "<portal_components/test.erp5.testERP5Catalog>", line 4144, in testSearchNonAsciiWithTheInitUser
          person_module.searchFolder(title=person_title)]
        File "./erp5/product/ERP5Type/Core/Folder.py", line 452, in searchFolder
          return self.portal_catalog.searchResults(**kw)
        File "./erp5/product/ERP5Catalog/CatalogTool.py", line 819, in searchResults
          return ZCatalog.searchResults(self, sql_catalog_id=catalog_id, **kw)
        File "./erp5/product/ZSQLCatalog/ZSQLCatalog.py", line 1070, in searchResults
          return catalog.searchResults(REQUEST, **kw)
        File "./erp5/product/ZSQLCatalog/SQLCatalog.py", line 2362, in searchResults
          **kw
        File "./erp5/product/ZSQLCatalog/SQLCatalog.py", line 2326, in queryResults
          **kw
        File "./erp5/product/ZSQLCatalog/SQLCatalog.py", line 2214, in buildSQLQuery
          only_group_columns,
        File "./erp5/product/ZSQLCatalog/SQLExpression.py", line 397, in asSQLExpressionDict
          'where_expression': self.getWhereExpression(),
        File "./erp5/product/ZSQLCatalog/SQLExpression.py", line 298, in getWhereExpression
          result = self.sql_expression_list[0].getWhereExpression()
        File "./erp5/product/ZSQLCatalog/SQLExpression.py", line 303, in getWhereExpression
          result = '(%s)' % (operator.join(x.getWhereExpression() for x in self.sql_expression_list), )
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 25: ordinal not in range(128)
      eb9b366c
    • Jérome Perrin's avatar
      xhtml_style: don't set content type header if already set · cd63c2fb
      Jérome Perrin authored
      This is necessary on Zope4 because the error page is executed even if
      the response already has a locked body - and in this case we don't
      want to override the content-type header that might also have been set.
      
      One user of this is Base_redirect from erp5_hal_json_style, when
      abort_transaction is True, in that case it sets a body in json, a
      content type header of application/json and then raise a redirect so
      that the transaction is not commited. This fixes a problem visible on
      Zope4 with erp5_bank_reconciliation_renderjs_ui_test:testFunctionalRJSBankReconciliationAction
      cd63c2fb
    • Jérome Perrin's avatar
      hal_json_style/Base_redirect: pass an URL to Redirect · 4beac602
      Jérome Perrin authored
      Even if this is not used because we have locked a status earlier, the
      constructor expects an URL with zExceptions 4
      4beac602
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      patches/CookieCrumbler: apply upstream changes · 25f5ecda
      Jérome Perrin authored
      zopefoundation/Products.CMFCore commit 882a697 (- correct check for
      request compatibility for CookieCrumbler, 2017-05-12)
      25f5ecda
    • Jérome Perrin's avatar
      b39cee0e
    • Jérome Perrin's avatar
      ERP5Type: import code from WSGIPublisher instead of redefining · eb8d1ee1
      Jérome Perrin authored
      This drops some patches that should no longer be needed with zope 4 to
      only keep the publisher timeout changes
      eb8d1ee1
    • Jérome Perrin's avatar
      oauth_facebook_login: update # hack to be compatible with Zope4 redirects · f4ca4bde
      Jérome Perrin authored
      Zope4 uses urlparse + urlunparse to encode the URL, which has a side
      effect of removing the empty fragment from the URL. Using a lower level
      API to set the status code and the Location header we achieve the same
      result.
      f4ca4bde