Commit c4a0056b authored by helior's avatar helior Committed by fago

#1230572 patch by helior: Positive integer validation not being applied to...

 #1230572 patch by helior: Positive integer validation not being applied to non-id columns in entity_metadata_convert_schema().
parent 2e1e9ac5
......@@ -77,7 +77,6 @@ class EntityDefaultMetadataController {
// Set better metadata for known entity keys.
$id_key = $this->info['entity keys']['id'];
$info['properties'][$id_key]['validation callback'] = 'entity_metadata_validate_integer_positive';
if (!empty($this->info['entity keys']['name']) && $key = $this->info['entity keys']['name']) {
$info['properties'][$key]['type'] = 'token';
......@@ -138,7 +137,7 @@ function entity_metadata_convert_schema($table) {
// As we cannot know about any setter access, leave out the setter
// callback. For getting usually no further access callback is needed.
);
if ($type == 'serial') {
if ($info['type'] == 'serial') {
$properties[$name]['validation callback'] = 'entity_metadata_validate_integer_positive';
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment