Details
-
Bug
-
Resolution: Fixed
-
High
-
5.0, 5.1, 5.2-dev, 2013.07
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 ) )}