Skip to content

Commit

Permalink
fix #1903 コンテンツ一覧(表)コピーの際にコピー先のタイトルに「のコピー」とつかない (#2779)
Browse files Browse the repository at this point in the history
Co-authored-by: Đỗ Văn Hùng <[email protected]>
  • Loading branch information
HungDV2022 and dovanhung authored Oct 9, 2023
1 parent be31140 commit 371c614
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion plugins/baser-core/src/Model/Table/ContentFoldersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function copy(int $id, $newParentId, $newTitle, $newAuthorId, $newSiteId)
$entity->content = new Content([
'name' => $entity->content->name,
'parent_id' => $newParentId,
'title' => $newTitle,
'title' => $newTitle ?? $oldEntity->title . '_copy',
'author_id' => $newAuthorId,
'site_id' => $newSiteId,
'description' => $entity->content->description,
Expand Down
2 changes: 1 addition & 1 deletion plugins/baser-core/src/Model/Table/PagesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function copy($id, $newParentId, $newTitle, $newAuthorId, $newSiteId = nu
$page->content = new Content([
'name' => $page->content->name,
'parent_id' => $newParentId,
'title' => $newTitle,
'title' => $newTitle ?? $oldPage->title . '_copy',
'author_id' => $newAuthorId,
'site_id' => $newSiteId,
'description' => $page->content->description,
Expand Down
2 changes: 0 additions & 2 deletions plugins/bc-admin-third/src/js/admin/_lib/jquery.bcTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,6 @@
*/
copyContent: function (parent, node) {
var data = $.extend(true, {}, node.data.jstree);
data.contentTitle = bcI18n.bcTreeCopyTitle.sprintf(data.contentTitle);
data.status = false;
$.bcToken.check(function () {
return $.ajax({
Expand All @@ -1013,7 +1012,6 @@
data: {
content_id: data.contentId,
entity_id: data.contentEntityId,
title: data.contentTitle,
parent_id: data.contentParentId,
site_id: data.contentSiteId,
_csrfToken: $.bcToken.key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,12 @@ class="bca-btn-icon"
]) ?>
<?php endif ?>

<!-- コピーのみ使うフォーム -->
<form>
<input type="hidden" name="id" value="<?= $content->id ?>">
<input type="hidden" name="type" value="<?= $content->type ?>">
<input type="hidden" name="entity_id" value="<?= $content->entity_id ?>">
<input type="hidden" name="parent_id" value="<?= $content->parent_id ?>">
<input type="hidden" name="title" value="<?= h($content->title) ?>">
<input type="hidden" name="site_id" value="<?= $content->site_id ?>">
<input type="hidden" name="status" value="<?= $toStatus ?>">
<input type="hidden" name="alias_id" value="<?= (bool)$content->alias_id ?>">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
'bcTreeAlertMessage6' => __d('baser_core', '追加に失敗しました。'),
'bcTreeInfoMessage1' => __d('baser_core', 'ゴミ箱は空です'),
'bcTreeInfoMessage2' => __d('baser_core', 'ゴミ箱より戻しました。一覧に遷移しますのでしばらくお待ち下さい。'),
'bcTreeCopyTitle' => __d('baser_core', '%s のコピー'),
'bcTreeAliasTitle' => __d('baser_core', '%s のエイリアス'),
'bcTreeUnNamedTitle' => __d('baser_core', '名称未設定'),
'bcTreeNewTitle' => __d('baser_core', '新しい %s'),
Expand Down
2 changes: 1 addition & 1 deletion plugins/bc-blog/src/Model/Table/BlogContentsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function copy(
$data->content = new Content([
'name' => $name,
'parent_id' => $newParentId,
'title' => $newTitle,
'title' => $newTitle ?? $oldData->title . '_copy',
'author_id' => $newAuthorId,
'site_id' => $newSiteId,
'exclude_search' => false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function copy(int $id, $newParentId, $newTitle, $newAuthorId, $newSiteId)
$entity->content = new Content([
'name' => $entity->content->name,
'parent_id' => $newParentId,
'title' => $newTitle,
'title' => $newTitle ?? $oldEntity->title . '_copy',
'author_id' => $newAuthorId,
'site_id' => $newSiteId,
'description' => $entity->content->description,
Expand Down
2 changes: 1 addition & 1 deletion plugins/bc-mail/src/Model/Table/MailContentsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function copy(
$data->content = new Content([
'name' => $name,
'parent_id' => $newParentId,
'title' => $newTitle,
'title' => $newTitle ?? $oldData->title . '_copy',
'author_id' => $newAuthorId,
'site_id' => $newSiteId,
'exclude_search' => false,
Expand Down

0 comments on commit 371c614

Please sign in to comment.