I just updated from 8.4.3 to 8.5.1 and updated this module to the 2.0 version, and was getting this error on all pages with this block, and also when I tried accessing the block layout manager:
TypeError: Argument 1 passed to Drupal\simple_social_icons\Plugin\Block\SimpleSocialIconsBlock::__construct() must be an instance of Symfony\Component\HttpFoundation\Request, array given, called in /core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php on line 25 in Drupal\simple_social_icons\Plugin\Block\SimpleSocialIconsBlock->__construct() (line 66 of /modules/contrib/simple_social_icons/src/Plugin/Block/SimpleSocialIconsBlock.php) #0/core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(25):
I also tried the 2.x-dev branch but it has the same problem. I also tested this on a clean 8.5.1 installation and got the same results.
Line 66 of SimpleSocialIconsBlock.php is this:
public function __construct(Request $request, RouteMatchInterface $route, ImmutableConfig $config, TitleResolverInterface $titleresolver)
Drupal thinks the module's using an array for $request, rather than an instance of Symfony\Component\HttpFoundation\Request. I looked at the Request class changes in 8.5. There are some changes there, but nothing I think is relevant. I also had a look at Drupal 8.5's block module API, which seems to suggest the need to use BlockPluginInterface (which this module does not, right now). I tried that but it did not solve this particular issue; didn't seem to do anything.
I don't really know what has to be adjusted to get this working again. I have had a look at core's BlockBase class and I figure the SimpleSocialIconsBlock class needs some tweaks - I just don't know what to tweak here. Anyone have insights on this?
I have had to remove this block from my site for the time being, to keep my site from showing WSODs.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 2957599-08.patch | 4.3 KB | mahaveer003 |
Comments
Comment #2
caspervoogt commentedComment #3
platinum1 commentedTried installing this module on an 8.6 site. Could not place the respective block.
+1 for this problem
Comment #4
fbas commentedThe problems and a possible solution are described here: https://drupal.stackexchange.com/questions/260187/creating-a-simple-drup...
Comment #5
caspervoogt commentedThanks @fbas. I tried implementing ContainerFactoryPluginInterface and got nowhere with that. Do you have a patch that does that? Do the maintainers have any thoughts here?
Comment #6
mahaveer003 commentedSorry For the late Reply Working On it now.
Comment #7
mahaveer003 commentedComment #8
mahaveer003 commentedHi, I have Added changes to make the module work.
Adding patch for this.
Please review
Comment #9
mahaveer003 commentedComment #10
chishah92 commentedThe patch works fine. I have been able to enable and place the block.
Comment #12
mahaveer003 commented