Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1ブランチの修正を4.2ブランチへマージ #5487

Merged
merged 37 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e5a09a2
Bump semver-regex from 3.1.3 to 3.1.4
dependabot[bot] Jun 3, 2022
4047d13
SKIP_INSTALL_SCRIPT_ON_DOCKER_BUILDを廃止して初回実行時に初期化するように修正
kiy0taka May 26, 2022
a5651ac
www-dataで実行
kiy0taka May 27, 2022
8f2f869
ec-cubeコンテナが起動するまで待機
kiy0taka May 27, 2022
0ad0fbc
SQLiteで利用できないので`--if-not-exists`オプションは使用しない
kiy0taka May 27, 2022
7372f65
ec-cubeコンテナが起動するまで待つ
kiy0taka Jun 7, 2022
fc93eea
SKIP_INSTALL_SCRIPT_ON_DOCKER_BUILDを削除
kiy0taka Jun 7, 2022
402b7cd
upgrade mailcatcher-codeception-module
kiy0taka Jun 9, 2022
77942f0
$message['recipients'] -> $message->getRecipients()
kiy0taka Jun 9, 2022
c394377
update gulp-sass
Jun 14, 2022
6c466ad
Merge pull request #5384 from kiy0taka/dev/upgrade-mailcatcher-codece…
chihiro-adachi Jun 15, 2022
89cf6e9
Bump guzzlehttp/guzzle from 6.5.6 to 6.5.7
dependabot[bot] Jun 15, 2022
c081e92
Merge remote-tracking branch 'upstream/4.1' into dev/initialize_on_fi…
kiy0taka Jun 15, 2022
1919352
Bump jpeg-js from 0.4.3 to 0.4.4 in /zap/selenium/ci/TypeScript
dependabot[bot] Jun 17, 2022
0655787
Merge pull request #1 from EC-CUBE/4.1
Jun 20, 2022
a1e6668
update
Jun 20, 2022
9092094
Merge pull request #5381 from EC-CUBE/dependabot/npm_and_yarn/semver-…
chihiro-adachi Jun 21, 2022
33b3184
Merge pull request #5394 from EC-CUBE/dependabot/npm_and_yarn/zap/sel…
chihiro-adachi Jun 21, 2022
9d1d337
Merge pull request #5386 from EC-CUBE/dependabot/composer/guzzlehttp/…
chihiro-adachi Jun 21, 2022
5f836bf
Bump guzzlehttp/guzzle from 6.5.7 to 6.5.8
dependabot[bot] Jun 21, 2022
bfeb2c9
Merge pull request #5403 from EC-CUBE/dependabot/composer/guzzlehttp/…
chihiro-adachi Jun 22, 2022
b8b3966
Merge branch 'EC-CUBE:4.1' into patch-1
Jun 24, 2022
81c50dd
Merge pull request #5369 from kiy0taka/dev/initialize_on_first_startup
chihiro-adachi Jul 12, 2022
0db130e
商品CSV登録で商品コードの項目がなければ更新を無視するように対応
k-yamamura Jul 13, 2022
b7fafd5
Update messages.en.yaml
talalio Jul 13, 2022
781b44d
Merge pull request #5389 from 5ym/patch-1
chihiro-adachi Jul 21, 2022
3070826
Merge pull request #5441 from maborosh1/maborosh1-patch-1
chihiro-adachi Jul 21, 2022
091b3b1
Merge pull request #5438 from k-yamamura/feature-productcsvimport
chihiro-adachi Jul 21, 2022
36cbdeb
受注登録時に電話番号のバリデーションを効くように修正
kiy0taka Jul 22, 2022
74d7919
使用されていないhiddenを削除
kiy0taka Jul 22, 2022
25e7b1c
Merge pull request #5464 from kiy0taka/fix/order-phone-number-validation
carkn Jul 22, 2022
064e59c
$this->form->isValid()は常にfalseになるので、テスト対象のフォームごとに確認するように変更
kiy0taka Jul 22, 2022
fbee989
郵便番号のバリデーションが効くように修正
kiy0taka Jul 22, 2022
92b9393
Merge pull request #5466 from kiy0taka/fix/remove-unuse-hidden
carkn Jul 25, 2022
e09643d
Merge pull request #5469 from kiy0taka/fix/improved-order-type-test
chihiro-adachi Aug 2, 2022
d5b681c
Merge pull request #5470 from kiy0taka/fix/order-type-constraints
chihiro-adachi Aug 2, 2022
d66ba86
Merge remote-tracking branch 'origin/4.1' into merge-41
chihiro-adachi Aug 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/deny-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,17 @@ jobs:
run: ${{ github.event.repository.name }}/package.sh

