fix an php error when importing attributes with incorrect type -

category validation
pull/61/head
Christophe Vandeplas 2012-06-13 16:02:27 +02:00
parent 3bec9bbefc
commit 7cea666c9b
2 changed files with 5 additions and 1 deletions

View File

@ -139,6 +139,8 @@ class ServersController extends AppController {
public function pull($id = null, $full=false) {
// TODO should we de-activate data validation for type and category / and or mapping? Maybe other instances have other configurations that are incompatible.
if (!$this->request->is('post')) {
throw new MethodNotAllowedException();
}

View File

@ -354,7 +354,9 @@ class Attribute extends AppModel {
function validateTypeValue($fields) {
$category = $this->data['Attribute']['category'];
return in_array($fields['type'], $this->category_definitions[$category]['types']);
if (isset($this->category_definitions[$category]['types']))
return in_array($fields['type'], $this->category_definitions[$category]['types']);
return false;
}
function validateAttributeValue ($fields) {