Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
74d0ba4
Modify user agent handling in contact form
Hlavtox Nov 14, 2025
53cace9
Update php.yml
Hlavtox Nov 15, 2025
1cf36de
Merge pull request #85 from Hlavtox/bump-ci
kpodemski Nov 15, 2025
36c0389
Merge pull request #84 from Hlavtox/prevent-user-agent-failure
kpodemski Nov 15, 2025
07ce853
Update contactform.php
Hlavtox Nov 16, 2025
932c8ff
Update version number to 4.4.4
Hlavtox Nov 16, 2025
15d37dd
Merge pull request #86 from Hlavtox/bump444
Hlavtox Nov 17, 2025
6df340b
contactform: hide subject select when only one contact
Codencode Feb 12, 2026
2dde702
Fix: Escape contact name in select option
Codencode Feb 12, 2026
907f9f5
Fix CI
Touxten Feb 18, 2026
7078f44
compilance
Touxten Feb 18, 2026
7096b29
Update Readme
Touxten Feb 18, 2026
d919d30
Add missing
Touxten Feb 18, 2026
71d795c
Update repo for test
Touxten Feb 20, 2026
71dbb40
Test
Touxten Feb 20, 2026
ce6e3e4
catch eror
Touxten Feb 20, 2026
abd3085
Restore PrestaShop Repo
Touxten Feb 21, 2026
e59bc59
Compilance
Touxten Feb 22, 2026
551f47a
Merge pull request #89 from Touxten/dev
jf-viguier Feb 25, 2026
8351f97
Merge pull request #88 from Codencode/contactform-hide-subject-when-s…
Codencode Feb 25, 2026
590d76b
github: new workflow to add issue to project
ga-devfront Mar 2, 2026
1412069
Merge pull request #90 from PrestaShop/github/add-issue-to-project
ga-devfront Mar 2, 2026
06e147c
CI : PHPStan with common action
Jun 15, 2026
dc96c92
Merge pull request #92 from Progi1984/ci
nicosomb Jun 18, 2026
ef2a5cd
Support for PS 8.2+
Jun 18, 2026
43fdd15
Merge pull request #93 from Progi1984/ci
jf-viguier Jun 18, 2026
ec8d8fb
PHP support from 7.2 to 8.5 (PS 8.2+)
Jun 19, 2026
8770d93
Merge pull request #94 from Progi1984/ci
jf-viguier Jun 19, 2026
c7d24b3
CI : Dependabot (PHP / Node / Github Actions)
Jun 22, 2026
68452b3
Merge pull request #95 from Progi1984/ci
jf-viguier Jun 22, 2026
8229294
Support for PS 9.2.x
Jul 15, 2026
0f951db
Merge pull request #97 from Progi1984/ci
nicosomb Jul 16, 2026
e0606f6
Replace 9.1.x branch with 9.1.4 tag in CI
jolelievre Aug 6, 2026
6b78ab4
Merge pull request #99 from jolelievre/update-ci-9.1.x-to-9.1.4
jolelievre Aug 6, 2026
0053277
CI: pin PrestaShop 9.1.5 instead of the superseded 9.1.4 tag
mattgoud Aug 28, 2026
10ef9aa
Merge pull request #101 from mattgoud/ci/pin-9.1.5
jolelievre Aug 31, 2026
8ebc42d
Bump 5.0.0
jolelievre Sep 10, 2026
4964be9
Merge pull request #105 from jolelievre/bump-500
jolelievre Sep 10, 2026
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
11 changes: 9 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
version: 2
updates:
- package-ecosystem: npm
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: composer
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/add-issue-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Add Issue to Project

on:
issues:
types: [ opened ]

jobs:
add-to-project:
uses: PrestaShop/.github/.github/workflows/reusable-add-to-project.yml@master
with:
project-number: 47
secrets:
TOKEN: ${{ secrets.JARVIS_TOKEN }}
165 changes: 110 additions & 55 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
name: PHP tests
on: [push, pull_request]
jobs:
# Check there is no syntax errors in the project
php-linter:
name: PHP Syntax check 5.4 => 8.1
name: PHP Syntax check 7.2 => 8.5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: PHP syntax checker 5.4
uses: prestashop/github-action-php-lint/5.6@master

- name: PHP syntax checker 5.5
uses: prestashop/github-action-php-lint/5.6@master

