webERP Forum
Error in commit for Timesheets.php - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (/forumdisplay.php?fid=8)
+--- Thread: Error in commit for Timesheets.php (/showthread.php?tid=8318)



Error in commit for Timesheets.php - falkoner - 12-29-2018 01:10 AM

There is an error in this commit:

https://github.com/timschofield/webERP-svn/commit/39cf14d6022b95f01112bc91037c68c94dafd66c

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


RE: Error in commit for Timesheets.php - phil - 12-30-2018 04:25 PM

Thanks Tim