diff --git a/.composer-require-checker.config.json b/.composer-require-checker.config.json index f49e224..841670d 100644 --- a/.composer-require-checker.config.json +++ b/.composer-require-checker.config.json @@ -47,6 +47,7 @@ "GALETTE_NIGHTLY", "GALETTE_PHOTOS_PATH", "GALETTE_PLUGINS_PATH", + "GALETTE_PLUGINS_DATA_PATH", "GALETTE_ROOT", "GALETTE_TELEMETRY_URI", "GALETTE_TEMPIMAGES_PATH", diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 8adbfcd..daadb79 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -25,7 +25,7 @@ jobs: strategy: matrix: - php-versions: [ '8.1', '8.4' ] + php-versions: [ '8.2', '8.4' ] coverage: [none] fail-fast: false @@ -73,7 +73,7 @@ jobs: ../../vendor/bin/phpcs lib/ ./*.php - name: CS Fixer - if: matrix.php-versions == '8.1' + if: matrix.php-versions == '8.2' run: | cd galette-core/galette/plugins/plugin-helloasso ../../vendor/bin/php-cs-fixer check --show-progress=dots --verbose --diff @@ -106,22 +106,20 @@ jobs: strategy: matrix: include: - #always tests higher stable php version with lower db version - #enable coverage on higher stable php version with higher postrgesql version #higher stable php version - { php-version: "8.4", db-image: "postgres:13", coverage: none, always: true } - - { php-version: "8.4", db-image: "postgres:17", coverage: none, always: true } + - { php-version: "8.4", db-image: "postgres:18", coverage: none, always: true } - { php-version: "8.4", db-image: "mysql:8.0", coverage: none, always: true } - - { php-version: "8.4", db-image: "mysql:9.1", coverage: none, always: false } - - { php-version: "8.4", db-image: "mariadb:10.5", coverage: none, always: true } - - { php-version: "8.4", db-image: "mariadb:11.6", coverage: none, always: false } + - { php-version: "8.4", db-image: "mysql:9.4", coverage: none, always: true } + - { php-version: "8.4", db-image: "mariadb:10.6", coverage: none, always: true } + - { php-version: "8.4", db-image: "mariadb:12.0", coverage: none, always: true } #lower php version - - { php-version: "8.1", db-image: "postgres:13", coverage: none, always: false } - - { php-version: "8.1", db-image: "postgres:17", coverage: none, always: false } - - { php-version: "8.1", db-image: "mysql:8.0", coverage: none, always: false } - - { php-version: "8.1", db-image: "mysql:9.1", coverage: none, always: false } - - { php-version: "8.1", db-image: "mariadb:10.5", coverage: none, always: false } - - { php-version: "8.1", db-image: "mariadb:11.6", coverage: none, always: false } + - { php-version: "8.2", db-image: "postgres:13", coverage: none, always: true } + - { php-version: "8.2", db-image: "postgres:18", coverage: none, always: true } + - { php-version: "8.2", db-image: "mysql:8.0", coverage: none, always: true } + - { php-version: "8.2", db-image: "mysql:9.4", coverage: none, always: true } + - { php-version: "8.2", db-image: "mariadb:10.6", coverage: none, always: true } + - { php-version: "8.2", db-image: "mariadb:12.0", coverage: none, always: true } fail-fast: false env: diff --git a/_define.php b/_define.php index 132f437..65d386b 100644 --- a/_define.php +++ b/_define.php @@ -26,7 +26,7 @@ 'Helloasso integration', //Short description 'Guillaume AGNIERAY', //Author '1.0.0-dev', //Version - '1.2.0', //Galette compatible version + '1.2.1', //Galette compatible version 'helloasso', //routing name and translation domain '2025-07-23', //Release date [ //Permissions needed diff --git a/lib/GaletteHelloasso/Controllers/HelloassoController.php b/lib/GaletteHelloasso/Controllers/HelloassoController.php index 851342b..ced0707 100644 --- a/lib/GaletteHelloasso/Controllers/HelloassoController.php +++ b/lib/GaletteHelloasso/Controllers/HelloassoController.php @@ -77,8 +77,8 @@ public function form(Request $request, Response $response): Response if (!$helloasso->isLoaded()) { $this->flash->addMessageNow( 'error', - _T("Payment could not work: An error occurred (that has been logged) while loading Helloasso settings from the database.
Please report the issue to the staff.", "helloasso") . - '
' . _T("Our apologies for the annoyance.", "helloasso") + _T("Payment could not work: An error occurred (that has been logged) while loading Helloasso settings from the database.
Please report the issue to the staff.", "helloasso") + . '
' . _T("Our apologies for the annoyance.", "helloasso") ); } @@ -432,19 +432,18 @@ public function webhook(Request $request, Response $response): Response // all goes well, we can proceed if ($real_contrib) { // Check contribution to set $contrib->errors to [] and handle contribution overlap - $valid = $contrib->check($check_contrib_args, [], []); + $valid = $contrib->setNoCheckLogin()->check($check_contrib_args, [], []); if ($valid !== true) { Analog::log( - 'Cannot create invalid contribution from Helloasso payment:' . - implode("\n ", $valid), + 'Cannot create invalid contribution from Helloasso payment:' + . implode("\n ", $valid), Analog::ERROR ); $hh->setState(HelloassoHistory::STATE_ERROR); return $response->withStatus(500, 'Internal error'); } - $store = $contrib->store(); - if ($store === true) { + if ($contrib->store()) { // contribution has been stored :) Analog::log( 'Helloasso payment has been successfully registered as a contribution', diff --git a/lib/GaletteHelloasso/Helloasso.php b/lib/GaletteHelloasso/Helloasso.php index 1b851a5..b56b6fc 100644 --- a/lib/GaletteHelloasso/Helloasso.php +++ b/lib/GaletteHelloasso/Helloasso.php @@ -128,8 +128,8 @@ public function load(): void default: //we've got a preference not intended Analog::log( - '[' . get_class($this) . '] unknown preference `' . - $row->nom_pref . '` in the database.', + '[' . get_class($this) . '] unknown preference `' + . $row->nom_pref . '` in the database.', Analog::WARNING ); } @@ -146,8 +146,8 @@ public function load(): void $this->loadContributionsTypes(); } catch (\Exception $e) { Analog::log( - '[' . get_class($this) . '] Cannot load helloasso settings |' . - $e->getMessage(), + '[' . get_class($this) . '] Cannot load helloasso settings |' + . $e->getMessage(), Analog::ERROR ); //consider plugin is not loaded when missing the main settings @@ -169,8 +169,8 @@ private function loadContributionsTypes(): void $this->amounts_loaded = true; } catch (\Exception $e) { Analog::log( - '[' . get_class($this) . '] Cannot load amounts from core contributions types' . - '` | ' . $e->getMessage(), + '[' . get_class($this) . '] Cannot load amounts from core contributions types' + . '` | ' . $e->getMessage(), Analog::ERROR ); //amounts are not loaded at this point @@ -262,16 +262,16 @@ public function store(): bool $edit = $this->zdb->execute($update); Analog::log( - '[' . get_class($this) . - '] Helloasso settings were sucessfully stored', + '[' . get_class($this) + . '] Helloasso settings were sucessfully stored', Analog::DEBUG ); return true; } catch (\Exception $e) { Analog::log( - '[' . get_class($this) . '] Cannot store helloasso settings' . - '` | ' . $e->getMessage(), + '[' . get_class($this) . '] Cannot store helloasso settings' + . '` | ' . $e->getMessage(), Analog::ERROR ); return false; @@ -377,8 +377,8 @@ public function checkout(array $metadata, float $amount): array|bool return json_decode($contents, true); } catch (\Exception $e) { Analog::log( - '[' . get_class($this) . '] Cannot create Helloasso checkout' . - '` | ' . $e->getMessage(), + '[' . get_class($this) . '] Cannot create Helloasso checkout' + . '` | ' . $e->getMessage(), Analog::ERROR ); return false; diff --git a/lib/GaletteHelloasso/HelloassoHistory.php b/lib/GaletteHelloasso/HelloassoHistory.php index ebda521..0e82207 100755 --- a/lib/GaletteHelloasso/HelloassoHistory.php +++ b/lib/GaletteHelloasso/HelloassoHistory.php @@ -162,8 +162,8 @@ public function getHelloassoHistory(): array $new[] = $o; } catch (\Exception $e) { Analog::log( - 'Error loading helloasso history entry #' . $o[$this->getPk()] . - ' ' . $e->getMessage(), + 'Error loading helloasso history entry #' . $o[$this->getPk()] + . ' ' . $e->getMessage(), Analog::WARNING ); } diff --git a/lib/GaletteHelloasso/PluginGaletteHelloasso.php b/lib/GaletteHelloasso/PluginGaletteHelloasso.php index 9cdbbdc..f0daf38 100644 --- a/lib/GaletteHelloasso/PluginGaletteHelloasso.php +++ b/lib/GaletteHelloasso/PluginGaletteHelloasso.php @@ -106,7 +106,7 @@ public static function getDashboardsContents(): array global $preferences; $contents = []; - if ($preferences->showPublicPages($login)) { + if ($preferences->showPublicPage($login, 'pref_publicpages_visibility_generic')) { $contents[] = [ 'label' => _T("Payment form", "helloasso"), 'route' => [