hi there,
when i was looking at moodle code i found this piece of code at get_logs_usercourse in lib/datalib.php
$params['userid'] = $userid;
$$coursestart = (int)$coursestart; // note: unfortunately pg complains if you use name parameter or column alias in GROUP BY
//GESMOD-336 comentamos bloque y aniadimos bloque
/*
return $DB->get_records_sql("SELECT FLOOR((time - $coursestart)/". DAYSECS .") AS day, COUNT(*) AS num
FROM {log}
WHERE userid = :userid
AND time > $coursestart $courseselect
GROUP BY FLOOR((time - $coursestart)/". DAYSECS .")", $params);
variable variables names are used in moodle code, but in this case ( $$
coursestart ) i think it is a bug, nevertheless, this code runs, because the variable is an autoasign and i think cast to int is for safety and rarely is needed.I was misunderstood something or is it a bug?