Context module doesn't work with Third Party Settings when you add a block via context it doesn't create associated block config entity.
Because of this, we can't integrate context module with Menu Multilingual and at the same time use third party settings. See related issue #2956990: Settings no longer stored as third party settings.
I can add them directly to this config, but then it's not possible to delete these custom settings during my module uninstall process:
'blocks' =>
array (
'f1e391e6-942d-4d38-ae87-570103a4e8f8' =>
array (
'id' => 'system_menu_block:account',
'label' => 'User account menu contexttt',
'provider' => 'system',
'label_display' => 'visible',
'level' => '1',
'depth' => '0',
'region' => 'header',
'weight' => '0',
'custom_setting' => 'value',
'context_mapping' =>
array (
),
'theme' => 'bartik',
'css_class' => '',
'unique' => 0,
'context_id' => 'test',
'uuid' => 'f1e391e6-942d-4d38-ae87-570103a4e8f8',
),
),
The question is, what's the best way to add my settings to context's blocks config?
Comments
Comment #2
matsbla commentedComment #3
matsbla commentedDuplicate of #2953766: Provide a Configuration Schema
Comment #4
jeroentRe-opening since #2953766: Provide a Configuration Schema did not fix this issue.
Comment #5
jeroentComment #6
jeroentI tested this patch with menu_multilingual. In theory this should also fix block_class and context integration but I didn't test that.
The patch attached calls hook_form_block_form_alter in the context block forms. So modules like menu_multilingual and block_class that are implementing
hook_form_block_form_alter()are also called when editing blocks in a context.Comment #8
jeroentComment #9
ilgnerfagundes commentedI applied the patch and did some tests and for me it's working.
Comment #10
paulocsPatch needs a re-roll.
Comment #11
deaom commentedDid not test the patch, just re-rolled it, so it needs additional review.
Comment #12
jeroentBack to RTBC, since the patch was only rerolled.
Comment #13
paulocsI'm setting back to NR because I'm not sure what #9 pointed with the screenshots attached.
We need a more consistent review.
I'll see if I can review it later.
Comment #14
paulocsThanks for it.
Patch looks good.
Comment #16
paulocs