Problem/Motivation

Currently, this module only supports a single configuration for each social network. When placing multiple Instagram blocks, for example, each block must display the same feed.

Proposed resolution

- Treat the global configuration as defaults for new blocks
- Add relevant settings to block configuration

Comments

brian.reese created an issue. See original summary.

brian.reese’s picture

I've gotten a start on this. Submitting a patch which does the following:
- Treats existing global configuration as defaults for new block instances (if configured)
- Adds a "Customize" option to each block that is unchecked by default. Checking this option adds fields to the block
- When the global config is empty or incomplete, the "Customize" option is disabled and the additional block fields are required

Todo:
- There are a number of settings on the global config that are used directly by preprocess functions (e.g. Drupal::config('socialfeed.facebooksettings')->get(<setting>)) and not by the block plugin. These have been left as-is on the global config forms and are not configurable on the block. It might make sense to add fields to the block plugin and pass values to the respective theme implementations
- I'm unable to test the facebook block due to https://www.drupal.org/project/socialfeed/issues/2977624
- Automated tests would be nice

brian.reese’s picture

Submitting an updated patch. This one also adds an a new permission, 'administer social feeds', to the module.

brian.reese’s picture

brian.reese’s picture

This latest patch also addresses uncaught exceptions from the facebook sdk and other edge cases resulting from invalid feed configuration.

rgristroph’s picture

I read through this code and have also been testing it, it looks good.

  • Hemangi Gokhale committed da54ca8 on 8.x-1.x
    git commit -m 'Issue #2984276 by brian.reese: Allow block configuration...
hemangi.gokhale’s picture

Status: Active » Fixed

Thanks for the excellent work @brian.reese, I've committed the code with some minor code changes & improvement.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.