Skip to content

Commit

Permalink
Merge branch '5.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Sep 26, 2024
2 parents 7c2f275 + 555a96f commit 8fc2ae9
Show file tree
Hide file tree
Showing 99 changed files with 8,559 additions and 736 deletions.
42 changes: 0 additions & 42 deletions config/test_install.php

This file was deleted.

1 change: 0 additions & 1 deletion docker/docker-compose.yml.default
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# volumes:
# db-volume: # windowsの場合はコメントを外す

services:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ q {}","",""
"23","use_site_device_setting","0","",""
"24","use_site_lang_setting","0","",""
"25","use_update_notice","1","",""
"26","contents_sort_last_modified","","",""
"27","mail_additional_parameters","","",""
"28","outer_service_output_header","","",""
"29","outer_service_output_footer","","",""
"30","allow_simple_password","0","",""
"31","password_reset_days","","",""
"32","use_two_factor_authentication","0","",""
"26","mail_additional_parameters","","",""
"27","outer_service_output_header","","",""
"28","outer_service_output_footer","","",""
"29","allow_simple_password","0","",""
"30","password_reset_days","","",""
"31","use_two_factor_authentication","0","",""
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ q {}","",""
"23","use_site_device_setting","0","",""
"24","use_site_lang_setting","0","",""
"25","use_update_notice","1","",""
"26","contents_sort_last_modified","","",""
"27","mail_additional_parameters","","",""
"28","outer_service_output_header","","",""
"29","outer_service_output_footer","","",""
"30","allow_simple_password","0","",""
"31","password_reset_days","","",""
"32","use_two_factor_authentication","0","",""
"26","mail_additional_parameters","","",""
"27","outer_service_output_header","","",""
"28","outer_service_output_footer","","",""
"29","allow_simple_password","0","",""
"30","password_reset_days","","",""
"31","use_two_factor_authentication","0","",""
22 changes: 22 additions & 0 deletions plugins/baser-core/VERSION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@
CHG: 変更内容 / BUG: バグフィックス / NEW: 機能追加


[2024-09-26] basercms-5.1.2
- NEW [BC] JWTキー生成コマンド追加
- BUG [BC] BcUploadで作成したフォルダの権限が書き込み可能になっていない問題を改善
- BUG [BC] アップデート可能なバージョンの数量カウントが間違っていたため調整
- BUG [BC] DBプレフィックス付きの環境の場合、バックアップファイルが正常に生成されない問題を改善
- BUG [BC] コンテンツ管理でゴミ箱に入れた際、ツリー構造が壊れてしまう問題を改善
- BUG [BC] サブサイトを削除した場合にツリー構造が崩れてしまう問題を改善
- BUG [BC] 編集画面を開いている状態で、別画面でツリー構造を変更し、編集画面で保存するとツリー構造が壊れる問題を改善
- BUG [BC] テーマ一覧 テーマのdescriptionが設定されていないとエラーとなる問題を改善
- BUG [BC] ユーザーが1ユーザーのみの場合でも、「利用状況:有効チェックなし」をセーブできてしまう問題を改善 fix #3785
- BUG [BC] 【システム】エディタ設定でエディタタイプを「なし」にしてもCKEditorが表示される問題を改善 fix #3765
- BUG [BC] 管理画面のテーマ設定で保存実行時にエラーが発生する問題を改善 fix #3683
- BUG [BC] アクセスルールグループ一覧から、タイプをAdmin Web APIにした状態で新規追加ボタンを押すと404となる問題を改善 fix #3778
- BUG [BC] コンテンツ一覧にて複数ユーザーで更新を行うとツリー構造が壊れてしまう問題を改善
- BUG [BC] ユーザー画面側で管理ツールバーが表示されているとき、一部imgの width= タグがユーザー側のcssのスタイルで上書きされてしまう問題を改善
- BUG [BC] テーマ用初期データダウンロードを利用してDLした初期データファイル名にプレフィクスがついて生成されてしまう問題を改善
- CHG [BG] ブログ記事をコピーする際、公開開始日、公開終了日をリセットするように改善
- BUG [BG] APIから記事登録時に必須項目のバリデーションが効いていない問題を改善
- BUG [CC] カスタムコンテンツの一覧表示件数設定を無視して全件表示される問題を改善
- BUG [ML] メールフォーム追加後、検索インデックス一覧を開くとエラーになる問題を改善 fix #3779
- BUG [ML] メールフォームにファイルフィールドが存在する場合、入力画面から確認画面に進めない問題を改善 fix #3777