- name: Build Container
run: docker build -t ec-cube --build-arg SKIP_INSTALL_SCRIPT_ON_DOCKER_BUILD=true .
run: docker build -t ec-cube .

- name: Container Run
run: |
docker run -e APP_ENV=prod -e APP_DEBUG=0 -e DATABASE_URL="sqlite:///var/eccube.db" -e DATABASE_SERVER_VERSION=3 --rm -d -p 8080:80 --name eccube ec-cube
echo -n $(docker inspect -f {{.State.Health.Status}} eccube)
until [ $(docker inspect -f {{.State.Health.Status}} eccube) != "starting" ]; do
echo -n .
sleep 10;
done;
docker inspect -f {{.State.Health.Status}} eccube
docker cp ../eccube.tar.gz eccube:/tmp/
docker exec -w /tmp eccube bash -c "rm -rf /var/www/html; tar xf /tmp/eccube.tar.gz -C /var/www; mv /var/www/ec-cube /var/www/html; chown -R www-data: /var/www/html"
docker exec -u www-data eccube bin/console eccube:install -n
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/dockerbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@master

- name: docker build
run: docker-compose build
run: docker compose build

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -70,11 +70,9 @@ jobs:
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml up -d
docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml exec -T ec-cube bin/console doctrine:schema:create --env=dev
docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml exec -T ec-cube bin/console eccube:fixtures:load --env=dev
docker compose -f docker-compose.yml -f docker-compose.pgsql.yml up -d --wait
sed -i 's!APP_ENV: "dev"!APP_ENV: "prod"!g' docker-compose.yml
docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml up -d
docker compose -f docker-compose.yml -f docker-compose.pgsql.yml up -d --wait

- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
Expand Down
40 changes: 1 addition & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,35 +61,12 @@ RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY dockerbuild/php.ini $PHP_INI_DIR/conf.d/
COPY dockerbuild/docker-php-entrypoint /usr/local/bin/

RUN chown www-data:www-data /var/www \
&& mkdir -p ${APACHE_DOCUMENT_ROOT}/vendor \
&& mkdir -p ${APACHE_DOCUMENT_ROOT}/var \
&& chown www-data:www-data ${APACHE_DOCUMENT_ROOT}/vendor \
&& chmod g+s ${APACHE_DOCUMENT_ROOT}/vendor \
&& chown www-data:www-data ${APACHE_DOCUMENT_ROOT}/var

RUN curl -sS https://getcomposer.org/installer \
| php \
&& mv composer.phar /usr/bin/composer

# 全体コピー前にcomposer installを先行完了させる(docker cache利用によるリビルド速度向上)

RUN composer config -g repos.packagist composer https://packagist.jp
COPY composer.json ${APACHE_DOCUMENT_ROOT}/composer.json
COPY composer.lock ${APACHE_DOCUMENT_ROOT}/composer.lock
RUN chown www-data:www-data ${APACHE_DOCUMENT_ROOT}/composer.*

USER www-data
RUN composer install \
--no-scripts \
--no-autoloader \
--no-plugins \
-d ${APACHE_DOCUMENT_ROOT} \
;

##################################################################
# ファイル変更時、以後のステップにはキャッシュが効かなくなる
USER root
COPY . ${APACHE_DOCUMENT_ROOT}
WORKDIR ${APACHE_DOCUMENT_ROOT}

