Merge branch 'develop' into feature/387

This commit is contained in:
mateuswetah 2020-05-25 15:42:25 -03:00
commit e42cd01c09
5 changed files with 27 additions and 8 deletions

View File

@ -620,6 +620,7 @@ class CSV extends Importer {
$updating_item = false;
$Tainacan_Item_Metadata->disable_logs();
if ( is_numeric($this->get_transient('item_id')) ) {
$item = $Tainacan_Items->fetch( (int) $this->get_transient('item_id') );
} else {
@ -635,7 +636,7 @@ class CSV extends Importer {
$this->add_log('item will be updated ID:' . $item->get_id() );
$updating_item = true;
// When creating a new item, disable log for each metadata to speed things up
$Tainacan_Item_Metadata->disable_logs();
$Tainacan_Item_Metadata->enable_logs();
} else {
$this->add_log('item with ID ' . $this->get_transient('item_id') . ' not found. Unable to update. Creating a new one.' );
$item = new Entities\Item();
@ -855,6 +856,19 @@ class CSV extends Importer {
}
$this->save_mapping( $collection['id'], $collection['mapping'] );
$coll = \Tainacan\Repositories\Collections::get_instance()->fetch($collection['id']);
$metadata_order = array_map(
function($meta) { return ["enabled"=>true, "id"=>$meta]; },
array_keys( $collection['mapping'] )
);
$coll->set_metadata_order( $metadata_order );
if ( $coll->validate() ) {
\Tainacan\Repositories\Collections::get_instance()->update( $coll );
} else {
$this->add_error_log( __("Don't save metadata order collection.", 'tainacan') );
}
}
$this->remove_collection($collection['id']);

View File

@ -4,7 +4,7 @@ Tags: museums, libraries, archives, GLAM, collections, repository
Requires at least: 4.8
Tested up to: 5.4
Requires PHP: 5.6
Stable tag: 0.16
Stable tag: 0.16.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

View File

@ -4,13 +4,13 @@ Plugin Name: Tainacan
Plugin URI: https://tainacan.org/
Description: Open source, powerfull and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional respository platform.
Author: Tainacan.org
Version: 0.16
Version: 0.16.1
Text Domain: tainacan
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
const TAINACAN_VERSION = '0.16';
const TAINACAN_VERSION = '0.16.1';
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
$TAINACAN_BASE_URL = plugins_url('', __FILE__);

View File

@ -80,8 +80,12 @@
<!-- THIRD FIELD - DYNAMIC INPUTS -->
<transition name="filter-item">
<template v-if="bulkEditionProcedures[criterion] && bulkEditionProcedures[criterion].metadatum && bulkEditionProcedures[criterion].action">
<template v-if="bulkEditionProcedures[criterion].action == editionActions.replace">
<!-- This has do be a 'div' as the transition animation only renders one child -->
<div
style="margin-left: 12px; display: flex;"
v-if="bulkEditionProcedures[criterion].action == editionActions.replace">
<component
:is="bulkEditionProcedures[criterion].metadatum.metadata_type_object.component"
:forced-component-type="bulkEditionProcedures[criterion].metadatum.metadata_type_object.component.includes('taxonomy') ? 'tainacan-taxonomy-tag-input' : ''"
@ -113,7 +117,7 @@
:disabled="bulkEditionProcedures[criterion].isDone"
@input="addToBulkEditionProcedures($event, 'newValue', criterion)"
/>
</template>
</div>
<template
v-else-if="bulkEditionProcedures[criterion].metadatum.id == 'status'">

View File

@ -405,7 +405,8 @@
animation="slide-menu"
:trap-focus="filtersAsModal"
full-screen
:custom-class="'tainacan-form filters-menu' + (filtersAsModal ? ' filters-menu-modal' : '')">
:custom-class="'tainacan-form filters-menu' + (filtersAsModal ? ' filters-menu-modal' : '')"
:can-cancel="hideHideFiltersButton ? ['x', 'outside'] : ['x', 'escape', 'outside']">
<filters-items-list
:autofocus="filtersAsModal"
:tabindex="filtersAsModal ? -1 : 0"