webERP Forum

Full Version: Error in commit for Timesheets.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
There is an error in this commit:

https://github.com/timschofield/webERP-s...c94dafd66c

where there is no concatenation operator in the new sql string, so:

PHP Code:
                                '" . _('WO') . ':' . $WeekTimeRow['wo'] . ' ' . _('Work Centre') '' . $WeekTimeRow['workcentre'] . ' ' . $WeekTimeRow['firstname'] . ' ' . $WeekTimeRow['surname'] . ' ' . _('as') . ' ' . $WeekTimeRow['issueitem'] . ' ' . $WeekTimeRow['totalweekhours'] . ' ' . _('hours') . ' ' . locale_number_format($WeekTimeRow['labourcost'], $_SESSION['CompanyRecord']['decimalplaces']) . "'

should be:

PHP Code:
                                '" . _('WO') . ':' . $WeekTimeRow['wo'] . ' ' . _('Work Centre') . '' . $WeekTimeRow['workcentre'] . ' ' . $WeekTimeRow['firstname'] . ' ' . $WeekTimeRow['surname'] . ' ' . _('as') . ' ' . $WeekTimeRow['issueitem'] . ' ' . $WeekTimeRow['totalweekhours'] . ' ' . _('hours') . ' ' . locale_number_format($WeekTimeRow['labourcost'], $_SESSION['CompanyRecord']['decimalplaces']) . "'

and the same in the sql statement immediately following.

This is why code shouldn't be committed directly to the weberp team repository, but rather committed to the developers own repository, and then a pull request raised. This pull request can then be peer reviewed by a second set of eyes and any amendments made before it got to the team repository. This is a great facility, and would have prevented many of the minor irritations Paul B has been flagging up, as well as this bug.

Also I have a git hook that does a syntax check before code is committed, which is how I found this problem. I am happy to share the hooks me and my team have written with any interested developers.

Tim
Thanks Tim
Reference URL's