Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-15142

related object counted even if it is moved to a trash

    Details

      Description

      eZPublish ver. 4.1.2

      Steps to reproduce

      1. create an object
      2. add fx. 2 related objects
      3. move one related object to a trash
      4. the list of related objects will show only one object but count both objects (Related objects [2])

      1. ezcontentobject.php.diff
        4 kB
        (inactive) Gunnstein Lye
      2. ezcontentobject.php.diff
        3 kB
        (inactive) Gunnstein Lye
      3. join_related_object_count.sql
        3 kB
        (inactive) Gunnstein Lye
      4. join_related_object_count.sql
        3 kB
        (inactive) Gunnstein Lye
      5. join_related_object_count.sql
        3 kB
        (inactive) Gunnstein Lye
      6. related_object_count.sql
        3 kB
        (inactive) Gunnstein Lye

        Activity

        Hide
        (inactive) Gunnstein Lye added a comment - - edited

        Updated patch for the suggested solution attached
        (for svn trunk/4.2.0alpha1)

        • Fixes wrong use of AS in table aliases (oracle error)
        • Query rewritten to use join instead of subselectezcontentobject.php.diff
        Show
        (inactive) Gunnstein Lye added a comment - - edited Updated patch for the suggested solution attached (for svn trunk/4.2.0alpha1) Fixes wrong use of AS in table aliases (oracle error) Query rewritten to use join instead of subselect ezcontentobject.php.diff
        Hide
        (inactive) Gunnstein Lye added a comment -

        In reply to comment #048926
        Example SQL produced by new patch attached. Oracle compatibility verified.join_related_object_count.sql

        Show
        (inactive) Gunnstein Lye added a comment - In reply to comment #048926 Example SQL produced by new patch attached. Oracle compatibility verified. join_related_object_count.sql
        Hide
        André R added a comment -

        In reply to comment #048926
        One last thing, the code shouldn't use "if ( $db->databaseName() == 'oracle' )" but $db->bitAnd() and $db->bitOr() and so on.

        Show
        André R added a comment - In reply to comment #048926 One last thing, the code shouldn't use "if ( $db->databaseName() == 'oracle' )" but $db->bitAnd() and $db->bitOr() and so on.
        Hide
        (inactive) Gunnstein Lye added a comment -

        In reply to comment #048928
        Thanks, I didn't know this, duly noted. However, this is existing, older code and unrelated to the fix in question. I have added a comment in the relevant, related issue.
        #013469: always use db handler BITAND function when creating sql code that needs it
        http://issues.ez.no/13469

        Show
        (inactive) Gunnstein Lye added a comment - In reply to comment #048928 Thanks, I didn't know this, duly noted. However, this is existing, older code and unrelated to the fix in question. I have added a comment in the relevant, related issue. #013469: always use db handler BITAND function when creating sql code that needs it http://issues.ez.no/13469
        Hide
        (inactive) Gunnstein Lye added a comment -

        Fixed in
        trunk (4.3.0alpha1) rev. 24358
        stable/4.2 (4.2.1) rev. 24359
        stable/4.1 (4.1.5) rev. 24360

        Show
        (inactive) Gunnstein Lye added a comment - Fixed in trunk (4.3.0alpha1) rev. 24358 stable/4.2 (4.2.1) rev. 24359 stable/4.1 (4.1.5) rev. 24360

          People

          • Assignee:
            (inactive) Gunnstein Lye
            Reporter:
            Jarosław-- Heba
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: