fix: test if metadatum found

This commit is contained in:
vnmedeiros 2020-11-17 10:03:33 -03:00
parent e09ffe2d69
commit 316b130f04
1 changed files with 5 additions and 0 deletions

View File

@ -471,6 +471,11 @@ class Item_Metadata_Entity extends Entity {
$metadatum = $this->get_metadatum();
$item = $this->get_item();
if( !isset($metadatum) ) {
$this->add_error('not_found', ['metadatum not found'] );
return false;
}
if (empty($value) && $this->is_required() && in_array( $item->get_status(), apply_filters( 'tainacan-status-require-validation', [
'publish',
'future',