Skip to content

Commit d4ef6d7

Browse files
authored
Merge pull request PrestaShop#61 from PrestaShop/dev
Release 2.6.0
2 parents 0ef14fa + c1f1b16 commit d4ef6d7

38 files changed

+1064
-657
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-----------------------------------------------------------------------------
2+
Thank you for contributing to the PrestaShop project!
3+
4+
Please take the time to edit the "Answers" rows below with the necessary information.
5+
6+
Check out our contribution guidelines to find out how to complete it:
7+
https://devdocs.prestashop.com/1.7/contribute/contribution-guidelines/#pull-requests
8+
------------------------------------------------------------------------------>
9+
10+
| Questions | Answers
11+
| ------------- | -------------------------------------------------------
12+
| Description? | Please be specific when describing the PR. <br> Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table.
13+
| Type? | bug fix / improvement / new feature / refacto / critical
14+
| BC breaks? | yes / no
15+
| Deprecations? | yes / no
16+
| Fixed ticket? | Fixes PrestaShop/Prestashop#{issue number here}.
17+
| How to test? | Please indicate how to best verify that this PR is correct.
18+
19+
<!-- Click the form's "Preview" button to make sure the table is functional in GitHub. Thank you! -->

.github/release-drafter.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
branches:
2+
- master
3+
name-template: v$NEXT_PATCH_VERSION
4+
tag-template: v$NEXT_PATCH_VERSION
5+
categories:
6+
- title: 🚀 Improvements
7+
label: enhancement
8+
- title: 🐛 Bug Fixes
9+
label: bug
10+
change-template: '- #$NUMBER: $TITLE by @$AUTHOR'
11+
template: |
12+
# Changes
13+
14+
$CHANGES

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/config_*.xml
22
/translations/*.php
3+
/vendor

.travis.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
language: node_js
2+
3+
notifications:
4+
email:
5+
on_success: never
6+
7+
jobs:
8+
include:
9+
- stage: "PHP"
10+
name: "PHPStan on PS nightly and unit tests"
11+
language: php
12+
php: 7.2
13+
script:
14+
- composer install
15+
# PHP syntax check
16+
- bash -c '! (find . -name "*.php" ! -path "./vendor/*" -print0 | xargs -0 -n1 -P4 php -l | grep "Parse error")'
17+
# PHP cs fixer
18+
# - composer run lint
19+
# PHP Unit
20+
# - composer run test
21+
# PHP Stan
22+
- docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:nightly
23+
# - docker exec -ti temp-ps rm -rf /var/www/html/modules/ps_emailsubscription
24+
# - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/ps_emailsubscription -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/ps_emailsubscription/tests/php/phpstan/phpstan.neon
25+
- stage: "PHP"
26+
name: "PHPStan on PS 1.7.5.2"
27+
language: php
28+
php: 7.2
29+
script:
30+
- composer install
31+
- docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.5.1
32+
# - docker exec -ti temp-ps rm -rf /var/www/html/modules/ps_emailsubscription
33+
# - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/ps_emailsubscription -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/ps_emailsubscription/tests/php/phpstan/phpstan.neon
34+
- stage: "PHP"
35+
name: "PHPStan on PS 1.7.4.4"
36+
language: php
37+
php: 7.2
38+
script:
39+
- composer install
40+
- docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.4.4
41+
# - docker exec -ti temp-ps rm -rf /var/www/html/modules/ps_emailsubscription
42+
# - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/ps_emailsubscription -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/ps_emailsubscription/tests/php/phpstan/phpstan.neon
43+
- stage: "PHP"
44+
name: "PHPStan on PS 1.7.3.4"
45+
language: php
46+
php: 7.2
47+
script:
48+
- composer install
49+
- docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.3.4
50+
# - docker exec -ti temp-ps rm -rf /var/www/html/modules/ps_emailsubscription
51+
# - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/ps_emailsubscription -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/ps_emailsubscription/tests/php/phpstan/phpstan.neon
52+
- stage: "PHP"
53+
name: "PHPStan on PS 1.7.2.5"
54+
language: php
55+
php: 7.2
56+
script:
57+
- composer install
58+
- docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.2.5
59+
#- docker exec -ti temp-ps rm -rf /var/www/html/modules/ps_emailsubscription
60+
#- docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/ps_emailsubscription -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/ps_emailsubscription/tests/php/phpstan/phpstan.neon
61+
- stage: "PHP"
62+
name: "PHPStan on PS 1.7.1.2"
63+
language: php
64+
php: 7.2
65+
script:
66+
- composer install
67+
- docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.1.2
68+
# - docker exec -ti temp-ps rm -rf /var/www/html/modules/ps_emailsubscription
69+
# - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/ps_emailsubscription -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/ps_emailsubscription/tests/php/phpstan/phpstan.neon

Readme.md renamed to README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
Adds a block for newsletter subscription.
66

7+
## Multistore compatibility
8+
9+
This module is partially compatible with the multistore feature. Some of its options might not be available.
10+
711
## Reporting issues
812

913
You can report issues with this module in the main PrestaShop repository. [Click here to report an issue][report-issue].

composer.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<module>
33
<name>ps_emailsubscription</name>
44
<displayName><![CDATA[E-mail subscription form]]></displayName>
5-
<version><![CDATA[2.5.1]]></version>
5+
<version><![CDATA[2.6.0]]></version>
66
<description><![CDATA[Adds a block for newsletter subscription.]]></description>
77
<author><![CDATA[PrestaShop]]></author>
88
<confirmUninstall><![CDATA[Are you sure that you want to delete all of your contacts?]]></confirmUninstall>

controllers/front/index.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
<?php
2-
/*
3-
* 2007-2015 PrestaShop
4-
*
5-
* NOTICE OF LICENSE
6-
*
7-
* This source file is subject to the Academic Free License (AFL 3.0)
8-
* that is bundled with this package in the file LICENSE.txt.
9-
* It is also available through the world-wide-web at this URL:
10-
* http://opensource.org/licenses/afl-3.0.php
11-
* If you did not receive a copy of the license and are unable to
12-
* obtain it through the world-wide-web, please send an email
13-
* to [email protected] so we can send you a copy immediately.
14-
*
15-
* DISCLAIMER
16-
*
17-
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18-
* versions in the future. If you wish to customize PrestaShop for your
19-
* needs please refer to http://www.prestashop.com for more information.
20-
*
21-
* @author PrestaShop SA <[email protected]>
22-
* @copyright 2007-2015 PrestaShop SA
23-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24-
* International Registered Trademark & Property of PrestaShop SA
25-
*/
26-
2+
/**
3+
* 2007-2020 PrestaShop.
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* https://opensource.org/licenses/AFL-3.0
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18+
* versions in the future. If you wish to customize PrestaShop for your
19+
* needs please refer to http://www.prestashop.com for more information.
20+
*
21+
* @author PrestaShop SA <[email protected]>
22+
* @copyright 2007-2020 PrestaShop SA
23+
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
24+
* International Registered Trademark & Property of PrestaShop SA
25+
*/
26+
2727
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
2828
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
29-
29+
3030
header("Cache-Control: no-store, no-cache, must-revalidate");
3131
header("Cache-Control: post-check=0, pre-check=0", false);
3232
header("Pragma: no-cache");
33-
33+
3434
header("Location: ../");
35-
exit;
35+
exit;