Expand All @@ -99,19 +76,4 @@ RUN find ${APACHE_DOCUMENT_ROOT} \( -path ${APACHE_DOCUMENT_ROOT}/vendor -prune
| xargs -0 chmod g+s \
;

USER www-data
RUN composer dumpautoload -o --apcu

RUN if [ ! -f ${APACHE_DOCUMENT_ROOT}/.env ]; then \
cp -p .env.dist .env \
; fi

# trueを指定した場合、DBマイグレーションやECCubeのキャッシュ作成をスキップする。
# ビルド時点でDBを起動出来ない場合等に指定が必要となる。
ARG SKIP_INSTALL_SCRIPT_ON_DOCKER_BUILD=false

RUN if [ ! -f ${APACHE_DOCUMENT_ROOT}/var/eccube.db ] && [ ! ${SKIP_INSTALL_SCRIPT_ON_DOCKER_BUILD} = "true" ]; then \
composer run-script installer-scripts && composer run-script auto-scripts \
; fi

USER root
HEALTHCHECK --interval=10s --timeout=5s --retries=30 CMD pgrep apache
10 changes: 8 additions & 2 deletions docker-compose.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ volumes:
services:
ec-cube:
depends_on:
- mysql
mysql:
condition: service_healthy
environment:
DATABASE_URL: "mysql://dbuser:secret@mysql/eccubedb"
DATABASE_SERVER_VERSION: 5.7
Expand All @@ -17,12 +18,17 @@ services:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eccubedb
MYSQL_USER: dbuser
MYSQL_PASSWORD: secret
volumes:
- mysql-database:/var/lib/mysql
- ./dockerbuild/grant_to_dbuser.sql:/docker-entrypoint-initdb.d/grant_to_dbuser.sql
ports:
- 13306:3306
networks:
- backend
healthcheck:
test: mysqladmin ping
interval: 3s
timeout: 3s
retries: 3
9 changes: 7 additions & 2 deletions docker-compose.pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ volumes:
services:
ec-cube:
depends_on:
- postgres
postgres:
condition: service_healthy
environment:
DATABASE_URL: "postgres://dbuser:secret@postgres/eccubedb"
DATABASE_SERVER_VERSION: 14
Expand All @@ -16,7 +17,6 @@ services:
postgres:
image: postgres:14
environment:
POSTGRES_DB: eccubedb
POSTGRES_USER: dbuser
POSTGRES_PASSWORD: secret
ports:
Expand All @@ -25,3 +25,8 @@ services:
- pg-database:/var/lib/postgresql/data
networks:
- backend
healthcheck:
test: pg_isready -U dbuser
interval: 3s
timeout: 3s
retries: 3
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ services:
ec-cube:
build:
context: .
args:
# ビルド時のECCubeインストールスクリプトをスキップする場合にtrueを指定する。
# ビルド時点でDBサーバの起動や接続が出来ない、という場合等にエラーとなるため。
SKIP_INSTALL_SCRIPT_ON_DOCKER_BUILD: "true"
ports:
- 8080:80
- 4430:443
Expand Down
22 changes: 22 additions & 0 deletions dockerbuild/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
#!/bin/sh
set -e

if [ ! -d /var/www/html/vendor/bin ]; then
composer install \
--no-scripts \
--no-autoloader \
--no-plugins \
-d ${APACHE_DOCUMENT_ROOT}
composer dumpautoload -o --apcu
chown -R www-data: vendor
fi

bin/console doctrine:query:sql 'select * from dtb_base_info' > /dev/null 2>&1 || (
if [ -z ${DATABASE_URL} ]; then
cp .env.dist .env
fi
composer run-script installer-scripts
composer run-script auto-scripts
find ${APACHE_DOCUMENT_ROOT} \( -path ${APACHE_DOCUMENT_ROOT}/vendor -prune \) -or -print0 \
| xargs -0 chown www-data:www-data
find ${APACHE_DOCUMENT_ROOT} \( -path ${APACHE_DOCUMENT_ROOT}/vendor -prune \) -or \( -type d -print0 \) \
| xargs -0 chmod g+s
)

echo "PassEnv APP_ENV APP_DEBUG TRUSTED_PROXIES TRUSTED_HOSTS" > /etc/apache2/conf-enabled/eccube_env.conf

# first arg is `-f` or `--some-option`
Expand Down
1 change: 1 addition & 0 deletions dockerbuild/grant_to_dbuser.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GRANT ALL PRIVILEGES ON *.* TO 'dbuser'@'%';
20 changes: 12 additions & 8 deletions src/Eccube/Controller/Admin/Product/CsvImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1132,10 +1132,12 @@ protected function createProductClass($row, Product $Product, $data, $headerByKe
}
}

