opencats / OpenCATS

Applicant Tracking System (maintained code base)
http://www.opencats.org
Other
532 stars 245 forks source link

Question about code quality #433

Open arunwebber opened 5 years ago

arunwebber commented 5 years ago

Expected behavior and actual behavior.

I got it running on my php7 installation fully followed with this question but i am wondering about the code quality of this project

Steps to reproduce the problem.

https://stackoverflow.com/questions/56348310/using-this-when-not-in-object-context-php-fatal-error If you want I am willing to share the changes which I have made

What version of opencats are you running?

Version 0.9.4 Countach

Release or downloaded from Git?

https://github.com/opencats/OpenCATS/tree/test-php-7.x

WAMP or LAMP?

LAMP

What version of PHP and MySQL are you running

PHP 7.2.3-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Mar 6 2018 12:03:48) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.3-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Server version: 5.5.55-0ubuntu0.14.04.1 (Ubuntu)

attach appropriate error logs. Please attach [apache/mysql] error/access logs as needed.

RussH commented 5 years ago

Hi @arunwebber you're running from an unrelease test branch. It's not yet reached a level to be released yet. Please share your changes in a PR so they can be evaluated and likely included - thanks!

arunwebber commented 5 years ago

I have downloaded the same and it is working perfectly on my machine I got an error saying autoload is not found while creating a job order but after composer installation its disappeared

arunwebber commented 5 years ago

Anyway the changes I have performed before I will put here. in careers/index.php

include_once('/var/www/html/opencats/lib/CATSUtility.php');

In lib/JobOrders.php

Line no 66

    public function $this->contacts->($siteID)  to
    public function __construct($siteID)

Line no 872

public function $this->contacts->($instanceName, $siteID, $parameters, $misc) to
    public function __construct($instanceName, $siteID, $parameters, $misc)

Line no 1214

 parent::$this->contacts->($instanceName, $parameters, $misc); to
        parent::__construct($instanceName, $parameters, $misc);

Then the following stuff on this stack overflow question

Still, I got the bug I changed the query into this way

$sql = sprintf(
            "SELECT
                company_department_id AS departmentID
             FROM
                company_department
             WHERE
                name = %s
             AND
                company_id = %s
             OR
                site_id = ''",
             $db ->makeQueryString($departmentName),
             $companyID,
             $db->_siteID
        );
RussH commented 5 years ago

@arunwebber thanks I'll check these when I get time to move the new branch along, seem to be the same as logged on #408 #411 #412

arunwebber commented 5 years ago

Yeah same.