Commit graph

155323 commits

Author SHA1 Message Date
Laurent Destailleur
25ef7d42ea Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop 2026-07-15 20:46:43 +02:00
MDW
ca789645fc
Fix: Use AI provider agnostic .agents, update commit exclusion: develop and version branches (#39189)
* qual: Update branch protection rules in AGENTS.md

Updated the branch protection rules in AGENTS.md to reflect the new policy of never committing directly to the `develop` branch or version branches matching the regex `^\d+\.\d+$`.

* Fix: Rename .claude directory to .agents

Renamed the .claude directory and its contents to .agents.
.agents is AI provider agnostic.
2026-07-15 20:40:45 +02:00
Laurent Destailleur
40e7493eac Debug v24 2026-07-15 20:31:48 +02:00
Laurent Destailleur
7624ab0b0a Doc 2026-07-15 19:31:58 +02:00
Laurent Destailleur
a1c2470021 Debug v24 2026-07-15 13:04:32 +02:00
Laurent Destailleur
4ddbfd977f Fix regressions 2026-07-15 02:34:01 +02:00
Laurent Destailleur
ad4ceba536 Automated merge from 23.0 to develop 2026-07-15 02:06:09 +02:00
Laurent Destailleur
b97959e5f0 Doc 2026-07-15 01:27:33 +02:00
Laurent Destailleur
967897f763 Automated merge from 22.0 to 23.0 by tool pullmerge.sh 2026-07-15 01:26:14 +02:00
Laurent Destailleur
349c283a4a Backport ci optimizations 2026-07-15 01:22:24 +02:00
Laurent Destailleur
79242074f5 Backport ci optimizations 2026-07-15 01:20:38 +02:00
Laurent Destailleur
4f27660d6d Automated merge from 21.0 to 22.0 by tool pullmerge.sh 2026-07-15 01:15:01 +02:00
Laurent Destailleur
675b5bf1bc Doc 2026-07-15 00:59:45 +02:00
Laurent Destailleur
902aa3ca88 Automated merge from 20.0 to 21.0 by tool pullmerge.sh 2026-07-15 00:58:26 +02:00
Laurent Destailleur
a326afccdc Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-15 00:56:54 +02:00
Laurent Destailleur
f267603a7c Fix mailmap file 2026-07-15 00:56:44 +02:00
w3houde
ef6631e9bd
Fix #38963 enforce website write right on legacy filemanager (#39160)
The legacy FCKeditor file manager connector (config.inc.php, also included
by browser/default/browser.php and connectors/php/connector.php) only called
main.inc.php and never checked any module right on 21.0 and 22.0, so any
authenticated user, even one with no permission, could reach the connector,
browse the medias directory and upload files.

The permission check already present on 23.0 and develop was never backported.
This adds the same guard so a non-admin without website write right is refused.
Reported by Abderrahmane Aksoum.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-07-15 00:52:28 +02:00
Grégory Aliot
61899bb8cd
FIX #39113 CSV export: decode HTML entities in header labels (#39151)
Extrafield labels are stored HTML encoded in llx_extrafields.label
because they are saved through Translate::trans(), which runs the
string through htmlentities(). write_title() wrote the label as-is,
so the CSV header line showed raw entities (Donn&eacute;es instead of
Données) while the data cells were fine. With a ; separator the
trailing ; of each entity also wrapped the label in double quotes.

Decode entities and remove HTML with dol_string_nohtmltag() before
csvClean(), consistent with the TSV and Excel export drivers. For the
derived _label column of Select extrafields, append the suffix before
csvClean() so the column stays valid CSV when the decoded label
contains the separator or a quote.

Signed-off-by: Gregory Aliot <greg.aliot@gmail.com>
Co-authored-by: Gregory Aliot <greg.aliot@gmail.com>
2026-07-15 00:44:37 +02:00
w3houde
fe1386fa2d
Fix #38860 build valid ldap:// URI for scheme-less host on PHP 8.3+ (#39167)
Since PHP 8.3 ldap_connect() takes a single URI argument. connectBind()
concatenated host and port as "host:port", which is a malformed URI for a
scheme-less host (localhost, 192.168.0.2) since the host is then parsed as the
URI scheme, so the following bind returns false. It also appended ":port" to an
already qualified ldaps:// URI. Prefix scheme-less hosts with ldap:// and leave
ldap(s):// URIs untouched.

Signed-off-by: Dolicraft <clement@pixodeo.com>
2026-07-15 00:41:18 +02:00
TowyTowy
5c6e4f486d
FIX dol_string_nohtmltag() skips double-space collapsing when string starts with a double space (#39175)
The double-space removal loop guarded its condition with the truthiness
of strpos():

    while (strpos($temp, "  ")) {

strpos() returns int 0 when the first double space is at position 0 of
the string, and 0 is falsy, so the loop body never runs. As a result NO
double spaces are collapsed at all in that string, including interior
ones. This happens for any input that begins with two spaces, e.g. text
whose leading "<br><br>" is turned into two leading spaces by the
removelinefeed step just above. The trailing trim() hides the leading
spaces but the interior double spaces survive, producing wrong output
(e.g. "Total  amount  due" instead of "Total amount due").

Fix by comparing against false, the standard PHP idiom used elsewhere in
this codebase. Strings that do not start with a double space were already
handled correctly, so behaviour is unchanged for them. Also corrected the
neighbouring comment ("double quotes" -> "double spaces").

Signed-off-by: TowyTowy <towy@airreps.link>
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-15 00:40:03 +02:00
github-actions[bot]
e8227696b4
PHPStan > Update baseline (#39174)
Co-authored-by: Dolibot <dolibarr-bot@users.noreply.github.com>
2026-07-15 00:39:16 +02:00
MDW
03319e88c9
Qual: Improve some CodingPhpTest notices with line numbers (#39176)
* Qual: Improve a notice with line numbers

* Qual: Fix PHPStan ci when no files are to be analyzed
2026-07-15 00:38:28 +02:00
Charlène Benke
a366cee392
create categorie_fichinter-fichinter not run (#39177) 2026-07-15 00:37:05 +02:00
Charlène Benke
10492c5c81
Add 'ficheinter' to module security tests (#39180) 2026-07-15 00:36:38 +02:00
Charlène Benke
d8a61e5200
Add 'notnull' attribute to fk_statut field (#39179)
generate warning error on list
2026-07-15 00:36:11 +02:00
Laurent Destailleur
45c13ab4ef Doc 2026-07-15 00:06:18 +02:00
Laurent Destailleur
29f4ddcdf1 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-15 00:03:29 +02:00
Laurent Destailleur
9d5c3a33b9 Doc 2026-07-15 00:03:17 +02:00
Laurent Destailleur
eb998bbc67 Update agents setup files 2026-07-14 23:57:05 +02:00
Zakaria Boushaba
c8ba7f4696
FIX #37775 Improve extra fields merge when creating invoice from template (#39173)
* FIX Invoice creation from template ignores extra fields set in form

* Fix Strict comparison using === between mixed and null will always evaluate to false

---------

Co-authored-by: Zakaria Boushaba <z.boushaba@vold.africa>
2026-07-14 13:51:21 +02:00
MDW
9ecec7b248
Qual: Update logToCheckStyle (now extracts PHP Lint error msg) (#39169)
# Qual: Update logToCheckStyle (now extracts PHP Lint error msg)

logToCheckStyle  was updated to extract PHP Lint (php -l) errors.
So they will show in the summary report and as annotations.
2026-07-14 13:50:39 +02:00
MDW
ff2adb5b84
Qual: Update Phan baseline.txt (#39170) 2026-07-14 13:49:56 +02:00
Laurent Destailleur
66daa3ffed Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-14 00:47:15 +02:00
GregcodeOhm
8f85bf6b0d FIX phan and phpstan errors on 21.0 static analysis (#39152)
Two errors were surfaced on the 21.0 branch by the automated pullmerge
from the 18.0 to 20.0 branches, and they make the phan and phpstan CI
jobs fail on every open pull request:

- htdocs/takepos/invoice.php: dol_htmloutput_errors() second argument
  must be an array, not null (phpstan).
- htdocs/societe/class/societe.class.php: the string parameter $remise
  must be cast to float before the multiplication, like the surrounding
  lines already do (phan PhanTypeInvalidLeftOperandOfNumericOp).

Signed-off-by: Gregory Aliot <greg.aliot@gmail.com>
Co-authored-by: Gregory Aliot <greg.aliot@gmail.com>
2026-07-14 00:46:59 +02:00
MDW
7c43affbdb
fix: Remove extra closing parenthesis in user note permission check (#39150)
Removed an extra closing parenthesis in the user note permission check to fix a syntax error. Also added a new copyright line for 2026 and updated the parameters array formatting for consistency.
2026-07-14 00:43:23 +02:00
GregcodeOhm
edc19593c9
FIX phan and phpstan errors on 21.0 static analysis (#39152)
Two errors were surfaced on the 21.0 branch by the automated pullmerge
from the 18.0 to 20.0 branches, and they make the phan and phpstan CI
jobs fail on every open pull request:

- htdocs/takepos/invoice.php: dol_htmloutput_errors() second argument
  must be an array, not null (phpstan).
- htdocs/societe/class/societe.class.php: the string parameter $remise
  must be cast to float before the multiplication, like the surrounding
  lines already do (phan PhanTypeInvalidLeftOperandOfNumericOp).

Signed-off-by: Gregory Aliot <greg.aliot@gmail.com>
Co-authored-by: Gregory Aliot <greg.aliot@gmail.com>
2026-07-14 00:42:54 +02:00
Laurent Destailleur
a8ec8b3cdf Trans 2026-07-13 23:45:41 +02:00
Nathan
b2bba40457
fix: save member extrafields from subscriptions tab (#39095)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 17:22:25 +02:00
Nathan
68c0415512
fix: delete takepos supplement lines with parent (#39094)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 16:49:55 +02:00
minimexat
4a87b0a265
FIX: #37711 add stock movement batch index (#39124)
* FIX: #37711 add stock movement batch index

* Update ChangeLog

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 16:47:49 +02:00
Laurent Destailleur
6cb5380087 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2026-07-13 16:33:26 +02:00
Laurent Destailleur
dc382c14aa Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-07-13 16:28:07 +02:00
Laurent Destailleur
febbfc8207 Automated merge from 18.0 to 19.0 by tool pullmerge.sh 2026-07-13 16:16:47 +02:00
Nathan
57a47746c7
FIX #39084 Use service ref label on service creation (#39097) 2026-07-13 16:14:22 +02:00
minimexat
1f217c564c
FIX: enforce document upload access checks (#39125)
* FIX: enforce document upload access checks

* Update ChangeLog for version 24.0.0

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 16:13:51 +02:00
Jam Balaya
6f0bc87209
Qual: Fix PHPStan always true/false errors breaking develop CI (#39114)
The full PHPStan analysis that runs on push to develop (and *.0 branches)
reported 5 new 'always true/false' errors, not caught by the per-PR diff
analysis and not yet in the baseline:

- htdocs/document.php: is_numeric() on the int-cast $entity is always true;
  the redundant check is removed.
- htdocs/salaries/stats/index.php: $mode is hardcoded to 'statistics', so the
  three view-switch button state comparisons are constant; replaced with their
  literal results (1/1/2) and removed the now-unused $mode.
- htdocs/theme/md/style.css.php: method_exists($menumanager, 'showmenu') is
  always true since $menumanager is a MenuManager; the redundant check is removed.

Behaviour is unchanged.
2026-07-13 16:11:51 +02:00
Jam Balaya
67aadf2cba
FIX: undefined variables from wrong variable names (#39115)
Several pages read a variable that is never defined on that page (copy/paste
from another page), so PHPStan level 10 flags 'Variable $x might not be
defined' and PHP 8 emits an undefined-variable warning with a null value:

- reception/card.php: $reception -> $object (matches the 10 other builddoc
  blocks in the same file; otherwise the output PDF language is wrong)
- loan/payment/card.php: $object->id -> $id (page uses $id; matches the
  adjacent enabled-button line)
- opensurvey/card.php: ConfirmRemovalOfPoll uses $id -> $numsondage
  (otherwise the confirmation message placeholder is empty)
- opensurvey/results.php: guard $expiredate with !empty() (never defined on
  this page; still falls back to $object->date_fin)
- projet/card.php: guard $morecss with !empty() (never defined here)

No behaviour change beyond removing the undefined-variable reads.

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 16:08:10 +02:00
Jam Balaya
ae463f2234
FIX: stocktransfer addcontact reports false success without a valid object (#39118)
In htdocs/product/stock/stocktransfer/stocktransfer_contact.php the
'addcontact' action assigns $result only inside 'if ($object->id > 0)', but
the success test 'if ($result >= 0)' runs unconditionally. On a POST with no
id/ref the object is not fetched ($object->id == 0), so $result is undefined
and 'null >= 0' evaluates to true, redirecting as if the contact was added.

Initialize $result = -1 at the start of the block so the missing-object case
takes the error branch instead of a false-success redirect. PHPStan level 10
also flagged 'Variable $result might not be defined' here.
2026-07-13 16:07:05 +02:00
minimexat
9b5229ef3a
FIX: #39063 prevent self-edit users updating other notes (#39123)
* FIX: #39063 prevent self-edit users updating other notes

* Update note.php

* Update ChangeLog

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 15:59:46 +02:00
minimexat
6eb81e0166
FIX: check document list read permissions (#39131)
* FIX: Check document list read permissions

* Update ChangeLog

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 15:50:21 +02:00