This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Fatel error while browsing blogs by tag
expandshrink

Fatel error while browsing blogs by tag

Fatel error while browsing blogs by tag

Wednesday 11 July 2012 4:54:37 pm - 4 replies

After fresh eZ Publish installed with eZ flow ,

While browsing blogs by t ags At : http://myurl.com/Blogs/(tag)/Berlin

I get error :

 
 
Fatal error: mysql_query(): Query error: 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 =  ezconten IN /srv/qtdn/ez/lib/ezdb/classes/ezmysqldb.php ON line <em>426</em>

xdebug : http://i.imgur.com/5aswL.png

Modified on Wednesday 11 July 2012 6:47:07 pm by Gurudutt Verma

Wednesday 11 July 2012 5:43:05 pm

Full query :

 

<span>SELECT DISTINCT ezcontentobject_tree.node_id, ezkeyword.keyword, a0.sort_key_int<span id="line2"> </span>                  FROM ezkeyword<span id="line3"> </span>                       INNER JOIN ezkeyword_attribute_link ON (ezkeyword_attribute_link.keyword_id = ezkeyword.id)<span id="line4"></span>                       INNER JOIN ezcontentobject_attribute ON (ezcontentobject_attribute.id = ezkeyword_attribute_link.objectattribute_id)<span id="line5"></span>                       INNER JOIN ezcontentobject ON (ezcontentobject_attribute.version = ezcontentobject.current_version AND ezcontentobject_attribute.contentobject_id = ezcontentobject.id)<span id="line6"></span>                       INNER JOIN ezcontentobject_tree ON (ezcontentobject_tree.contentobject_id = ezcontentobject.id)<span id="line7"></span>                       INNER JOIN ezcontentclass ON (ezcontentclass.id = ezcontentobject.contentclass_id)<span id="line8"></span>                        INNER JOIN ezcontentobject_attribute a0 ON (<span id="line9"></span>                                   a0.contentobject_id = ezcontentobject.id AND<span id="line10"></span>                                   a0.contentclassattribute_id = 216 AND<span id="line11"></span>                                   a0.version = ezcontentobject_name.content_version AND<span id="line12"></span> ( a0.language_id <span><span>&</span></span> ezcontentobject.language_mask > 0 AND<span id="line13"></span>     ( (   ezcontentobject.language_mask - ( ezcontentobject.language_mask <span><span>&</span></span> a0.language_id ) ) <span><span>&</span></span> 1 )<span id="line14"></span>   + ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask <span><span>&</span></span> a0.language_id ) ) <span><span>&</span></span> 8 ) >> 2 )<span id="line15"></span>   + ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask <span><span>&</span></span> a0.language_id ) ) <span><span>&</span></span> 4 ) )<span id="line16"></span>   + ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask <span><span>&</span></span> a0.language_id ) ) <span><span>&</span></span> 2 ) </span><span class="error" title="Bad character after “<”. Probable cause: Unescaped “<”. Try escaping it as “&lt;”."><<</span><span></span><span class="error" title="Bad character after “<”. Probable cause: Unescaped “<”. Try escaping it as “&lt;”."> </span><span>2 )<span id="line17"></span>   </span><span class="error" title="Bad character after “<”. Probable cause: Unescaped “<”. Try escaping it as “&lt;”."><<span id="line18"></span></span><span>     ( a0.language_id <span><span>&</span></span> 1 )<span id="line19"></span>   + ( ( a0.language_id <span><span>&</span></span> 8 ) >> 2 )<span id="line20"></span>   + ( ( a0.language_id <span><span>&</span></span> 4 ) )<span id="line21"></span>   + ( ( a0.language_id <span><span>&</span></span> 2 ) </span><span class="error" title="Bad character after “<”. Probable cause: Unescaped “<”. Try escaping it as “&lt;”."><<</span><span></span><span class="error" title="Bad character after “<”. Probable cause: Unescaped “<”. Try escaping it as “&lt;”."> </span><span>2 )<span id="line22"></span> ) <span id="line23"></span>) INNER JOIN ezcontentobject_name ON (ezcontentobject_name.contentobject_id = ezcontentobject.id)<span id="line24"></span>                       <span id="line25"></span>                  WHERE<span id="line26"></span>                  ezkeyword.keyword LIKE 'Berlin%'<span id="line27"></span>                  AND ezcontentobject_tree.is_invisible = 0<span id="line28"></span>                   AND ((ezcontentobject.section_id in (1)) OR (ezcontentobject.contentclass_id in (29, 33, 35, 36, 37, 45) AND ezcontentobject.section_id in (3))) <span id="line29"></span>                  <span id="line30"></span>                  <span id="line31"></span>                  AND ezcontentobject_tree.parent_node_id = '109'<span id="line32"></span>                  AND ezcontentclass.version = 0<span id="line33"></span>                  AND ezcontentobject.status = 1<span id="line34"></span>                  AND ezcontentobject_tree.main_node_id = ezcontentobject_tree.node_id<span id="line35"></span>                  ORDER BY a0.sort_key_int DESC</span><span></span>

