diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 53383d31023..81ecb17f1cd 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -59,6 +59,34 @@ jobs: key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} # Run all the precommit tools (defined in pre-commit-config.yaml). + - name: Extract PHP version + id: extract-php-version + run: | + PHP_VERSION=$(sed -n 's/.*\$arrayphpmaxversionwarning\s*=\s*array\s*(\s*\([0-9]\+\)\s*,\s*\([0-9]\+\).*/\1.\2/p' htdocs/install/check.php) + echo "PHP_VERSION=$PHP_VERSION" >> $GITHUB_ENV + + - name: Setup PHPCS + uses: shivammathur/setup-php@v2 + # Install proper php version, and also install phpcs which may be needed + if: | + ! cancelled() && + ( + steps.changed-php.outputs.any_changed == 'true' + || + ( + env.gh_event == 'push' + && ( + github.event.ref == 'refs/heads/develop' + || endsWith(github.event.ref, '.0') + ) + ) + ) + with: + php-version: ${{ env.PHP_VERSION }} # Version from check.php + coverage: none # disable xdebug, pcov + tools: phpcs + + # Run all the precommit tools (defined into pre-commit-config.yaml). # We can force exclusion of some of them here. - name: Run pre-commit hooks env: @@ -78,27 +106,6 @@ jobs: # files: | # **.php - - name: Setup PHPCS - uses: shivammathur/setup-php@v2 - # Install when we're going to run phpcs - if: | - ! cancelled() && - ( - steps.changed-php.outputs.any_changed == 'true' - || - ( - env.gh_event == 'push' - && ( - github.event.ref == 'refs/heads/develop' - || endsWith(github.event.ref, '.0') - ) - ) - ) - with: - php-version: 8.1 - coverage: none # disable xdebug, pcov - tools: phpcs - - name: Run some pre-commit hooks on selected changed files only if: "! cancelled() && steps.changed-php.outputs.any_changed == 'true'" env: diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index c4ea3c8fbce..3e9335a30d1 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -861,6 +861,27 @@ if (empty($reshook)) { } } + if ($action == 'update_extras' && $user->hasRight('adherent', 'creer')) { + $object->oldcopy = dol_clone($object, 2); + $attribute_name = GETPOST('attribute', 'restricthtml'); + + // Fill array 'array_options' with data from update form + $ret = $extrafields->setOptionalsFromPost(null, $object, $attribute_name); + if ($ret < 0) { + $error++; + } + if (!$error) { + $result = $object->updateExtraField($attribute_name, 'MEMBER_MODIFY'); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } + } + if ($error) { + $action = 'edit_extras'; + } + } + // SPIP Management if (is_object($mailmanspip)) { if ($user->hasRight('adherent', 'supprimer') && $action == 'confirm_del_spip' && $confirm == 'yes') { diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index ede222b86f3..1ec7c21252f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -329,6 +329,8 @@ if ($action == 'update') { $csscontent = dol_string_nohtmltag($csscontent, 2); dolibarr_set_const($db, "MAIN_IHM_CUSTOM_CSS", $csscontent, 'chaine', 0, '', $conf->entity); + + setEventMessages($langs->trans("RecordSaved"), null); } $_SESSION["mainmenu"] = ""; // The menu manager may have changed diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 9df853c1c14..0d129b745a1 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -455,7 +455,7 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) { print '