Skip to content

#4171 [Digirisk] fix: php8 warnings #4335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

evarisk-kilyan
Copy link
Contributor

No description provided.

Copy link
Contributor

@evarisk-micka evarisk-micka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finir de répercuter les changements aux endroits qui peuvent encore être clean et c'est good

@@ -254,7 +254,7 @@ public function selectDigiriskElementList($selected = '', $htmlname = 'fk_elemen
{
global $conf, $form, $langs;

if (dol_strlen($filter['customsql'])) {
if (!empty($filter['customsql']) && dol_strlen($filter['customsql'])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si !empty($filter) alors il est forcément rempli c'est redondant, il faut plutôt vérifier si dol_strlen est supérieur à > 0 pour retirer le warning ou seulement laisser !empty()

@@ -254,7 +254,7 @@ public function selectDigiriskElementList($selected = '', $htmlname = 'fk_elemen
{
global $conf, $form, $langs;

if (dol_strlen($filter['customsql'])) {
if (!empty($filter['customsql']) && dol_strlen($filter['customsql'])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si !empty($filter) alors il est forcément rempli c'est redondant, il faut plutôt vérifier si dol_strlen est supérieur à > 0 pour retirer le warning ou seulement laisser !empty()

@@ -346,7 +346,7 @@ public function select_preventionplan_list($selected = '', $htmlname = 'fk_preve
{
global $form;

if (dol_strlen($filter['customsql'])) {
if (!empty($filter['customsql']) && dol_strlen($filter['customsql'])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pareil

if ( ! $evalsortfield) $evalsortfield = "evaluation." . key($evaluation->fields);
if (empty($sortfield)) $sortfield = $conf->global->DIGIRISKDOLIBARR_SORT_LISTINGS_BY_COTATION ? "evaluation.cotation" : "r." . key($risk->fields);; // Set here default search field. By default 1st field in definition.
if (empty($sortorder)) $sortorder = $conf->global->DIGIRISKDOLIBARR_SORT_LISTINGS_BY_COTATION ? "DESC" : "ASC" ;
if (empty($evalsortfield)) $evalsortfield = "evaluation." . key($evaluation->fields);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ce bloc est également présent dans les fichiers firepermit_list, evaluator, risk, risksign, risk_list, etc... tant qu'à clean les warning autant ctrl + alt + f pour voir toute les occurrences et les réparer pour ne plus avoir à s'en soucier plus tard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean PHP 8
2 participants