Feature #1244
openChange all course literal codes to course integer ID's
Description
This is a MAJOR restructuring task. Because the literal course codes are such a performance-killer and a hazardous resource when it comes to deal with international strings*, we want to move to pure-integer identifiers for courses. This effectively means updating all tables and creating a new field course_id that will hold the course ID, then removing the course_code field.
All functions using the course code will have to be modified as well. I suggest doing this in three steps:- Adding the new field
- Modifying the functions
- Removing the old field
It is very important that the person working on this can work alone and has high time availability and a previous experience in Chamilo/Dokeos development.
- This should be minimized by Ivan Tcholakov's changes to UTF-8 management
Updated by Yannick Warnier about 13 years ago
- Target version changed from 1.8.7.1 to 1.8.8 stable
Updated by Ivan Tcholakov about 13 years ago
Even after restructuring, I think course_code should stay, because it may serve as an external key for exact course identification in other information systems, and in documentation archives. Also, these non-numeric course codes (that may be generated by a convention) should be mentioned in the certificates issued.
By the way, in the certificates also user's official codes should be written, because user identification only by first and last names is incomplete, it is not enough.
Updated by Yannick Warnier over 12 years ago
- Target version changed from 1.8.8 stable to 1.9 Stable
Updated by Julio Montoya over 11 years ago
- Status changed from New to Needs more info
- % Done changed from 0 to 10
all course tables now have a c_id (course id) which is an int value see #3910
this improvement will be good to replace all literal code to a int but it's a lot of work ...
Updated by Yannick Warnier over 11 years ago
- Target version changed from 1.9 Stable to 1.9 RC1
Updated by Yannick Warnier about 11 years ago
- Status changed from Needs more info to New
- Target version changed from 1.9 RC1 to 2.0
Moving the rest to 1.10. Nice work so far.
Updated by Yannick Warnier over 7 years ago
- Category set to Database & API changes
- Status changed from New to Assigned
- Assignee set to Angel Quiroz
- % Done changed from 10 to 50
When changing course_code to c_id, it is important to remember to add the corresponding indexes to the tables (the ones that are present with course code should now exist with c_id).
It is also important to remember to check all possible uses of the field. Not only in queries that use the table name directly or the constant directly, but also in queries where the constant is first set into a variable (like $tCourseRelClass for example) and then used into the query.
Remaining course codes in:- course_rel_class.course_code
- gradebook_category.course_code
- gradebook_evaluation.course_code
- gradebook_link.course_code
- personal_agenda.course (not sure, check what's in there because it's a varchar(255))
- search_engine_ref.course_code
- shared_survey.course_code
- specific_field.course_code
- templates.course_code
- track_e_attempt.course_code (this field can probably be completely removed now - after changing the corresponding PHP code - considering another c_id field is present)
- track_e_hotspot.hotspot_course_code (this field can probably be completely removed now - after changing the corresponding PHP code - considering another c_id field is present)
Also, change language.dokeos_folder into language.folder please.
Updated by Angel Quiroz over 7 years ago
- % Done changed from 50 to 70
Changing the course_code, on entities and class methods
I have some issues with gradebook_category (category.class.php) and its course_code
I still do not write migrations
Updated by Angel Quiroz over 7 years ago
- % Done changed from 70 to 60
Cambiando a c_id con gradebook_category, tengo que cambiar también algunos parámetros que genera api_get_cidreq porque algunos course_code son pasados como parámetros a url, estoy en eso.
También estoy aprovechando para cambiar las consultas SQL por métodos con entidades
Updated by Angel Quiroz over 7 years ago
Reemplazados los course_code de templates
Updated by Angel Quiroz over 7 years ago
Reemplazados los course_code de specific_field_values
Updated by Angel Quiroz over 7 years ago
Reemplazados los course_code de shared_survey
Estoy reemplzando (por la mitad) los de search_engine_ref
Updated by Angel Quiroz over 7 years ago
Reemplazados los course_code de gradebook_link
Updated by Angel Quiroz over 7 years ago
Tengo problemas al probar los cambios en master. Por no poder instalar master
Updated by Angel Quiroz over 7 years ago
Pude instalar la rama master. Pero encuentro errores, aunque no sé si son por los cambios
Estoy agregando relaciones entre las tablas para obtener entidades en ves de cId
$gradebookCategory->getCourse()->getCode()
Updated by Angel Quiroz over 7 years ago
En personal_agenda hay un campo course
pero he revisado (en los usos de TABLE_PERSONAL_AGENDA y los lugares en donde se usan las funciones que usan TABLE_PERSONAL_AGENDA) y no encuentro alguna línea en la cual se inserte un course_code
o c_id
.
He quitado ese campo de la entidad
Updated by Angel Quiroz over 7 years ago
Logré instalando la rama C1244
Estoy probando los cambios
Updated by Angel Quiroz over 7 years ago
- % Done changed from 60 to 80
Probé los cambios en las herramientas, en algunas encuentro errores por código que no he modificado como en c_notebook que falta un c_id (en 1.10.x sí tiene)
También hice cambios usando Criteria::create() para filtrar entre repositorios, pero no me funcionó. Así que los cambié por createQueryBuilder, y funcionó.
Me falta hacer las migraciones desde 1.10.x
Updated by Angel Quiroz over 7 years ago
- Status changed from Assigned to Needs testing
- Assignee deleted (
Angel Quiroz) - % Done changed from 80 to 100
Envié los cambios a la rama master