Merge branch 'hotfix/0.18.2'
This commit is contained in:
commit
9ca477e168
|
@ -132,7 +132,8 @@ class Item extends Entity {
|
|||
|
||||
if( in_array('tainacan-small', $sizes ) ) {
|
||||
$tmp_src = wp_get_attachment_image_src( $this->get__thumbnail_id(), 'tainacan-small' );
|
||||
$blurhash = $this->get_image_blurhash($tmp_src[0], $tmp_src[1], $tmp_src[2]);
|
||||
$file_name = get_attached_file( $this->get__thumbnail_id() );
|
||||
$blurhash = $this->get_image_blurhash($file_name, $tmp_src[1], $tmp_src[2]);
|
||||
}
|
||||
|
||||
foreach ( $sizes as $size ) {
|
||||
|
|
|
@ -740,7 +740,9 @@ class Logs extends Repository {
|
|||
}
|
||||
|
||||
private function insert_item_metadata( Entities\Item_Metadata_Entity $entity ) {
|
||||
|
||||
if($this->current_diff == false) {
|
||||
return;
|
||||
}
|
||||
$log = new Entities\Log();
|
||||
|
||||
$item_id = $entity->get_item()->get_id();
|
||||
|
|
|
@ -4,7 +4,7 @@ Tags: museums, libraries, archives, GLAM, collections, repository
|
|||
Requires at least: 5.0
|
||||
Tested up to: 5.6
|
||||
Requires PHP: 5.6
|
||||
Stable tag: 0.18.1
|
||||
Stable tag: 0.18.2
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
|
|
|
@ -4,13 +4,13 @@ Plugin Name: Tainacan
|
|||
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
|
||||
Version: 0.18.1
|
||||
Version: 0.18.2
|
||||
Text Domain: tainacan
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
|
||||
const TAINACAN_VERSION = '0.18.1';
|
||||
const TAINACAN_VERSION = '0.18.2';
|
||||
|
||||
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
|
||||
$TAINACAN_BASE_URL = plugins_url('', __FILE__);
|
||||
|
|
|
@ -78,21 +78,22 @@
|
|||
if (!isEqual)
|
||||
this.onSelect();
|
||||
},
|
||||
'query'() {
|
||||
if (!this.isUsingElasticSearch)
|
||||
this.loadOptions();
|
||||
},
|
||||
facetsFromItemSearch: {
|
||||
handler() {
|
||||
if (this.isUsingElasticSearch)
|
||||
this.loadOptions();
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (!this.isUsingElasticSearch && !this.filtersAsModal)
|
||||
this.loadOptions();
|
||||
|
||||
this.$eventBusSearch.$on('has-to-reload-facets', (shouldReload) => {
|
||||
if ( !this.isUsingElasticSearch && shouldReload )
|
||||
this.loadOptions();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadOptions() {
|
||||
|
|
|
@ -67,7 +67,7 @@ class Numeric_Interval extends Filter_Type {
|
|||
return [
|
||||
'step' => [
|
||||
'title' => __( 'Step', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on filter control buttons. This alo defines whether the input accepts decimal numbers.', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on the filter control buttons. This also defines whether the input accepts decimal numbers.', 'tainacan' ),
|
||||
],
|
||||
'custom' => ['title' => __('Custom interval','tainacan')],
|
||||
];
|
||||
|
|
|
@ -76,7 +76,7 @@ class Numeric extends Filter_Type {
|
|||
return [
|
||||
'step' => [
|
||||
'title' => __( 'Step', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on filter control buttons.', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on the filter control buttons. This also defines whether the input accepts decimal numbers.', 'tainacan' ),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
@ -37,10 +37,6 @@
|
|||
}
|
||||
},
|
||||
watch: {
|
||||
'query'() {
|
||||
if (!this.isUsingElasticSearch)
|
||||
this.loadOptions();
|
||||
},
|
||||
facetsFromItemSearch: {
|
||||
handler() {
|
||||
if (this.isUsingElasticSearch)
|
||||
|
@ -49,9 +45,14 @@
|
|||
immediate: true
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
mounted() {
|
||||
if (!this.isUsingElasticSearch)
|
||||
this.loadOptions();
|
||||
|
||||
this.$eventBusSearch.$on('has-to-reload-facets', (shouldReload) => {
|
||||
if ( !this.isUsingElasticSearch && shouldReload )
|
||||
this.loadOptions();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadOptions(){
|
||||
|
|
|
@ -107,13 +107,10 @@
|
|||
},
|
||||
isLoadingItems: {
|
||||
handler() {
|
||||
if (!this.filtersAsModal)
|
||||
this.isLoadingOptions = this.isLoadingItems;
|
||||
if (!this.filtersAsModal && this.isUsingElasticSearch)
|
||||
this.isLoadingOptions = this.isLoadingItems;
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
'query'() {
|
||||
this.loadOptions();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -129,6 +126,11 @@
|
|||
mounted(){
|
||||
if (!this.filtersAsModal)
|
||||
this.loadOptions();
|
||||
|
||||
this.$eventBusSearch.$on('has-to-reload-facets', (shouldReload) => {
|
||||
if ( !this.isUsingElasticSearch && shouldReload )
|
||||
this.loadOptions();
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class Numeric extends Metadata_Type {
|
|||
return [
|
||||
'step' => [
|
||||
'title' => __( 'Step', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on filter control buttons.', 'tainacan' ),
|
||||
'description' => __( 'The amount to be increased or decreased when clicking on the metadatum control buttons. This also defines whether the input accepts decimal numbers.', 'tainacan' ),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@
|
|||
if (this.metadatumComponent == 'tainacan-compound')
|
||||
return;
|
||||
|
||||
if (this.itemMetadatum.value !== null) {
|
||||
if (this.itemMetadatum.value !== null && this.itemMetadatum.value !== false) {
|
||||
|
||||
// This routine avoids calling the API if the value did not changed
|
||||
switch(this.itemMetadatum.value.constructor.name) {
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
|
||||
let val = this.valueComponent;
|
||||
|
||||
if (!Array.isArray(val) && this.itemMetadatum.metadatum.multiple === 'no') {
|
||||
if ((!Array.isArray(val) || val.length == 0) && this.itemMetadatum.metadatum.multiple === 'no') {
|
||||
axios.patch(`/item/${this.itemMetadatum.item.id}/metadata/${this.itemMetadatum.metadatum.id}`, {
|
||||
values: term.id,
|
||||
}).then(() => {
|
||||
|
|
|
@ -160,7 +160,28 @@ export default {
|
|||
} else {
|
||||
this.$store.dispatch('search/set_postquery', this.$route.query);
|
||||
}
|
||||
|
||||
// Checks current metaqueries and taxqueries to alert filters that should reload
|
||||
// For some reason, this process is not working accessing to.query, so we need to check the path string.
|
||||
const oldQueryString = from.fullPath.replace(from.path + '?', '');
|
||||
const newQueryString = to.fullPath.replace(from.path + '?', '');
|
||||
|
||||
const oldQueryArray = oldQueryString.split('&');
|
||||
const newQueryArray = newQueryString.split('&');
|
||||
|
||||
const oldMetaQueryArray = oldQueryArray.filter(queryItem => queryItem.startsWith('metaquery'));
|
||||
const newMetaQueryArray = newQueryArray.filter(queryItem => queryItem.startsWith('metaquery'));
|
||||
const oldTaxQueryArray = oldQueryArray.filter(queryItem => queryItem.startsWith('taxquery'));
|
||||
const newTaxQueryArray = newQueryArray.filter(queryItem => queryItem.startsWith('taxquery'));
|
||||
|
||||
if (
|
||||
JSON.stringify(oldMetaQueryArray) != JSON.stringify(newMetaQueryArray) ||
|
||||
JSON.stringify(oldTaxQueryArray) != JSON.stringify(newTaxQueryArray)
|
||||
) {
|
||||
this.$emit('has-to-reload-facets', true);
|
||||
}
|
||||
|
||||
// Finally, loads items
|
||||
if (to.fullPath != from.fullPath) {
|
||||
this.loadItems(to);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,8 @@ export const dynamicFilterTypeMixin = {
|
|||
watch: {
|
||||
isLoadingItems: {
|
||||
handler() {
|
||||
this.isLoadingOptions = this.isLoadingItems;
|
||||
if (this.isUsingElasticSearch )
|
||||
this.isLoadingOptions = this.isLoadingItems;
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
&:hover .actions-area {
|
||||
visibility: visible;
|
||||
opacity: 1.0;
|
||||
top: -7px;
|
||||
top: calc(-1 * 0.5em - var(--tainacan-container-padding));
|
||||
|
||||
a {
|
||||
opacity: 1;
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
&:hover .actions-area {
|
||||
visibility: visible;
|
||||
opacity: 1.0;
|
||||
top: -7px;
|
||||
top: calc(-1 * 0.5em - var(--tainacan-container-padding));
|
||||
|
||||
a {
|
||||
opacity: 1;
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
&:hover .actions-area {
|
||||
visibility: visible;
|
||||
opacity: 1.0;
|
||||
top: -7px;
|
||||
top: calc(-1 * 0.5em - var(--tainacan-container-padding));
|
||||
|
||||
a {
|
||||
opacity: 1;
|
||||
|
|
Loading…
Reference in New Issue