Details
-
Bug
-
Resolution: Fixed
-
Medium
-
2011.7
-
None
-
Operating System: Ubuntu 11.04
PHP Version: 5.3.5
Database and version: 5.1.54-1ubuntu4 (Ubuntu)
Browser (and version): FireFox 4
Description
When try to move an content object to trash box, I receive a DB Transaction error.
here is the log I have:
[ Aug 25 2011 05:24:26 ] [192.168.0.55] eZMySQLiDB:
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 ')' at line 2. Query: SELECT id, contentobject_attribute_id, filepath
FROM ezimagefile WHERE contentobject_attribute_id='1300' AND filepath IN ( )
[ Aug 25 2011 05:24:26 ] [192.168.0.55] eZDBInterface::commit TRANSID-9b7b03454bb2238ec1c8aa67a377bd6a:
Transaction in progress failed due to DB error, transaction was rollbacked. Transaction ID is TRANSID-9b7b03454bb2238ec1c8aa67a377bd6a.
I check the log, it occurred when try to fetch data from table 'ezimagefile' with an empty filepath value. so I guess the problem might be related to the datatype "ezimage".
=============================================================
I trace the code and actually I found where the piece of code causing this problem.
in the file "kernel/classes/datatypes/ezimage/ezimagetype.php", line 70
$conds = array(
"contentobject_attribute_id" => $contentObjectAttribute->attribute( "id" ),
"filepath" => array( $aliasesPath )
);
the array $aliasesPath is empty because not all the version of object attribute have content, need to determine if the array is empty or not before doing the fetch.
my solution is below:
add the following line before the $conds
if( empty( $aliasesPath ))
also in the line 119 of the same file, the same problem is as above, but occurred when trying to restore the same content object.
please fix it, thanks!
Steps to reproduce
Create a content object using a content class with ezimage datatype in it, do not upload image for the attribute, after save and publish, move the content to trash, the DB Transaction error will occur.
Attachments
Issue Links
- is duplicated by
-
EZP-18533 Fatal error when trying to remove an article in EzFlow/EzWebin
- Closed
-
EZP-18641 Fatal error in moving object to trash
- Closed
-
EZP-18844 fatal error when moving an image object to trash
- Closed
- relates to
-
EZP-18844 fatal error when moving an image object to trash
- Closed
-
EZP-17781 image aliases not restored when restoring object from trash
- Closed
-
EZP-17797 DFS cluster should not use match by LIKE
- Closed