Skip to content

Commit

Permalink
fix(formanswer): empty list of answers
Browse files Browse the repository at this point in the history
in some conditions the search criterias are set when displaying answers of a form

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 3, 2019
1 parent 1e65276 commit 2478b2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
$number = $dbUtils->countElementsInTableForMyEntities(
static::getTable(),
[
$formFk => $item->getID()
$formFk => $item->getID(),
'is_deleted' => 0,
]
);
return self::createTabEntry(self::getTypeName($number), $number);
Expand Down Expand Up @@ -383,7 +384,7 @@ static function showForForm(PluginFormcreatorForm $form, $params = []) {
$forcedisplay = array_combine($sopt_keys, $sopt_keys);

// do search
$params = Search::manageParams(__CLASS__, $params);
$params = Search::manageParams(__CLASS__, $params, false);
$data = Search::prepareDatasForSearch(__CLASS__, $params, $forcedisplay);
Search::constructSQL($data);
Search::constructData($data);
Expand Down

0 comments on commit 2478b2c

Please sign in to comment.