Commit graph

153 commits

Author SHA1 Message Date
MDW
f142240083
Qual: Fix phan notices (#37837)
* Qual: Ignore PhanUndeclaredProperty for specific lines

* Fix: Update payment mode reference in PDF generation

# Fix: Update payment mode reference in PDF generation

The payment mode reference in the PDF generation was incorrectly using `type_payment_code`, an unknown property in Salary.
It has been updated to use `type_code` as used elsewhere for the same purpose.

* Qual: Typing of several DDLUpdateField field_desc items made optional

# Qual: Typing of several DDLUpdateField field_desc items made optional

Not all fields are required for updateing the DB typing, and ExtraFields was not providing all of them.

* Qual: Update typing for phan notices

# Qual: Update typing for phan notices

Fix typing mismatches

* Qual: Fix extrafields typing in objectline_create.tpl.php

# Qual: Fix extrafields typing in objectline_create.tpl.php

- Update typing for phan

* Qual: Fix typing for Phan & re-use encrypted password when requested

# Qual: Fix typing for Phan & re-use encrypted password when requested

- Added a cast to string for the crypted password to hint phan that it returns the string version (not the array)
- Added a check to ensure the password is not already crypted before generating a new password.
- Updated the type hints for parameters `$changelater`, `$notrigger`, `$nosyncmember`, and `$passwordalreadycrypted` to include the range of possible values.
- Updated the return type hint for the `setPassword` method to include the range of possible error values.

* Qual: Fix file argument to showPreview() calls

# Qual: Fix file argument to showPreview() calls

Fix argument type mismatches by adjusting '$file' arguments in showPreview calls.

* Qual: Update login_c type to string

# Qual: Update login_c type to string

login_c is username from db.

* Qual: Update type hints in treeview.lib.php

# Qual: Update type hints in treeview.lib.php

Update type hints for static analysis.

* Qual: Add null check for objecttmp in selectForFormsList

# Qual: Add null check for objecttmp in selectForFormsList

Add null check for objecttmp before calling selectForFormsList to ensure static analysis

* Qual: Fix phan through null check on object argument

# Qual: Fix phan through null check on object argument

- Do null check to avoid null parameter (fix phan);
- Set more specific type for argument.

* Qual: Change type hint of $remise_percent parameter to float

# Qual: Change type hint of $remise_percent parameter to float

DB type is float, so correct arg type to fix phan notice.

* Qual: Ignore some phan notices

The descriptions for the linkedObjectsFullLoaded and oldcopy properties have been updated to avoid modification by code formatting tools

* Qual: Update phan baseline

* Qual: Cast remise_percent to float to match typing requirements

* Qual: Cast label to string to help static analysis

* Qual: Update date_cancel property type and assignment

To fix phan notices:

- The date_cancel property type was changed from 'int|string' to 'int|""' to match return type from jdate().
- Additionally, the assignment of date_cancel was updated to use dol_now() instead of $this->db->idate(dol_now()).

* Qual: Provide the expected user_id instead of the User object

Changed the user fetch logic from using `user_author` to `user_creation_id`

* Qual: Correct bool argument from 0 to false ($fill)

* Qual/Fix: Correct date converted to dol_print_date

* Qual: Fix argument type for addline()

* Qual: Update Phan baseline.txt
2026-04-13 12:50:23 +02:00
Laurent Destailleur
f6ec5b44fe CI 2026-02-08 14:51:11 +01:00
Laurent Destailleur
5c6bc657f4 CI 2026-02-08 12:58:22 +01:00
Laurent Destailleur
b82f488c54 Fix CI 2026-02-08 00:11:01 +01:00
Laurent Destailleur
f133fce841 Debug v23 2025-12-21 16:04:12 +01:00
Laurent Destailleur
38a7524846 Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-09-28 20:01:36 +02:00
ldestailleur
752e06f5fc FIX #35520 FIX #35522 2025-09-28 15:21:20 +02:00
R0ck3n
6334fa5bea
NEW: Add prepare() method to DoliDB class (rebuild) (#35249)
* feat:prepared sql for mysqli and postgres

* refactor:remove whitespace

* Update DoliDB.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-09-08 02:37:42 +02:00
ldestailleur
9276042264 Fix CI 2025-03-06 11:34:27 +01:00
ldestailleur
7a0e9d4dc1 Accept utf8 chars in the natural_search in mode 3. Close #32930 2025-03-06 04:00:42 +01:00
ldestailleur
caead5de9f Fix protect use of sanitize to make sql injection 2025-03-06 03:29:54 +01:00
Laurent Destailleur (aka Eldy)
113a59a135 Debug v21 2025-01-03 19:50:38 +01:00
Laurent Destailleur
bd170e0474 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2024-11-12 11:33:31 +01:00
MDW
b91c99b18a
Qual: Fix phan/phpstan notices in class files (part 3) (#31578)
* fix phpstan in conf class (#31630)

* fix phpstan

* fix phan

* Fix merge

* Qual: Avoid notification with typing hint

* Qual: Fix notices link.class

* Qual: Fix notices link..socialneetworkmanager.class and DoliDb->DoliDB

* Qual: Fix notices for link..utils.class

* Qual: Fix notices for db classes

* Update translate.class.php

* Update translate.class.php

---------

Co-authored-by: Frédéric FRANCE <frederic34@users.noreply.github.com>
Co-authored-by: Laurent Destailleur <eldy@users.sourceforge.net>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-10-29 22:44:47 +01:00
Laurent Destailleur
96046c40a8 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop 2024-09-27 16:13:39 +02:00
John BOTELLA
25754d87c9
FIX : FATAL ERROR abusively triggered due to incomplete regex (#31052)
* Fix regex detection

* New regular expression to include offset
2024-09-26 22:38:38 +02:00
MDW
d6948077b2
Qual: Fix spelling/update .pre-commit configuration (versions) (#30546)
* Qual: Update pre-commit configuration

* Qual: Update spelling

* Ignore use of deprecated constant
2024-08-07 01:20:43 +02:00
Frédéric FRANCE
fbbdf7fb3e
fix cti (#30323) 2024-07-09 19:29:35 +02:00
Laurent Destailleur
bd2a0b9e55 Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2024-06-25 15:13:51 +02:00
Frédéric FRANCE
e57e99fe19
fix warning with pgsql DoliDB.class.php (#30153) 2024-06-25 15:12:03 +02:00
jyhere
88a294df22
CHANGE: add a notice in getRows() instead of returning false (#29790)
* CHANGE: add a notice  in getRows() instead of returning false

* CHANGE: replace notice by a fatal error when using getRows with no limit
2024-06-03 18:03:17 +02:00
Laurent Destailleur
b1f4f09b1c Code comment 2024-05-06 18:25:06 +02:00
Laurent Destailleur
6358f89c0d Fix phan warnings 2024-04-28 17:10:51 +02:00
Laurent Destailleur
a9f5b5c227 Doxygen 2024-04-27 18:08:13 +02:00
Laurent Destailleur
132595f10f CSS customreport 2024-04-10 01:38:36 +02:00
Frédéric FRANCE
00b2185813
fix phpstan (#29258)
* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan
2024-04-07 11:50:26 +02:00
MDW
c7560a7c89
Qual: improve typing for jdate
# Qual: improve typing for jdate

Limit jdate return type to int|'' .
Tested with phan and phpstan.
This will allow setting the same type on the date fields and allow
detecting the assignment of non empty strings.

int|''|'specific value'  also works, so could be used on other fields.
2024-04-02 13:40:04 +02:00
Laurent Destailleur
68babcbc46 NEW Add sql stddev_pop db function. 2024-03-29 14:52:27 +01:00
MDW
fc6af20479
Update typing for database functions 2024-03-21 00:00:00 +01:00
MDW
6e5c4ef851
Fix PHPDoc date_m typo 2024-03-11 21:43:50 +01:00
Laurent Destailleur
b963a9ab36 Fix phpunit 2024-03-11 16:30:33 +01:00
Laurent Destailleur
553587b660
Update DoliDB.class.php 2024-03-11 16:27:46 +01:00
Laurent Destailleur
5b921d0dc4
Update DoliDB.class.php 2024-03-11 16:26:17 +01:00
ATM john
24059b0b8d get rows security 2024-03-06 17:24:23 +01:00
Lucas Marcouiller
f84ae10dbf
Fix some php warnings (#28278)
Co-authored-by: Hystepik <lmarcouiller@nltechno.com>
2024-02-19 17:57:16 +01:00
MDW
044d342956 Fix: LABEL is required on the db classes.
# Fix: LABEL is required on the db classes.

Define const in parent type so that it is required in the subclasses.
2024-01-29 18:56:17 +01:00
MDW
3a4cef8705 fixup! QUAL Force subclass MINVERSION (#26314) 2024-01-23 21:20:35 +01:00
MDW
4b162cefee QUAL Force subclass MINVERSION (#26314)
* Define DoliDB::VERSIONMIN as mandatory constant in subclass

See https://stackoverflow.com/a/43134924/6378634

This also helps static tool checks
2024-01-23 20:47:19 +01:00
MDW
89004f7e03
Qual: Spelling htdocs/core (#27491)
Highlights:
- initialY in pdf_standard.modules.php was unused
  - remove (otherwise -> initially) (+same in other file)
2024-01-13 19:48:20 +01:00
Laurent Destailleur
aba9afe9f1 NEW Add method getPublicImageOfObject() for website module 2024-01-12 13:05:28 +01:00
Laurent Destailleur
97ae114265 FIX Universal search syntax accept string with ' in the IN 2023-12-19 15:01:21 +01:00
Laurent Destailleur
dae7bb5e80 Fix phpstan 2023-12-15 11:02:50 +01:00
Laurent Destailleur
dc134cddba FIX Remove useless code line that make phpstan hang with not enough
memory
2023-12-15 10:46:49 +01:00
MDW
24f8488b48
QUAL Force subclass MINVERSION (#26314)
* Define DoliDB::VERSIONMIN as mandatory constant in subclass

See https://stackoverflow.com/a/43134924/6378634

This also helps static tool checks

* fixup! Define DoliDB::VERSIONMIN as mandatory constant in subclass
2023-10-21 16:27:52 +02:00
hystepik
597b36e57c Fix : php8.1 warnings with strict mode 2023-06-10 10:47:36 +02:00
Laurent Destailleur
f964f14c85 Fix phpunit 2023-01-04 17:36:31 +01:00
Laurent Destailleur
b005c9389b Doxygen 2023-01-03 18:54:11 +01:00
Laurent Destailleur
85e1bd722d
Merge pull request #22819 from noec764/14_FIX_getNextValue
FIX: GetNextValue() adding regexsql() function
2022-12-01 17:27:36 +01:00
Laurent Destailleur
53a1867be8 Fix phpcs 2022-11-24 16:40:44 +01:00
stickler-ci
97618510e5 Fixing style errors. 2022-11-10 16:19:12 +00:00