Questions tagged [configuration]
Use this tag for questions about Drupal's configuration system.
838
questions
-2
votes
0
answers
22
views
How to fix "missing schema" errors, which are reported by "Configuration inspector" module?
I have just installed the module "Configuration inspector". When I call "/admin/reports/config-inspector" I see many errors, mostly "missing schema". How can I safely fix ...
1
vote
1
answer
40
views
How do I override settings.php for Symfony Mailer to use Mailhog for local development?
Now that I am supporting Drupal 10, I needed to set up Mailhog to allow local capturing of emails when I'm testing in my local Docker environment.
I used to use the SMTP and Mail System modules and ...
0
votes
3
answers
77
views
Is it possible to override config in settings.local.php by prepending/appending to the current value?
I have tried both of the following:
$config['my_module.default']['content'] = 'prepend ' . $config['my_module.default']['content'];
$config['my_module.default']['content'] .= ' append';
but the ...
0
votes
0
answers
36
views
Trusted host patterns problem, again
I need to set up trusted host patterns for 3 EC2 instances. They all share same base code, so they all use the "same" settings.php.
On my two (production) instances everything works fine:
...
0
votes
0
answers
31
views
Why does a custom matcher cause a linkit profile to be deleted on module uninstall?
In a custom module, I've set up a custom EntityMatcher in order to get suggestions for instances of my custom entity type in the linkit dialogue. This all works very fine.
However, when uninstalling ...
0
votes
1
answer
37
views
How to update migration field mapping using custom module/form?
I was learning about Drupal migration recently and found out that we can use Migrate Plus module to import migrations as configurations. Hence I started wondering if a migration is imported as a ...
0
votes
0
answers
27
views
Configuration synchronization
I am trying to import views from one of my Drupal 9 sites, we will call it Drupal A to another Drupal 9 site, we will call it Drupal B.
I keep getting this error:
Error message
The configuration ...
0
votes
1
answer
27
views
How to pass block instance configuration settings to TWIG template?
I've got a custom block plugin which has some configuration settings that can set from the block configuration form. How can I then access that configuration info later when the block is being ...
0
votes
1
answer
42
views
How to Save Configuration Data for Custom Block
I'm have a custom module that creates a custom block plugin, but am having trouble figuring out how to add some custom configuration settings to the block.
Just for understanding how to do this, I've ...
0
votes
0
answers
84
views
How to run drush cim command for importing all the configurations
I cloned the drupal project on my local.
I have a Docker desktop app.
so I run docker-compose up -d on command prompt.
docker-compose.yml:
services:
mariadb:
image: wodby/mariadb:$MARIADB_TAG
...
0
votes
1
answer
67
views
Custom field type that has an array property won't save unless serialized, otherwise get "This value should be of the correct primitive type" error
I have a custom field type with two properties I am storing on it. One stores a string. The other I want to store an array. The array should be serialized in the field value table of the database, but ...
0
votes
0
answers
28
views
Install module with required config that may exist
I have a module that have some config in config/install folder, that require config that may already exist in the current config. So I placed those config under config/optional.
But if those config ...
0
votes
1
answer
40
views
is it posible to get the value of other fields right inside the buildForm() method without having to save configuration?
I have a config form with two select fields. The first one(vocabulary) gets populated automatically without problems with options taken from the available vocabularies for users to pick up one. The ...
0
votes
0
answers
92
views
How can you update a single configuration entity using drush?
Every now and then, if I try to import partial configs using drush, like
drush config:import --partial --source=stuff/is/here
drush seems to understand that some of these config entities exist in the ...
0
votes
2
answers
142
views
Config Export changes to different folder
Is it possible to export only the changed configuration files to a specified folder?
When you run drush cex to see the change list of files like this
+------------+----------------------+-----------+
|...
0
votes
0
answers
28
views
Why does Drush:migrate not generate config entities for separate content types?
When using Drupal 9 with modules migrate, migrate_drupal, migrate_upgrade and migrate_plus, and calling drush:migrate --configure-only with a Drupal 7 source database
I see migrations at drush ...
1
vote
2
answers
133
views
Enum class not found when trying to use it in settings.php
I defined an enum in a custom module:
namespace Drupal\my_module\Enum;
enum BuildType: string {
case Apple = 'apple_build';
case Orange = 'orange_build';
}
And I want to use it in settings.php ...
3
votes
0
answers
40
views
Can I use pseudofields in anything other than source?
If I use pseudofields in the source property for my custom plugin, they are correctly substituted with the computed values. If I use them in another configuration (as per the example), they are ...
0
votes
1
answer
23
views
Custom form, add admin editable instructions from settings area to form
I have a custom form that is working great. I'd like to add a field "instructions" right under the title, above the first form field. This "instructions" field is editable in the ...
0
votes
0
answers
39
views
Config split is imported only every second time of jenkins job run
I have some weird behavior with drush cim when running from a jenkins job.
It seems like a config split is only imported every second time or so when the job is run.
The update skript containing the ...
3
votes
0
answers
77
views
Enable a module with sample config that depends on a theme
I have a submodule that provides some prepared configuration via config/install. The goal is to have devs enable that module to get a preconfigured set of content types complete with preconfigured ...
0
votes
0
answers
30
views
Why isn't this configuration saving?
How do I do change configuration when there is a dash in the yml file?
The configuration is the following one.
source:
plugin: url
data_fetcher_plugin: http
data_parser_plugin: xml
urls:
- ...
0
votes
1
answer
48
views
Deleted context link still exists in admin toolbar menu
I have deleted context but in admin toolbar it still showing . On main context admin page context doesn't exists. I have installed/uninstalled module - not helping
How do i remove that link from ...
0
votes
0
answers
24
views
How to find bad tokens stored in config automatically?
I recently deleted some fields (media_term_fruits) and created new fields (media_fruits) on a local dev site. I then exported the config and pushed it to my dev server.
My dev server uses Github ...
0
votes
0
answers
27
views
Can I change the autocomplete to a dropdown for the entity_browser module?
I'd like to be able to change the autocomplete for the Site Sections portion of the entity_browser module.
I'm not seeing any way to modify this within the admin. Am I missing something? Can I do this ...
0
votes
0
answers
18
views
Translate ajax form config
I have created a form where a user has the possibility to add as many section as he want (via ajax), each sectionhas a field (1 field to make it simple).
My question is related to multilingual website,...
0
votes
0
answers
35
views
How to import localized version of a configuration file
With drupal, you can import a single config file.
Let say it is a view config file and let say that this view has been translated in french and has produced a locallized config file under the "fr&...
0
votes
1
answer
59
views
Block Configuration Form Returning Unexpected Value
I'm trying to build a block configuration form. Here's my blockForm code:
public function blockForm($form, FormStateInterface $form_state) {
$form['resolve_ip_addresses'] = [
'#type' => ...
0
votes
0
answers
143
views
Why my custom module configuration are not getting created on module install?
I have created one custom module with config/install folder. This install folder contain content type yml. Basically on install of custom module new content type should be created.
When I use drush en ...
5
votes
0
answers
78
views
How do I import a sync config file into my Kernel unit test?
How do I import a sync config file into my Kernel unit test ?
Specifically, I have some REST resources in files
config/sync/rest.resource.foo.yml,config/sync/rest.resource.bar.yml
At present, when I ...
3
votes
0
answers
78
views
Where do you put install config translations?
I have a Drupal 9 site. When I export site config (drush cex) I get config/sync dir with settings and inside it I have i.e. language/de where translation config is stored. So translations are in ...
2
votes
1
answer
202
views
How to create configurable plugins under a plugin manager?
I have a custom plugin type and annotation. The purpose of it is so people can develop their own clients for an API integration, and tell the system which plugin to use to perform these actions. I am ...
0
votes
2
answers
293
views
Error about non-existing configuration
After trying to import configuration with drush cim it returns an error saying
The import failed due to the following reasons:
Configuration core.entity_view_display.contact_message.kontaktujte_nas....
1
vote
2
answers
215
views
Programmatically add new fields to content type
I have a custom module that has a form that allows the user to select various content types. I would like to create fields for those content types programmatically so that after the form is saved, it ...
0
votes
0
answers
56
views
How to import config to a site installed with a profile?
Good day. I’ve installed a profile, made my settings, entered my content, exported config and pushed everything to the repo. Now, when I clone it somewhere else and attempt to install using the config,...
0
votes
0
answers
105
views
Why does layout builder duplicate the body of a node after a full configuration import?
I used Layout builder for a site (Site A) using Drupal 9 and configured the Article content type to
Use Layout Builder and
Allow each content item to have its layout customized
This allowed me to ...
1
vote
1
answer
200
views
Correct schema for an Entity Reference in config settings
Background
I am creating a schema for a custom module's config settings, which are saved from a simple settings form. It has some basic fields, such as a checkbox for a Boolean value for hiding some ...
-4
votes
1
answer
400
views
Error importing configuration [duplicate]
[error] Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.
The <em class="placeholder">language.content_settings.media.instagram</...
0
votes
0
answers
1k
views
PluginNotFoundException entity type does not exist when trying to uninstall any module
I've got this drupal website from a client that the another developer created, and they've made a mess with many things in this site. I'm having a problem where every time I try to uninstall a module, ...
1
vote
0
answers
69
views
How to invalidate config or service cache
I have a service wich is loading a config at construct time:
class MyService {
public function __construct(ConfigFactoryInterface $config_factory) {
$config = $config_factory->get('my.config')...
1
vote
1
answer
87
views
How should we configure Config link on custom module?
I need to create Config link while enabling module. In routing file, I have mention the path name of config form, but its not directly show in the Configuration page. Below is my routing code.
...
2
votes
1
answer
221
views
How to temporarily override configuration?
I want to be able to contextually modify configuration variables, i.e. within a page controller.
Example
I have a custom ad module which besides other settings has an option to globally disable or ...
1
vote
1
answer
147
views
Config sync & Field default value for entity reference fields
Given two environments dev & live, how do you properly transfer field default values for entity reference fields when deploying with Drush (cex & cim)? The default value is a UUID, which is ...
0
votes
0
answers
231
views
Import config on Drush install with config in non-standard directory
I've got a site set up with its config sync in a directory outside of web root; specifically ../config/sync (relative to the Drupal root). I have that path set for $settings['config_sync_directory'] ...
1
vote
1
answer
194
views
Custom theme settings not saving
I am in Drupal 9.3 and I am working to add 5 new fields to the theme settings. I am following all the instructions I can find. I have tried clearing caches a few times. I can see the fields. But ...
0
votes
2
answers
839
views
How do I create a configuration schema of type array?
I have a PHP array where an instance may look like this:
$mymodule_myarray = [
'first' => 0,
];
I want to have it represented and initialised as part of the configuration for the custom module &...
0
votes
0
answers
24
views
How to inherit Payment Gateway configurations?
I have a main payment gateway which I want to configure.
And multiple other payment gateways which I want to inherit the main gateway's configuration data.
I only have the CommercePaymentGateway ID (...
0
votes
1
answer
565
views
After installing webform, unable to use composer
The crux of this matter is that composer is now not working. I get the following when I try to run almost any composer command. (This Drupal 9 site is a composer installed site, and I would like to ...
0
votes
1
answer
18
views
Is the config object adapted to store datas from many users ( for the purpose of a subscription custom module )?
I have created a custom module that allows to subscribe to some news.
Each user ( and there will be thousands of them ) can register to some news category using that form
On form submit, the couple [...
2
votes
1
answer
180
views
Configuration import continues to list items as 'importable'
I am developing on a Drupal 9 site. I have found something a bit odd when running drush cim. There are a handful of configurations for which it DOES say there was a success, but when you run drush cim ...