controllers/front/subscription.php

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<?php
2-
/*
3-
* 2007-2015 PrestaShop
4-
*
5-
* NOTICE OF LICENSE
6-
*
7-
* This source file is subject to the Academic Free License (AFL 3.0)
8-
* that is bundled with this package in the file LICENSE.txt.
9-
* It is also available through the world-wide-web at this URL:
10-
* http://opensource.org/licenses/afl-3.0.php
11-
* If you did not receive a copy of the license and are unable to
12-
* obtain it through the world-wide-web, please send an email
13-
* to [email protected] so we can send you a copy immediately.
14-
*
15-
* DISCLAIMER
16-
*
17-
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18-
* versions in the future. If you wish to customize PrestaShop for your
19-
* needs please refer to http://www.prestashop.com for more information.
20-
*
21-
* @author PrestaShop SA <[email protected]>
22-
* @copyright 2007-2015 PrestaShop SA
23-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24-
* International Registered Trademark & Property of PrestaShop SA
25-
*/
2+
/**
3+
* 2007-2020 PrestaShop.
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* https://opensource.org/licenses/AFL-3.0
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18+
* versions in the future. If you wish to customize PrestaShop for your
19+
* needs please refer to http://www.prestashop.com for more information.
20+
*
21+
* @author PrestaShop SA <[email protected]>
22+
* @copyright 2007-2020 PrestaShop SA
23+
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
24+
* International Registered Trademark & Property of PrestaShop SA
25+
*/
2626

