Closed (fixed)
Project:
Context
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Nov 2017 at 15:41 UTC
Updated:
3 Jun 2021 at 17:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joao sausen commentedFor now the only content I can think of that can be added is block_content.
Comment #3
maaty388 commentedReplace the line 388 with this
Just one depency injection...
I tested this.
Also where can I see if depencies are getting exported?
I went debugging and saw that something is added to dependency array.
Comment #4
joao sausen commentedJust export and the the yml file generated, you will be able to see if there is a content entry on dependencies, it will be something like:
Comment #5
maaty388 commentedI tested this patch and its working.
I added block Page title and it was not exported to the config because this is working just for block_content blocks.
Should depencies for blocks get exported as well?
Comment #6
joao sausen commentedIt is maybe a better idea to add a dependency to the block directly, if its a custom block, it will have a dependency in the block content already. What do you think? I will work on it when I have time.
Comment #7
maaty388 commentedYes I think that will be much better :)
Comment #8
gambryNice work guys.
But
I thinkthe dependency calculation should live inside each Condition/Reaction plugin.The context calculateDependencies() should only collect the condition/reaction plugins instances dependencies and merge them to the parent::calculateDependecies(), if anyConfigEntityBase::calculateDependencies() already process each condition/reaction instance calculateDependencies(), it just a matter of adding some logic, as at the moment it just return an empty array .Comment #9
gambryAttached patch add dependencies for block using a PluginDependencyTrait(). This dependencies are only for the Blocks ContextReaction plugin.
It adds all required block dependencies: configs, content and modules.
This issue summary needs to be update, and maybe follow up must be create to add dependency for example on the selected theme for the Theme ContextReaction plugin.
Also settings 8.x-1.x as target branch due #2933080: 8.x-4.x branch is attached to 7.x code.
Comment #10
gambryUpdating the issue summary.
Comment #11
gambryUpdating the issue title to reflect what the work on this issue refers to (ContextReaction\Blocks dependencies).
Comment #12
BarisW commentedCan we have this patch in please? We need it on every project we work on, to make sure blocks created on a local environment will get created on other environments using config management
Comment #13
BarisW commentedPlease commit, so we don't have to use patches for our deployments anymore.
Comment #15
boshtian commentedComment #17
lamp5Hi quys. I think that something went wrong and this issue still exists. I can see that calculateDependency method is never called so we have no dependencies for our blocks. I tested patch from #2 and it works but need reroll.
Comment #18
paulocsI'll provide a patch for it.
Comment #19
manish-31 commentedI have created a reroll patch for 8.x-4.x, needs review.
Comment #20
paulocsI created a new patch to add the dependency.
The problem of patch #2 is that it calculates the block dependency in the context entity and it is not right IMHO.
In the patch that I attached, it adds dependency for conditions and reactions.
Please review it.
Comment #21
paulocsSmall documentation fix.
Comment #22
guilhermevp commentedPatch #21 adds dependency successfully. Moving to RTBC and updating branch.
Comment #24
paulocsFixed!
Thanks.