From 791ff512585e426a315426c9891b41b4c00e9b28 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 13 Dec 2020 15:14:57 +0900 Subject: [PATCH 01/17] =?UTF-8?q?fix:=20test:=20TravisCI=E3=81=AEphp7.3?= =?UTF-8?q?=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C=E5=87=BA=E3=82=8B?= =?UTF-8?q?=E3=81=9F=E3=82=81=E4=BF=AE=E6=AD=A3=20https://github.com/NetCo?= =?UTF-8?q?mmons3/NetCommons3/issues/1618?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6c47da6..555efd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ php: - 7.0 - 7.1 - 7.2 - - 7.3 + - 7.3.24 - 7.4 sudo: false From 387a4b77f6e16d3ad631e9b0b8e3931e3db69484 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 14:01:13 +0900 Subject: [PATCH 02/17] =?UTF-8?q?add:=20release=E3=82=BF=E3=82=B0=E4=BB=98?= =?UTF-8?q?=E3=81=91=E3=81=AEgithub=20action=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/NetCommons3/NetCommons3/issues/1619 --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a3225bc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '3*' + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: | + NetCommons ${{ github.ref }} released. + draft: false + prerelease: false From 4402b10c2969ef812bd610208048d9a7c3c9a88a Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sat, 23 Jan 2021 14:01:18 +0900 Subject: [PATCH 03/17] change: Version number to 3.3.3 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 4772543..619b537 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.2 +3.3.3 From ea9886d2f41470055cb78a42276da2c0682fd8b8 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 4 Aug 2021 13:22:09 +0900 Subject: [PATCH 04/17] =?UTF-8?q?change:=20test:=20TravisCI=E3=81=8B?= =?UTF-8?q?=E3=82=89GithubAction=E3=81=AB=E5=A4=89=E6=9B=B4=20https://gith?= =?UTF-8?q?ub.com/NetCommons3/NetCommons3/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 137 ++++++++++++++++++++++++++++++++++++ .travis.yml | 42 ----------- README.md | 9 +-- phpunit.xml.dist | 4 +- 4 files changed, 141 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d6bd01e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,137 @@ +on: + push: + branches: + - main + - master + - availability + pull_request: + branches: + - main + - master + - availability + +name: tests + +jobs: + tests: + name: tests + runs-on: ubuntu-18.04 + strategy: + matrix: + php: [ '7.1', '7.2', '7.3', '7.4' ] + + env: + NC3_BUILD_DIR: "/opt/nc3" + NC3_DOCKER_DIR: "/opt/docker" + NC3_GIT_URL: "git://github.com/NetCommons3/NetCommons3.git" + NC3_GIT_BRANCH: "master" + PLUGIN_BUILD_DIR: ${{ github.workspace }} + PHP_VERSION: ${{ matrix.php }} + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: cakephp_test + + steps: + - uses: actions/checkout@v2 + + - name: environment + run: | + echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" + echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" + echo "PHP_VERSION=${PHP_VERSION}" + ls -al ${PLUGIN_BUILD_DIR} + + - name: docker-compose install + run: | + curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + chmod +x ~/docker-compose + sudo mv ~/docker-compose /usr/local/bin/docker-compose + docker-compose --version + + - name: git clone nc3 + run: git clone -b ${NC3_GIT_BRANCH} ${NC3_GIT_URL} ${NC3_BUILD_DIR} + + - name: git clone nc3_docker + run: git clone https://github.com/NetCommons3/nc3app-docker.git ${NC3_DOCKER_DIR} + + - name: docker-compose start + run: | + cd ${NC3_DOCKER_DIR} + docker-compose up -d + docker-compose start + + - run: docker ps + + - name: check libraries + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/start-on-docker.sh + + - name: nc3 build + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/app-build.sh + + - name: phpcs (PHP CodeSniffer) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh + + - name: phpmd (PHP Mess Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh + + - name: phpcpd (PHP Copy/Paste Detector) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh + + - name: gjslint (JavaScript Style Check) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh + + - name: phpdoc (PHP Documentor) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh + + - name: phpunit (PHP UnitTest) + run: | + cd ${NC3_DOCKER_DIR} + docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh + sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build + + - name: push coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.php }} + run: | + cd ${NC3_BUILD_DIR} + ls -la ${NC3_BUILD_DIR} + vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + + - name: docker-compose remove + run: | + cd ${NC3_DOCKER_DIR} + docker-compose rm -f + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: good + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: notify-netcommons3 + SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_COLOR: danger diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 555efd9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3.24 - - 7.4 - -sudo: false -dist: trusty - -env: - matrix: - - NETCOMMONS_VERSION=master DB=mysql - global: - - secure: "iq/xEV3mq8MBLWnumo8LOSc9cVvkrh7E+joO8ZpmZ7+CxfpFW1ESp2X552ncso9LPMH2rl24/ZR24xwwklNxpqxu+erXfmIpiO2gCa7ESFAJW3J/irN5uRL+t7Z9RWZwFq88p4jsR+2LHeVzl+jgqVNmCpjVJd40uR1DDYzODO4=" - - GIT_COMMITTER_NAME=s-nakajima - - GIT_COMMITTER_EMAIL=nakajimashouhei@gmail.com - - GIT_AUTHOR_NAME=s-nakajima - - GIT_AUTHOR_EMAIL=nakajimashouhei@gmail.com - -before_script: - - export NETCOMMONS_BUILD_DIR=`dirname $TRAVIS_BUILD_DIR`/NetCommons3 - - git clone git://github.com/NetCommons3/NetCommons3 $NETCOMMONS_BUILD_DIR - - cd $NETCOMMONS_BUILD_DIR - - git checkout $NETCOMMONS_VERSION - - travis_wait . tools/build/plugins/cakephp/travis/pre.sh - - . tools/build/plugins/cakephp/travis/environment.sh - -script: - - . tools/build/plugins/cakephp/travis/main.sh - -after_script: - - . tools/build/plugins/cakephp/travis/post.sh - -notifications: - email: - recipients: - - netcommons3@googlegroups.com - on_success: never # default: change - on_failure: always # default: always diff --git a/README.md b/README.md index 0abe9f2..dfc9bb4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ Pages ==== -[![Build Status](https://travis-ci.org/NetCommons3/Pages.png?branch=master)](https://travis-ci.org/NetCommons3/Pages) -[![Coverage Status](https://coveralls.io/repos/NetCommons3/Pages/badge.png?branch=master)](https://coveralls.io/r/NetCommons3/Pages?branch=master) - -| dependencies | status | -| ------------ | ------ | -| composer.json | [![Dependency Status](https://www.versioneye.com/user/projects/5305d1d1ec137516990000e2/badge.png)](https://www.versioneye.com/user/projects/5305d1d1ec137516990000e2) | +[![Tests Status](https://github.com/NetCommons3/Pages/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/NetCommons3/Pages/actions/workflows/tests.yml) +[![Coverage Status](https://coveralls.io/repos/NetCommons3/Pages/badge.svg?branch=master)](https://coveralls.io/r/NetCommons3/Pages?branch=master) +[![Stable Version](https://img.shields.io/packagist/v/netcommons/pages.svg?label=stable)](https://packagist.org/packages/netcommons/pages) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 62a9213..f71af07 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,9 +3,6 @@ - - - app/Plugin/Pages @@ -20,5 +17,6 @@ + From 4b8960d01f4c6d4920627ca5d994db861befadae Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Aug 2021 22:19:53 +0900 Subject: [PATCH 05/17] =?UTF-8?q?fix:=20callbacks=E3=82=92=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=81=97=E3=81=A6=E3=80=81actAs=E3=81=8C=E5=8B=95?= =?UTF-8?q?=E3=81=8B=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20https://github.com/NetCommons3/NetCommons3/issues/1?= =?UTF-8?q?562?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/SavePageBehavior.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Model/Behavior/SavePageBehavior.php b/Model/Behavior/SavePageBehavior.php index 1c8022f..3751edb 100644 --- a/Model/Behavior/SavePageBehavior.php +++ b/Model/Behavior/SavePageBehavior.php @@ -242,7 +242,9 @@ public function saveMove(Model $model, $data) { $childCount = $model->childCount($data[$model->alias]['parent_id'], true); $result = $model->moveDown($model->id, $childCount); } elseif ($data[$model->alias]['type'] === 'move') { - $result = $model->saveField('parent_id', $data[$model->alias]['parent_id']); + //callbacksは必要 + $result = + $model->saveField('parent_id', $data[$model->alias]['parent_id'], ['callbacks' => true]); } else { $result = false; } From 89ed2b788ec07eba1614bbe63bfc77307ae08649 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Wed, 11 Aug 2021 10:55:43 +0900 Subject: [PATCH 06/17] =?UTF-8?q?change:=20test:=20Slack=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3,=20mysql8.0=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 35 ++++++++++++++++++++++++-- .github/workflows/tests.yml | 47 +++++++++++++++++++++++++---------- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3225bc..592d72f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,16 +4,25 @@ on: tags: - '3*' -name: Create Release +name: create_release jobs: build: - name: Create Release + name: create_release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + SLACK_MESSAGE: "Start Job" + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -26,3 +35,25 @@ jobs: NetCommons ${{ github.ref }} released. draft: false prerelease: false + + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Finish + uses: rtCamp/action-slack-notify@v2.2.0 + if: success() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-release + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good + SLACK_MESSAGE: "Job Success" + + # テスト失敗時はこちらのステップが実行される + - name: Slack Notification on Failure + uses: rtCamp/action-slack-notify@v2.2.0 + if: failure() + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_RELEASE }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: danger + SLACK_MESSAGE: "Job Failure" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d6bd01e..1477ea2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,26 @@ on: name: tests jobs: + setup: + name: setup + runs-on: ubuntu-18.04 + steps: + - name: Slack Notification on Start + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: "#f0ad4e" + tests: name: tests + needs: setup runs-on: ubuntu-18.04 strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] + mysql: [ '5.7', '8.0' ] env: NC3_BUILD_DIR: "/opt/nc3" @@ -27,6 +41,7 @@ jobs: NC3_GIT_BRANCH: "master" PLUGIN_BUILD_DIR: ${{ github.workspace }} PHP_VERSION: ${{ matrix.php }} + MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test @@ -38,6 +53,7 @@ jobs: echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" echo "PLUGIN_BUILD_DIR=${PLUGIN_BUILD_DIR}" echo "PHP_VERSION=${PHP_VERSION}" + echo "MYSQL_VERSION=${MYSQL_VERSION}" ls -al ${PLUGIN_BUILD_DIR} - name: docker-compose install @@ -116,22 +132,27 @@ jobs: cd ${NC3_DOCKER_DIR} docker-compose rm -f - # テスト成功時はこちらのステップが実行される - - name: Slack Notification on Success - if: success() - uses: rtCamp/action-slack-notify@v2.2.0 - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" - SLACK_COLOR: good - # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 if: failure() env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: notify-netcommons3 - SLACK_TITLE: "${{ github.repository }}(${{ matrix.php }})" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}(php${{ matrix.php }}, mysql${{ matrix.mysql }})" SLACK_COLOR: danger + + teardown: + name: teardown + runs-on: ubuntu-18.04 + needs: tests + steps: + # テスト成功時はこちらのステップが実行される + - name: Slack Notification on Success + if: success() + uses: rtCamp/action-slack-notify@v2.2.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} + SLACK_CHANNEL: notify-nc3-tests + SLACK_TITLE: "${{ github.repository }}" + SLACK_COLOR: good From b1d18ef1487066931887362d522a826fe477a649 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 13 Aug 2021 16:49:24 +0900 Subject: [PATCH 07/17] change: Version number to 3.3.4 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 619b537..a0891f5 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.3 +3.3.4 From b1cacf00bcd6c3e937b3203c28dabf705e288449 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 10 Feb 2022 10:17:03 +0900 Subject: [PATCH 08/17] =?UTF-8?q?fix:=20=E5=88=A5=E3=81=AE=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AE=E4=B8=8B=E3=81=AB=E7=A7=BB=E5=8B=95?= =?UTF-8?q?=E3=81=97=E3=81=9F=E9=9A=9B=E3=81=AB=E3=83=91=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=8C=E6=9B=B4=E6=96=B0=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20https://github.com/NetCommons3/NetCommons3/issues/1683?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/SavePageBehavior.php | 15 +++++++++++++-- Model/Page.php | 16 +++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Model/Behavior/SavePageBehavior.php b/Model/Behavior/SavePageBehavior.php index 3751edb..d5c5b76 100644 --- a/Model/Behavior/SavePageBehavior.php +++ b/Model/Behavior/SavePageBehavior.php @@ -243,8 +243,19 @@ public function saveMove(Model $model, $data) { $result = $model->moveDown($model->id, $childCount); } elseif ($data[$model->alias]['type'] === 'move') { //callbacksは必要 - $result = - $model->saveField('parent_id', $data[$model->alias]['parent_id'], ['callbacks' => true]); + $permalink = + $model->getParentPermalink($data['Page']) . '/' . Current::read('Page.slug'); + if (substr($permalink, 0, 1) === '/') { + $permalink = substr($permalink, 1); + } + $data[$model->alias]['permalink'] = $permalink; + $model->create(false); + $options = [ + 'validate' => false, + 'fieldList' => ['parent_id', 'permalink'], + 'callbacks' => true + ]; + $result = $model->save($data, $options); } else { $result = false; } diff --git a/Model/Page.php b/Model/Page.php index d364210..bf5f250 100644 --- a/Model/Page.php +++ b/Model/Page.php @@ -344,9 +344,9 @@ public function isUniquePermalink($fields) { */ public function afterSave($created, $options = array()) { if (Hash::get($this->data, 'Page.id') && - Hash::get($this->data, 'Page.slug') !== Current::read('Page.slug')) { + Hash::get($this->data, 'Page.permalink')) { $chidren = $this->children( - Hash::get($this->data, 'Page.id'), false, array('Page.id', 'Page.permalink') + Hash::get($this->data, 'Page.id'), false, array('Page.id', 'Page.permalink', 'Page.slug') ); $data = $this->data; @@ -354,13 +354,11 @@ public function afterSave($created, $options = array()) { foreach ($chidren as $child) { $this->id = $child[$this->alias]['id']; - $pattern = '/^' . preg_quote(Current::read('Page.permalink') . '/', '/') . '/'; - $permalink = preg_replace( - $pattern, Hash::get($data, 'Page.permalink') . '/', $child[$this->alias]['permalink'] - ); - - if (! $this->saveField('permalink', $permalink, array('callbacks' => false))) { - throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); + $permalink = Hash::get($data, 'Page.permalink') . '/' . $child[$this->alias]['slug']; + if ($permalink !== $child[$this->alias]['permalink']) { + if (! $this->saveField('permalink', $permalink, array('callbacks' => false))) { + throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); + } } } From 792c43e86b547fc8b47369fe8a77d3f463b1970a Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 10 Feb 2022 10:24:09 +0900 Subject: [PATCH 09/17] =?UTF-8?q?fix:=20phpmd=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E5=9B=9E=E9=81=BF=20https://github.com/NetCommons3/NetCommons3?= =?UTF-8?q?/issues/1683?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Behavior/SavePageBehavior.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Model/Behavior/SavePageBehavior.php b/Model/Behavior/SavePageBehavior.php index d5c5b76..f079e0b 100644 --- a/Model/Behavior/SavePageBehavior.php +++ b/Model/Behavior/SavePageBehavior.php @@ -219,6 +219,7 @@ public function saveTheme(Model $model, $data) { * @param array $data request data * @return bool * @throws InternalErrorException + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function saveMove(Model $model, $data) { //トランザクションBegin From c53612e920dc78d41d090602cd566d242e6eb84c Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 11 Feb 2022 20:39:52 +0900 Subject: [PATCH 10/17] change: Version number to 3.3.5 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index a0891f5..fa7adc7 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.4 +3.3.5 From d38453618273740a7e898a708f446a0e022c81eb Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 22 Apr 2022 23:36:52 +0900 Subject: [PATCH 11/17] =?UTF-8?q?test:=20github=20actions=E3=81=AE?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1477ea2..9501566 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Fix up git URLs + run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig + - name: environment run: | echo "GITHUB_WORKSPACE=${GITHUB_WORKSPACE}" @@ -58,7 +61,7 @@ jobs: - name: docker-compose install run: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose + curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose docker-compose --version From 0976884d3cfbcf04ce0f5d1bc8266da27ce215d6 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 26 Apr 2022 17:06:23 +0900 Subject: [PATCH 12/17] =?UTF-8?q?fix:=20=E3=83=81=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=82=AF=E6=BC=8F=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/PagesEditController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/PagesEditController.php b/Controller/PagesEditController.php index 1bf54e2..6c05370 100644 --- a/Controller/PagesEditController.php +++ b/Controller/PagesEditController.php @@ -53,7 +53,7 @@ class PagesEditController extends PagesAppController { public $components = array( 'NetCommons.Permission' => array( 'allow' => array( - 'index,add,edit,delete,layout,add_m17n' => 'page_editable', + '*' => 'page_editable', ), ), 'Pages.PageLayout', From 1251518c1cfbda753eef0c6b57d90b9bb3e72cf5 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 10 Jan 2023 14:23:04 +0900 Subject: [PATCH 13/17] =?UTF-8?q?fix:=20=E5=A4=9A=E8=A8=80=E8=AA=9E?= =?UTF-8?q?=E3=81=AE=E3=82=B5=E3=82=A4=E3=83=88=E3=81=A7=E3=80=81=E7=89=87?= =?UTF-8?q?=E6=96=B9=E3=81=AE=E8=A8=80=E8=AA=9E=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=81=AB=E3=83=90=E3=82=B0=E3=81=8C=E3=81=82=E3=82=8A=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=A8=E3=81=AA=E3=82=8B=E3=80=82=E3=81=9F?= =?UTF-8?q?=E3=81=A0=E3=80=81=E5=BD=93=E6=A9=9F=E8=83=BD=E3=81=AF=E3=81=BB?= =?UTF-8?q?=E3=81=BC=E4=BD=BF=E3=82=8F=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=82=81=E3=81=93=E3=81=AE=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E8=87=AA=E4=BD=93=E3=82=92=E6=B6=88=E3=81=99=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/PagesEditController.php | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Controller/PagesEditController.php b/Controller/PagesEditController.php index 6c05370..d648467 100644 --- a/Controller/PagesEditController.php +++ b/Controller/PagesEditController.php @@ -660,21 +660,22 @@ private function __hasDeletePage() { * @return bool */ private function __hasDeleteThisPage() { - $activeLangs = $this->Language->getLanguages(); - if (! Current::read('Space.is_m17n') && count($activeLangs) <= 1) { - return false; - } - - $hasDeletePage = $this->__hasDeletePage(); - if (! $hasDeletePage) { - return false; - } - - $activeLangIds = Hash::extract($activeLangs, '{n}.Language.id'); - - $pageIdsM17n = $this->Page->getPageIdsWithM17n(Current::read('Page.id')); - - return (bool)array_diff($activeLangIds, Hash::get($pageIdsM17n, Current::read('Page.id'), [])); + return false; + //$activeLangs = $this->Language->getLanguages(); + //if (! Current::read('Space.is_m17n') && count($activeLangs) <= 1) { + // return false; + //} + // + //$hasDeletePage = $this->__hasDeletePage(); + //if (! $hasDeletePage) { + // return false; + //} + // + //$activeLangIds = Hash::extract($activeLangs, '{n}.Language.id'); + // + //$pageIdsM17n = $this->Page->getPageIdsWithM17n(Current::read('Page.id')); + // + //return (bool)array_diff($activeLangIds, Hash::get($pageIdsM17n, Current::read('Page.id'), [])); } } From f2c7174e0b47cffa5f7e23af7ae9f96155d3dc5c Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Fri, 24 Feb 2023 15:56:43 +0900 Subject: [PATCH 14/17] =?UTF-8?q?test:=20Github=20Action=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9501566..7cfa881 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,7 @@ jobs: MYSQL_VERSION: ${{ matrix.mysql }} MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: cakephp_test + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 From df14699342c738b19d60943dd9fc7ad98bb13168 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Sun, 26 Feb 2023 03:45:41 +0900 Subject: [PATCH 15/17] change: Version number to 3.3.6 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index fa7adc7..9c25013 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.5 +3.3.6 From cd5e74931bfca20092dc72ca51c4256b41a1084d Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Thu, 5 Oct 2023 19:40:24 +0900 Subject: [PATCH 16/17] =?UTF-8?q?test:=20github=20action=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cfa881..6da4321 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,22 +3,21 @@ on: branches: - main - master - - availability pull_request: branches: - main - master - - availability name: tests jobs: setup: name: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Slack Notification on Start uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -28,7 +27,7 @@ jobs: tests: name: tests needs: setup - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: matrix: php: [ '7.1', '7.2', '7.3', '7.4' ] @@ -92,46 +91,53 @@ jobs: docker-compose exec -T nc3app bash /opt/scripts/app-build.sh - name: phpcs (PHP CodeSniffer) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh - name: phpmd (PHP Mess Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh - name: phpcpd (PHP Copy/Paste Detector) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh - name: gjslint (JavaScript Style Check) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh - name: phpdoc (PHP Documentor) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh - name: phpunit (PHP UnitTest) + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build - - name: push coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.php }} - run: | - cd ${NC3_BUILD_DIR} - ls -la ${NC3_BUILD_DIR} - vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v +# - name: push coveralls +# env: +# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# COVERALLS_FLAG_NAME: ${{ matrix.php }} +# run: | +# cd ${NC3_BUILD_DIR} +# ls -la ${NC3_BUILD_DIR} +# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v - name: docker-compose remove + if: always() run: | cd ${NC3_DOCKER_DIR} docker-compose rm -f @@ -139,7 +145,7 @@ jobs: # テスト失敗時はこちらのステップが実行される - name: Slack Notification on Failure uses: rtCamp/action-slack-notify@v2.2.0 - if: failure() + if: env.SLACK_WEBHOOK != '' && failure() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests @@ -148,13 +154,13 @@ jobs: teardown: name: teardown - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest needs: tests steps: # テスト成功時はこちらのステップが実行される - name: Slack Notification on Success - if: success() uses: rtCamp/action-slack-notify@v2.2.0 + if: env.SLACK_WEBHOOK != '' && success() env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }} SLACK_CHANNEL: notify-nc3-tests From 61d61d29d6cfc1e4cb28ea9c8fa2247e23755b23 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 9 Oct 2023 21:03:04 +0900 Subject: [PATCH 17/17] change: Version number to 3.3.7 --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 9c25013..86fb650 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.3.6 +3.3.7