2727
/**
2828
* @since 1.5.0
@@ -36,12 +36,11 @@ class Ps_EmailsubscriptionSubscriptionModuleFrontController extends ModuleFrontC
3636
*/
3737
public function postProcess()
3838
{
39-
4039
$this->variables['value'] = Tools::getValue('email', '');
4140
$this->variables['msg'] = '';
4241
$this->variables['conditions'] = Configuration::get('NW_CONDITIONS', $this->context->language->id);
4342

44-
if (Tools::isSubmit('submitNewsletter')) {
43+
if (Tools::isSubmit('submitNewsletter') || $this->ajax) {
4544
$this->module->newsletterRegistration();
4645
if ($this->module->error) {
4746
$this->variables['msg'] = $this->module->error;
@@ -50,8 +49,12 @@ public function postProcess()
5049
$this->variables['msg'] = $this->module->valid;
5150
$this->variables['nw_error'] = false;
5251
}
53-
}
5452

53+
if ($this->ajax) {
54+
header('Content-Type: application/json');
55+
$this->ajaxDie(json_encode($this->variables));
56+
}
57+
}
5558
}
5659

5760
/**

controllers/front/verification.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<?php
2-
/*
3-
* 2007-2015 PrestaShop
4-
*
5-
* NOTICE OF LICENSE
6-
*
7-
* This source file is subject to the Academic Free License (AFL 3.0)
8-
* that is bundled with this package in the file LICENSE.txt.
9-
* It is also available through the world-wide-web at this URL:
10-
* http://opensource.org/licenses/afl-3.0.php
11-
* If you did not receive a copy of the license and are unable to
12-
* obtain it through the world-wide-web, please send an email
13-
* to [email protected] so we can send you a copy immediately.
14-
*
15-
* DISCLAIMER
16-
*
17-
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18-
* versions in the future. If you wish to customize PrestaShop for your
19-
* needs please refer to http://www.prestashop.com for more information.
20-
*
21-
* @author PrestaShop SA <[email protected]>
22-
* @copyright 2007-2015 PrestaShop SA
23-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24-
* International Registered Trademark & Property of PrestaShop SA
25-
*/
2+
/**
3+
* 2007-2020 PrestaShop.
4+
*
5+
* NOTICE OF LICENSE
6+
*
7+
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
8+
* that is bundled with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* https://opensource.org/licenses/AFL-3.0
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to [email protected] so we can send you a copy immediately.
14+
*
15+
* DISCLAIMER
16+
*
17+
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
18+
* versions in the future. If you wish to customize PrestaShop for your
19+
* needs please refer to http://www.prestashop.com for more information.
20+
*
21+
* @author PrestaShop SA <[email protected]>
22+
* @copyright 2007-2020 PrestaShop SA
23+
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
24+
* International Registered Trademark & Property of PrestaShop SA
25+
*/
2626

2727
/**
2828
* @since 1.5.0

0 commit comments

Comments
 (0)