Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in commit for Timesheets.php
12-29-2018, 01:10 AM
Post: #1
Error in commit for Timesheets.php
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
Visit this user's website Find all posts by this user
Quote this message in a reply
12-30-2018, 04:25 PM
Post: #2
RE: Error in commit for Timesheets.php
Thanks Tim

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)