Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX T230598 #433

Open
wants to merge 71 commits into
base: 17.0_koesio
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8d9ddf4
fix comment about datehour -> datetime
rycks Jan 30, 2024
1f21e1a
fix #27883 : zero could be a value stored
rycks Jan 30, 2024
356bb80
Merge pull request #27903 from rycks/14.0_fix_datehour_to_datetime_co…
eldy Jan 30, 2024
662ab45
Merge pull request #27904 from rycks/14.0_fix_zero_could_be_a_value_i…
eldy Feb 1, 2024
ab585b6
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Feb 1, 2024
efa977b
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Feb 1, 2024
07d0093
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Feb 1, 2024
5f24f79
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Feb 1, 2024
7b17884
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 1, 2024
a237f5d
Merge branch '17.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 1, 2024
ed3bfb1
Qual: Backport pre-commit to 17.0 (#27948)
mdeweerd Feb 2, 2024
72305a9
Qual: pre-commit: run phpcs on all files in 'main' branches. (#28018)
mdeweerd Feb 5, 2024
015546b
FIX: line special_code never saved (#28051)
noec764 Feb 7, 2024
5a756ff
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Feb 7, 2024
a2f58f1
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Feb 7, 2024
7926069
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 7, 2024
4a0519c
Merge branch '17.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 7, 2024
b92b8c4
fix cunits.class.php (backport) (#28068)
frederic34 Feb 8, 2024
fb69347
FIX CVE-2024-23817 (#28089)
hregis Feb 9, 2024
6a8be83
14.0 fix CVE 2024 23817 (#28090)
thomas-Ngr Feb 9, 2024
2c07bd7
FIX: Bar code verification should be done by entity because generatio…
noec764 Feb 9, 2024
f5df332
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Feb 9, 2024
48c3dfb
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Feb 9, 2024
e22dabe
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Feb 9, 2024
027e033
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Feb 9, 2024
2f1eecd
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 9, 2024
92afb65
Fixed default value for radio extrafield (#27066)
W1W1-M Feb 10, 2024
60f15ba
Qual: Backport: pre-commit php-cs with cache (#28123)
mdeweerd Feb 12, 2024
52ab3db
Release 17.0.4
eldy Feb 12, 2024
36d9022
Changelog
eldy Feb 12, 2024
7e652b9
fix token to link (#28141)
atm-jpb Feb 12, 2024
280ceef
outputlangs must not be a string as default value like others generat…
rycks Feb 12, 2024
1ef91d3
FIX avoid Unknown column 'pfp.ref_fourn' (#28145)
hregis Feb 15, 2024
acf09b8
Fix: Make all 'relative paths' absolute (#28196)
mdeweerd Feb 16, 2024
6e5fd5e
FIX: notification module: for supplier orders (any of the 3 triggers)…
atm-florianm Feb 18, 2024
05cf98f
Fix lost POST data when redirection after drag_n_drop an event inside…
MaximilienR-easya Feb 18, 2024
f9426f3
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Feb 18, 2024
1a14c19
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Feb 18, 2024
b3720de
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 18, 2024
2b71c26
FIX 16.0 - parent company gets emptied when updating a third party fr…
atm-florianm Feb 19, 2024
6f5ed78
FIX : Don't display column when it's out of date (#28271)
atm-adrien Feb 19, 2024
46afde0
Fix missing cash control menu in auguria
eldy Feb 19, 2024
ffafad5
Merge branch '17.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 19, 2024
c2980f3
Fix: add missing parameters to existing hook (#28304)
priojk Feb 20, 2024
75ad2e8
fix entity if interventions are shared between entities (#28317)
rycks Feb 20, 2024
6defdcd
better fix with this->entity thanks to regis (#28331)
rycks Feb 21, 2024
52646ee
fix aperçu/dl fichier quand il est dans {userid}/temp (#27211)
atm-saamiperdrix Feb 21, 2024
f7e8725
Clean code
eldy Feb 21, 2024
8c2a910
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Feb 21, 2024
a76eafa
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Feb 21, 2024
88da45d
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 21, 2024
1f129fe
Merge branch '17.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 21, 2024
af062aa
datenextrun is mandatory as dolibarr 16.0 (#28344)
rycks Feb 22, 2024
bb12b0c
fix: display root account according root label in balance bookkeeping…
FHenry Feb 26, 2024
4c116e1
Doc
eldy Feb 29, 2024
284fb49
Try a better fix for #28526
eldy Feb 29, 2024
c3ad0bc
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Feb 29, 2024
9ab1f56
Update expensereport.lib.php (#28553)
Delthair Mar 1, 2024
615a808
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Mar 1, 2024
ce4dc61
Merge branch '17.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Mar 1, 2024
f166f15
Qual: Backport/pre commit / log annotation simplification (#28614)
mdeweerd Mar 4, 2024
55c0efa
FIX: Special code is now transmitted by args only in order supplier (…
noec764 Mar 4, 2024
75f1de8
Fix: Deposit lines are not created correctly (#28646)
fmarcet Mar 5, 2024
4dcf98b
fix entity in sql from RemoveFromGroup (#28682)
ATM-NicolasV Mar 7, 2024
7f10566
FIX 17.0: $num doesn't take trigger-modified newref into account, lea…
atm-florianm Mar 7, 2024
4065a59
FIX #24265 regression cannot see all product on takepos (#28753)
daraelmin Mar 11, 2024
2db58f0
Merge branch '14.0' of [email protected]:Dolibarr/dolibarr.git into 15.0
eldy Mar 11, 2024
ab760df
Merge branch '15.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
eldy Mar 11, 2024
2df1ea2
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Mar 11, 2024
5daa7d6
Merge branch '17.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
eldy Mar 11, 2024
89a3671
Merge branch '17.0' of https://github.com/Dolibarr/dolibarr into 17.0…
atm-florianm Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
name: pre-commit
on:
pull_request:
push:
jobs:
pre-commit:
runs-on: ubuntu-latest
env:
RAW_LOG: pre-commit.log
CS_XML: pre-commit.xml
steps:
- name: Install required tools
run: sudo apt-get update && sudo apt-get install cppcheck
if: false

# The next uses the git API because there is no clone yet.
# This is faster for a big repo.
- name: Get all changed php files (if PR)
id: changed-php
uses: tj-actions/changed-files@v42
if: github.event_name == 'pull_request'
with:
files: |
**.php

# Checkout git sources to analyze
- uses: actions/checkout@v4
# Action setup-python needs a requirements.txt or pyproject.toml
# This ensures one of them exists.
- name: Create requirements.txt if no requirements.txt or pyproject.toml
run: |-
[ -r requirements.txt ] || [ -r pyproject.toml ] || touch requirements.txt
# Install python and pre-commit tool
- uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.11"
- run: python -m pip install pre-commit
# Restore previous cache of precommit
- uses: actions/cache/restore@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
# Run all the precommit tools (defined into pre-commit-config.yaml).
# We can force exclusion of some of them here.
- name: Run pre-commit hooks
env:
# SKIP is used by pre-commit to not execute certain hooks
SKIP: no-commit-to-branch,php-cs,php-cbf,trailing-whitespace,end-of-file-fixer,check-json,check-executables-have-shebangs,check-shebang-scripts-are-executable,beautysh,yamllint,shellcheck
run: |
set -o pipefail
pre-commit gc
pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}

# The next uses git, which is slow for a bit repo.
# - name: Get all changed php files (if PR)
# id: changed-php
# uses: tj-actions/changed-files@v42
# if: github.event_name == 'pull_request'
# with:
# files: |
# **.php

- name: Setup PHPCS
uses: shivammathur/setup-php@v2
# Install when we're going to run phpcs
if: |
steps.changed-php.outputs.any_changed == 'true'
||
(
github.event_name == 'push'
&& (
github.event.ref == 'refs/heads/develop'
|| endsWith(github.event.ref, '.0')
)
)
with:
php-version: 8.1
coverage: none # disable xdebug, pcov
tools: phpcs

- name: Run some pre-commit hooks on selected changed files only
if: steps.changed-php.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }}
run: |
set -o pipefail
pre-commit run php-cs --files ${ALL_CHANGED_FILES} | tee -a ${RAW_LOG}

- name: Run some pre-commit hooks on all files on push to "main" branches
if: |
github.event_name == 'push'
&& (
github.event.ref == 'refs/heads/develop'
|| endsWith(github.event.ref, '.0')
)
run: |
set -o pipefail
ln -sf ~/.cache .cache # Absolute path in .pre-commit-config.yaml
pre-commit run --hook-stage manual -a php-cs-with-cache | tee -a ${RAW_LOG}
ls -l ~/.cache/pre-commit/

- name: Convert Raw Log to Annotations
uses: mdeweerd/[email protected]
if: ${{ failure() }}
with:
in: ${{ env.RAW_LOG }}

# Save the precommit cache
- uses: actions/cache/save@v4
if: ${{ ! cancelled() }}
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
# Upload result log files of precommit into the Artifact shared store
- name: Provide log as artifact
uses: actions/upload-artifact@v4
if: ${{ ! cancelled() }}
with:
name: precommit-logs
path: |
${{ env.RAW_LOG }}
${{ env.CS_XML }}
retention-days: 2
171 changes: 171 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
---
exclude: (?x)^( htdocs/includes/ckeditor/.* )
repos:
# Several miscellaneous checks and fix (on yaml files, end of files fix)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: no-commit-to-branch
args: [--branch, develop, --pattern, \d+.0]
- id: check-yaml
args: [--unsafe]
- id: check-json
- id: mixed-line-ending
exclude: (?x)^(htdocs/includes/tecnickcom/tcpdf/fonts/.*)$
- id: trailing-whitespace
exclude_types: [markdown]
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
exclude:
(?x)^( dev/tools/dolibarr-postgres2mysql.php |test/other/test_serialize.php
|test/phpunit/textutf8.txt |test/phpunit/textiso.txt |htdocs/includes/.*
|htdocs/modulebuilder/template/.* |build/debian/dolibarr.postrm |build/debian/dolibarr.postinst
|build/debian/dolibarr.config )$
- id: fix-byte-order-marker
- id: check-case-conflict

# Beautify shell scripts
- repo: https://github.com/lovesegfault/beautysh.git
rev: v6.2.1
hooks:
- id: beautysh
exclude: (?x)^(dev/setup/git/hooks/pre-commit)$
args: [--tab]

# Run local script
#
# For instance to update the license in edited files, you could add to local.sh:
#
# ```shell
# #!/bin/bash
# MYDIR=$(dirname "$0")
# CHANGED_INTERNALS=$(git diff --name-only | grep -v includes)
# "$MYDIR/dev/tools/updatelicense.php" $CHANGED_INTERNALS
# ```
- repo: local
hooks:
- id: local-precommit-script
name: Run local script before commit if it exists
language: system
entry: bash -c '[ ! -x local.sh ] || ./local.sh'
pass_filenames: false

# Check PHP syntax
- repo: https://github.com/mdeweerd/pre-commit-php
rev: v1.6.5
hooks:
- id: php-cbf
files: \.(php)$
args: [--standard=dev/setup/codesniffer/ruleset.xml]
- id: php-cs
files: \.(php)$
args:
[
--standard=dev/setup/codesniffer/ruleset.xml,
--report=emacs,
--severity=5,
]
- alias: php-cs-with-cache
id: php-cs
# Configuration for ci - run on all files with cache
stages: [manual]
args:
[
--standard=dev/setup/codesniffer/ruleset.xml,
--report=emacs,
--severity=5,
--cache=.cache/pre-commit/dolibarr-php-cs.cache,
.,
]
pass_filenames: false # Run on all files
- id: php-lint
- id: php-stan
stages: [manual]
files: \.(php)$

# Prettier (format code, only for non common files)
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
stages: [manual]
exclude:
(?x)^( .*\.(phar |min\.css |lock) |htdocs/(includes|theme/common)/.*
)$
exclude_types:
- php
- executable
- binary
- shell
- javascript
- markdown
- html
- less
- plain-text
- scss
- css
- yaml

# Check format of yaml files
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
hooks:
- id: yamllint
args:
- --no-warnings
- -d
- "{extends: relaxed, rules: {line-length: {max: 120}}}"

# Execute codespell to fix typo errors (setup of codespell into dev/tools/codespell/)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
# Due to a current limitation of configuration files,
# we can specify two dicts only on the CLI.
# You can update the contents of the exclude-file codespell-lines-ignore with the script
# dev/tools/codespell/addCodespellIgnores.sh
args:
- -D
- "-"
- -D
- dev/tools/codespell/codespell-dict.txt
- -I
- dev/tools/codespell/codespell-ignore.txt
- -x
- dev/tools/codespell/codespell-lines-ignore.txt
- --uri-ignore-words-list
- ned
exclude_types: [image]
exclude: (?x)^(.phan/stubs/.*)$
additional_dependencies: [tomli]
- alias: codespell-lang-en_US
# Only for translations with specialised exceptions
# -D contains predefined conversion dictionaries
# -L is to ignore some words
id: codespell
files: ^htdocs/langs/en_US/.*$
args:
- -D
- "-"
- -D
- dev/tools/codespell/codespell-dict.txt
- -L
- informations,medias,uptodate,reenable,crypted,developpers
- -L
- creat,unitl,alltime,datas,referers
- -I
- dev/tools/codespell/codespell-ignore.txt
- -x
- dev/tools/codespell/codespell-lines-ignore.txt
- --uri-ignore-words-list
- ned

# Check some shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
args: [-W, "100"]
Loading
Loading