From 1b2f16b01a311249058145f3568a512cf75a6159 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Jan 2026 10:42:37 +0100 Subject: [PATCH 01/29] Fix ci --- htdocs/core/modules/modProduct.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 36dae6c27f7..092305cdbf1 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -879,8 +879,8 @@ class modProduct extends DolibarrModules $this->import_regex_array[$r] = array( 'pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 'pr.recuperableonly'=>'^[0|1]$' - ); - $this->import_convertvalue_array[$r] = array( + ); + $this->import_convertvalue_array[$r] = array( 'pr.fk_product'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/class/product.class.php', 'class'=>'Product', 'method'=>'fetch', 'element'=>'Product') ); $this->import_examplevalues_array[$r] = array('pr.fk_product'=>"ref:PRODUCT_REF or id:123456", From 51e61c8ef3e8a470c1570708512321eeded5f3c6 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 28 Jan 2026 15:17:39 +0100 Subject: [PATCH 02/29] FIX: missing code to add Ressource to event on creation card (#37002) --- htdocs/comm/action/card.php | 90 ++++++++++++++++++++++++++++++++++--- 1 file changed, 85 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 3076f3d4854..40b6f99bf04 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -410,6 +410,11 @@ if (empty($reshook) && $action == 'add') { if (!empty($_SESSION['assignedtouser'])) { $listofuserid = json_decode($_SESSION['assignedtouser'], true); } + + if (!empty($_SESSION['assignedtoresource'])) { + $listofresourceid = json_decode($_SESSION['assignedtoresource'], true); + } + $i = 0; foreach ($listofuserid as $key => $value) { if ($i == 0) { // First entry @@ -520,22 +525,95 @@ if (empty($reshook) && $action == 'add') { // Creation of action/event $idaction = $object->create($user); + $moreparam = ''; if ($idaction > 0) { if (!$object->error) { + if (is_array($listofresourceid) && count($listofresourceid)) { + foreach ($listofresourceid as $resource_id => $val) { + $resource_type = 'dolresource'; + $busy = 1;//GETPOSTINT('busy'); + + // Resources association + if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK')) { + $eventDateStart = $object->datep; + $eventDateEnd = $object->datef; + $isFullDayEvent = $object->fulldayevent; + if (empty($eventDateEnd)) { + if ($isFullDayEvent) { + $eventDateStartArr = dol_getdate($eventDateStart); + $eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + } + } + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " WHERE er.resource_id = " . ((int) $resource_id); + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql) > 0) { + // Resource already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
- ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $object->error; + + setEventMessages($object->error, null, 'errors'); + } + $db->free($resql); + } + } + + if (!$error) { + $res = $object->add_element_resource($resource_id, $resource_type, $busy, $val['mandatory']); + } + } + } + + unset($_SESSION['assignedtoresource']); + + // Category association - $categories = GETPOST('categories', 'array'); - $object->setCategories($categories); + if (!$error) { + $categories = GETPOST('categories', 'array'); + $object->setCategories($categories); + } unset($_SESSION['assignedtouser']); - $moreparam = ''; if ($user->id != $object->userownerid) { $moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view. } // Create reminders - if ($addreminder == 'on') { + if (!$error && $addreminder == 'on') { $actionCommReminder = new ActionCommReminder($db); $dateremind = dol_time_plus_duree($datep, -1 * $offsetvalue, $offsetunit); @@ -606,7 +684,9 @@ if (empty($reshook) && $action == 'add') { $donotclearsession = 1; } - if ($eventisrecurring) { + if (!$error && $eventisrecurring) { + $dayoffset = 0; + $monthoffset = 0; // We set first date of recurrence and offsets if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) { $firstdatearray = dol_get_first_day_week(GETPOST("apday", 'int'), GETPOST("apmonth", 'int'), GETPOST("apyear", 'int')); From 07ff579416ad1a9d2287e00c6af45de495ffba7a Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 29 Jan 2026 10:01:29 +0100 Subject: [PATCH 03/29] auto assign PR to 18 thanks to copilot --- .github/workflows/pr-18.yaml | 178 +++++++++++++++++++++++++---------- 1 file changed, 127 insertions(+), 51 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index ef651ffa8e6..379657c5293 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -1,11 +1,17 @@ -# Action to prepare the github action -# Go on Dolibarr - Settings - Developer settings - Enter a name + webhook to disable + Permissions (see app test) + Can install by any account -# Click on generate the private keys -# Click on Install application - choose user of the Organization -# Go on Organisation - Secret and variables and create a secret PR18_SECRET_KEY and copy the content of received private key. Choose the repository access to "Repository Dolibarr". -# Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr". +# Action to prepare the GitHub Action +# Prerequisites (create in the organization / repo): +# - Secret: PR18_SECRET_KEY (private key generated for the GitHub App) +# - Variable: PR18_APP_ID (GitHub App ID) +# +# Behavior: +# - On pull_request_target (opened, synchronize, reopened) against branch 18.0: +# - Generate a GitHub App token +# - Add the label "Issue for v18 maintenance Team" to the PR (error-tolerant) +# - Assign the reviewers listed below, excluding the PR author +# -> attempt per reviewer (if a reviewer fails, log and continue) +# -> the step fails only if no reviewer could be added +# - On push to 18.0: workflow runs but PR-specific actions are skipped # - name: Set reviewer and label for v18 on: pull_request_target: @@ -24,54 +30,124 @@ jobs: assign-and-label-v18: runs-on: ubuntu-latest + # Mergeers / reviewers list: edit here as needed (comma-separated) + env: + REVIEWERS: "lvessiller-opendsi,rycks" + # Label name to apply + V18_LABEL: "Issue for v18 maintenance Team" + steps: - #- name: Install GitHub CLI - # run: sudo apt-get install gh + # 1) Generate a GitHub App token (via actions/create-github-app-token) + - name: Generate GitHub App token + id: generate-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.PR18_APP_ID }} + private-key: ${{ secrets.PR18_SECRET_KEY }} - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@v2 - with: - app-id: ${{ vars.PR18_APP_ID }} - private-key: ${{ secrets.PR18_SECRET_KEY }} + # 2) Checkout repository (useful if repo content is needed later) + - name: Checkout repository + uses: actions/checkout@v4 - - name: Checkout repository - uses: actions/checkout@v4 + # 3) Install / configure GitHub CLI (gh) on the runner + - name: Setup GitHub CLI (gh) + uses: cli/gh-action@v3 - - name: Assign Tag - env: - GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} - prid: ${{ github.event.pull_request.number }} - url: ${{ github.event.pull_request.html_url }} - url2: ${{ github.event.pull_request_target.html_url }} - run: | - echo "env.prid=${{env.prid}}" - echo "env.url=${{env.url}}" - echo "env.url2=${{env.url2}}" - gh pr edit "${{env.prid}}" --add-label "Issue for v18 maintenance Team" + # Debug information (useful for diagnostics) + - name: Debug info + run: | + echo "Event: $GITHUB_EVENT_NAME" + echo "Ref: $GITHUB_REF" + echo "Run id: $GITHUB_RUN_ID" + echo "Reviewers configured: $REVIEWERS" - - name: Set reviewers except PR author - id: set-reviewers - run: | - # Liste des reviewers à ajuster selon équipe - REVIEWERS=("lvessiller-opendsi" "rycks") - AUTHOR="${{ github.event.pull_request.user.login }}" - FINAL_REVIEWERS=() - for reviewer in "${REVIEWERS[@]}"; do - if [ "$reviewer" != "$AUTHOR" ]; then - FINAL_REVIEWERS+=("$reviewer") + # 4) Add the label to the PR (PR events only) + # -> tolerant to errors: log on failure but do not fail the job + - name: Add label to PR (pull_request events only) + if: ${{ github.event_name == 'pull_request' }} + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + PR_NUMBER: ${{ github.event.pull_request.number }} + V18_LABEL: ${{ env.V18_LABEL }} + run: | + set -euo pipefail + echo "Adding label '$V18_LABEL' to PR #${PR_NUMBER}" + if gh pr edit "$PR_NUMBER" --add-label "$V18_LABEL"; then + echo "Label added successfully." + else + echo "Warning: failed to add label '$V18_LABEL' to PR #${PR_NUMBER}. Continuing." fi - done - echo "AUTHOR=$AUTHOR" - echo "reviewers=$(IFS=, ; echo "${FINAL_REVIEWERS[*]}")" >> $GITHUB_OUTPUT - - name: Assign reviewers - if: steps.set-reviewers.outputs.reviewers != '' - env: - GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} - prid: ${{ github.event.pull_request.number }} - url: ${{ github.event.pull_request.html_url }} - reviewers: ${{ steps.set-reviewers.outputs.reviewers }} - run: | - echo "Assigning reviewers: ${{env.reviewers}}" - gh pr edit "${{env.prid}}" --add-reviewer "${{env.reviewers}}" + # 5) Compute final reviewers list excluding the PR author + - name: Compute reviewers (exclude PR author) + if: ${{ github.event_name == 'pull_request' }} + id: set-reviewers + run: | + set -euo pipefail + IFS=',' read -ra ALL_REVIEWERS <<< "${REVIEWERS}" + AUTHOR="${{ github.event.pull_request.user.login }}" + FINAL=() + for r in "${ALL_REVIEWERS[@]}"; do + r_trimmed="$(echo "$r" | xargs)" + if [ -z "$r_trimmed" ]; then + continue + fi + if [ "$r_trimmed" != "$AUTHOR" ]; then + FINAL+=("$r_trimmed") + fi + done + if [ ${#FINAL[@]} -eq 0 ]; then + echo "reviewers=" >> $GITHUB_OUTPUT + else + reviewers_csv="$(IFS=, ; echo "${FINAL[*]}")" + echo "reviewers=${reviewers_csv}" >> $GITHUB_OUTPUT + fi + echo "author=$AUTHOR" >> $GITHUB_OUTPUT + echo "Computed reviewers: ${reviewers_csv:-}" + + # 6) Assign reviewers one-by-one with fine-grained error handling + # - try each reviewer, track successes and failures + # - fail the step only if none could be added + # - succeed if at least one was added (but log failures) + - name: Assign reviewers on PR (per-reviewer, tolerant errors) + if: ${{ github.event_name == 'pull_request' && steps.set-reviewers.outputs.reviewers != '' }} + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REVIEWERS_CSV: ${{ steps.set-reviewers.outputs.reviewers }} + run: | + # Note: avoid 'set -e' to handle per-reviewer failures manually + set -uo pipefail + IFS=',' read -ra TO_ADD <<< "${REVIEWERS_CSV}" + SUCCESS=0 + FAILED=() + for r in "${TO_ADD[@]}"; do + r_trimmed="$(echo "$r" | xargs)" + if [ -z "$r_trimmed" ]; then + continue + fi + echo "Attempting to add reviewer: $r_trimmed" + if gh pr edit "$PR_NUMBER" --add-reviewer "$r_trimmed"; then + echo "Added reviewer: $r_trimmed" + SUCCESS=$((SUCCESS+1)) + else + echo "Warning: failed to add reviewer: $r_trimmed" + echo "Debug: PR view:" + gh pr view "$PR_NUMBER" --json number,title,author,reviewRequests || true + FAILED+=("$r_trimmed") + fi + done + if [ $SUCCESS -eq 0 ]; then + echo "Error: none of the configured reviewers could be added: ${FAILED[*]:-}" + # Fail the step because no reviewer was added + exit 1 + else + echo "Reviewers added: ${SUCCESS}. Failed to add: ${FAILED[*]:-none}" + # Step succeeds even if some reviewers failed + fi + + # 7) Push event notice (no PR-specific actions performed) + - name: Push event notice + if: ${{ github.event_name == 'push' }} + run: | + echo "Triggered by push on branch 18.0. No PR-specific actions performed." From 70b3be5e7f40f21052745854f8eeb7e698e4db2b Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Thu, 29 Jan 2026 13:02:25 +0100 Subject: [PATCH 04/29] Fix from V22 (#35559) Using a packaging with a float value less than 1 (0.1, 0.5, etc.) generates a 500 error (division by 0) Co-authored-by: Laurent Destailleur Co-authored-by: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> --- .../class/fournisseur.commande.class.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ee155e7ad3d..4cfb71d908f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -616,7 +616,7 @@ class CommandeFournisseur extends CommonOrder $objsearchpackage = $this->db->fetch_object($resqlsearchpackage); if ($objsearchpackage) { $line->fk_fournprice = $objsearchpackage->rowid; - $line->packaging = $objsearchpackage->packaging; + $line->packaging = (float) $objsearchpackage->packaging; } } else { $this->error = $this->db->lasterror(); @@ -1979,16 +1979,16 @@ class CommandeFournisseur extends CommonOrder } // Predefine quantity according to packaging - if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { + if (getDolGlobalString('PRODUCT_USE_SUPPLIER_PACKAGING')) { $prod = new Product($this->db); - $prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', (empty($this->fk_soc) ? $this->socid : $this->fk_soc)); + $prod->get_buyprice($fk_prod_fourn_price, (float) $qty, $fk_product, 'none', (empty($this->fk_soc) ? $this->socid : $this->fk_soc)); if ($qty < $prod->packaging) { - $qty = $prod->packaging; + $qty = (float) $prod->packaging; } else { - if (!empty($prod->packaging) && ($qty % $prod->packaging) > 0) { - $coeff = intval($qty / $prod->packaging) + 1; - $qty = $prod->packaging * $coeff; + if (!empty($prod->packaging) && (fmod((float) $qty, (float) $prod->packaging) > 0.000001)) { + $coeff = intval((float) $qty / $prod->packaging) + 1; + $qty = (float) $prod->packaging * $coeff; setEventMessages($langs->trans('QtyRecalculatedWithPackaging'), null, 'mesgs'); } } @@ -2962,11 +2962,11 @@ class CommandeFournisseur extends CommonOrder $this->line->desc = $desc; // redefine quantity according to packaging - if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { + if (getDolGlobalString('PRODUCT_USE_SUPPLIER_PACKAGING')) { if ($qty < $this->line->packaging) { $qty = $this->line->packaging; } else { - if (!empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) { + if (!empty($this->line->packaging) && is_numeric($this->line->packaging) && (float) $this->line->packaging > 0 && (fmod((float) $qty, $this->line->packaging) > 0)) { $coeff = intval($qty / $this->line->packaging) + 1; $qty = $this->line->packaging * $coeff; setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); @@ -3869,7 +3869,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $objsearchpackage = $this->db->fetch_object($resqlsearchpackage); if ($objsearchpackage) { $this->fk_fournprice = $objsearchpackage->rowid; - $this->packaging = $objsearchpackage->packaging; + $this->packaging = (float) $objsearchpackage->packaging; } } else { $this->error = $this->db->lasterror(); From 72ed29a5990b778e2093d72988ba1e08760c1099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= <121813548+BenjaminFlr@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:50:21 +0100 Subject: [PATCH 05/29] FIX(API, thirdparties): get fixed amount discounts (#37068) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Benjamin Falière --- htdocs/societe/class/api_thirdparties.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 351a178d318..7a19427f728 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1,8 +1,9 @@ - * Copyright (C) 2018 Pierre Chéné - * Copyright (C) 2019 Cedric Ancelin +/* Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Pierre Chéné + * Copyright (C) 2019 Cedric Ancelin * Copyright (C) 2020-2021 Frédéric France + * Copyright (C) 2026 Benjamin Falière * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1052,8 +1053,9 @@ class Thirdparties extends DolibarrApi $sql = "SELECT f.ref, f.type as factype, re.fk_facture_source, re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc, re.description, re.fk_facture, re.fk_facture_line"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re, ".MAIN_DB_PREFIX."facture as f"; - $sql .= " WHERE f.rowid = re.fk_facture_source AND re.fk_soc = ".((int) $id); + $sql .= " FROM ".MAIN_DB_PREFIX."societe_remise_except as re"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = re.fk_facture_source"; + $sql .= " WHERE re.fk_soc = ".((int) $id); if ($filter == "available") { $sql .= " AND re.fk_facture IS NULL AND re.fk_facture_line IS NULL"; } From 07a3d0e4b7d5e1d1d4e95cc6ce8ce61ae7d18821 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 5 Feb 2026 09:43:02 +0100 Subject: [PATCH 06/29] auto assign PR on 18.0 / Unable to resolve action cli/gh-action, repository not found --- .github/workflows/pr-18.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 379657c5293..e606aa233e1 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -50,8 +50,21 @@ jobs: uses: actions/checkout@v4 # 3) Install / configure GitHub CLI (gh) on the runner - - name: Setup GitHub CLI (gh) - uses: cli/gh-action@v3 + #- name: Setup GitHub CLI (gh) + # uses: cli/gh-action@v3 + # -> Error: Unable to resolve action cli/gh-action, repository not found + - name: Setup GitHub CLI (gh) (install locally) + run: | + set -euo pipefail + sudo apt-get update + sudo apt-get install -y gh || { + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + sudo apt-get update + sudo apt-get install -y gh + } + gh --version # Debug information (useful for diagnostics) - name: Debug info From 66c552ccb2bd84217322e88beefe246bb3008c68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Feb 2026 02:39:30 +0100 Subject: [PATCH 07/29] Removed not used file --- .scrutinizer.yml | 231 ----------------------------------------------- 1 file changed, 231 deletions(-) delete mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index c1cb2e853f1..00000000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,231 +0,0 @@ -# .scrutinizer.yml -#build: -# - php-scrutinizer-run -build: - nodes: - analysis: - tests: - override: - - command: php-scrutinizer-run - idle_timeout: 8000 - -imports: - - javascript - - php - -filter: - excluded_paths: - - build/* - - dev/* - - doc/* - - documents/* - - node_modules/* - - test/* - dependency_paths: - - htdocs/includes/* - paths: - - htdocs/* - - scripts/* - -tools: - # php_analyzer. Doc on https://scrutinizer-ci.com/docs/tools/php/php-analyzer/ - php_analyzer: - enabled: true - extensions: - - php - dependency_paths: - - htdocs/includes/ - filter: - excluded_paths: - - build/* - - dev/* - - doc/* - - documents/* - - htdocs/includes/* - - htdocs/core/class/lessc.class.php - - node_modules/* - - test/* - paths: - - htdocs/ - - scripts/ - config: - parameter_reference_check: - enabled: true - checkstyle: - enabled: false - no_trailing_whitespace: true - naming: - enabled: true - local_variable: ^[a-z][a-zA-Z0-9]*$ - abstract_class_name: ^Abstract|Factory$ - utility_class_name: Utils?$ - constant_name: ^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$ - property_name: ^[a-z][a-zA-Z0-9]*$ - method_name: ^(?:[a-z]|__)[a-zA-Z0-9]*$ - parameter_name: ^[a-z][a-zA-Z0-9]*$ - interface_name: ^[A-Z][a-zA-Z0-9]*Interface$ - type_name: ^[A-Z][a-zA-Z0-9]*$ - exception_name: ^[A-Z][a-zA-Z0-9]*Exception$ - isser_method_name: ^(?:is|has|should|may|supports) - unreachable_code: - enabled: true - check_access_control: - enabled: true - typo_checks: - enabled: true - check_variables: - enabled: true - check_calls: - enabled: true - too_many_arguments: true - missing_argument: true - argument_type_checks: lenient # Allowed Values: "disabled", "lenient", "strict" - suspicious_code: - enabled: true - overriding_parameter: false - overriding_closure_use: true - parameter_closure_use_conflict: true - parameter_multiple_times: true - non_existent_class_in_instanceof_check: true - non_existent_class_in_catch_clause: true - assignment_of_null_return: true - non_commented_switch_fallthrough: true - non_commented_empty_catch_block: true - overriding_private_members: true - use_statement_alias_conflict: true - precedence_in_condition_assignment: true - dead_assignments: - enabled: true - verify_php_doc_comments: - enabled: false - parameters: true - return: true - suggest_more_specific_types: true - ask_for_return_if_not_inferrable: true - ask_for_param_type_annotation: true - loops_must_use_braces: - enabled: true - check_usage_context: - enabled: true - simplify_boolean_return: - enabled: false - phpunit_checks: - enabled: false - reflection_checks: - enabled: true - - # Checks Common Precedence Mistakes - precedence_checks: - enabled: true - assignment_in_condition: true - comparison_of_bit_result: true - basic_semantic_checks: - enabled: true - # Disabled unused code. In most cases, we want to keep it. - unused_code: - enabled: false - deprecation_checks: - enabled: true - useless_function_calls: - enabled: true - metrics_lack_of_cohesion_methods: - enabled: true - metrics_coupling: - enabled: true - stable_code: - namespace_prefixes: [] - classes: [] - doctrine_parameter_binding: - enabled: false - doctrine_entity_manager_injection: - enabled: false - symfony_request_injection: - enabled: false - doc_comment_fixes: - enabled: true - reflection_fixes: - enabled: false - use_statement_fixes: - enabled: true - remove_unused: true - # Whether you would like multiple imports in one USE statement to be preserved, e.g. ``use A, B;``. - preserve_multiple: false - # Whether you would like to preserve blank lines between use statements. - preserve_blanklines: false - order_alphabetically: false - # To use specific config for a specific path, use path_configs: (see example on page https://scrutinizer-ci.com/docs/configuration/tool_config_structure) - - # php_depend - php_pdepend: - enabled: false - configuration_file: null - suffixes: - - php - excluded_dirs: { } - filter: - excluded_paths: - - 'build/*' - - 'dev/*' - - 'doc/*' - - 'test/*' - - 'htdocs/includes/*' - paths: { } - - # change tracking - php_changetracking: - enabled: false - bug_patterns: - - '\bfix(?:es|ed)?\b' - feature_patterns: - - '\badd(?:s|ed)?\b' - - '\bimplement(?:s|ed)?\b' - filter: - excluded_paths: - - 'build/*' - - 'dev/*' - - 'doc/*' - - 'documents/*' - - 'htdocs/includes/*' - - 'node_modules/*' - - 'test/*' - paths: { } - - # Similar code detection - php_sim: - enabled: false - min_mass: 30 - filter: - excluded_paths: - - 'build/*' - - 'dev/*' - - 'doc/*' - - 'documents/*' - - 'htdocs/includes/*' - - 'node_modules/*' - - 'test/*' - paths: { } - - # Coding-Style / Bug Detection - js_hint: - enabled: false - use_native_config: true - extensions: - - js - filter: - excluded_paths: - - 'build/*' - - 'dev/*' - - 'doc/*' - - 'documents/*' - - 'htdocs/includes/*' - - 'node_modules/*' - - 'test/*' - paths: { } - config: { } - path_configs: { } - - -before_commands: { } -after_commands: { } -artifacts: { } -build_failure_conditions: { } From 59ce599ba55c6b1ed5e600908fd1ac509d433358 Mon Sep 17 00:00:00 2001 From: Vincent Penel Date: Fri, 6 Feb 2026 12:18:36 +0100 Subject: [PATCH 08/29] set oldCopy and Status (#37117) * set oldCopy and Status * Update ticket.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/ticket/class/ticket.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 187867c54c3..e821b4e80d4 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1510,11 +1510,12 @@ class Ticket extends CommonObject if ($this->statut != self::STATUS_CANCELED) { // no closed $this->oldcopy = dol_clone($this); + $this->status = Ticket::STATUS_READ; $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."ticket"; - $sql .= " SET fk_statut = ".Ticket::STATUS_READ.", date_read = '".$this->db->idate(dol_now())."'"; + $sql .= " SET fk_statut = ".$this->status .", date_read = '".$this->db->idate(dol_now())."'"; $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::markAsRead"); @@ -1538,12 +1539,14 @@ class Ticket extends CommonObject } else { $this->db->rollback(); $this->error = join(',', $this->errors); + $this->status = $this->oldcopy->status; dol_syslog(get_class($this)."::markAsRead ".$this->error, LOG_ERR); return -1; } } else { $this->db->rollback(); $this->error = $this->db->lasterror(); + $this->status = $this->oldcopy->status; dol_syslog(get_class($this)."::markAsRead ".$this->error, LOG_ERR); return -1; } @@ -1743,9 +1746,11 @@ class Ticket extends CommonObject if ($this->fk_statut != Ticket::STATUS_CLOSED && $this->fk_statut != Ticket::STATUS_CANCELED) { // not closed $this->db->begin(); + $this->oldcopy = dol_clone($this); + $this->status = ($mode ? Ticket::STATUS_CANCELED : Ticket::STATUS_CLOSED); $sql = "UPDATE ".MAIN_DB_PREFIX."ticket"; - $sql .= " SET fk_statut=".($mode ? Ticket::STATUS_CANCELED : Ticket::STATUS_CLOSED).", progress=100, date_close='".$this->db->idate(dol_now())."'"; + $sql .= " SET fk_statut=".$this->status.", progress=100, date_close='".$this->db->idate(dol_now())."'"; $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::close mode=".$mode); From 173c6865cb73fafdd736f2938e41c589d8cb8b15 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Feb 2026 13:05:21 +0100 Subject: [PATCH 09/29] Test CI --- .github/workflows/pr-18-testldr.yaml | 79 ++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/pr-18-testldr.yaml diff --git a/.github/workflows/pr-18-testldr.yaml b/.github/workflows/pr-18-testldr.yaml new file mode 100644 index 00000000000..a04673417c3 --- /dev/null +++ b/.github/workflows/pr-18-testldr.yaml @@ -0,0 +1,79 @@ +# Action to prepare the github action +# Go on Dolibarr - Settings - Developer settings - Enter a name + webhook to disable + Permissions (see app test) + Can install by any account +# Click on generate the private keys +# Click on Install application - choose user of the Organization +# Go on Organisation - Secret and variables and create a secret PR18_SECRET_KEY and copy the content of received private key. Choose the repository access to "Repository Dolibarr". +# Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr". +# + +name: Set reviewer and label for v18 +on: + pull_request_target: + types: [opened, synchronize, reopened] + branches: + - "18.0" + push: + branches: + - "18.0" + +permissions: + pull-requests: write + issues: write + +jobs: + assign-and-label-v18: + runs-on: ubuntu-latest + + steps: + #- name: Install GitHub CLI + # run: sudo apt-get install gh + + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.PR18_APP_ID }} + private-key: ${{ secrets.PR18_SECRET_KEY }} + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Assign Tag + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + prid: ${{ github.event.pull_request.number }} + prid2: ${{ github.event.pull_request_target.number }} + url: ${{ github.event.pull_request.html_url }} + url2: ${{ github.event.pull_request_target.html_url }} + run: | + echo "env.prid=${{env.prid}}" + echo "env.prid=${{env.prid2}}" + echo "env.url=${{env.url}}" + echo "env.url2=${{env.url2}}" + gh pr edit "${{env.prid}}" --add-label "Issue for v18 maintenance Team" + + - name: Set reviewers except PR author + id: set-reviewers + run: | + # Liste des reviewers à ajuster selon équipe + REVIEWERS=("lvessiller-opendsi" "rycks") + AUTHOR="${{ github.event.pull_request.user.login }}" + FINAL_REVIEWERS=() + for reviewer in "${REVIEWERS[@]}"; do + if [ "$reviewer" != "$AUTHOR" ]; then + FINAL_REVIEWERS+=("$reviewer") + fi + done + echo "AUTHOR=$AUTHOR" + echo "reviewers=$(IFS=, ; echo "${FINAL_REVIEWERS[*]}")" >> $GITHUB_OUTPUT + + - name: Assign reviewers + if: steps.set-reviewers.outputs.reviewers != '' + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + prid: ${{ github.event.pull_request.number }} + url: ${{ github.event.pull_request.html_url }} + reviewers: ${{ steps.set-reviewers.outputs.reviewers }} + run: | + echo "Assigning reviewers: ${{env.reviewers}}" + gh pr edit "${{env.prid}}" --add-reviewer "${{env.reviewers}}" From da0ece345fb5fd72119c0aeda83f2f2bc3b59740 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Feb 2026 13:06:16 +0100 Subject: [PATCH 10/29] Fix label --- .github/workflows/pr-18-testldr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-18-testldr.yaml b/.github/workflows/pr-18-testldr.yaml index a04673417c3..330a853a55f 100644 --- a/.github/workflows/pr-18-testldr.yaml +++ b/.github/workflows/pr-18-testldr.yaml @@ -6,7 +6,7 @@ # Go on Organisation - Secret and variables and create a variable PR18_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr". # -name: Set reviewer and label for v18 +name: Set reviewer and label for v18 (test ldr) on: pull_request_target: types: [opened, synchronize, reopened] From 2b3ae6c2d7d4ff3ccbf9df06b71c8e8d3168dfd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Feb 2026 13:16:16 +0100 Subject: [PATCH 11/29] Add logs --- .github/workflows/pr-18-testldr.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr-18-testldr.yaml b/.github/workflows/pr-18-testldr.yaml index 330a853a55f..6babdf86b76 100644 --- a/.github/workflows/pr-18-testldr.yaml +++ b/.github/workflows/pr-18-testldr.yaml @@ -28,6 +28,9 @@ jobs: #- name: Install GitHub CLI # run: sudo apt-get install gh + - name: Debug GitHub Event + run: cat $GITHUB_EVENT_PATH + - name: Generate a token id: generate-token uses: actions/create-github-app-token@v2 From 94d4f2661dbca1c3961e6d927cb6c41e70526749 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Sun, 8 Feb 2026 15:38:36 +0100 Subject: [PATCH 12/29] MEMBER_ADDON does not exists, MEMBER_CODEMEMBER_ADDON is the right key (#37151) --- htdocs/core/modules/modAdherent.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 6e2aeb58c13..928620bcb8a 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -363,8 +363,8 @@ class modAdherent extends DolibarrModules $this->import_convertvalue_array[$r] = array( 'a.ref'=>array( 'rule'=>'getrefifauto', - 'class'=>(empty($conf->global->MEMBER_ADDON) ? 'mod_member_simple' : $conf->global->MEMBER_ADDON), - 'path'=>"/core/modules/member/".(empty($conf->global->MEMBER_ADDON) ? 'mod_member_simple' : $conf->global->MEMBER_ADDON).'.php' + 'class'=>(empty($conf->global->MEMBER_CODEMEMBER_ADDON) ? 'mod_member_simple' : $conf->global->MEMBER_CODEMEMBER_ADDON), + 'path'=>"/core/modules/member/".(empty($conf->global->MEMBER_CODEMEMBER_ADDON) ? 'mod_member_simple' : $conf->global->MEMBER_CODEMEMBER_ADDON).'.php' ), 'a.state_id' => array( 'rule' => 'fetchidfromcodeid', From 7b5ddac96354e3b992741419ed1e94a07a2cda01 Mon Sep 17 00:00:00 2001 From: kkhelifa-opendsi Date: Sun, 8 Feb 2026 22:25:58 +0100 Subject: [PATCH 13/29] FIX: Backport fix on v20 for result page of compta (/compta/resultat/index.php) (#37127) * FIX: Backport fix on v20 for result page of compta (/compta/resultat/index.php). The expense report were not included when the module was activated * Update index.php --------- Co-authored-by: Laurent Destailleur --- htdocs/compta/resultat/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 6a1fd134562..b7de1fe19eb 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -45,7 +45,7 @@ $date_endyear = GETPOST('date_endyear', 'int'); $nbofyear = 4; -// Change this to test different cases of setup +// Change this to test different cases of setup. //$conf->global->SOCIETE_FISCAL_MONTH_START = 7; @@ -678,7 +678,7 @@ if (isModEnabled('salaries') && ($modecompta == 'CREANCES-DETTES' || $modecompta * Expense reports */ -if (!isModEnabled('expensereport') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('expensereport') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { $langs->load('trips'); if ($modecompta == 'CREANCES-DETTES') { From 0cc80e65ed41be9546ec85b1e7afd01bdbbb9947 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 9 Feb 2026 18:33:54 +0100 Subject: [PATCH 14/29] FIX SQL Error on VAT not defined in product card (#37159) --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8a285587b79..e8b04307c2f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2012-2016 Marcos García * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2012-2015 Raphaël Doursenaud - * Copyright (C) 2014-2023 Alexandre Spangaro + * Copyright (C) 2014-2026 Alexandre Spangaro * Copyright (C) 2018-2022 Ferran Marcet * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2018 Nicolas ZABOURI @@ -6446,7 +6446,7 @@ class Form if (!empty($user) && $user->admin && preg_match('/\'(..)\'/', $country_code, $reg)) { $langs->load("errors"); $new_country_code = $reg[1]; - $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_pays', 'code', 'rowid'); + $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_country', 'code', 'rowid'); $this->error .= '
'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : '')); } $this->error .= ''; From 0b8e0c4765d79a37314d2a6875fdd546ad2c15b1 Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Tue, 10 Feb 2026 15:30:40 +0100 Subject: [PATCH 15/29] FIX display of DLC/DLUO in tooltip (#37164) --- htdocs/product/stock/class/productlot.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 7e54fd90622..8070fc45a6b 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -956,10 +956,10 @@ class Productlot extends CommonObject //$datas['divopen'] = '
'; $datas['batch'] = '
'.$langs->trans('Batch').': '.$this->batch; if ($this->eatby && empty($conf->global->PRODUCT_DISABLE_EATBY)) { - $datas['eatby'] = '
'.$langs->trans('EatByDate').': '.dol_print_date($this->db->jdate($this->eatby), 'day'); + $datas['eatby'] = '
'.$langs->trans('EatByDate').': '.dol_print_date($this->eatby, 'day'); } if ($this->sellby && empty($conf->global->PRODUCT_DISABLE_SELLBY)) { - $datas['sellby'] = '
'.$langs->trans('SellByDate').': '.dol_print_date($this->db->jdate($this->sellby), 'day'); + $datas['sellby'] = '
'.$langs->trans('SellByDate').': '.dol_print_date($this->sellby, 'day'); } //$datas['divclose'] = '
'; From e43438cc7b82239e1438282437bb6c4c397950fc Mon Sep 17 00:00:00 2001 From: Vincent Penel Date: Tue, 10 Feb 2026 15:40:05 +0100 Subject: [PATCH 16/29] Fix/ticket status (#37129) * set oldCopy and Status * Update ticket.class.php * Question Eldy * Fix event status change --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/commonobject.class.php | 4 ++++ htdocs/ticket/card.php | 4 ++-- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/ticket/list.php | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1561867c858..385b493b2d7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4478,7 +4478,11 @@ abstract class CommonObject } } + $this->context = array_merge($this->context, array('newstatus' => $status)); + if ($trigkey) { + $this->oldcopy = dol_clone($this); + // Call trigger $result = $this->call_trigger($trigkey, $user); if ($result < 0) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index e207479cacc..9832970bdfa 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -568,7 +568,7 @@ if (empty($reshook)) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { // prevent browser refresh from reopening ticket several times if ($object->status == Ticket::STATUS_CLOSED || $object->status == Ticket::STATUS_CANCELED) { - $res = $object->setStatut(Ticket::STATUS_ASSIGNED); + $res = $object->setStatut(Ticket::STATUS_ASSIGNED, null, '', 'TICKET_MODIFY'); if ($res) { // Log action in ticket logs table //$log_action = $langs->trans('TicketLogReopen'); @@ -626,7 +626,7 @@ if (empty($reshook)) { if ($object->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { $new_status = GETPOST('new_status', 'int'); $old_status = $object->status; - $res = $object->setStatut($new_status); + $res = $object->setStatut($new_status, null, '', 'TICKET_MODIFY'); if ($res) { // Log action in ticket logs table $log_action = $langs->trans('TicketLogStatusChanged', $langs->transnoentities($object->statuts_short[$old_status]), $langs->transnoentities($object->statuts_short[$new_status])); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index e821b4e80d4..fadcb371358 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2714,7 +2714,7 @@ class Ticket extends CommonObject if (($object->status < self::STATUS_IN_PROGRESS && !$user->socid && !$private) || ($object->status > self::STATUS_IN_PROGRESS && $public_area) ) { - $object->setStatut(3); + $object->setStatut(3, null, '', 'TICKET_MODIFY'); } return 1; } else { diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 4c4dce5a428..1fddd77010c 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -284,7 +284,7 @@ if (empty($reshook)) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { if ($objecttmp->status == Ticket::STATUS_CLOSED || $objecttmp->status == Ticket::STATUS_CANCELED) { - $result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED); + $result = $objecttmp->setStatut(Ticket::STATUS_ASSIGNED, null, '', 'TICKET_MODIFY'); if ($result < 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); $error++; From 673659de986ecd65929671fbe5dfe263f50bb0aa Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 12 Feb 2026 01:23:06 +0100 Subject: [PATCH 17/29] FIX Accountancy - Update height of the export popup (#37206) --- htdocs/accountancy/bookkeeping/export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 246b8e99ebe..45934b646f6 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2013-2026 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2021 Frédéric France @@ -778,7 +778,7 @@ if ($action == 'export_file') { ); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 500, 600); } // Print form confirm From e850355b3034bb46e3fa5257bf8fbaf19441bf2b Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Thu, 12 Feb 2026 09:37:04 +0100 Subject: [PATCH 18/29] Refactor GitHub Actions workflow steps Remove depends on gh and only use curl and requests on github api ... --- .github/workflows/pr-18.yaml | 52 +++++++++++++++--------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index e606aa233e1..39e34ae88f3 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -49,23 +49,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # 3) Install / configure GitHub CLI (gh) on the runner - #- name: Setup GitHub CLI (gh) - # uses: cli/gh-action@v3 - # -> Error: Unable to resolve action cli/gh-action, repository not found - - name: Setup GitHub CLI (gh) (install locally) - run: | - set -euo pipefail - sudo apt-get update - sudo apt-get install -y gh || { - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg - sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null - sudo apt-get update - sudo apt-get install -y gh - } - gh --version - # Debug information (useful for diagnostics) - name: Debug info run: | @@ -74,7 +57,7 @@ jobs: echo "Run id: $GITHUB_RUN_ID" echo "Reviewers configured: $REVIEWERS" - # 4) Add the label to the PR (PR events only) + # 3) Add the label to the PR (PR events only) # -> tolerant to errors: log on failure but do not fail the job - name: Add label to PR (pull_request events only) if: ${{ github.event_name == 'pull_request' }} @@ -82,16 +65,23 @@ jobs: GH_TOKEN: ${{ steps.generate-token.outputs.token }} PR_NUMBER: ${{ github.event.pull_request.number }} V18_LABEL: ${{ env.V18_LABEL }} + REPO: ${{ github.repository }} run: | set -euo pipefail echo "Adding label '$V18_LABEL' to PR #${PR_NUMBER}" - if gh pr edit "$PR_NUMBER" --add-label "$V18_LABEL"; then + response=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ + -H "Authorization: Bearer ${GH_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${REPO}/issues/${PR_NUMBER}/labels" \ + -d "{\"labels\": [\"${V18_LABEL}\"]}") + + if [ "$response" -eq 200 ]; then echo "Label added successfully." else - echo "Warning: failed to add label '$V18_LABEL' to PR #${PR_NUMBER}. Continuing." + echo "Warning: failed to add label '$V18_LABEL' to PR #${PR_NUMBER} (HTTP $response). Continuing." fi - # 5) Compute final reviewers list excluding the PR author + # 4) Compute final reviewers list excluding the PR author - name: Compute reviewers (exclude PR author) if: ${{ github.event_name == 'pull_request' }} id: set-reviewers @@ -118,7 +108,7 @@ jobs: echo "author=$AUTHOR" >> $GITHUB_OUTPUT echo "Computed reviewers: ${reviewers_csv:-}" - # 6) Assign reviewers one-by-one with fine-grained error handling + # 5) Assign reviewers one-by-one with fine-grained error handling # - try each reviewer, track successes and failures # - fail the step only if none could be added # - succeed if at least one was added (but log failures) @@ -128,8 +118,8 @@ jobs: GH_TOKEN: ${{ steps.generate-token.outputs.token }} PR_NUMBER: ${{ github.event.pull_request.number }} REVIEWERS_CSV: ${{ steps.set-reviewers.outputs.reviewers }} + REPO: ${{ github.repository }} run: | - # Note: avoid 'set -e' to handle per-reviewer failures manually set -uo pipefail IFS=',' read -ra TO_ADD <<< "${REVIEWERS_CSV}" SUCCESS=0 @@ -140,26 +130,28 @@ jobs: continue fi echo "Attempting to add reviewer: $r_trimmed" - if gh pr edit "$PR_NUMBER" --add-reviewer "$r_trimmed"; then + response=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ + -H "Authorization: Bearer ${GH_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${REPO}/pulls/${PR_NUMBER}/requested_reviewers" \ + -d "{\"reviewers\": [\"${r_trimmed}\"]}") + + if [ "$response" -eq 201 ] || [ "$response" -eq 200 ]; then echo "Added reviewer: $r_trimmed" SUCCESS=$((SUCCESS+1)) else - echo "Warning: failed to add reviewer: $r_trimmed" - echo "Debug: PR view:" - gh pr view "$PR_NUMBER" --json number,title,author,reviewRequests || true + echo "Warning: failed to add reviewer: $r_trimmed (HTTP $response)" FAILED+=("$r_trimmed") fi done if [ $SUCCESS -eq 0 ]; then echo "Error: none of the configured reviewers could be added: ${FAILED[*]:-}" - # Fail the step because no reviewer was added exit 1 else echo "Reviewers added: ${SUCCESS}. Failed to add: ${FAILED[*]:-none}" - # Step succeeds even if some reviewers failed fi - # 7) Push event notice (no PR-specific actions performed) + # 6) Push event notice (no PR-specific actions performed) - name: Push event notice if: ${{ github.event_name == 'push' }} run: | From a8e050834312b1c9a5736f550ab012e941e72434 Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Thu, 12 Feb 2026 16:30:45 +0100 Subject: [PATCH 19/29] Sec: Can init a page with php content without permission for php content (#37211) edition (reported by phdwg1410) Co-authored-by: Laurent Destailleur --- htdocs/website/class/websitepage.class.php | 12 ++++++++++++ htdocs/website/index.php | 3 +++ 2 files changed, 15 insertions(+) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 40ca4231d7d..0e3c84cbb8e 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -226,6 +226,18 @@ class WebsitePage extends CommonObject // Remove spaces and be sure we have main language only $this->lang = preg_replace('/[_-].*$/', '', trim($this->lang)); // en_US or en-US -> en + // Test if page contains dynamic PHP content + if (!$user->hasRight('website', 'writephp')) { + // Check there is no PHP content into the imported file (must be only HTML + JS) + $phpcontent = dolKeepOnlyPhpCode($this->content); + + if ($phpcontent) { + $this->error = 'Error: you try to create a page with PHP content without having permissions for that.'; + $this->errors = $this->error; + return -1; + } + } + return $this->createCommon($user, $notrigger); } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index c67e80dee29..e8725ad8b56 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -806,6 +806,7 @@ if ($action == 'addcontainer' && $usercanedit) { // Remove comments $tmp['content'] = removeHtmlComment($tmp['content']); + /* disable this, moved into the create() method // Check there is no PHP content into the imported file (must be only HTML + JS) $phpcontent = dolKeepOnlyPhpCode($tmp['content']); if ($phpcontent) { @@ -813,6 +814,7 @@ if ($action == 'addcontainer' && $usercanedit) { setEventMessages('Error getting '.$urltograb.': file that include PHP content is not allowed', null, 'errors'); $action = 'createcontainer'; } + */ } if (!$error) { @@ -1169,6 +1171,7 @@ if ($action == 'addcontainer' && $usercanedit) { } if (!$error) { + // Create page. This also check there is no PHP content if user has no pemrissions for that. $pageid = $objectpage->create($user); if ($pageid <= 0) { $error++; From 808a3f820c7074ae1b7edbfabc4a1cfb46e1d9e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2026 00:50:53 +0100 Subject: [PATCH 20/29] Debug v23 --- htdocs/compta/paiement/card.php | 2 +- htdocs/compta/paiement/document.php | 42 +++-------------------------- 2 files changed, 5 insertions(+), 39 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index b3716d1213a..b3c1ea610db 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -312,7 +312,7 @@ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print '
'; print '
'; -print ''."\n"; +print '
'."\n"; // Date payment print '
'.$form->editfieldkey("Date", 'datep', $object->date, $object, $user->hasRight('facture', 'paiement')).''; diff --git a/htdocs/compta/paiement/document.php b/htdocs/compta/paiement/document.php index 9a972b83afc..479bb790e4a 100644 --- a/htdocs/compta/paiement/document.php +++ b/htdocs/compta/paiement/document.php @@ -113,48 +113,13 @@ llxHeader('', $title); if ($object->id > 0 && $upload_dir !== null) { $head = payment_prepare_head($object); + print dol_get_fiche_head($head, 'documents', $langs->trans("Payment"), -1, 'payment'); // Supplier order card $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = '
'; - - // Date of payment - $morehtmlref .= $form->editfieldkey("Date", 'datep', $object->date, $object, (int) ($object->statut == 0 && ($user->hasRight('facture', 'creer'))), 'datehourpicker', '', 0, 3).': '; - $morehtmlref .= $form->editfieldval("Date", 'datep', $object->date, $object, (int) ($object->statut == 0 && ($user->hasRight('facture', 'creer'))), 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded')); - - // Payment mode - $morehtmlref .= '
'.$langs->trans('PaymentMode').' : '; - $morehtmlref .= $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; - $morehtmlref .= $object->num_payment ? ' - '.$object->num_payment : ''; - - // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); - - // Amount - $morehtmlref .= '
'.$langs->trans('Amount').' : '. price($object->amount, 0, $langs, 0, 0, -1, $conf->currency); - - $allow_delete = 1; - // Bank account - if (isModEnabled('bank')) { - if ($object->fk_account) { - $bankline = new AccountLine($db); - $bankline->fetch($object->bank_line); - if ($bankline->rappro) { - $allow_delete = 0; - $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemoveConciliatedPayment")); - } - - $morehtmlref .= '
'.$langs->trans('BankAccount').' : '; - $accountstatic = new Account($db); - $accountstatic->fetch($bankline->fk_account); - $morehtmlref .= $accountstatic->getNomUrl(1); - - $morehtmlref .= '
'.$langs->trans('BankTransactionLine').' : '; - $morehtmlref .= $bankline->getNomUrl(1, 0, 'showconciliated'); - } - } + $morehtmlref = ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -168,7 +133,8 @@ if ($object->id > 0 && $upload_dir !== null) { print '
'; print '
'; - print ''; + print '
'."\n"; + print ''; print ''; print "
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.dol_print_size($totalsize, 1, 1).'
\n"; From 1d3cfdb65442c4eaac20aedce9e10262c0edee8c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2026 00:57:14 +0100 Subject: [PATCH 21/29] Debug v23 --- htdocs/takepos/invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index d52eb4ff32d..c8a7571dcc7 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -341,7 +341,7 @@ if (empty($reshook)) { $payment->paiementid = $paiementid; $payment->paiementcode = $paycode; - $payment->num_payment = $invoice->ref; + $payment->num_payment = ''; if ($pay != "delayed") { $res = $payment->create($user); // This record payment and regenerate the PDF From 96cd5b9afb8b96efd6c912999cd68a6ea9a28924 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2026 02:03:38 +0100 Subject: [PATCH 22/29] Debug v23 --- htdocs/core/actions_linkedfiles.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index e59fc651416..b02b42e66ba 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -304,7 +304,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto $langs->load("errors"); // lang must be loaded because we can't rely on loading during output, we need var substitution to be done now. setEventMessages($langs->trans("ErrorFilenameCantStartWithDot", $filenameto), null, 'errors'); } elseif (!file_exists($destpath)) { - $result = dol_move($srcpath, $destpath, '0', 1, 0, 1, [], $object->entity ?? 0); + $result = dol_move($srcpath, $destpath, '0', 1, 0, 1, [], $object->entity ?? $conf->entity); if ($result) { // Define if we have to generate thumbs or not $generatethumbs = 1; From 30f7f34708bd0cd7752901994a4a2887ddeaf361 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 16 Feb 2026 19:54:09 +0100 Subject: [PATCH 23/29] FIX Societe - Wrong control on update of VAT Intra (#37224) --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9ffd25427be..a78c66f95c6 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2018 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2023 Alexandre Spangaro + * Copyright (C) 2013-2026 Alexandre Spangaro * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud @@ -1368,7 +1368,7 @@ class Societe extends CommonObject $this->supplier_order_min_amount = price2num($this->supplier_order_min_amount); $this->tva_assuj = trim($this->tva_assuj); - $this->tva_intra = dol_sanitizeFileName($this->tva_intra, ''); + $this->tva_intra = trim($this->tva_intra); $this->vat_reverse_charge = empty($this->vat_reverse_charge) ? '0' : '1'; if (empty($this->status)) { $this->status = 0; From 9f4674806e40950c8c43d92307596d7746b4b6b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2026 20:00:45 +0100 Subject: [PATCH 24/29] Fix CI --- htdocs/website/class/websitepage.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 4f0e7e855df..9c8deaa2822 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -276,7 +276,7 @@ class WebsitePage extends CommonObject if ($phpcontent) { $this->error = 'Error: you try to create a page with PHP content without having permissions for that.'; - $this->errors = $this->error; + $this->errors[] = $this->error; return -1; } } From 83b137d8540029507476043b56e6f5e17f7ea018 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 16 Feb 2026 20:01:27 +0100 Subject: [PATCH 25/29] FIX Luxembourg VAT rate by default (17% since 2024-01-01) (#37255) --- htdocs/install/mysql/data/llx_c_tva.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 88b3afc8d4d..98a109b8fee 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -205,7 +205,7 @@ insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (1 insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '14','0','VAT rate - intermediary',1,__ENTITY__); insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '8','0','VAT rate - reduced', 1,__ENTITY__); insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '3','0','VAT rate - super-reduced', 1,__ENTITY__); -insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '16','0','VAT rate - standard',1,__ENTITY__); +insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (140, '17','0','VAT rate - standard',1,__ENTITY__); -- MALI (id country=147) insert into llx_c_tva(fk_pays,taux,recuperableonly,note,active,entity) values (147, '0','0','VAT rate 0', 1,__ENTITY__); From 7a37ebbeb3afc8ba375c1aa2549bc42bc419ef06 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Mon, 16 Feb 2026 20:03:22 +0100 Subject: [PATCH 26/29] FIX: Clean filenames with double spaces (#37256) * Clean filenames with double spaces If a filename contains double spaces, it can get uploaded in Dolibarr exactly as it is. When listing the file or trying to download it, the dolibarr functions clear double spaces in the filename. In particular the alpha parameter for GETPOST. This results in files being uploaded (e.g. attachments for invoices) than can get listed but remain inaccessible and even cannot get deleted via UI. We either need to fix all these places to accept double spaces or we change a single location, when we sanitize filenames. * removed white space --- htdocs/core/lib/functions.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d4d4ec2332d..5ac76b1c506 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1783,6 +1783,7 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1, $includequotes $tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp); $tmp = preg_replace('/\s+\-$/', '', $tmp); $tmp = str_replace('..', '', $tmp); + $tmp = preg_replace('/\s{2,}/', ' ', $tmp); return $tmp; } @@ -1815,6 +1816,8 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1) $tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp); $tmp = preg_replace('/\s+\-$/', '', $tmp); $tmp = str_replace('..', '', $tmp); + $tmp = preg_replace('/\s{2,}/', ' ', $tmp); + return $tmp; } From 917c2d6be860a3ccc4ef73bc8f76a80e78c4ba7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Mon, 16 Feb 2026 20:12:21 +0100 Subject: [PATCH 27/29] Add check for empty delivery date before setting (#37254) --- htdocs/fourn/commande/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index df24bc83789..11e5b7fdab3 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1358,8 +1358,10 @@ if (empty($reshook)) { dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); $result = $srcobject->fetch($object->origin_id); if ($result > 0) { - $tmpdate = $srcobject->delivery_date; - $object->setDeliveryDate($user, $tmpdate); + if (empty($object->delivery_date)) { + $tmpdate = $srcobject->delivery_date; + $object->setDeliveryDate($user, $tmpdate); + } $object->set_id_projet($user, $srcobject->fk_project); $lines = $srcobject->lines; From 7a73ad95663413920405612ae7c878b78c0098a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2026 20:43:36 +0100 Subject: [PATCH 28/29] Fix #37227 Fix #37233 --- htdocs/blockedlog/class/blockedlog.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 2d1040ac9cb..6c0efef5010 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -1151,7 +1151,7 @@ class BlockedLog { $aaa = null; try { - $aaa = (object) jsonOrUnserialize($data); + $aaa = (object) jsonOrUnserialize($data, false); } catch (Exception $e) { // print $e->getErrs); } From 02f23d5193f6c8d056b4054d0ba0a0df4cc4a498 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Feb 2026 20:54:57 +0100 Subject: [PATCH 29/29] Fix #37227 Fix #37233 --- htdocs/core/lib/functions.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0db6dc81f21..1a31f743ab7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -15632,11 +15632,12 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex * Decode an encoded string. The string can be encoded in json format (recommended) or with serialize (avoid this) * * @param string $stringtodecode String to decode (json or serialize coded) + * @param boolean $assoc true=Return is converted into associative array * @return mixed The decoded object. */ -function jsonOrUnserialize($stringtodecode) +function jsonOrUnserialize($stringtodecode, $assoc = true) { - $result = json_decode($stringtodecode); + $result = json_decode($stringtodecode, $assoc); if ($result === null) { $result = unserialize($stringtodecode); // For backward compatibility. Is no more used in recent versions. }