- name: PHP syntax checker 5.6
uses: prestashop/github-action-php-lint/5.6@master
uses: actions/checkout@v3.1.0

- name: PHP syntax checker 7.2
uses: prestashop/github-action-php-lint/7.2@master
Expand All @@ -33,63 +23,128 @@ jobs:
- name: PHP syntax checker 8.1
uses: prestashop/github-action-php-lint/8.1@master

- name: PHP syntax checker 8.2
uses: prestashop/github-action-php-lint/8.2@master

- name: PHP syntax checker 8.3
uses: prestashop/github-action-php-lint/8.3@master

- name: PHP syntax checker 8.4
uses: prestashop/github-action-php-lint/8.4@master

- name: PHP syntax checker 8.5
uses: prestashop/github-action-php-lint/8.5@master

# Check the PHP code follow the coding standards
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Run PHP-CS-Fixer
uses: PrestaShop/.github/.github/actions/php-ci/php-cs@master
with:
php-version: '7.4'

- name: Checkout
uses: actions/checkout@v2.0.0

- name: Cache dependencies
uses: actions/cache@v2
# Run PHPStan against the module (PHP 7.4 – PS 8.2)
phpstan-74-81:
name: PHPStan (PHP 7.4 - 8.1)
runs-on: ubuntu-latest
strategy:
matrix:
presta_version: ['8.2.x']
php_version: ['7.4', '8.1']
fail-fast: false
env:
PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}

- name: Install dependencies
run: composer install

- name: Run PHP-CS-Fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --diff-format udiff

# Run PHPStan against the module and a PrestaShop release
phpstan:
name: PHPStan
path: ${{ github.event.repository.name }}

- name: Prepare PHP env for PrestaShop 8 (define constants before any bootstrap)
run: |
mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini
{
echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php"
echo "memory_limit=512M"
} > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini

- name: Run PHPStan
uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master
with:
php-version: ${{ matrix.php_version }}
presta-version: ${{ matrix.presta_version }}
module-name: ${{ github.event.repository.name }}
phpstan-level: '5'
phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon
phpstan-version: '^0.12'
composer-version: '2.2.18'

# Run PHPStan against the module (PHP 8.1 – 8.4)
phpstan-81-84:
name: PHPStan (PHP 8.1 - 8.4)
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ['1.7.2.5', '1.7.3.4', '1.7.4.4', '1.7.5.1', '1.7.6', '1.7.7', '1.7.8', 'latest']
presta_version: ['9.0.3']
php_version: ['8.1', '8.4']
fail-fast: false
env:
PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Checkout repository
uses: actions/checkout@v6
with:
php-version: '7.4'

- name: Checkout
uses: actions/checkout@v2.0.0

# Add vendor folder in cache to make next builds faster
- name: Cache vendor folder
uses: actions/cache@v1
path: ${{ github.event.repository.name }}

- name: Prepare PHP env for PrestaShop 9.1.x and later (define constants before any bootstrap)
run: |
mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini
{
echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php"
echo "memory_limit=512M"
} > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini

- name: Run PHPStan
uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
php-version: ${{ matrix.php_version }}
presta-version: ${{ matrix.presta_version }}
module-name: ${{ github.event.repository.name }}
phpstan-level: '5'
phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon

# Add composer local folder in cache to make next builds faster
- name: Cache composer folder
uses: actions/cache@v1
# Run PHPStan against the module (PHP 8.1 – 8.5)
phpstan:
name: PHPStan (PHP 8.1 - 8.5)
runs-on: ubuntu-latest
strategy:
matrix:
presta_version: ['9.1.5', '9.2.x', 'develop']
php_version: ['8.1', '8.5']
fail-fast: false
env:
PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: ~/.composer/cache
key: php-composer-cache

- run: composer install

# Docker images prestashop/prestashop may be used, even if the shop remains uninstalled
- name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }})
run: ./tests/phpstan.sh ${{ matrix.presta-versions }}
path: ${{ github.event.repository.name }}

- name: Prepare PHP env for PrestaShop 9.1.x and later (define constants before any bootstrap)
run: |
mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini
{
echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php"
echo "memory_limit=512M"
} > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini

- name: Run PHPStan
uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master
with:
php-version: ${{ matrix.php_version }}
presta-version: ${{ matrix.presta_version }}
module-name: ${{ github.event.repository.name }}
phpstan-level: '5'
phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Help your customers get in touch when they need, add a contact form on your stor

