diff --git a/swad_ID.c b/swad_ID.c index 63dd961c7..aa7f7a0f0 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -233,7 +233,7 @@ unsigned ID_GetListUsrCodsFromUsrID (struct UsrData *UsrDat, Str_Concat (Query," AND Confirmed='Y'", MaxLength); - ListUsrCods->NumUsrs = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get user's codes"); + ListUsrCods->NumUsrs = (unsigned) DB_QuerySELECT (&Query,&mysql_res,"can not get user's codes"); if (ListUsrCods->NumUsrs) { /***** Allocate space for the list of users' codes *****/ diff --git a/swad_attendance.c b/swad_attendance.c index 17c397101..75ae50e32 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -2452,7 +2452,7 @@ static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSel MaxLength); - NumStdsInAttEvent = (unsigned) DB_QueryCOUNT_new ("can not get number of students from a list who are registered in an event"); + NumStdsInAttEvent = (unsigned) DB_QueryCOUNT (&Query,"can not get number of students from a list who are registered in an event"); } return NumStdsInAttEvent; } diff --git a/swad_changelog.h b/swad_changelog.h index a97524a79..d98604a30 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -355,10 +355,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.10 (2018-10-30)" +#define Log_PLATFORM_VERSION "SWAD 18.10.1 (2018-10-30)" #define CSS_FILE "swad18.4.css" #define JS_FILE "swad17.17.1.js" /* + Version 18.10.1: Oct 30, 2018 Fixed bugs in access to database. (235399 lines) Version 18.10: Oct 30, 2018 Fixing bugs in access to database. Not finished. (235399 lines) Version 18.9.10: Oct 30, 2018 Some sprintf for database queries changed by asprintf. (235311 lines) Version 18.9.8: Oct 30, 2018 Cleaning unused functions. (235694 lines) diff --git a/swad_statistic.c b/swad_statistic.c index c745f15ee..11e58898f 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -349,7 +349,7 @@ void Sta_LogAccess (const char *Comments) Str_Concat (Query,"')", MaxLength); - DB_QueryINSERT (Query,"can not log access (comments)"); + DB_QueryINSERT (&Query,"can not log access (comments)"); } if (Gbl.Search.LogSearch && Gbl.Search.Str[0]) @@ -370,7 +370,7 @@ void Sta_LogAccess (const char *Comments) Str_Concat (Query,"')", MaxLength); - DB_QueryINSERT (Query,"can not log access (search)"); + DB_QueryINSERT (&Query,"can not log access (search)"); } if (Gbl.WebService.IsWebService) @@ -1484,7 +1484,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse) Ale_ShowAlert (Ale_INFO,Query); */ /***** Make the query *****/ - NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get clicks"); + NumRows = DB_QuerySELECT (&Query,&mysql_res,"can not get clicks"); /***** Count the number of rows in result *****/ if (NumRows == 0) diff --git a/swad_test.c b/swad_test.c index e2b4501b9..ca74ea424 100644 --- a/swad_test.c +++ b/swad_test.c @@ -2635,7 +2635,7 @@ static unsigned long Tst_GetQuestions (MYSQL_RES **mysql_res) } /* Make the query */ - NumRows = DB_QuerySELECT (Query,mysql_res,"can not get questions"); + NumRows = DB_QuerySELECT (&Query,mysql_res,"can not get questions"); if (NumRows == 0) Ale_ShowAlert (Ale_INFO,Txt_No_questions_found_matching_your_search_criteria); @@ -2771,7 +2771,7 @@ static unsigned long Tst_GetQuestionsForTest (MYSQL_RES **mysql_res) Lay_ShowAlert (Lay_INFO,Query); */ /* Make the query */ - return DB_QuerySELECT (Query,mysql_res,"can not get questions"); + return DB_QuerySELECT (&Query,mysql_res,"can not get questions"); } /*****************************************************************************/ diff --git a/swad_user.c b/swad_user.c index b48dab9ce..dcb5fe6d6 100644 --- a/swad_user.c +++ b/swad_user.c @@ -4177,10 +4177,6 @@ static void Usr_BuildQueryToGetUsrsLstCrs (char **Query,Rol_Role_t Role) return; } - /***** Get list of groups types in current course *****/ - if (!Gbl.Usrs.ClassPhoto.AllGroups) - Grp_GetListGrpTypesInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS); - /***** Allocate space for query *****/ if ((*Query = (char *) malloc (Usr_MAX_BYTES_QUERY_GET_LIST_USRS + 1)) == NULL) Lay_NotEnoughMemoryExit (); @@ -4209,6 +4205,9 @@ static void Usr_BuildQueryToGetUsrsLstCrs (char **Query,Rol_Role_t Role) /***** Select users in selected groups *****/ if (!Gbl.Usrs.ClassPhoto.AllGroups) { + /***** Get list of groups types in current course *****/ + Grp_GetListGrpTypesInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS); + /***** Allocate memory for list of booleans AddStdsWithoutGroupOf *****/ if ((AddStdsWithoutGroupOf = (bool *) calloc (Gbl.CurrentCrs.Grps.GrpTypes.Num,sizeof (bool))) == NULL) Lay_NotEnoughMemoryExit (); diff --git a/swad_web_service.c b/swad_web_service.c index 0812c7063..d5a28908a 100644 --- a/swad_web_service.c +++ b/swad_web_service.c @@ -2779,7 +2779,7 @@ int swad__sendAttendanceUsers (struct soap *soap, Str_Concat (Query,")", Length); - DB_QueryUPDATE (Query,"can not set other users as absent"); + DB_QueryUPDATE (&Query,"can not set other users as absent"); /* Clean table att_usr */ Att_RemoveUsrsAbsentWithoutCommentsFromAttEvent (Att.AttCod); @@ -3296,7 +3296,7 @@ int swad__sendMessage (struct soap *soap, if (ReplyUsrCod > 0 || ThereAreNicknames) // There are a recipient to reply or nicknames in "to" { /***** Get users *****/ - NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get users"); + NumRows = DB_QuerySELECT (&Query,&mysql_res,"can not get users"); sendMessageOut->numUsers = (int) NumRows; sendMessageOut->usersArray.__size = (int) NumRows;