The signup end date field is not properly populated after a "Course" is created.
To reproduce:

  1. Install classroom.
  2. Create a content-type for your classes.
  3. Assign the "Course" type to the content-type you've created.
  4. Create a class (course). Set the signup end date to something in the future.
  5. Save your class.
  6. Look at the signup end date value again.

The Signup End Date is coming back as today's date; not the date I assigned it.

Comments

wjaspers’s picture

Version: 6.x-1.1 » 6.x-1.0

Note: The database IS storing the correct value for this field.
Therefore, I would assume the bug lies strictly in the code meant to create the class' administrative form.

wjaspers’s picture

Version: 6.x-1.0 » 6.x-1.1

Problem is persistent in 1.1

wjaspers’s picture

Found it!

In File: classroom.courses.inc
On Line: 241
Near:

  $fields['classroom_course']['registration_end_date'] = array(

Replace:

  '#default_value' => $node->classrooom_course['registration_end_date'],

With:

  '#default_value' => $node->classroom_course['registration_end_date'],
wjaspers’s picture

Version: 6.x-1.0 » 6.x-1.1
Status: Active » Needs review
StatusFileSize
new1.82 KB

Also included some minor PHP fixes for incorrect syntax.

imobachgs’s picture

Assigned: Unassigned » imobachgs

Hi wjaspers,

What a stupid typo! :) Thank you!

About your patch, I've got a question: why is incorrect using 'and' operator instead of '&&'? I think that the only difference is the precedence.

Anyway, I'll commit your fix in a few hours.

Regards.

wjaspers’s picture

Don't sweat it!

I switched the AND's to && because keeps your code consistent. Not to mention, I thought any pseudo-code you may have had got in and was affecting this.
PHP is currently nice enough to interpret it correctly; but there's no guarantee that functionality is permanent.
Plus, if plain-text comparison operators (AND | OR | XOR) were to become language (english, spanish, etc...) dependent, your code may not run.

imobachgs’s picture

Status: Needs review » Fixed

Hi,

I've commited the fix. We'll consider changing 'and' with '&&' through all the code in a near future.

Thank you wjaspers!

Status: Fixed » Closed (fixed)
Issue tags: -dates, -signup end date, -populating fields

Automatically closed -- issue fixed for 2 weeks with no activity.