Problem/Motivation
When flippy is used and the block is placed for an entity type, visiting any node of that type results in:
Warning: Undefined array key "provider" in block_theme_suggestions_block()
Warning: Undefined array key "provider" in language_preprocess_block()
Warning: Undefined array key "provider" in menu_ui_preprocess_block()
Warning: Undefined array key "provider" in node_preprocess_block()
[...]
So a typical "provider" key seems to be missing or altered when Flippy is enabled.
Another interesting fact are these keys:
#plugin_id => string (6) "broken"
#base_plugin_id => string (6) "broken"
Steps to reproduce
See above
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
anybodyComment #3
anybodyResaving the block after configuring the flippy settings on the entity type made the error disappear.
Needs steps to reproduce though.
Comment #4
anybodyNo idea how that happened. Please add details, if it should happen to you.
Comment #5
anybodyI guess we should test the following:
And see if that triggers the error. If that doesn't trigger the error, play around a bit and if we can't reproduce it, let's close this.
Anyway, as of the hooks listed, the error will only happen when using the flippy block in certain combinations.
Comment #6
dqd@Anybody: long holding issue here :) Maybe it isn't reproducable for you no more now. But I would like to inform that this happens without Flippy being installed here so I assume that we are close to inverstigate another issue, which can randomly affect many projects, maybe caused on other places or caused by methods used in contrib, which need to be changed. Any news on yours?
Comment #7
dqdPossibly related:
#2756331: Custom blocks cannot be properly exported and imported
Possible interesting contribs:
https://www.drupal.org/project/recreate_block_content
https://www.drupal.org/project/fixed_block_content
Comment #8
hanneshh commentedI had the same problem. The warnings came after every time I flushed all caches.
I think the problem is the same in this module. More precisely:
The $build variable currently doesn't have this: '#configuration' => ['label' => $block->label(), 'provider' => $provider, ...
.. And a lot of Drupal core modules have code that want this $provider value (like core/modules/block/block.module):
Comment #9
anybodyThanks @hanneshh but looking at the code I don't think flippy is doing anything wrong there?
Back to postponed until we have clear steps for reproduction and can say what's causing this... I'm also unsure if flippy is causing this or not.
Comment #10
dudeweb commentedI have this problem on 2 projects now... Must be related to core somehow...
Comment #11
anybody@DudeWeb: Do you have flippy installed on both?
Comment #12
unarain commented@DudeWeb @Anybody, i think the issue is with twig tweak when calling blocks.
Instead of calling your blocks as drupal_block('block_name'), you should be using drupal_entity('block', 'block_name')
Comment #13
dqd@unarain if you refer to the module "Twig_Tweak" this is not installed here by testing this issue, so again, as I sad already above long time ago, it is rather that something in core has changed and contrib needs to follow. So it could be affect multiple contrib projects.
And since this occurs here also without Flippy installed I would suggest to convert this issue to a core block component issue with a changed summary and changed goal for this task which suggests that core thows an exception with a better error output so that contrib maintainers can precicely refer to when/where it is caused on their projects and can change this accordingly.