Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.0.7, 4.1.4, 4.2.0, 4.3.0
-
None
-
eZ Publish 4.2.0
ezoracle 2.0.3
Oracle 10.2.0.1.0
Description
The following error could occur when using fetch( 'content', 'keyword' ) in conjunction with oracle:
—
Error (1791): ORA-01791: Kein mit SELECT ausgewählter Ausdruck Failed query at offset 1893: SELECT DISTINCT ezcontentobject_tree.node_id, substr( ezkeyword.keyword, 1, 4 ) AS keyword FROM ezkeyword, ezkeyword_attribute_link,ezcontentobject_tree,ezcontentobject,ezcontentclass , ezcontentobject_attribute a0, ezcontentobject_name, ezcontentobject_attribute a1 WHERE a0.contentobject_id = ezcontentobject.id AND a0.contentclassattribute_id = 771 AND a0.version = ezcontentobject_name.content_version AND ( bitand( a0.language_id, ezcontentobject.language_mask ) > 0 AND bitand( ezcontentobject.language_mask - bitand( ezcontentobject.language_mask, a0.language_id ), 1 ) + bitand( ezcontentobject.language_mask - bitand( ezcontentobject.language_mask, a0.language_id ), 2 ) < bitand( a0.language_id, 1 ) + bitand( a0.language_id, 2 ) ) AND ezcontentobject.id = ezcontentobject_name.contentobject_id AND a1.version=ezcontentobject.current_version AND a1.contentobject_id=ezcontentobject.id AND ezkeyword.keyword LIKE 'Eins%' AND ezcontentobject_tree.is_invisible = 0 AND ezcontentobject_tree.parent_node_id = '253549' AND ezcontentclass.version=0 AND ezcontentobject.status=1 AND ezcontentobject_tree.main_node_id=ezcontentobject_tree.node_id AND ezcontentobject_tree.contentobject_id = ezcontentobject.id AND ezcontentclass.id = ezcontentobject.contentclass_id AND a1.id=ezkeyword_attribute_link.objectattribute_id AND ezkeyword_attribute_link.keyword_id = ezkeyword.id ORDER BY a0.sort_key_int ASC Start of error: a0.sort_key_int ASC
—
The reason for the query to fail is, that when using "ORDER BY a0.sort_key_int", "a0.sort_key_int" must be in the list of SELECTed columns which is not the case.
The attached patch fixes this by setting and using the already existing $sortingInfo['attributeTargetSQL'] variable correctly.
Steps to reproduce
- Use Oracle database
- Execute:
$result = eZContentFunctionCollection::fetchKeyword( $alphabet, $classid, $offset, $limit, $owner, $sortBy, $parentNodeID, $includeDuplicates, $strictMatching );
where $sortBy is for example:
array( 'attribute', true, 'keyword_test_class/keywords_attribute' );
Attachments
Issue Links
- relates to
-
EZP-17167 Documentation: Keyword fetch sort by attribute works now
- Closed