1. 30 Nov, 2017 3 commits
    • Denis Laxalde's avatar
      [ssplanner] Prevent execution of write queries involving computed relations · 68ca7fe0ca29
      Denis Laxalde authored
      Previously, setting a computed relation upon entity creation or
      modification (using the ORM or an RQL query) would usually fail with an
      operational error in the backend ("no such table"). However, under some
      mysterious circumstances (like passing a string as value in cw_set for a
      computed relation), the RQL to SQL transformation would simply drop the
      clause.
      
      To prevent this to happen, we add a check for computed relation before
      adding a relation to an execution plan. This check raises a QueryError.
      It happens in several places:
      
      * in querier.InsertPlan.add_relation_def() (called from several places
        in ssplanner steps) for INSERT queries,
      * in ssplanner.UpdateStep.execute() for SET queries and,
      * in ssplanner.SSplanner.build_delete_plan() for DELETE queries.
      
      Tests added to unittest_querier.py because unittest_sslplanner.py looked
      inappropriate (it has only unit tests) and the former already had a
      NonRegressionTC class.
      68ca7fe0ca29
    • Denis Laxalde's avatar
      [querier] Expand 'rdef' argument in InsertPlan.add_relation_def() · 06deb43c23c3
      Denis Laxalde authored
      Expand the 'rdef' tuple to improve readability. The 'rtype' value is not
      used at the moment, but will in the next changeset.
      06deb43c23c3
    • Denis Laxalde's avatar
  2. 03 Nov, 2017 3 commits
  3. 15 Sep, 2017 4 commits
  4. 29 Nov, 2017 3 commits
    • Denis Laxalde's avatar
      [gcdebug] Only ignore weakref.WeakKeyDictionary class on Python 2 · 24393ce335f5
      Denis Laxalde authored
      From Python 3.5, this class fails isinstance check with the following
      error:
      
      ::
      
          cls = <class 'weakref.WeakKeyDictionary'>, instance = <functools._lru_list_elem object at 0x7f4331859a48>
      
              def __instancecheck__(cls, instance):
                  """Override for isinstance(instance, cls)."""
                  # Inline the cache checking
          >       subclass = instance.__class__
          E       AssertionError: [<class 'AttributeError'> in gc] 'functools._lru_list_elem' object has no attribute '__class__'
      
          /usr/lib/python3.5/abc.py:181: AssertionError
      
      
      I have no clue why this happens, but it makes
      cubicweb.web.test.test_views.AutomaticWebTest.test_startup_views fail on
      Python 3.5. So only consider this class for Python 2.
      24393ce335f5
    • Denis Laxalde's avatar
      [wsgi] Convert "code" passed to WSGIResponse as integer · 55924e962cd7
      Denis Laxalde authored
      WSGIResponse is passed a Request.status_out in
      CubicWebWSGIApplication._render(), which, starting from Python 3.5, is
      an instance of HTTPStatus.
      However, webtest still expects a 3-digits value as status string.
      Fortunately, calling int() on an HTTPStatus works.
      55924e962cd7
    • Denis Laxalde's avatar
      [test] Add a "version" to cubicweb_mycube/__pkginfo__.py · 93dc77e9da77
      Denis Laxalde authored
      Starting from Python 3.5, unittest_cwctl.py::CubicWebCtlTC.test_list()
      would fail without this.
      93dc77e9da77
  5. 28 Nov, 2017 1 commit
  6. 03 Nov, 2017 1 commit
  7. 30 Oct, 2017 9 commits
  8. 15 Sep, 2017 1 commit
  9. 12 Sep, 2017 1 commit
  10. 06 Oct, 2017 1 commit
    • Sylvain Thénault's avatar
      [test] Pin some test dependencies · cfd25da225c2
      Sylvain Thénault authored
      We currently have CI failures because cubes used as test dependencies have been
      updated to new-style cube layout. To avoid this, pin them to previous released.
      
      Those dependencies should be removed but in the mean time this should be enough
      (and backported in all active branches).
      cfd25da225c2
  11. 12 Sep, 2017 2 commits
  12. 11 Sep, 2017 1 commit
  13. 10 Jul, 2017 3 commits
  14. 22 Jun, 2017 1 commit
  15. 06 Jun, 2017 1 commit
    • Denis Laxalde's avatar
      [pyramid] Only expose 'cubicweb.bwcompat' setting for "all-in-one" configuration type · 36f1c7ab9010
      Denis Laxalde authored
      The "pyramid" instance configuration does not work with "cubiwceb.bwcompat"
      mode (on purpose). Yet, having the setting exposed in development.ini file
      (generate by `cubicweb-ctl create --config pyramid <cube> <instance>` command)
      is misleading and we want to remove it.
      
      Thus, we only query this setting when cubicweb configuration is "all-in-one" and
      drop the setting line from templated development.ini file. If the option is
      found and True for any other configuration type, we issue a user warning (and
      ignore the option).
      
      --HG--
      branch : 3.25
      36f1c7ab9010
  16. 27 Apr, 2017 1 commit
  17. 05 May, 2017 1 commit
  18. 21 Apr, 2017 1 commit
    • Sylvain Thénault's avatar
      [facets] Fix disappearance of navtop component on facet filtering · ef46695adb68
      Sylvain Thénault authored
      which is because facets are replacing the whole #pageContent div, while this one
      contains other stuff than the view:
      
      * a type selector component that should be dropped for a while,
      * a computed title,
      * the page navigation.
      
      Then the view content itself is in a #contentmain div. The thing is that the
      navigation should be rebuilded on filtering (this is not the case for other
      bullets in the list above). This is currently handled specifically in the
      ajaxcontroller (except for the type selector which will disappear... who said it
      should be dropped at once?).
      
      So to fix this we:
      
      * put the page navigation into the "contentmain" div
      * don't replace anymore "pageContent" but "contentmain"
      
      After that we can even remove from the ajax controller the code that
      reimplements title handling similarly to the main template.
      
      Notice the part that changes the main template has to be ported to squareui.
      
      Closes #17074195
      ef46695adb68
  19. 19 Jun, 2017 2 commits