diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index c4f20739faf..04c2c21d884 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -32,7 +32,7 @@ jobs: run: | gh pr edit "$url" --add-assignee rycks --add-reviewer rycks gh pr merge "$url" --merge --auto - + continue-on-error: true - name: Assign reviewer method 2 env: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e1f97436b60..c4deb467261 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,8 +3,7 @@ on: workflow_dispatch: pull_request: types: [opened, reopened, synchronize] - branches: - - "18.0" + push: env: ENVGHT: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c2226fb84b..b26721ab58d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -161,7 +161,7 @@ repos: pass_filenames: false # Run on all files - id: php-lint exclude: - (?x)^(htdocs/includes/symfony/.*)$ + (?x)^(htdocs/includes/symfony/var-dumper/Tests/.*)$ - id: php-stan stages: [manual] files: \.(php)$ diff --git a/htdocs/commande/class/orderline.class.php b/htdocs/commande/class/orderline.class.php index b5efe3913f4..e16bde3054e 100644 --- a/htdocs/commande/class/orderline.class.php +++ b/htdocs/commande/class/orderline.class.php @@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; + /** * Class to manage order lines */ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 73f0c481c53..6ee17c17e72 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6664,6 +6664,12 @@ abstract class CommonObject $new_array_options[$key] = null; } + // If we create product combination, we have to clean unique extrafields to prevent duplicates. + // This behaviour can be prevented by external code by changing $this->context['createproductcombination'] value in hook + if (!empty($this->context['createproductcombination']) && $this->context['createproductcombination'] == 'createproductcombination' && !empty($attributeUnique)) { + $new_array_options[$key] = null; + } + // Similar code than into insertExtraFields if ($attributeRequired) { $v = $this->array_options[$key]; diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index b7c9d5e3c45..27829353182 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -782,6 +782,9 @@ class ProductCombination $newproduct = clone $product; } + // To avoid warning with unique extrafields values + $newproduct->context['createproductcombination'] = 'createproductcombination'; + //Final weight impact $weight_impact = (float) $forced_weightvar; // If false, return 0