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

SQL error when fetching related_objects from template.

    XMLWordPrintable

    Details

      Description

      I'm having the following SQL error when using an old template with:

                                          {def $new_relations=fetch( 'content', 'related_objects',
                                                  hash( 'object_id',            $node.object.id,
                                                        'attribute_identifier', 442,
                                                        'sort_by',              array( 'published', false() ),
                                                        'as_object',            true()
                                                    ) )
                                          }
      

      The error looks like:

      Error: eZMySQLiDB	Apr 17 2013 13:34:44
      Query error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND contentclassattribute_id=442  ( relation_type & 8 ) <> 0 
                        ' at line 19. Query: SELECT 
                              ezcontentclass.serialized_name_list AS class_serialized_name_list,
                              ezcontentclass.identifier as contentclass_identifier,
                              ezcontentclass.is_container as is_container,
                              ezcontentobject.*, ezcontentobject_name.name as name, ezcontentobject_name.real_translation
                              
                           FROM
                              ezcontentclass,
                              ezcontentobject,
                              ezcontentobject_link,
                              ezcontentobject_name
                              
                           WHERE
                              ezcontentclass.id=ezcontentobject.contentclass_id AND
                              ezcontentclass.version=0 AND
                              ezcontentobject.status=1 AND
                              
                              
                               AND contentclassattribute_id=442  ( relation_type & 8 ) <> 0 
                               AND ezcontentobject.id=ezcontentobject_link.to_contentobject_id AND
                                                                            ezcontentobject_link.from_contentobject_id='1604' AND
                                                                            ezcontentobject_link.from_contentobject_version='5' 
                               AND
                              ezcontentobject.id = ezcontentobject_name.contentobject_id AND
                              ezcontentobject.current_version = ezcontentobject_name.content_version AND
                              
       ( ezcontentobject_name.language_id & ezcontentobject.language_mask > 0 AND
           ( (   ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 1 )
         + ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 2 ) )
         <
           ( ezcontentobject_name.language_id & 1 )
         + ( ( ezcontentobject_name.language_id & 2 ) )
       ) 
      
                               ORDER BY ezcontentobject.published DESC
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fjmagan Kiko Magán
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: