eZ Community » Forums » eZ Publish 5 Platform » [Resolved] Fetch...
expandshrink

[Resolved] Fetch reverse_related_objects sql error

[Resolved] Fetch reverse_related_objects sql error

Thursday 30 May 2013 12:07:42 pm - 12 replies

I use a simple fetch function for reverse related object but don't works and return a sql error (mysql):

 

{def $related_solution = fetch( 'content', 'reverse_related_objects', hash( 'object_id', $node.contentobject_id,
'attribute_identifier', '428' ) )}

 

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=428  ( 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=428  ( relation_type & 8 ) <> 0                          AND ezcontentobject.id=ezcontentobject_link.from_contentobject_id AND                                                                      ezcontentobject_link.to_contentobject_id=272 AND                                                                      ezcontentobject_link.from_contentobject_version=ezcontentobject.current_version                          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 ) ) )

Modified on Tuesday 04 June 2013 12:53:59 pm by Daniele Nocentini

Thursday 30 May 2013 12:37:39 pm

Hi,

I copy/pasted your query to check the SQL. Part of it is:

"ezcontentobject.status=1 AND AND contentclassattribute_id=428"

Notice the double AND. Try removing that and see if it works.

 

Regards Robin

Thursday 30 May 2013 12:50:46 pm

Hi Robin,

it's a standard ez query. I use only template fetch function.

Thursday 30 May 2013 9:25:04 pm

Hi,

Which version of eZ are you using? I'll see if I can get another dev or engineering to look at this.

 

-- Robin

Friday 31 May 2013 9:27:18 am

I use ezpublish Community Project 2013.1

Friday 31 May 2013 10:04:20 am

Then this has most likely been fixed since then, but to be certain, can someone try to reproduce on 2013.05 or 5.1?

Friday 31 May 2013 10:10:44 am

I try to upgrade to 2013.05 and than test again.

Monday 03 June 2013 10:16:24 am

the problem occurs also on 2013.5 version, I think it's a bug.

Monday 03 June 2013 10:42:41 am

Then it is indeed a bug, could you report if there isn't any issues on it already? then I'll make sure to hand it over to be fixed.

Modified on Monday 03 June 2013 10:43:05 am by André R

Monday 03 June 2013 10:48:07 am

ok but you can tell me the URL of new bug tracking?

Monday 03 June 2013 11:15:15 am

It's https://jira.ez.no, https://issues.ez.no should redirect there as well blunk.gif Emoticon

Monday 03 June 2013 11:27:01 am

ok I create this bug report

https://jira.ez.no/browse/EZP-20962

Tuesday 04 June 2013 12:53:32 pm

my bug report it's a duplicate of this:

https://jira.ez.no/browse/EZP-20943

and the solution is to open file kernel/classes/ezcontentobject.php and change line 2850 from this:

$relationTypeMasking .= " AND contentclassattribute_id=$attributeID ";

 

to this:

$relationTypeMasking .= " contentclassattribute_id=$attributeID AND ";

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from