if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
$ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
} else {
$ProductClass->setCode(null);
if (isset($row[$headerByKey['product_code']])) {
if (StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
$ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
} else {
$ProductClass->setCode(null);
}
}

if (!isset($row[$headerByKey['stock_unlimited']])
Expand Down Expand Up @@ -1310,10 +1312,12 @@ protected function updateProductClass($row, Product $Product, ProductClass $Prod
}
}

if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
$ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
} else {
$ProductClass->setCode(null);
if (isset($row[$headerByKey['product_code']])) {
if (StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
$ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
} else {
$ProductClass->setCode(null);
}
}

if (!isset($row[$headerByKey['stock_unlimited']])
Expand Down
12 changes: 4 additions & 8 deletions src/Eccube/Form/Type/PhoneNumberType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TelType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints as Assert;

Expand Down Expand Up @@ -56,29 +55,26 @@ public function buildForm(FormBuilderInterface $builder, array $options)
*/
public function configureOptions(OptionsResolver $resolver)
{
$eccubeConfig = $this->eccubeConfig;
$constraints = function (Options $options) use ($eccubeConfig) {
$resolver->setNormalizer('constraints', function($options, $value) {
$constraints = [];
// requiredがtrueに指定されている場合, NotBlankを追加
if (isset($options['required']) && true === $options['required']) {
$constraints[] = new Assert\NotBlank();
}

$constraints[] = new Assert\Length([
'max' => $eccubeConfig['eccube_tel_len_max'],
'max' => $this->eccubeConfig['eccube_tel_len_max'],
]);

$constraints[] = new Assert\Type([
'type' => 'digit',
'message' => 'form_error.numeric_only',
]);

return $constraints;
};
return array_merge($constraints, $value);
});

$resolver->setDefaults([
'options' => ['constraints' => []],
'constraints' => $constraints,
'attr' => [
'placeholder' => 'common.phone_number_sample',
],
Expand Down
11 changes: 4 additions & 7 deletions src/Eccube/Form/Type/PostalType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TelType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints as Assert;

Expand Down Expand Up @@ -55,29 +54,27 @@ public function buildForm(FormBuilderInterface $builder, array $options)
*/
public function configureOptions(OptionsResolver $resolver)
{
$eccubeConfig = $this->eccubeConfig;
$constraints = function (Options $options) use ($eccubeConfig) {
$resolver->setNormalizer('constraints', function($options, $value) {
$constraints = [];
// requiredがtrueに指定されている場合, NotBlankを追加
if (isset($options['required']) && true === $options['required']) {
$constraints[] = new Assert\NotBlank();
}

$constraints[] = new Assert\Length([
'max' => $eccubeConfig['eccube_postal_code'],
'max' => $this->eccubeConfig['eccube_postal_code'],
]);

$constraints[] = new Assert\Type([
'type' => 'digit',
'message' => 'form_error.numeric_only',
]);

return $constraints;
};
return array_merge($constraints, $value);
});

$resolver->setDefaults([
'options' => [],
'constraints' => $constraints,
'attr' => [
'class' => 'p-postal-code',
'placeholder' => 'common.postal_code_sample',
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Resource/locale/messages.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ front.shopping.confirm_title: Review Your Order
front.shopping.checkout: Place an Order
front.shopping.back_to_order: Go back to Checkout
front.shopping.complete_title: Order Placed
front.shopping.complete_message__title: Thank you for your oder!
front.shopping.complete_message__title: Thank you for your order!
front.shopping.complete_message__body: |
We have sent an order confirmation email.
In case you do not receive it, please contact us as your order may have not been received.
Expand Down
1 change: 0 additions & 1 deletion src/Eccube/Resource/template/admin/Order/edit.twig
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ file that was distributed with this source code.
</div>
<form name="form1" id="form1" method="post" action="?"{% if BaseInfo.isOptionPoint and Order.Customer is not null %} onsubmit="updatePointItem()"{% endif %}>
<input type="hidden" name="mode" value="">
<input type="hidden" name="modal" value="">
{{ form_widget(form._token) }}
{{ form_widget(form.return_link) }}
<div class="c-contentsArea__cols">
Expand Down
Loading