Problem
Some Open Social modules provide optional fields (e.g. the like_and_dislike field installed through Social Like). However, there are modules declaring default view modes for their entities that include these optional modules without declaring a dependency on the module that provides the field.
An example is the Social Post and Social Comment modules that provide configuration for Posts and Comments. Neither of these modules declares a dependency on Social Like (or Like and Dislike) but they both include the like_and_dislike field provided by those modules.
Solution
Identify all modules that provide (optional) fields. See how they should be added and ensure they're not in the default view mode exports. If a module provides a required field that should be installed by default but a dependency is missing then the dependency should be added.
In the specific case of the like_and_dislike module, it may be sufficient to enable the module in the like_and_dislike.settings.yml file and remove the field definition from the exported entity_view_display file. The module seems to add fields and view modes on its own based on its settings.
As part of this module we may want to create a config_extend module that can act in a similar way as config/optional but deep-merging configuration (similar to an override) instead of requiring the installation of an entire configuration object. This can make it easier for modules to extend existing configuration when the module is enabled and remove this configuration when the module is disabled.
Comments
Comment #3
kingdutch