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

SQL query error in fetch('content', 'keyword') with some 'sort_by' parameters

    Details

      Description

      When using eZ Demo Blog, if you click on a tag from a Blog Post you'll get a fatal error

      Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause'. Query: SELECT DISTINCT ezcontentobject_tree.node_id, ezkeyword.keyword, a0.sort_key_int FROM ezkeyword INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id) INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id) INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id) INNER JOIN ezcontentobject_attribute a0 ON ( a0.contentobject_id = in /var/www/blog_resende_biz/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php on line 419
      

      To reproduce this issue, using eZ Demo:

      1. Add a Blog Object
      2. Add a Blog Post
      3. Fill in the tag field with something
      4. Go the frontpage and access the Blog Post
      5. Click on the tag

      The query error happens when using the "attribute" or "class_name" sort_by parameter of the fetch('content', 'keyword') function.

      A more descriptive way the reproduce this issue it to use the following code in a template:

      {set $blogs = fetch( 'content', 'keyword', hash( 'alphabet', rawurldecode( $view_parameters.tag ),
          'classid', 'blog_post',
          'parent_node_id', $node.node_id,
          'offset', $view_parameters.offset,
          'sort_by', array( 'attribute', false(), 'blog_post/publication_date' ),
          'limit', $page_limit ) )}
      

      or

      {set $blogs = fetch( 'content', 'keyword', hash( 'alphabet', rawurldecode( $view_parameters.tag ),
          'classid', 'blog_post',
          'parent_node_id', $node.node_id,
          'offset', $view_parameters.offset,
          'sort_by', array( 'class_name', false() ),
          'limit', $page_limit ) )}
      

        Activity

        Pedro Resende (Inactive) created issue -
        Pedro Resende (Inactive) made changes -
        Field Original Value New Value
        Status Open [ 1 ] Confirmed [ 10037 ]
        Pedro Resende (Inactive) made changes -
        Description When using eZ Demo Blog, if you click on a tag from a Blog Post you'll get a fatal error

        {noformat}
        Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause'. Query: SELECT DISTINCT ezcontentobject_tree.node_id, ezkeyword.keyword, a0.sort_key_int FROM ezkeyword INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id) INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id) INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id) INNER JOIN ezcontentobject_attribute a0 ON ( a0.contentobject_id = in /var/www/blog_resende_biz/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php on line 419
        {noformat}
        When using eZ Demo Blog, if you click on a tag from a Blog Post you'll get a fatal error

        {noformat}
        Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause'. Query: SELECT DISTINCT ezcontentobject_tree.node_id, ezkeyword.keyword, a0.sort_key_int FROM ezkeyword INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id) INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id) INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id) INNER JOIN ezcontentobject_attribute a0 ON ( a0.contentobject_id = in /var/www/blog_resende_biz/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php on line 419
        {noformat}

        To reproduce this issue, using eZ Demo:

        1. Add a Blog Object
        2. Add a Blog Post
        3. Fill in the tag field with something
        4. Go the frontpage and access the Blog Post
        5. Click on the tag
        Pedro Resende (Inactive) made changes -
        Affects Version/s 2013.07 [ 12581 ]
        Pedro Resende (Inactive) made changes -
        Fix Version/s QA tracked issues [ 11072 ]
        Patrick Allaert (Inactive) made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 10 minutes [ 600 ]
        Worklog Id 38677 [ 38677 ]
        André Rømcke made changes -
        Status Confirmed [ 10037 ] InputQ [ 10001 ]
        André Rømcke made changes -
        Rank Ranked higher
        André Rømcke made changes -
        Rank Ranked higher
        André Rømcke made changes -
        Rank Ranked higher
        Patrick Allaert (Inactive) made changes -
        Status InputQ [ 10001 ] Development [ 3 ]
        Assignee Patrick Allaert [ patrick.allaert@ez.no ]
        Patrick Allaert (Inactive) made changes -
        Summary Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause' while browsing blogs by tag SQL query error in fetch('content', 'keyword') with some 'sort_by' parameters
        Patrick Allaert (Inactive) made changes -
        Description When using eZ Demo Blog, if you click on a tag from a Blog Post you'll get a fatal error

        {noformat}
        Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause'. Query: SELECT DISTINCT ezcontentobject_tree.node_id, ezkeyword.keyword, a0.sort_key_int FROM ezkeyword INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id) INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id) INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id) INNER JOIN ezcontentobject_attribute a0 ON ( a0.contentobject_id = in /var/www/blog_resende_biz/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php on line 419
        {noformat}

        To reproduce this issue, using eZ Demo:

        1. Add a Blog Object
        2. Add a Blog Post
        3. Fill in the tag field with something
        4. Go the frontpage and access the Blog Post
        5. Click on the tag
        When using eZ Demo Blog, if you click on a tag from a Blog Post you'll get a fatal error

        {noformat}
        Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause'. Query: SELECT DISTINCT ezcontentobject_tree.node_id, ezkeyword.keyword, a0.sort_key_int FROM ezkeyword INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id) INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id) INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id) INNER JOIN ezcontentobject_attribute a0 ON ( a0.contentobject_id = in /var/www/blog_resende_biz/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php on line 419
        {noformat}

        To reproduce this issue, using eZ Demo:

        1. Add a Blog Object
        2. Add a Blog Post
        3. Fill in the tag field with something
        4. Go the frontpage and access the Blog Post
        5. Click on the tag

        The query error happens when using the _"attribute"_ or _"class_name"_ sort_by parameter of the .

        A more descriptive way the reproduce this issue it to use the following code in a template:
        {code}
        {set $blogs = fetch( 'content', 'keyword', hash( 'alphabet', rawurldecode( $view_parameters.tag ),
            'classid', 'blog_post',
            'parent_node_id', $node.node_id,
            'offset', $view_parameters.offset,
            'sort_by', array( 'attribute', false(), 'blog_post/publication_date' ),
            'limit', $page_limit ) )}
        {code}

        or

        {code}
        {set $blogs = fetch( 'content', 'keyword', hash( 'alphabet', rawurldecode( $view_parameters.tag ),
            'classid', 'blog_post',
            'parent_node_id', $node.node_id,
            'offset', $view_parameters.offset,
            'sort_by', array( 'class_name', false() ),
            'limit', $page_limit ) )}
        {code}
        Patrick Allaert (Inactive) made changes -
        Description When using eZ Demo Blog, if you click on a tag from a Blog Post you'll get a fatal error

        {noformat}
        Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause'. Query: SELECT DISTINCT ezcontentobject_tree.node_id, ezkeyword.keyword, a0.sort_key_int FROM ezkeyword INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id) INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id) INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id) INNER JOIN ezcontentobject_attribute a0 ON ( a0.contentobject_id = in /var/www/blog_resende_biz/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php on line 419
        {noformat}

        To reproduce this issue, using eZ Demo:

        1. Add a Blog Object
        2. Add a Blog Post
        3. Fill in the tag field with something
        4. Go the frontpage and access the Blog Post
        5. Click on the tag

        The query error happens when using the _"attribute"_ or _"class_name"_ sort_by parameter of the .

        A more descriptive way the reproduce this issue it to use the following code in a template:
        {code}
        {set $blogs = fetch( 'content', 'keyword', hash( 'alphabet', rawurldecode( $view_parameters.tag ),
            'classid', 'blog_post',
            'parent_node_id', $node.node_id,
            'offset', $view_parameters.offset,
            'sort_by', array( 'attribute', false(), 'blog_post/publication_date' ),
            'limit', $page_limit ) )}
        {code}

        or

        {code}
        {set $blogs = fetch( 'content', 'keyword', hash( 'alphabet', rawurldecode( $view_parameters.tag ),
            'classid', 'blog_post',
            'parent_node_id', $node.node_id,
            'offset', $view_parameters.offset,
            'sort_by', array( 'class_name', false() ),
            'limit', $page_limit ) )}
        {code}
        When using eZ Demo Blog, if you click on a tag from a Blog Post you'll get a fatal error

        {noformat}
        Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause'. Query: SELECT DISTINCT ezcontentobject_tree.node_id, ezkeyword.keyword, a0.sort_key_int FROM ezkeyword INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id) INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id) INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id) INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id) INNER JOIN ezcontentobject_attribute a0 ON ( a0.contentobject_id = in /var/www/blog_resende_biz/ezpublish_legacy/lib/ezdb/classes/ezmysqlidb.php on line 419
        {noformat}

        To reproduce this issue, using eZ Demo:

        1. Add a Blog Object
        2. Add a Blog Post
        3. Fill in the tag field with something
        4. Go the frontpage and access the Blog Post
        5. Click on the tag

        The query error happens when using the _"attribute"_ or _"class_name"_ sort_by parameter of the _fetch('content', 'keyword')_ function.

        A more descriptive way the reproduce this issue it to use the following code in a template:
        {code}
        {set $blogs = fetch( 'content', 'keyword', hash( 'alphabet', rawurldecode( $view_parameters.tag ),
            'classid', 'blog_post',
            'parent_node_id', $node.node_id,
            'offset', $view_parameters.offset,
            'sort_by', array( 'attribute', false(), 'blog_post/publication_date' ),
            'limit', $page_limit ) )}
        {code}

        or

        {code}
        {set $blogs = fetch( 'content', 'keyword', hash( 'alphabet', rawurldecode( $view_parameters.tag ),
            'classid', 'blog_post',
            'parent_node_id', $node.node_id,
            'offset', $view_parameters.offset,
            'sort_by', array( 'class_name', false() ),
            'limit', $page_limit ) )}
        {code}
        Patrick Allaert (Inactive) made changes -
        Time Spent 10 minutes [ 600 ] 5 hours, 40 minutes [ 20400 ]
        Worklog Id 39844 [ 39844 ]
        Patrick Allaert (Inactive) made changes -
        Status Development [ 3 ] Development review [ 10006 ]
        Patrick Allaert (Inactive) made changes -
        Status Development review [ 10006 ] Development Review done [ 10028 ]
        Fix Version/s 5.0 Maintenance [ 11287 ]
        Fix Version/s Ventoux [ 11282 ]
        Fix Version/s 5.1 Maintenance [ 12301 ]
        Fix Version/s 5.2 Maintenance [ 12782 ]
        Fix Version/s 5.2-dev [ 12300 ]
        Patrick Allaert (Inactive) made changes -
        Status Development Review done [ 10028 ] Documentation done [ 10011 ]
        Pedro Resende (Inactive) made changes -
        Status Documentation done [ 10011 ] QA [ 10008 ]
        Assignee Patrick Allaert [ patrick.allaert@ez.no ] Pedro Resende [ pedro.resende@ez.no ]
        Pedro Resende (Inactive) made changes -
        Assignee Pedro Resende [ pedro.resende@ez.no ] Joao Pingo [ joao.pingo@ez.no ]
        Joao Pingo (Inactive) made changes -
        Time Spent 5 hours, 40 minutes [ 20400 ] 6 hours, 10 minutes [ 22200 ]
        Worklog Id 41048 [ 41048 ]
        Joao Pingo (Inactive) made changes -
        Status QA [ 10008 ] InputQ [ 10001 ]
        Assignee Joao Pingo [ joao.pingo@ez.no ]
        Joao Pingo (Inactive) made changes -
        Time Spent 6 hours, 10 minutes [ 22200 ] 1 day, 40 minutes [ 31200 ]
        Worklog Id 41056 [ 41056 ]
        André Rømcke made changes -
        Status InputQ [ 10001 ] Development [ 3 ]
        Assignee André Rømcke [ andre.romcke@ez.no ]
        André Rømcke made changes -
        Time Spent 1 day, 40 minutes [ 31200 ] 1 day, 50 minutes [ 31800 ]
        Worklog Id 41057 [ 41057 ]
        André Rømcke made changes -
        Status Development [ 3 ] Documentation done [ 10011 ]
        Joao Pingo (Inactive) made changes -
        Status Documentation done [ 10011 ] QA [ 10008 ]
        Assignee André Rømcke [ andre.romcke@ez.no ] Joao Pingo [ joao.pingo@ez.no ]
        Joao Pingo (Inactive) made changes -
        Assignee Joao Pingo [ joao.pingo@ez.no ]
        Status QA [ 10008 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Joao Pingo (Inactive) made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Joao Pingo (Inactive) made changes -
        Time Spent 1 day, 50 minutes [ 31800 ] 1 day, 2 hours, 50 minutes [ 39000 ]
        Worklog Id 41154 [ 41154 ]
        Joao Pingo (Inactive) made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        André Rømcke made changes -
        Workflow eZ Engineering Scrumban Workflow [ 57877 ] EZ* Development Workflow [ 84156 ]
        Alex Schuster made changes -
        Workflow EZ* Development Workflow [ 84156 ] EZEE Development Workflow [ 122794 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Pedro Resende (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 day, 2 hours, 50 minutes
              1d 2h 50m