Skip to content

Commit

Permalink
Merge branch 'dev-4' of github.com:baserproject/basercms
Browse files Browse the repository at this point in the history
  • Loading branch information
gondoh committed Oct 28, 2021
2 parents 5107c9e + 99105a4 commit 408a310
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 45 deletions.
29 changes: 15 additions & 14 deletions lib/Baser/Plugin/Blog/View/Helper/BlogHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,19 @@ public function __construct(View $View, $settings = [])
public function setContent($blogContentId = null)
{
$blogContentUpdated = false;
if (empty($this->blogContent) || ($blogContentId != $this->blogContent['id'])) {
if ($blogContentId) {
if (!empty($this->request->query['preview']) && $this->request->query['preview'] == 'default' && $this->request->data) {
if (!empty($this->request->data['BlogContent'])) {
$this->blogContent = $this->request->data['BlogContent'];
$blogContentUpdated = true;
}
} else {
$BlogContent = ClassRegistry::init('Blog.BlogContent');
$BlogContent->unbindModel(['hasMany' => ['BlogPost', 'BlogCategory']]);
$blogContent = $BlogContent->find('first', ['conditions' => ['BlogContent.id' => $blogContentId], 'recursive' => -1]);
$this->blogContent = Hash::extract($blogContent, 'BlogContent');
$blogContentUpdated = true;
}
if ($blogContentId && ($blogContentId != $this->blogContent['id'])) {
$BlogContent = ClassRegistry::init('Blog.BlogContent');
$BlogContent->unbindModel(['hasMany' => ['BlogPost', 'BlogCategory']]);
$blogContent = $BlogContent->find('first', ['conditions' => ['BlogContent.id' => $blogContentId], 'recursive' => -1]);
$this->blogContent = Hash::extract($blogContent, 'BlogContent');
$blogContentUpdated = true;
}

if (empty($this->blogContent)) {
if (!empty($this->request->query['preview']) && $this->request->query['preview'] == 'default' && $this->request->data['BlogContent']) {
$this->blogContent = $this->request->data['BlogContent'];
$blogContentUpdated = true;

} elseif (isset($this->_View->viewVars['blogContent']['BlogContent'])) {
$this->blogContent = $this->_View->viewVars['blogContent']['BlogContent'];
if ($this->request->params['Content']['type'] === 'BlogContent') {
Expand All @@ -92,6 +91,8 @@ public function setContent($blogContentId = null)
}
}
}


if ($this->blogContent) {
if ($blogContentUpdated) {
$siteId = 0;
Expand Down
3 changes: 1 addition & 2 deletions lib/Baser/Plugin/Mail/Config/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
$MailContent->Content->getConditionAllowPublish()
],
'recursive' => 0,
'order' => $MailContent->id,
'cache' => false,
'order' => $MailContent->id
]);
foreach($mailContents as $mailContent) {
$mail = $mailContent['MailContent'];
Expand Down
2 changes: 1 addition & 1 deletion lib/Baser/Plugin/Mail/Model/MailContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MailContent extends MailAppModel
*
* @var array
*/
public $actsAs = ['BcSearchIndexManager', 'BcCache', 'BcContents'];
public $actsAs = ['BcSearchIndexManager', 'BcContents'];

/**
* hasMany
Expand Down
25 changes: 0 additions & 25 deletions lib/Baser/Plugin/Mail/Model/MailField.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,29 +394,4 @@ public function formatSource($source)
return implode("\n", $sourceList);
}

/**
* After Delete
*/
public function afterDelete()
{
parent::afterDelete();
// フロントエンドでは、MailContentのキャッシュを利用する為削除しておく
$MailContent = ClassRegistry::init('Mail.MailContent');
$MailContent->delCache();
}

/**
* After Save
*
* @param bool $created
* @param array $options
*/
public function afterSave($created, $options = [])
{
parent::afterSave($created, $options);
// フロントエンドでは、MailContentのキャッシュを利用する為削除しておく
$MailContent = ClassRegistry::init('Mail.MailContent');
$MailContent->delCache();
}

}
9 changes: 7 additions & 2 deletions lib/Baser/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4.5.2
4.5.3

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// +---------------------------------------------------------------------------------------------------+ //
Expand All @@ -16,6 +16,11 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////
CHG: 変更内容 / BUG: バグフィックス / NEW: 機能追加

[2021-10-28] basercms-4.5.3
-CHG: [BC] fix #1666 ログ機構を変更
-BUG: [BG] fix #1756 ブログ記事更新時のプレビューで編集対象以外のブログ記事が読み込まれていた場合アイキャッチが正しく表示されない問題を改善
-BUG: [ML] メールフィールドが保存できない問題を改善

[2021-09-30] basercms-4.5.2
-BUG: [BC] fix #1748 MySQL sql mode : STRICT_TRANS_TABLESの場合、コンテンツの文字数が65535以上だとエラーになる問題を改善
-BUG: [BC] fix #1045 【ウィジェット】ローカルナビゲーション出力で、表示とリンクが別の内容になる問題を改善
Expand All @@ -29,7 +34,7 @@ CHG: 変更内容 / BUG: バグフィックス / NEW: 機能追加
-BUG: [UL] ファイルアップロードプラグインにおけるファイル詳細画面にてXSS(クロスサイトスクリプティング)が発生する問題の改善

[2021-07-29] basercms-4.5.0
-NEW: [ML] メールフィールドにオートコンプリート機能を追加
-NEW: [ML] メールフィールドにオートコンプリート機能を追加
-BUG: [BC] fix #1710 未ログイン時に管理画面にアクセスした際のエラーメッセージを表示しないように改善
-BUG: [BC] fix #1661 セッションストレージをDBにするとアップロードファイルがプレビューできない場合がある問題を改善
-BUG: [BC] fix #1247 管理画面での一覧表示を改善
Expand Down
2 changes: 1 addition & 1 deletion lib/Baser/View/Helper/BcUploadHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public function uploadImage($fieldName, $fileName, $options = [])
continue;
}
} else {
if ($options['mobile'] != preg_match('/^mobile_/', $key)) {
if ($options['mobile'] != preg_match('/^mobile_/', $key) && $options['imgsize'] != 'mobile_thumb') {
continue;
}
}
Expand Down

0 comments on commit 408a310

Please sign in to comment.