@@ -64,12 +72,13 @@
+
+
\ No newline at end of file
diff --git a/src/classes/field-types/selectbox/class-tainacan-selectbox.php b/src/classes/field-types/selectbox/class-tainacan-selectbox.php
index 297e9da21..9e05ebf1c 100644
--- a/src/classes/field-types/selectbox/class-tainacan-selectbox.php
+++ b/src/classes/field-types/selectbox/class-tainacan-selectbox.php
@@ -14,6 +14,7 @@ class Selectbox extends Field_Type {
parent::__construct();
parent::set_primitive_type('string');
$this->component = 'tainacan-selectbox';
+ $this->form_component = 'tainacan-form-selectbox';
}
/**
@@ -47,4 +48,21 @@ class Selectbox extends Field_Type {
get_status(), apply_filters('tainacan-status-require-validation', ['publish','future','private'])) )
+ return true;
+
+ if ( empty($this->get_option('options')) ) {
+ return [
+ 'options' => __('Options is required','tainacan')
+ ];
+ }
+
+ return true;
+ }
}
\ No newline at end of file
diff --git a/src/classes/tainacan-creator.php b/src/classes/tainacan-creator.php
index 5baaee579..f7655c663 100644
--- a/src/classes/tainacan-creator.php
+++ b/src/classes/tainacan-creator.php
@@ -87,7 +87,6 @@ $Tainacan_Fields->register_field_type('Tainacan\Field_Types\Date');
$Tainacan_Fields->register_field_type('Tainacan\Field_Types\Numeric');
$Tainacan_Fields->register_field_type('Tainacan\Field_Types\Selectbox');
$Tainacan_Fields->register_field_type('Tainacan\Field_Types\Relationship');
-$Tainacan_Fields->register_field_type('Tainacan\Field_Types\Radio');
$Tainacan_Fields->register_field_type('Tainacan\Field_Types\Category');
global $Tainacan_Filters;
diff --git a/src/js/axios/axios.js b/src/js/axios/axios.js
index 07602a6b6..7568594c1 100644
--- a/src/js/axios/axios.js
+++ b/src/js/axios/axios.js
@@ -1,12 +1,12 @@
import axios from 'axios';
-const tainacan = axios.create({
+export const tainacan = axios.create({
baseURL: tainacan_plugin.root
});
tainacan.defaults.headers.common['X-WP-Nonce'] = tainacan_plugin.nonce;
-const wp = axios.create({
+export const wp = axios.create({
baseURL: tainacan_plugin.root_wp_api
});
diff --git a/tests/test-fields.php b/tests/test-fields.php
index ec185c0ca..bb7691122 100644
--- a/tests/test-fields.php
+++ b/tests/test-fields.php
@@ -194,7 +194,7 @@ class Fields extends TAINACAN_UnitTestCase {
*/
function test_metadata_field_type(){
global $Tainacan_Fields;
- $this->assertEquals( 8, sizeof( $Tainacan_Fields->fetch_field_types() ) );
+ $this->assertEquals( 7, sizeof( $Tainacan_Fields->fetch_field_types() ) );
}
@@ -354,6 +354,7 @@ class Fields extends TAINACAN_UnitTestCase {
$invalidField->set_name('test');
$invalidField->set_description('test');
$invalidField->set_collection($collection);
+ $invalidField->set_status('publish');
$invalidField->set_field_type('Tainacan\Field_Types\Relationship');
$invalidField->set_field_type_options(['collection_id' => 'string']);