## Compatibility

PrestaShop: `1.7.2.0` or later
PrestaShop: `8.2.0` or later

## How to test

Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>contactform</name>
<displayName><![CDATA[Contact form]]></displayName>
<version><![CDATA[4.4.3]]></version>
<version><![CDATA[5.0.0]]></version>
<description><![CDATA[Adds a contact form to the "Contact us" page.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
Expand Down
15 changes: 12 additions & 3 deletions contactform.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct()
$this->name = 'contactform';
$this->author = 'PrestaShop';
$this->tab = 'front_office_features';
$this->version = '4.4.3';
$this->version = '5.0.0';
$this->bootstrap = true;

parent::__construct();
Expand All @@ -66,7 +66,7 @@ public function __construct()
'Modules.Contactform.Admin'
);
$this->ps_versions_compliancy = [
'min' => '1.7.2.0',
'min' => '8.2.0',
'max' => _PS_VERSION_,
];
}
Expand Down Expand Up @@ -530,7 +530,16 @@ public function sendMessage()
@chmod(_PS_UPLOAD_DIR_ . basename($file_attachment['rename']), 0664);
}
$cm->ip_address = (string) ip2long(Tools::getRemoteAddr());
$cm->user_agent = $_SERVER['HTTP_USER_AGENT'];

/*
* Adjust user agent length depending on PrestaShop version used.
* The limit was raised on 9.0.2.
*/
if (version_compare(_PS_VERSION_, '9.0.2', '>=')) {
$cm->user_agent = substr($_SERVER['HTTP_USER_AGENT'] ?? '', 0, 255);
} else {
$cm->user_agent = substr($_SERVER['HTTP_USER_AGENT'] ?? '', 0, 128);
}

if (!$cm->add()) {
$this->context->controller->errors[] = $this->trans(
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions tests/php/phpstan/phpstan-8.2.x.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon

parameters:
ignoreErrors:
- '#Access to an undefined property Cookie\:\:\$contactFormToken.#'
7 changes: 7 additions & 0 deletions tests/php/phpstan/phpstan-9.0.3.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon

parameters:
ignoreErrors:
- '#Access to an undefined property Cookie\:\:\$contactFormToken.#'
- '#Call to an undefined static method Tools\:\:stripslashes\(\).#'
7 changes: 7 additions & 0 deletions tests/php/phpstan/phpstan-9.1.5.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon

parameters:
ignoreErrors:
- '#Access to an undefined property Cookie\:\:\$contactFormToken.#'
- '#Call to an undefined static method Tools\:\:stripslashes\(\).#'
7 changes: 7 additions & 0 deletions tests/php/phpstan/phpstan-9.2.x.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon

parameters:
ignoreErrors:
- '#Access to an undefined property Cookie\:\:\$contactFormToken.#'
- '#Call to an undefined static method Tools\:\:stripslashes\(\).#'
7 changes: 7 additions & 0 deletions tests/php/phpstan/phpstan-develop.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- %currentWorkingDirectory%/tests/php/phpstan/phpstan.neon

parameters:
ignoreErrors:
- '#Access to an undefined property Cookie\:\:\$contactFormToken.#'
- '#Call to an undefined static method Tools\:\:stripslashes\(\).#'
2 changes: 2 additions & 0 deletions tests/php/phpstan/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Base PHPStan configuration for the moduleExpand commentComment on line R2ResolvedCode has comments. Press enter to view.
# This file is included by version-specific configs
11 changes: 11 additions & 0 deletions tests/php/phpstan/prepend-constants.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Defines constants required by PrestaShop config (e.g. defines_uri.inc.php) when running
* PHPStan outside a full request. Loaded via auto_prepend_file in CI for 9.x jobs.
*/
if (!defined('_THEME_NAME_')) {
define('_THEME_NAME_', 'classic');
}
if (!defined('__PS_BASE_URI__')) {
define('__PS_BASE_URI__', '/');
}
28 changes: 0 additions & 28 deletions tests/phpstan.sh

This file was deleted.

10 changes: 0 additions & 10 deletions tests/phpstan/phpstan-1.7.2.5.neon

This file was deleted.

10 changes: 0 additions & 10 deletions tests/phpstan/phpstan-1.7.3.4.neon

This file was deleted.

Loading
Loading