Project

General

Profile

Bug #4548

Long course codes > "already exists"

Added by Yannick Warnier over 7 years ago. Updated over 7 years ago.

Status:
Feature implemented
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
23/03/2012
Due date:
% Done:

100%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

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

Revision 315a159f (diff)
Added by Julio Montoya over 7 years ago

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

Revision c3f14c54 (diff)
Added by Julio Montoya over 7 years ago

Replacing 40 with the new constant + minor style fixes see #4548

History

#1

Updated by Julio Montoya over 7 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?

#2

Updated by Yannick Warnier over 7 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.

#3

Updated by Yannick Warnier over 7 years ago

  • Target version set to 1.9 Beta
#4

Updated by Yannick Warnier over 7 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."

#5

Updated by Julio Montoya over 7 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 ...

#6

Updated by Julio Montoya over 7 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

#7

Updated by Yannick Warnier over 7 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?

#8

Updated by Yannick Warnier over 7 years ago

The rest is great, as usual :-)

#9

Updated by Julio Montoya over 7 years ago

  • Status changed from Assigned to Feature implemented
  • Assignee deleted (Julio Montoya)
  • % Done changed from 70 to 100

closing :)

Also available in: Atom PDF