Merge tag '0.21.3' into develop

release 0.21.3
This commit is contained in:
vnmedeiros 2024-05-15 10:05:51 -03:00
commit 195a122291
5 changed files with 14 additions and 8 deletions

View File

@ -197,7 +197,12 @@ class CSV extends Importer {
? explode( $this->get_option('multivalued_delimiter'), $valueToInsert)
: [$valueToInsert];
if(!is_array($header)) {
$this->add_error_log('the compound metadata specification is invalid');
continue;
}
$key = key($header);
$returnValue = [];
foreach($valueToInsert as $index => $metadatumValue) {
$childrenHeaders = str_getcsv($compoundHeaders[$key], $this->get_option('delimiter'), $this->get_option('enclosure'));
@ -206,7 +211,7 @@ class CSV extends Importer {
str_getcsv($metadatumValue, $this->get_option('delimiter'), $this->get_option('enclosure'));
if ( sizeof($childrenHeaders) != sizeof($childrenValue) ) {
$this->add_error_log('Mismatch count headers childrens and row columns. file value:' . $metadatumValue);
$this->add_error_log('Mismatch count headers childrens and row columns in compound metadata. file value:' . $metadatumValue);
return false;
}
$tmp = [];

View File

@ -274,9 +274,10 @@
$this->debug('locking process: ' . $this->identifier);
$this->start_time = time(); // Set start time of current process.
$max_execution_time = ini_get('max_execution_time');
$lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : ( empty($max_execution_time) ? 60 : ($max_execution_time * 1.5) ); // 1 minute
$lock_duration = ( property_exists( $this, 'queue_lock_time' ) && !empty($this->queue_lock_time) ) ? $this->queue_lock_time : ( empty($max_execution_time) ? 60 : ($max_execution_time * 1.5) ); // 1 minute
$lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration );
$this->process_lock_in_time = microtime();
$this->debug('locking duration: ' . $lock_duration);
if(!$this->is_process_running())
set_site_transient( $this->identifier . '_process_lock', $this->process_lock_in_time, $lock_duration );
}

View File

@ -4,7 +4,7 @@ Tags: museums, archives, GLAM, collections, repository
Requires at least: 5.9
Tested up to: 6.5
Requires PHP: 7.0
Stable tag: 0.21.2
Stable tag: 0.21.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

View File

@ -5,17 +5,17 @@ Plugin URI: https://tainacan.org/
Description: Open source, powerful 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 repository platform.
Author: Tainacan.org
Author URI: https://tainacan.org/
Version: 0.21.2
Version: 0.21.3
Requires at least: 5.9
Tested up to: 6.5
Requires PHP: 7.0
Stable tag: 0.21.2
Stable tag: 0.21.3
Text Domain: tainacan
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
const TAINACAN_VERSION = '0.21.2';
const TAINACAN_VERSION = '0.21.3';
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
$TAINACAN_BASE_URL = plugins_url('', __FILE__);

View File

@ -108,7 +108,7 @@
v-for="(collectionMetadatum, metadatumIndex) of collectionNonChildMetadata"
:key="metadatumIndex"
:value="collectionMetadatum.id"
:disabled="checkIfMetadatumIsAvailable(collectionMetadatum.id)">
:disabled="checkIfMetadatumIsAvailable(collectionMetadatum.id) || ( checkIfMetadatumIsCompound(collectionMetadatum) && sourceMetadatum.indexOf('compound|(') < 0 )">
<span class="metadatum-name">
{{ collectionMetadatum.name }}
</span>
@ -139,7 +139,7 @@
v-for="(collectionMetadatum, metadatumIndex) of collectionNonChildMetadata"
:key="metadatumIndex"
:value="collectionMetadatum.id"
:disabled="!checkIfMetadatumIsCompound(collectionMetadatum) || checkIfMetadatumIsAvailable(collectionMetadatum.id)">
:disabled="!checkIfMetadatumIsCompound(collectionMetadatum) || checkIfMetadatumIsAvailable(collectionMetadatum.id) || typeof sourceMetadatum != 'object' || !Object.entries(sourceMetadatum)[0]">
<span class="metadatum-name">
{{ collectionMetadatum.name }}
</span>