diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php index 860c3b2679..b2bf620798 100644 --- a/lib/Alchemy/Phrasea/Core/Version.php +++ b/lib/Alchemy/Phrasea/Core/Version.php @@ -16,7 +16,7 @@ class Version /** * @var string */ - private $number = '4.1.0-alpha.13b'; + private $number = '4.1.0-alpha.14a'; /** * @var string diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Structure/Field.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Structure/Field.php index 7ea7d68d43..3b71f6f451 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Structure/Field.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Structure/Field.php @@ -89,7 +89,6 @@ class Field implements Typed case databox_field::TYPE_NUMBER: return FieldMapping::TYPE_DOUBLE; case databox_field::TYPE_STRING: - case databox_field::TYPE_TEXT: return FieldMapping::TYPE_STRING; } diff --git a/lib/classes/databox.php b/lib/classes/databox.php index 76f98524cf..c02ef4ffba 100644 --- a/lib/classes/databox.php +++ b/lib/classes/databox.php @@ -446,7 +446,6 @@ class databox extends base implements ThumbnailedElement databox_field::TYPE_DATE , databox_field::TYPE_NUMBER , databox_field::TYPE_STRING - , databox_field::TYPE_TEXT ] ) ? $type : databox_field::TYPE_STRING; diff --git a/lib/classes/databox/field.php b/lib/classes/databox/field.php index cd12bc8682..35fc525265 100644 --- a/lib/classes/databox/field.php +++ b/lib/classes/databox/field.php @@ -100,7 +100,6 @@ class databox_field implements cache_cacheableInterface protected $original_dces; protected $aggregable; - const TYPE_TEXT = "text"; const TYPE_DATE = "date"; const TYPE_STRING = "string"; const TYPE_NUMBER = "number"; diff --git a/lib/classes/patch/410alpha14a.php b/lib/classes/patch/410alpha14a.php new file mode 100644 index 0000000000..719b1a9700 --- /dev/null +++ b/lib/classes/patch/410alpha14a.php @@ -0,0 +1,64 @@ +release; + } + + /** + * {@inheritdoc} + */ + public function getDoctrineMigrations() + { + return []; + } + + /** + * {@inheritdoc} + */ + public function require_all_upgrades() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function concern() + { + return $this->concern; + } + + /** + * {@inheritdoc} + */ + public function apply(base $databox, Application $app) + { + $sql = "UPDATE metadatas_structure SET type = 'string' where type = 'text' OR type = '' "; + $databox->get_connection()->executeQuery($sql); + + return true; + } +} diff --git a/lib/conf.d/bases_structure.xml b/lib/conf.d/bases_structure.xml index 13ed58fcb9..a4d0d2f9c5 100644 --- a/lib/conf.d/bases_structure.xml +++ b/lib/conf.d/bases_structure.xml @@ -1901,7 +1901,7 @@ type - enum('string','text','date','number') + enum('string','date','number') diff --git a/lib/conf.d/data_templates/DublinCore.xml b/lib/conf.d/data_templates/DublinCore.xml index 5de4f32945..aada9b2258 100644 --- a/lib/conf.d/data_templates/DublinCore.xml +++ b/lib/conf.d/data_templates/DublinCore.xml @@ -198,7 +198,7 @@ - + diff --git a/lib/conf.d/data_templates/en-simple.xml b/lib/conf.d/data_templates/en-simple.xml index a9b2e33460..e42b18a490 100644 --- a/lib/conf.d/data_templates/en-simple.xml +++ b/lib/conf.d/data_templates/en-simple.xml @@ -202,7 +202,7 @@ - + diff --git a/lib/conf.d/data_templates/fr-simple.xml b/lib/conf.d/data_templates/fr-simple.xml index 550b8adac8..6af9a072f3 100644 --- a/lib/conf.d/data_templates/fr-simple.xml +++ b/lib/conf.d/data_templates/fr-simple.xml @@ -202,7 +202,7 @@ - + diff --git a/templates/web/admin/fields/templates.html.twig b/templates/web/admin/fields/templates.html.twig index 7a566a2df4..c785a9a701 100644 --- a/templates/web/admin/fields/templates.html.twig +++ b/templates/web/admin/fields/templates.html.twig @@ -130,7 +130,6 @@ diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php index 49c1677fd8..d78194c4d7 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php @@ -742,7 +742,7 @@ class ApiJsonTest extends ApiTestCase } $this->assertTrue(is_string($metadatas['thesaurus_branch'])); - $this->assertTrue(in_array($metadatas['type'], [\databox_field::TYPE_DATE, \databox_field::TYPE_STRING, \databox_field::TYPE_NUMBER, \databox_field::TYPE_TEXT])); + $this->assertTrue(in_array($metadatas['type'], [\databox_field::TYPE_DATE, \databox_field::TYPE_STRING, \databox_field::TYPE_NUMBER])); $this->assertTrue(is_bool($metadatas['indexable'])); $this->assertTrue(is_bool($metadatas['multivalue'])); $this->assertTrue(is_bool($metadatas['readonly']));