Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default report time for web submissions is almost always wrong #1130

Merged
merged 1 commit into from
Jun 1, 2013
Merged

Default report time for web submissions is almost always wrong #1130

merged 1 commit into from
Jun 1, 2013

Conversation

solarissmoke
Copy link
Contributor

The $incident_hour array used by the web report submission forms looks like this:

array (
  '01' => '01',
  '02' => '02',
  '03' => '03',
  '04' => '04',
  '05' => '05',
  '06' => '06',
  '07' => '07',
  '08' => '08',
  '09' => '09',
  10 => '10',
  11 => '11',
  12 => '12',
);

However, in application/controllers/reports.php, the default value for $form['incident_hour'] is:

$form['incident_hour'] = date('g'); (12-hour format of an hour without leading zeros)

So the resulting value will not have a leading zero, and the form helper never finds a match when hour is less than 10, and always defaults to "01". Probably just a typo ;-).

This needs to be date('h') instead, like what is used in application/controllers/admin/reports.php and application/controllers/members/reports.php.

@kamaulynder
Copy link
Contributor

Thanks for this

kamaulynder added a commit that referenced this pull request Jun 1, 2013
Default report time for web submissions is almost always wrong
@kamaulynder kamaulynder merged commit 3290750 into ushahidi:develop Jun 1, 2013
@solarissmoke solarissmoke deleted the bug-report-time branch June 2, 2013 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants