Merge pull request #435 from tainacan/feature/420
fix: transforms metadata of unknown types into text metadata
This commit is contained in:
commit
af1a080c21
|
@ -173,9 +173,12 @@ class Metadatum extends Entity {
|
||||||
function get_metadata_type_object(){
|
function get_metadata_type_object(){
|
||||||
$class_name = $this->get_metadata_type();
|
$class_name = $this->get_metadata_type();
|
||||||
|
|
||||||
|
if( !class_exists( $class_name ) ) {
|
||||||
|
$class_name = "Tainacan\\Metadata_Types\\Text";
|
||||||
if( !class_exists( $class_name ) ){
|
if( !class_exists( $class_name ) ){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$object_type = new $class_name();
|
$object_type = new $class_name();
|
||||||
$object_type->set_options( $this->get_mapped_property('metadata_type_options') );
|
$object_type->set_options( $this->get_mapped_property('metadata_type_options') );
|
||||||
|
|
Loading…
Reference in New Issue