HeuristNetwork / heurist

Core development repository. gitHub: Vsn 6 (2020 - ), Vsn 5 (2018 - 2020), Vsn 4 (2014-2017). Sourceforge: Vsn 3 (2009-2013), Vsn 1 & 2 (2005-2009)
http://HeuristNetwork.org
GNU General Public License v3.0
55 stars 25 forks source link

🐛 fix optional parameter warning #153

Closed wiztigers closed 1 year ago

wiztigers commented 1 year ago

On a fresh Heurist install, database cannot be created due to a PHP deprecation warning.
This blocks database creation on a fresh install of Heurist.

See screenshot below:
db_creation_blocked

(This pull request stems from this issue huma-num/heurist#8)

wiztigers commented 1 year ago

For info, this parse_query function default parameter doesn't seem to be used anywhere in the code ; that's why I took the liberty to remove it (instead of for example providing default values for the last parameters):

$ grep -ri parse_query *
hsapi/dbaccess/compose_sql.php:    $query = parse_query($search_domain, @$params['q'], @$params['s'], @$params['parentquery'], $currUserID);
hsapi/dbaccess/compose_sql.php:function parse_query($search_domain, $text, $sort_order, $parentquery, $currUserID) {
hsapi/dbaccess/compose_sql_new.php:                $query = parse_query($top_query->search_domain, urldecode($this->value), null, null, $top_query->currUserID);
wiztigers commented 1 year ago

For info (bis), as soon as this pull request is merged I'll have to update Heurist Docker image, as the image creation process currenty fixes this (so I'll have to remove the patch).

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information