Fix get_course_extra_field_value and subscribe_user2course.php - refs #8232

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent a0186b98a7
commit ec3e41c584
  1. 2
      main/inc/lib/course.lib.php
  2. 10
      main/inc/lib/usermanager.lib.php

@ -2807,7 +2807,7 @@ class CourseManager
$courseId = $courseInfo['real_id'];
$extraFieldValues = new ExtraFieldValue('course');
$result = $extraFieldValues->get_values_by_handler_and_field_variable($variable, $courseId);
$result = $extraFieldValues->get_values_by_handler_and_field_variable($courseId, $variable);
if (!empty($result['value'])) {
return $result['value'];
}

@ -2273,22 +2273,20 @@ class UserManager
* @param string the internal value of the field
* @return array with extra data info of a user i.e array('field_variable'=>'value');
*/
public static function get_extra_user_data_by_value($field_variable, $field_value, $all_visibility = true)
public static function get_extra_user_data_by_value($field_variable, $field_value)
{
$extraField = new ExtraFieldValue('user');
$data = $extraField->get_values_by_handler_and_field_variable(
$data = $extraField->get_item_id_from_field_variable_and_field_value(
$field_variable,
$field_value,
null,
true,
intval($all_visibility)
true
);
$result = [];
if (!empty($data)) {
foreach ($data as $data) {
$result[] = $data['item_id'];
$result[] = $data;
}
}

Loading…
Cancel
Save