Project

General

Profile

Bug #6632

feedback delete: not working

Added by Anonymous about 7 years ago. Updated about 7 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
-
Start date:
26/08/2013
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal

Description

cannot delete own feedback

MDB2 :: isError() returns true after query:

"DELETE FROM `admin_feedback_publication` WHERE `alias_afp`.`id` = 15" 

MDB2 Error: no such field
_doQuery: [Error message: Could not execute statement] [Last executed query: DELETE FROM `admin_feedback_publication` WHERE `alias_afp`.`id` = 15] [Native code: 1054] [Native message: Unknown column 'alias_afp.id' in 'where clause']


Files

History

#1

Updated by Anonymous about 7 years ago

resolved:

file chamilo-dev/core/admin/php/lib/data_manager/mdb2.class.php, line 147
public function delete_feedback_publication($feedback_publication)

change to:

        $condition = new EqualityCondition(FeedbackPublication :: PROPERTY_ID, $feedback_publication->get_id());

this looks like a revert of a previous bugfix. However this method now seems to be working.
This was the previous version:

$condition = new EqualityCondition(
            new PropertyConditionVariable(FeedbackPublication :: class_name(), FeedbackPublication :: PROPERTY_ID),
            new StaticConditionVariable($feedback_publication->get_id())

#2

Updated by Anonymous about 7 years ago

This was the original bug:
https://support.chamilo.org/issues/6242

I ran the suggested test (with the simple condition) with the bugfix mentioned above and it works.

I reran it with the previous code (with the complex condition) as well and it didn't work - I don't know how/why it was considered fixed.

#3

Updated by Anonymous about 7 years ago

  • Target version set to LCMS 4 Beta
#4

Updated by Sven Vanpoucke about 7 years ago

PropertyConditionVariables should in no case be removed. This was probably an issue due to a recent change in the MDB2DataManager where the alias was removed from the delete function. The alias should be restored to solve this problem.

#5

Updated by Anonymous about 7 years ago

  • Status changed from New to Bug resolved

Your recent commit https://bitbucket.org/chamilo/chamilo-dev/commits/c261050d02ee6aec78c8bf79f326458b359e153f fixed the problem, and some others too. Thanks.

I reverted to property condition variables, as requested.

#6

Updated by Sven Vanpoucke about 7 years ago

No problem

In case you still have issues with the delete function of the MDB2DataManager try to check if PropertyConditionVariables are used in the conditions. If not, then add them. This will automatically generate the correct alias for your conditions.

Also available in: Atom PDF