Bug #4548
Long course codes > "already exists"
Description
When creating a new course, if the generated code is too long, Chamilo answers the code "Already exists", while it should just say it is too long
Associated revisions
Replacing 40 with the new constant + minor style fixes see #4548
History
Updated by Julio Montoya almost 9 years ago
- Status changed from New to Needs more info
- Assignee set to Yannick Warnier
- % Done changed from 0 to 10
I think the generated code is never going to be big because it's auto generated by chamilo.
I created a course with a big title and no messages were shown. Fixed?
Updated by Yannick Warnier almost 9 years ago
I think you have to have several courses with the same title (and the same expected long code) and then it happens. Must try it myself, I have only been reported this.
Updated by Yannick Warnier almost 9 years ago
- Status changed from Needs more info to Assigned
- Assignee changed from Yannick Warnier to Julio Montoya
Tried with TESTLONGCODEFORCHAMILO4548 as a code added manually to the "code" box.
The error message (in French): "Le cours n'a pas été créé à cause d'une erreur interne."
The message should be something like "The course code you want to use for this new course is already used. Please choose another code."
Updated by Julio Montoya almost 9 years ago
I tried here
/main/create_course/add_course.php
and here:
main/create_course/add_course.php
and I didn' found the error.
Then I tried to create again a course with this name and code: TESTLONGCODEFORCHAMILO4548
and then I can see the error ... i will check that ...
Updated by Julio Montoya almost 9 years ago
- Status changed from Assigned to Needs more info
- Assignee changed from Julio Montoya to Yannick Warnier
- % Done changed from 10 to 70
I sent a fix
Updated by Yannick Warnier almost 9 years ago
- Status changed from Needs more info to Assigned
- Assignee changed from Yannick Warnier to Julio Montoya
There's still one literal "40" appearing in main/create_course/add_course.php with your change. I think you should use the constant. Is there anything against it?
Updated by Julio Montoya almost 9 years ago
- Status changed from Assigned to Feature implemented
- Assignee deleted (
Julio Montoya) - % Done changed from 70 to 100
closing :)
Adding a new constant (MAX_COURSE_LENGTH_CODE) in course.lib.php in order to use the same max value for the course code now is 40 like the field in the database see #4548