[UPMERGE] 5.1 -> 2026.x - #3133
Open
github-actions[bot] wants to merge 9 commits into
Open
Conversation
The RuleBundle Condition/Action `configuration` column was changed from
Doctrine `array` (PHP serialize) to `json` for Pimcore 12 / DBAL 4. PHP
serialize preserved the nested Condition/Action object graph (a cartItemAction's
conditions/actions, or a "nested" bracket condition); json_encode() cannot and
turns those objects into "{}", losing the data on save. On read the stored
arrays also no longer rehydrate into objects, so the runtime evaluation (which
expects ConditionInterface/ActionInterface) breaks.
- Condition/Action::setConfiguration() normalizes nested Condition/Action
objects into plain arrays ({id, type, sort, configuration}) for JSON storage.
- Condition/Action::denormalize() rehydrates a stored array back into an object;
the validation processor, its traceable decorator and the cartItemAction
processor use it so runtime evaluation keeps receiving objects.
- AbstractConfigurableRuleElementType drops a non-scalar submitted "id" (the
admin JS submits the whole element as "id" when the loaded nested element has
no id key), which otherwise failed integer validation on save.
doctrine/orm 3.6.8 added a guard in GenerateSchemaEventArgs::setSchema() that
throws unless the DBAL Schema::edit() API (doctrine/dbal ^4.5, currently only
4.5.x-dev) is available. Symfony's doctrine-bridge postGenerateSchema listeners
(messenger transport, cache, lock, remember-me, pdo session) call setSchema()
during SchemaTool::getSchemaFromMetadata(), which CoreShop uses in
coreshop:resources:create-tables (run by coreshop:install). With the latest
stable DBAL (4.4.x) this makes install/CI fail with:
The setSchema() method requires the DBAL Schema::edit() API ...
This feature requires doctrine/dbal ^4.5 or higher.
Cap orm to < 3.6.8 until doctrine/dbal ^4.5 is released as stable; the cap can
be lifted once DBAL 4.5 is available.
[Deps] Cap doctrine/orm < 3.6.8 until doctrine/dbal ^4.5 is released
Adds a cart-item-action scenario that reloads the cart price rules from the database (via a new "the cart price rules are reloaded from the database" step that clears the EntityManager) before recalculating the cart. This exercises the JSON serialize/deserialize of the nested condition + action, which regressed when the configuration column changed from doctrine 'array' to 'json'. Without the fix the nested elements are lost on reload and the discount is no longer applied.
[Rule] Fix nested conditions/actions lost with JSON configuration column
# Conflicts: # src/CoreShop/Component/Rule/Model/Action.php # src/CoreShop/Component/Rule/Model/Condition.php
[UPMERGE] 5.0 -> 5.1
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR has been generated automatically.
Remember! The upmerge should always be merged with using
Merge pull requestbutton.In case of conflicts, please resolve them manually with usign the following commands: