Incorrect parameter passing between execute_sql_arr and execute_sql

Bug #837013 reported by Howard Miller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Hugh Davenport

Bug Description

I'm looking at the very latest 1.3.7 code - not had a chance to look in 1.4.

Looking at the function execute_sql_arr(.....) in dml.php (line 1398 in mine) it has a parameter called $feedback which is described as 'specify to show status info (true) or not (false)'.

The function does some stuff and then makes a call to execute_sql( $sql, $feedback ) noting $feedback as the second parameter (boolean). However, if you look at execute_sql() (line 135 for me), the second parameter is called $values and is an array.

Tags: dmllib
Changed in mahara:
status: New → Triaged
importance: Undecided → Low
milestone: none → 1.5.0
Revision history for this message
Hugh Davenport (hugh-davenport) wrote :

It seems that the feedback isn't use anyway, but there are functions that call it with that argument so we can't just remove it from the function. Though a quick survey shows that it isn't being used in the other functions as well....

The fix would be to remove the 2nd parameter to the execute_sql function call, and assume the default $values=null

https://reviews.mahara.org/860

Changed in mahara:
assignee: nobody → Hugh Davenport (hugh-catalyst)
status: Triaged → In Progress
tags: added: dmllib
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/860
Committed: http://gitorious.org/mahara/mahara/commit/58ddf16fb130793bfaa159e5374f095ce1916981
Submitter: Francois Marier (<email address hidden>)
Branch: master

commit 58ddf16fb130793bfaa159e5374f095ce1916981
Author: Hugh Davenport <email address hidden>
Date: Tue Nov 15 16:45:03 2011 +1300

    Remove incorrect parameter to execute_sql

    Bug #837013

    Change-Id: I54e1964487c885bbde709bef51e4e377b1ae8904
    Signed-off-by: Hugh Davenport <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Melissa Draper (melissa)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.