Wednesday 11 July 2012 6:43:29 pm

Patch to fix this issue.

 

 --- kernel/content/ezcontentfunctioncollection.php      2012-07-11  18:39:38.257454474  +0200                                                                                   
+++ kernel/content/ezcontentfunctioncollection.php.orig      2012-05-31 18:34:19.000000000 +0200          
@@  -947,7 +947,7  @@                                                                                                                                                           
                     if ( $sortBy[0] == 'attribute'  )                                                                                                                         
                      {                                                                                                                                                        
                         // if sort_by is 'attribute' we should add  ezcontentobject_name to "FromSQL" and link to  ezcontentobject                                            
-                         $sortingInfo['attributeFromSQL']  = ' INNER JOIN ezcontentobject_name  ON (ezcontentobject_name.contentobject_id = ezcontentobject.id) ' .  $sortingInfo['attributeFromSQL'];
+                         $sortingInfo['attributeFromSQL']  .= ' INNER JOIN ezcontentobject_name  ON (ezcontentobject_name.contentobject_id =  ezcontentobject.id)';            
                         $sqlTarget  = 'DISTINCT ezcontentobject_tree.node_id,  '.$sqlKeyword;                                                                                  
                      }                                                                                                                                                        
                     else // for unique declaration                             

In issue tracker this issue was already reported and was closed as invalid .... not sure why but to fix this I have applied above patch.

Modified on Wednesday 11 July 2012 6:45:32 pm by Gurudutt Verma

Wednesday 18 July 2012 10:53:11 pm

Quote from Gurudutt Verma :

Patch to fix this issue.

 

 --- kernel/content/ezcontentfunctioncollection.php      2012-07-11  18:39:38.257454474  +0200                                                                                   
+++ kernel/content/ezcontentfunctioncollection.php.orig      2012-05-31 18:34:19.000000000 +0200          
@@  -947,7 +947,7  @@                                                                                                                                                           
                     if ( $sortBy[0] == 'attribute'  )                                                                                                                         
                      {                                                                                                                                                        
                         // if sort_by is 'attribute' we should add  ezcontentobject_name to "FromSQL" and link to  ezcontentobject                                            
-                         $sortingInfo['attributeFromSQL']  = ' INNER JOIN ezcontentobject_name  ON (ezcontentobject_name.contentobject_id = ezcontentobject.id) ' .  $sortingInfo['attributeFromSQL'];
+                         $sortingInfo['attributeFromSQL']  .= ' INNER JOIN ezcontentobject_name  ON (ezcontentobject_name.contentobject_id =  ezcontentobject.id)';            
                         $sqlTarget  = 'DISTINCT ezcontentobject_tree.node_id,  '.$sqlKeyword;                                                                                  
                      }                                                                                                                                                        
                     else // for unique declaration                             

In issue tracker this issue was already reported and was closed as invalid .... not sure why but to fix this I have applied above patch.

Oopps little mistake in generating this patch sad.gif Emoticon

consider + as -

and - as + 

and all works as expected happy.gif Emoticon 

Friday 23 August 2013 11:22:23 pm

This issue is still present on 5.2, however I've proposed a PR for this problem

https://github.com/ezsystems/ezpublish-legacy/pull/726

 
 
 
From 260c6de8597b4c9641c47c2b324b9ebed7fd0fef Mon Sep 17 00:00:00 2001From: Pedro Resende <pedroresende@mail.resende.biz>Date: Fri, 23 Aug 2013 22:16:14 +0100Subject: [PATCH] Fix EZP-21444 - Fatal error: mysqli_query(): Query error (1054): Unknown column 'ezcontentobject_name.content_version' in 'on clause' while browsing blogs by tag--- kernel/classes/ezcontentobjecttreenode.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)diff --git a/kernel/classes/ezcontentobjecttreenode.php b/kernel/classes/ezcontentobjecttreenode.phpindex 9a16224..4ea8587 100644--- a/kernel/classes/ezcontentobjecttreenode.php+++ b/kernel/classes/ezcontentobjecttreenode.php@@ -658,8 +658,7 @@ static function createSortingSQLStrings( $sortList, $treeTableName = 'ezcontento                             $datatypeFromSQL = "ezcontentobject_attribute $contentAttributeTableAlias";                             $datatypeWhereSQL = "                                    $contentAttributeTableAlias.contentobject_id = ezcontentobject.id AND-                                   $contentAttributeTableAlias.contentclassattribute_id = $classAttributeID AND-                                   $contentAttributeTableAlias.version = ezcontentobject_name.content_version AND";+                                   $contentAttributeTableAlias.contentclassattribute_id = $classAttributeID AND";                             $datatypeWhereSQL .= eZContentLanguage::sqlFilter( $contentAttributeTableAlias, 'ezcontentobject' );                              $dataType = eZDataType::create( eZContentObjectTreeNode::dataTypeByClassAttributeID( $classAttributeID ) );-- 1.8.1.6
expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from