[2024-09-05] basercms-5.1.1
- NEW [BC] PHP8.3に対応
- CHG: [BC] AppTable::find() を削除
Expand Down
7 changes: 0 additions & 7 deletions plugins/baser-core/config/Seeds/SiteConfigsSeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,6 @@ public function run(): void
'created' => '',
'modified' => ''
],
[
'id' => '25',
'name' => 'contents_sort_last_modified',
'value' => '',
'created' => '',
'modified' => ''
],
[
'id' => '26',
'name' => 'mail_additional_parameters',
Expand Down
2 changes: 2 additions & 0 deletions plugins/baser-core/src/BaserCorePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Authentication\Authenticator\SessionAuthenticator;
use Authentication\Middleware\AuthenticationMiddleware;
use BaserCore\Command\ComposerCommand;
use BaserCore\Command\CreateJwtCommand;
use BaserCore\Command\CreateReleaseCommand;
use BaserCore\Command\SetupInstallCommand;
use BaserCore\Command\SetupTestCommand;
Expand Down Expand Up @@ -670,6 +671,7 @@ public function console(CommandCollection $commands): CommandCollection
$commands->add('update', UpdateCommand::class);
$commands->add('create release', CreateReleaseCommand::class);
$commands->add('setup install', SetupInstallCommand::class);
$commands->add('create jwt', CreateJwtCommand::class);
return $commands;
}

Expand Down
8 changes: 4 additions & 4 deletions plugins/baser-core/src/BcPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ public function install($options = []): bool
$permissionGroupsService->buildByPlugin($pluginName);
}

$this->createAssetsSymlink();

