Ignore:
Timestamp:
Apr 22, 2026, 10:11:45 PM (3 days ago)
Author:
chronos
Message:
  • Fixed: IS form unknown items error handling.
  • Modified: Ping redirection to Inext local network.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Form/Form.php

    r948 r983  
    210210      else $SourceTable = '`'.$this->Definition['Table'].'` AS `TX`';
    211211    $DbResult = $this->Database->query('SELECT '.$Columns.' FROM '.$SourceTable.' WHERE `TX`.`Id`='.$Id);
    212     $DbRow = $DbResult->fetch_array();
    213     foreach ($this->Definition['Items'] as $Index => $Item)
    214     {
    215       if (!array_key_exists($Item['Type'], $this->FormManager->FormTypes) or
    216       (array_key_exists($Item['Type'], $this->FormManager->FormTypes) and
    217       ($this->FormManager->FormTypes[$Item['Type']]['Type'] != 'ManyToOne')))
    218       {
    219         $UseType = $this->GetItemType($Item);
    220         $this->Values[$Index] = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'OnLoadDb',
    221           array('Value' => $DbRow[$Index], 'Name' => $Index,
    222           'Type' => $Item['Type'], 'Values' => $this->Values));
    223         $this->ValuesFilter[$Index] = $DbRow[$Index.'_Filter'];
    224       }
    225     }
     212    if ($DbResult->num_rows == 1)
     213    {
     214      $DbRow = $DbResult->fetch_array();
     215     foreach ($this->Definition['Items'] as $Index => $Item)
     216      {
     217        if (!array_key_exists($Item['Type'], $this->FormManager->FormTypes) or
     218        (array_key_exists($Item['Type'], $this->FormManager->FormTypes) and
     219        ($this->FormManager->FormTypes[$Item['Type']]['Type'] != 'ManyToOne')))
     220        {
     221          $UseType = $this->GetItemType($Item);
     222          $this->Values[$Index] = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'OnLoadDb',
     223            array('Value' => $DbRow[$Index], 'Name' => $Index,
     224            'Type' => $Item['Type'], 'Values' => $this->Values));
     225          $this->ValuesFilter[$Index] = $DbRow[$Index.'_Filter'];
     226        }
     227      }
     228    } else throw new Exception('Item '.$Id.' not found');
    226229  }
    227230
Note: See TracChangeset for help on using the changeset viewer.