Skip to content
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

FIX : bad test on socid #27353

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions htdocs/core/class/html.formintervention.class.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2012-2013 Charles-Fr BENKE <charles.fr@benke.fr>
/* Copyright (C) 2012-2023 Charlene BENKE <charlene.r@patas-monkey.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -74,12 +74,10 @@ public function select_interventions($socid = -1, $selected = 0, $htmlname = 'in
$sql = "SELECT f.rowid, f.ref, f.fk_soc, f.fk_statut";
$sql .= " FROM ".$this->db->prefix()."fichinter as f";
$sql .= " WHERE f.entity = ".$conf->entity;
if ($socid != '') {
if ($socid == '0') {
$sql .= " AND (f.fk_soc = 0 OR f.fk_soc IS NULL)";
} else {
if ($socid > 0) {
$sql .= " AND f.fk_soc = ".((int) $socid);
}
} else {
Copy link
Member

@eldy eldy Jan 10, 2024

Choose a reason for hiding this comment

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

This seems to break the case when $socid = -1, where we should not have any test in such a case.

$sql .= " AND (f.fk_soc = 0 OR f.fk_soc IS NULL)";
}
if ($draftonly) {
$sql .= " AND f.fk_statut = 0";
Expand Down