BcUtil::clearAllCache();
$result = $plugins->install($pluginName);
TableRegistry::getTableLocator()->clear();
return $plugins->install($pluginName);
$this->createAssetsSymlink();
return $result;
} catch (BcException $e) {
$this->log($e->getMessage());
$this->migrations->rollback($options);
Expand Down Expand Up @@ -608,10 +608,10 @@ function(RouteBuilder $routes) use ($site) {
*/
public function applyAsTheme(Site $site, string $theme)
{
$this->createAssetsSymlink();
$site->theme = $theme;
$siteConfigsTable = TableRegistry::getTableLocator()->get('BaserCore.Sites');
$siteConfigsTable->save($site);
$this->createAssetsSymlink();
}

/**
Expand Down
39 changes: 39 additions & 0 deletions plugins/baser-core/src/Command/CreateJwtCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* baserCMS : Based Website Development Project <https://basercms.net>
* Copyright (c) NPO baser foundation <https://baserfoundation.org/>
*
* @copyright Copyright (c) NPO baser foundation
* @link https://basercms.net baserCMS Project
* @since 5.0.0
* @license https://basercms.net/license/index.html MIT License
*/

namespace BaserCore\Command;

use BaserCore\Utility\BcApiUtil;
use Cake\Command\Command;
use Cake\Console\Arguments;
use Cake\Console\ConsoleIo;

/**
* CreateJwtCommand
*
* bin/cake create jwt
*/
class CreateJwtCommand extends Command
{

/**
* execute
*
* @param Arguments $args
* @param ConsoleIo $io
* @return null
*/
public function execute(Arguments $args, ConsoleIo $io)
{
BcApiUtil::createJwt();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ public function index(ContentsAdminServiceInterface $service, SiteConfigsService

switch($this->getRequest()->getQuery('list_type')) {
case 1:
// 並び替え最終更新時刻をリセット
$siteConfigService->resetValue('contents_sort_last_modified');
$contents = $service->getTreeIndex($this->getRequest()->getQueryParams());
break;
case 2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function index(PermissionGroupsAdminServiceInterface $service, ?int $user
* @noTodo
* @unitTest
*/
public function add(PermissionGroupsAdminServiceInterface $service, int $userGroupId, string $prefix)
public function add(PermissionGroupsAdminServiceInterface $service, int $userGroupId)
{
if($this->getRequest()->is(['post', 'put'])) {
try {
Expand All @@ -96,7 +96,7 @@ public function add(PermissionGroupsAdminServiceInterface $service, int $userGro
}
$this->set($service->getViewVarsForForm(
$userGroupId,
$entity?? $service->getNew($prefix)
$entity?? $service->getNew($this->getRequest()->getQuery('prefix'))
));
}

Expand Down
51 changes: 27 additions & 24 deletions plugins/baser-core/src/Controller/Api/Admin/ContentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ public function trash_empty(ContentsServiceInterface $service)
try {
$trash = $service->getTrashIndex($this->request->getQueryParams())->orderBy(['plugin', 'type']);
foreach ($trash as $entity) {
if (!$service->hardDeleteWithAssoc($entity->id)) $result = false;
try {
$service->hardDeleteWithAssoc($entity->id);
} catch (RecordNotFoundException) {
// 親子関係の際、親が削除された場合、同時に子が削除されている場合があるので、例外を無視
// ただ、baserCMSの仕様上、ゴミ箱に入れた場合は親子関係がなくなるので、この処理は実質的には不要
// テスト用に置いておく
}
}
$message = __d('baser_core', 'ゴミ箱を空にしました。');
$this->BcMessage->setSuccess($message, true, false);
Expand Down Expand Up @@ -490,29 +496,26 @@ public function move(ContentsServiceInterface $service)
{
$this->request->allowMethod(['post', 'put', 'patch']);
$url = $content = $errors = null;
if (!$service->isTreeModifiedByAnotherUser($this->getRequest()->getData('listDisplayed'))) {
try {
$beforeContent = $service->get($this->request->getData('origin.id'));
$beforeUrl = $beforeContent->url;
$content = $service->move($this->request->getData('origin'), $this->request->getData('target'));
$message = sprintf(
__d('baser_core', "コンテンツ「%s」の配置を移動しました。\n%s > %s"),
$content->title,
rawurldecode($beforeUrl),
rawurldecode($content->url)
);
$url = $service->getUrlById($content->id, true);
$this->BcMessage->setSuccess($message, true, false);
} catch (PersistenceFailedException $e) {
$errors = $e->getEntity()->getErrors();
$message = __d('baser_core', "入力エラーです。内容を修正してください。");
$this->setResponse($this->response->withStatus(400));
} catch (\Throwable $e) {
$message = __d('baser_core', 'データベース処理中にエラーが発生しました。' . $e->getMessage());
$this->setResponse($this->response->withStatus(500));
}
} else {
$message = __d('baser_core', 'コンテンツ一覧を表示後、他のログインユーザーがコンテンツの並び順を更新しました。<br>一度リロードしてから並び替えてください。');

try {
$beforeContent = $service->get($this->request->getData('origin.id'));
$beforeUrl = $beforeContent->url;
$content = $service->move($this->request->getData('origin'), $this->request->getData('target'));
$message = sprintf(
__d('baser_core', "コンテンツ「%s」の配置を移動しました。\n%s > %s"),
$content->title,
rawurldecode($beforeUrl),
rawurldecode($content->url)
);
$url = $service->getUrlById($content->id, true);
$this->BcMessage->setSuccess($message, true, false);
} catch (PersistenceFailedException $e) {
$errors = $e->getEntity()->getErrors();
$message = __d('baser_core', "入力エラーです。内容を修正してください。");
$this->setResponse($this->response->withStatus(400));
} catch (\Throwable $e) {
$message = __d('baser_core', 'データベース処理中にエラーが発生しました。' . $e->getMessage());
$this->setResponse($this->response->withStatus(500));
}

$this->set([
Expand Down
1 change: 1 addition & 0 deletions plugins/baser-core/src/Event/BcEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public function implementedEvents(): array
* @return bool
* @checked
* @noTodo
* @unitTest
*/
public function isAction($action, $isContainController = true)
{
Expand Down
5 changes: 3 additions & 2 deletions plugins/baser-core/src/Model/Table/AppTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

use BaserCore\Utility\BcUtil;
use Cake\ORM\Association\BelongsToMany;
use Cake\ORM\Query;
use Cake\ORM\Table;
use Cake\I18n\FrozenTime;
use BaserCore\Annotation\NoTodo;
use BaserCore\Annotation\Checked;
use BaserCore\Annotation\UnitTest;
Expand Down Expand Up @@ -83,6 +81,7 @@ public function setTable(string $table)
* @return string
* @checked
* @noTodo
* @unitTest
*/
public function getTable(): string
{
Expand All @@ -100,6 +99,7 @@ public function getTable(): string
* @return BelongsToMany
* @checked
* @noTodo
* @unitTest
*/
public function belongsToMany(string $associated, array $options = []): BelongsToMany
{
Expand All @@ -125,6 +125,7 @@ public function belongsToMany(string $associated, array $options = []): BelongsT
* @return string
* @checked
* @noTodo
* @unitTest
*/
public function addPrefix($table)
{
Expand Down
Loading

0 comments on commit 8fc2ae9

Please sign in to comment.