From 110b35cba65156c509df426f1e49c4e34e81eb9f Mon Sep 17 00:00:00 2001 From: VIAL-GOUTEYRON Quentin Date: Mon, 18 May 2026 16:13:35 +0200 Subject: [PATCH 1/7] NEW Specify If the Object Manages Lines for Module Builder (#32664) * Specify If the Object Manages Lines for Module Builder * Update htdocs/modulebuilder/index.php * Update myobject.class.php * Update myobject.class.php * Update myobject.class.php * Update myobject.class.php * Update myobject.class.php * Update myobject.class.php * Update myobject.class.php * Update myobject.class.php * Fix modulebuilder CI issues * Fix Phan PhanUndeclaredProperty errors on PR #32664 - pdf_standard_myobject: add @phan-suppress-current-line on situation_percent, localtax2_tx, localtax1_type, localtax2_type, vat_src_code, pagebreak (MyObjectLine template class does not declare these inherited properties) - doc_generic_project_odt: replace fk_soc with socid (correct PHP property; fk_soc is the DB column name, Project::fetch() maps it to $this->socid) --------- Co-authored-by: Laurent Destailleur --- htdocs/core/lib/files.lib.php | 46 +++++++++++ .../doc/doc_generic_project_odt.modules.php | 4 +- htdocs/langs/en_US/modulebuilder.lang | 2 + htdocs/modulebuilder/index.php | 24 ++++++ .../template/class/api_mymodule.class.php | 4 +- .../template/class/myobject.class.php | 79 ++++++++++--------- .../doc/pdf_standard_myobject.modules.php | 18 +++-- .../modulebuilder/template/myobject_card.php | 13 ++- 8 files changed, 138 insertions(+), 52 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index f1a53d32f3a..e44a7245209 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -850,6 +850,52 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask return 1; } +/** + * Removes content from a file that matches a given pattern. + * + * @param string $filePath Path to the file to be processed. + * @param string $pattern Regular expression pattern to identify the content to remove. + * @return bool Returns true if the operation was successful, false otherwise. + */ +function removePatternFromFile(string $filePath, string $pattern): bool +{ + // Check if the file exists + if (! file_exists($filePath)) { + dol_syslog("files.lib.php::removePatternFromFile: File $filePath does not exist", LOG_WARNING); + + return false; + } + + // Read the file content + $content = file_get_contents($filePath); + if ($content === false) { + dol_syslog("files.lib.php::removePatternFromFile: Unable to read the file $filePath", LOG_WARNING); + + return false; + } + + // Remove content matching the pattern + $updatedContent = preg_replace($pattern, '', $content); + if ($updatedContent === null) { + dol_syslog("files.lib.php::removePatternFromFile: Error while processing the file $filePath", LOG_WARNING); + + return false; + } + + // Write the updated content back to the file + $result = file_put_contents($filePath, $updatedContent); + if ($result === false) { + dol_syslog("files.lib.php::removePatternFromFile: Permission denied to overwrite the target file $filePath", LOG_WARNING); + + return false; + } + + dol_syslog("files.lib.php::removePatternFromFile: Content successfully removed in the file $filePath", LOG_INFO); + + return true; +} + + /** * Copy a file to another file. diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 2f9d72ea3a3..706debb3be3 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -683,8 +683,8 @@ class doc_generic_project_odt extends ModelePDFProjects // Security check $socid = 0; - if (!empty($object->fk_soc)) { - $socid = $object->fk_soc; + if (!empty($object->socid)) { + $socid = $object->socid; } $tasksarray = $taskstatic->getTasksArray(null, null, $object->id, $socid, 0); diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index f79b7b980fb..ba852c68cf3 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -170,6 +170,8 @@ DefinePropertiesFromExistingTableDesc=If a table in the database (for the object DefinePropertiesFromExistingTableDesc2=Keep empty if the table does not exist yet. The code generator will use different kinds of fields to build an example of table that you can edit later. GeneratePermissions=I want to manage permissions on this object GeneratePermissionsHelp=If you check this, some code will be added to manage permissions to read, write and delete record of the objects +NoGenerateLines=I don't want to manage lines on this object +NoGenerateLinesHelp=If you check this, some code will be removed to manage lines of the objects PermissionDeletedSuccesfuly=Permission has been successfully removed PermissionUpdatedSuccesfuly=Permission has been successfully updated PermissionAddedSuccesfuly=Permission has been successfully added diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1738429e070..aa2358c5f40 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1656,6 +1656,29 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { // Test on $filetogenerate[] = 'core/modules/mod'.$module.'.class.php'; } + if (! $error && GETPOST('nogeneratelines', 'aZ09')) { + $checkComment = checkExistComment($moduledescriptorfile, 0); + if ($checkComment < 0) { + $warning++; + setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Menus"), basename($moduledescriptorfile)), null, 'warnings'); + } else { + // File path + $TFilePaths = [ + $destdir . '/class/' . strtolower($objectname) . '.class.php', + $destdir . '/class/api_' . strtolower($module) . '.class.php', + $destdir . '/' . strtolower($objectname) . '_card.php' + ]; + + // Pattern to remove everything between the tags + $pattern = '/\/\/BEGIN MODULEBUILDER LINES.*?\/\/END MODULEBUILDER LINES\s*/s'; + foreach ($TFilePaths as $filePath) { + if (! removePatternFromFile($filePath, $pattern)) { + $error++; + } + } + } + } + if (!$error) { // Edit PHP files to make replacement foreach ($filetogenerate as $destfile) { @@ -4150,6 +4173,7 @@ if ($module == 'initmodule') { print '
'; print '
'; print '
'; + print '
'; print '
'; print ''; print '
'; diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index 2074351fc21..6ec62448804 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -416,7 +416,7 @@ class MyModuleApi extends DolibarrApi unset($object->rowid); unset($object->canvas); - + //BEGIN MODULEBUILDER LINES // If object has lines, remove $db property if (isset($object->lines) && is_array($object->lines) && count($object->lines) > 0) { $nboflines = count($object->lines); @@ -427,7 +427,7 @@ class MyModuleApi extends DolibarrApi unset($object->lines[$i]->note); } } - + //END MODULEBUILDER LINES return $object; } } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 564564d2d20..5170570658c 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -205,43 +205,42 @@ class MyObject extends CommonObject public $import_key; // END MODULEBUILDER PROPERTIES - + //BEGIN MODULEBUILDER LINES // If this object has a subtable with lines - // /** - // * @var string Name of subtable line - // */ - // public $table_element_line = 'mymodule_myobjectline'; + /** + * @var string Name of subtable line + */ + public $table_element_line = 'mymodule_myobjectline'; - // /** - // * @var string Field name with ID of parent key if this object has a parent, Or Field name of in child tables to link to this record. - // */ - // public $fk_element = 'fk_myobject'; + /** + * @var string Field with ID of parent key if this object has a parent + */ + public $fk_element = 'fk_myobject'; - // /** - // * @var string Name of subtable class that manage subtable lines - // */ - // public $class_element_line = 'MyObjectline'; + /** + * @var string Name of subtable class that manage subtable lines + */ + public $class_element_line = 'MyObjectline'; - // /** - // * @var array List of child tables. To test if we can delete object. - // */ - // protected $childtables = array('mychildtable' => array('name'=>'MyObject', 'fk_element'=>'fk_myobject')); + /** + * @var array|string> List of child tables. To test if we can delete object. + */ + protected $childtables = array('mychildtable' => array('name'=>'MyObject', 'fk_element'=>'fk_myobject')); - // /** - // * @var array List of child tables. To know object to delete on cascade. - // * If name matches '@ClassName:FilePathClass:ParentFkFieldName' (the recommended mode) it will - // * call method ClassName->deleteByParentField(parentId, 'ParentFkFieldName') to fetch and delete child object. - // * Using an array like childtables should not be implemented because a child may have other child, so we must only use the method that call deleteByParentField(). - // */ - // protected $childtablesoncascade = array('mymodule_myobjectdet'); - - // /** - // * @var MyObjectLine[] Array of subtable lines - // */ - // public $lines = array(); + /** + * @var string[] List of child tables. To know object to delete on cascade. + * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will + * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object + */ + protected $childtablesoncascade = array('mymodule_myobjectdet'); + /** + * @var MyObjectLine[] Array of subtable lines + */ + public $lines = array(); + //END MODULEBUILDER LINES /** * Constructor @@ -327,14 +326,15 @@ class MyObject extends CommonObject // Load source object $result = $object->fetchCommon($fromid); + //BEGIN MODULEBUILDER LINES if ($result > 0 && !empty($object->table_element_line)) { $object->fetchLines(); } // get lines so they will be clone - //foreach($this->lines as $line) - // $line->fetch_optionals(); - + foreach ($this->lines as $line) + $line->fetch_optionals(); + //END MODULEBUILDER LINES // Reset some properties unset($object->id); unset($object->fk_user_creat); @@ -418,9 +418,11 @@ class MyObject extends CommonObject public function fetch($id, $ref = null, $noextrafields = 0, $nolines = 0) { $result = $this->fetchCommon($id, $ref, '', $noextrafields); + //BEGIN MODULEBUILDER LINES if ($result > 0 && !empty($this->table_element_line) && empty($nolines)) { $this->fetchLines($noextrafields); } + //END MODULEBUILDER LINES return $result; } @@ -437,8 +439,7 @@ class MyObject extends CommonObject $result = $this->fetchLinesCommon('', $noextrafields); return $result; } - - + //END MODULEBUILDER LINES /** * Load list of objects in memory from the database. * Using a fetchAll() with limit = 0 is a very bad practice. Instead try to forge yourself an optimized SQL request with @@ -545,6 +546,7 @@ class MyObject extends CommonObject //return $this->deleteCommon($user, $notrigger, 1); } + //BEGIN MODULEBUILDER LINES /** * Delete a line of object in database * @@ -562,6 +564,7 @@ class MyObject extends CommonObject return $this->deleteLineCommon($user, $idline, $notrigger); } + //END MODULEBUILDER LINES /** @@ -1107,10 +1110,11 @@ class MyObject extends CommonObject return $this->initAsSpecimenCommon(); } + //BEGIN MODULEBUILDER LINES /** * Create an array of lines * - * @return CommonObjectLine[]|int array of lines if OK, <0 if KO + * @return array|int array of lines if OK, <0 if KO */ public function getLinesArray() { @@ -1123,10 +1127,12 @@ class MyObject extends CommonObject $this->setErrorsFromObject($objectline); return $result; } else { + /** @phpstan-ignore-next-line */ $this->lines = $result; return $this->lines; } } + //END MODULEBUILDER LINES /** * Returns the reference to the following non used object depending on the active numbering module. @@ -1273,7 +1279,7 @@ class MyObject extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; - +//BEGIN MODULEBUILDER LINES /** * Class MyObjectLine. You can also remove this and generate a CRUD class for lines objects. */ @@ -1316,3 +1322,4 @@ class MyObjectLine extends CommonObjectLine $this->db = $db; } } +//END MODULEBUILDER LINES diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 202bed7aa7e..eab91fc4b7e 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -37,6 +37,7 @@ dol_include_once('/mymodule/core/modules/mymodule/modules_myobject.php'); require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; @@ -668,11 +669,11 @@ class pdf_standard_myobject extends ModelePDFMyObject $sign = 1; // Collection of totals by value of VAT in $this->tva["taux"]=total_tva $prev_progress = $object->lines[$i]->get_prev_progress($object->id); - if ($prev_progress > 0 && $object->lines instanceof CommonInvoiceLine && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation + if ($prev_progress > 0 && $object->lines[$i] instanceof CommonInvoiceLine && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { - $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; + $tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; // @phan-suppress-current-line PhanUndeclaredProperty } else { - $tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; + $tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent; // @phan-suppress-current-line PhanUndeclaredProperty } } else { if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { @@ -684,10 +685,11 @@ class pdf_standard_myobject extends ModelePDFMyObject $localtax1ligne = $object->lines[$i]->total_localtax1; $localtax2ligne = $object->lines[$i]->total_localtax2; + // @phan-suppress-next-line PhanUndeclaredProperty $localtax1_rate = $object->lines[$i]->localtax1_tx; - $localtax2_rate = $object->lines[$i]->localtax2_tx; - $localtax1_type = $object->lines[$i]->localtax1_type; - $localtax2_type = $object->lines[$i]->localtax2_type; + $localtax2_rate = $object->lines[$i]->localtax2_tx; // @phan-suppress-current-line PhanUndeclaredProperty + $localtax1_type = $object->lines[$i]->localtax1_type; // @phan-suppress-current-line PhanUndeclaredProperty + $localtax2_type = $object->lines[$i]->localtax2_type; // @phan-suppress-current-line PhanUndeclaredProperty $vatrate = (string) $object->lines[$i]->tva_tx; @@ -724,7 +726,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $this->tva[$vatrate] = 0; } $this->tva[$vatrate] += $tvaligne; - $vatcode = $object->lines[$i]->vat_src_code; + $vatcode = $object->lines[$i]->vat_src_code; // @phan-suppress-current-line PhanUndeclaredProperty if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; } @@ -761,7 +763,7 @@ class pdf_standard_myobject extends ModelePDFMyObject } } - if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { + if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { // @phan-suppress-current-line PhanUndeclaredProperty if ($pagenb == $pageposafter) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis); } else { diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 86c7fa3cdfe..05abb7f419f 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -211,8 +211,10 @@ if (empty($reshook)) { // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + //BEGIN MODULEBUILDER LINES // Action to move up and down lines of object - //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; + //END MODULEBUILDER LINES // Action to build doc include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; @@ -352,10 +354,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 'action-delete'); } + //BEGIN MODULEBUILDER LINES // Confirmation to delete line if ($action == 'deleteline') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); } + //END MODULEBUILDER LINES // Clone confirmation if ($action == 'clone') { @@ -470,7 +474,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print dol_get_fiche_end(); - + //BEGIN MODULEBUILDER LINES /* * Lines */ @@ -500,6 +504,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1); } + //BEGIN MODULEBUILDER LINES // Form to add new line if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { if ($action != 'editline') { @@ -515,6 +520,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } } + //END MODULEBUILDER LINES if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print ''; @@ -523,8 +529,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print "\n"; } - - + //END MODULEBUILDER LINES // Buttons for actions if ($action != 'presend' && $action != 'editline') { From 18b7fa0fd4b4a9ca6c13447e3ab1690d09e379e5 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 18 May 2026 19:44:48 +0200 Subject: [PATCH 2/7] FIX: Add Ghostscript installation and caching for Windows CI (#38325) * Exclude doctemplates as DB dependencies * FIX: Add Ghostscript installation and caching for Windows CI # FIX: Add Ghostscript installation and caching for Windows CI Ghostscript is necessary for one of the tests that converts an image into a PDF. This commit adds the necessary steps to install Ghostscript and cache it for the Windows CI workflow. --- .github/workflows/windows-ci.yml | 29 +++++++++++++++++++++++++++-- dev/setup/phpunit/setup_conf.sh | 6 +++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 219658be32c..4497c798639 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -26,6 +26,7 @@ env: PHP_INI_SCAN_DIR: C:\myphpini CKEY: win-ci-2 GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action + GS_VERSION: "10.07.0" # Ghostscript version jobs: win-test: @@ -53,6 +54,27 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # phpts: ts # ts for thread-safe, default nts + # steps: + + - name: Restore cache Ghostscript (also stores cache at end of workflow) + uses: actions/cache@v5 + with: + path: | + C:\Program Files\gs + key: ${{ runner.os }}-imagick-ghostscript-${{ env.GS_VERSION }} + + - name: Install Ghostscript if not found + run: | + $gsBinDir = "C:\Program Files\gs\gs${{ env.GS_VERSION }}\bin" + echo "$gsBinDir" >> $env:GITHUB_PATH + $gsPath = "$gsBinDir\gswin64c.exe" + if (-not (Test-Path $gsPath)) { + choco install ghostscript -y --no-progress --version=${{ env.GS_VERSION }} + } + if (-not (Test-Path "$gsBinDir\gs.exe")) { + New-Item -ItemType SymbolicLink -Path "$gsBinDir\gs.exe" -Target $gsPath -Force + } + DIR "$gsBinDir" # Restore cache - name: Restore cache @@ -96,10 +118,13 @@ jobs: SET DATA_DIR=%CD%\documents SET TEST_DIR=%CD%\test SET INITDEMO_DIR=%CD%\dev\initdemo + SET SESSION_DIR=%TEMP%\php_sessions + mkdir %SESSION_DIR% ECHO "==== Create INI file to set open_basedir ===" echo [php] > %INIFILE% - echo open_basedir^="%HTDOCS_DIR%;%DATA_DIR%;%TEST_DIR%;%INITDEMO_DIR%;%PHPROOT%" >> %INIFILE% - REM Unset PHP_INI_SCAN_DIR to disable open_basedir restritions (to limit debug effort) + echo open_basedir^="%HTDOCS_DIR%;%DATA_DIR%;%TEST_DIR%;%INITDEMO_DIR%;%PHPROOT%;%SESSION_DIR%" >> %INIFILE% + echo session.save_path^="%SESSION_DIR%" >> %INIFILE% + REM Unset PHP_INI_SCAN_DIR to disable open_basedir restrictions (to limit debug effort) REM SET PHP_INI_SCAN_DIR= ECHO "==== Show contents of INI file to set open_basedir ===" type %INIFILE% diff --git a/dev/setup/phpunit/setup_conf.sh b/dev/setup/phpunit/setup_conf.sh index 248d51e3bff..99b211947bd 100755 --- a/dev/setup/phpunit/setup_conf.sh +++ b/dev/setup/phpunit/setup_conf.sh @@ -1,5 +1,5 @@ #!/usr/bin/bash -xv -# Copyright (C) 2024-2025 MDW +# Copyright (C) 2024-2026 MDW # shellcheck disable=2050,2089,2090,2086 ME=$(realpath "$0") @@ -184,9 +184,9 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the # Compute md5 based on install file contents, and on db prefix # filefunc.inc.php holds the version, so include it" # shellcheck disable=2046 - sum=$(md5sum "$ME" $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f ; echo "${TRAVIS_BUILD_DIR}/filefunc.inc.php" ) | md5sum) + sum=$(md5sum "$ME" $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -not -path "${TRAVIS_BUILD_DIR}/htdocs/install/doctemplates/*" ; echo "${TRAVIS_BUILD_DIR}/filefunc.inc.php" ) | md5sum) # shellcheck disable=2046 - cnt=$(md5sum "$ME" $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | wc) + cnt=$(md5sum "$ME" $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -not -path "${TRAVIS_BUILD_DIR}/htdocs/install/doctemplates/*") | wc) echo "MD5SUM $sum COUNT:$cnt" load_cache=0 if [ -r "$DB_CACHE_FILE".md5 ] && [ -r "$DB_CACHE_FILE" ] && [ -x "$(which "${MYSQLDUMP}")" ] ; then From 74fc27b68b2952d0dcfa046d11943323e2bbca8f Mon Sep 17 00:00:00 2001 From: Pichinov-Jose Date: Mon, 18 May 2026 22:04:43 +0200 Subject: [PATCH 3/7] New: open AI Assistant in a popup overlay from top-toolbar icon (#38311) Per maintainer feedback on #38307: "adding a popup (without leaving current page) is better than opening a complete page". The AI Assistant top-toolbar icon (added in develop by e735bed1 via top_menu_ai() in main.inc.php) is a plain that navigates the user away from whatever page they were on. This patch makes the icon open the Assistant in a popup overlay instead, so the user keeps their working context while interacting with the assistant. Approach: Reuses the existing Dolibarr core helper dolButtonToOpenUrlInDialogPopup() (htdocs/core/lib/functions.lib.php) which: - Builds an with accesskey, title, and an icon - On click, injects an