atom_2x_issue_13495.patch

José Raddaoui Marín, 04/08/2021 02:00 PM

Download (1.96 KB)

View differences:

apps/qubit/modules/object/actions/exportAction.class.php
88 88
        break;
89 89

  
90 90
      case 'objectType':
91
        if (isset($this->objectType))
91
        if (isset($this->objectType) && in_array($this->objectType, ['informationObject', 'actor', 'repository']))
92 92
        {
93 93
          $choices = array(
94 94
            $this->objectType => sfConfig::get('app_ui_label_'.strtolower($this->objectType))
......
103 103
          );
104 104
        }
105 105

  
106
        $this->form->setValidator('objectType', new sfValidatorString(array('required' => true)));
106
        $this->form->setValidator('objectType', new sfValidatorChoice(array('choices' => array_keys($choices), 'required' => true)));
107 107
        $this->form->setWidget('objectType', new sfWidgetFormSelect(array('choices' => $choices)));
108 108

  
109 109
        break;
......
251 251
        return 'arRepositoryCsvExportJob';
252 252

  
253 253
      default:
254
        throw new sfException("Invalid object type specified: {$this->objectType}");
254
        throw new sfException("Invalid object type specified.");
255 255
    }
256 256
  }
257 257
}
258
-