Skip to content

Commit

Permalink
Merge branch '2024.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Feb 10, 2025
2 parents 4f72c34 + fe32cc9 commit a9913a0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tine20/Felamimail/js/MailDetailsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@ Ext.extend(Tine.Felamimail.MailDetailsPanel, Ext.Panel, {
await Tine.Felamimail.getAttachmentCache(attachmentId, createPreviewInstantly)
.then(async (cache) => {
const cacheRecord = new Tine.Tinebase.Model.Tree_Node(cache.attachments[0]);
const isPreviewReady = cache.attachments[0].preview_count !== 0 && cache.attachments[0].path !== '';
attachment.cache = cacheRecord;

const isPreviewReady = cache.attachments[0].preview_count !== 0 && cache.attachments[0].path !== '';
if (isPreviewReady) {
attachment.isPreviewReady = true;
attachment.cache = cacheRecord;
}
return resolve({
cache: new Tine.Tinebase.Model.Tree_Node(cache.attachments[0]),
Expand Down
14 changes: 9 additions & 5 deletions tine20/OnlyOfficeIntegrator/js/editDocumentAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ Promise.all([

emailInterceptor: async function(config) {
const mask = await config.setWaitText(app.i18n._('Preparing Attachment...'));

if (config?.cachePromises) {

if (config?.cache) {
config.recordData = config.cache?.data || config.cache;
} else if (config?.cachePromises) {
// open document does not need to check preview status
await Promise.race(config.cachePromises)
.then((response) => {
config.recordData = response?.cache?.data;
await Promise.all(config?.cachePromises)
.then((responses) => {
const validPromise = responses.find((cachePromise) => !!cachePromise?.cache);
config.recordData = validPromise.cache.data;
})
.catch((e) => {
console.error(e);
Expand All @@ -49,6 +52,7 @@ Promise.all([
const win = Tine.OnlyOfficeIntegrator.OnlyOfficeEditDialog.openWindow({
// always validate cachePromises to get the correct recordData
cachePromises: record?.cachePromises,
cache: record?.data?.cache,
recordData: recordData,
id: record.id,
contentPanelConstructorInterceptor: record?.cachePromises ? this.emailInterceptor : null
Expand Down
4 changes: 2 additions & 2 deletions tine20/Tinebase/AreaLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function lock(string $areaLockName): Tinebase_Model_AreaLockState
/**
* @param string $areaLockName
* @param string $userMfaId
* @param string $password
* @param null|string $password
* @param Tinebase_Model_FullUser $identity
* @return Tinebase_Model_AreaLockState
* @throws Tinebase_Exception
Expand All @@ -154,7 +154,7 @@ public function lock(string $areaLockName): Tinebase_Model_AreaLockState
* @throws Tinebase_Exception_Record_Validation
* @throws Zend_Session_Exception
*/
public function unlock(string $areaLockName, string $userMfaId, string $password, Tinebase_Model_FullUser $identity): Tinebase_Model_AreaLockState
public function unlock(string $areaLockName, string $userMfaId, ?string $password, Tinebase_Model_FullUser $identity): Tinebase_Model_AreaLockState
{
/** @var Tinebase_Model_AreaLockConfig $areaConfig */
$areaConfig = $this->_getConfig()->records
Expand Down
2 changes: 1 addition & 1 deletion tine20/Tinebase/Frontend/Json/AreaLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
class Tinebase_Frontend_Json_AreaLock extends Tinebase_Frontend_Json_Abstract
{
public function unlock(string $areaLockName, string $userMfaId, string $password = null): array
public function unlock(string $areaLockName, string $userMfaId, ?string $password = null): array
{
$result = Tinebase_AreaLock::getInstance()->unlock($areaLockName, $userMfaId, $password, Tinebase_Core::getUser());

Expand Down

0 comments on commit a9913a0

Please sign in to comment.