Problem/Motivation

There are several useful developer tools and tricks that people who are "in the know" know about, and others do not. We should make them more discoverable.

Proposed resolution

a) Add documentation to default.settings.php about the location of the developer-oriented example.settings.local.php file that is one directory up and that people do not notice is there. Right now it just says:

/**
 * Load local development override configuration, if available.
 *
 * Use settings.local.php to override variables on secondary (staging,
 * development, etc) installations of this site. Typically used to disable
 * caching, JavaScript/CSS compression, re-routing of outgoing emails, and
 * other things that should not happen on development and testing sites.
 *
 * Keep this code block at the end of this file to take full effect.
 */
# if (file_exists(__DIR__ . '/settings.local.php')) {
#   include __DIR__ . '/settings.local.php';
# }

which implies that the file should be in the sites/default directory, and there is no mention of the sample file at all.

b) Write a landing-page topic for api.drupal.org telling about this file and any other useful tips we can think of, and development tools.

Some things to list:

- drush cr / rebuild.php
- this sites/example.settings.local.php file
- phpStorm

Remaining tasks

Make a patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

jhodgdon’s picture

Title: Make developer ttricks / tools for D8 more discoverable/obvious » Make developer tricks / tools for D8 more discoverable/obvious
chx’s picture

I said several times that minimal should ship with $config['system.logging']['error_level'] = 'verbose';

dawehner’s picture

#2313059: Add a link to the error settings form on "website encounted an error" message is an issue which dramatically can help here as it will show an actual helpful message, if possible.

I said several times that minimal should ship with $config['system.logging']['error_level'] = 'verbose';

I could agree more. Hiding for example notices and log them instead, is a pain in the ass. I would assume logging them while being hidden
has the potential to slow things down actually quite a lot.

jhodgdon’s picture

I wonder if we should rename the example.settings.local.php to developer.settings.local.php or something like that? It's all developer stuff.

See also #2321407: Suggested setting in example.settings.local.php for render doesn't work in install

pwolanin’s picture

So, I think the idea is that core should default to a "production" mode since too many people don't know how to move out of a developer mode or never look.

Still, I think naming the file as jhodgdon suggests with some pre-baked settings would be very helpful - I'm certainly bit by the error reporting every time I reinstall

jhodgdon’s picture

Could we also default to having the local file stuff at the end of settings.php uncommented? I mean, it already has:

if (file_exists(__DIR__ . '/settings.local.php')) {
   include __DIR__ . '/settings.local.php';
}

So it would definitely work ... I guess there is a small cost associated with checking file_exists on every page load but it sure is annoying to have to have to either uncomment this every time you copy default.settings.php to settings.php to reinstall, or to have to stash default.settings.php every time you pull.

Maybe we should also include instructions on how to reinstall...

pwolanin’s picture

Maybe a drush flag to uncomment this and populate the developer one if absent?

davidhernandez’s picture

I was thinking the same thing. I would love a drush command. "drush setup-all-this-stuff-for-me"

tim.plunkett’s picture

Issue tags: -DX +DX (Developer Experience)
chx’s picture

So, I think the idea is that core should default to a "production" mode since too many people don't know how to move out of a developer mode or never look.

They will install standard.

moshe weitzman’s picture

Don't try to rename the local file in this issue please. It got bikeshed a lot in the prior issue.

jhodgdon’s picture

OK, but it's one level up from the default.settings.php file, so it is, in my experience anyway, not "discoverable". At least, I didn't know it existed until this week when someone pointed it out in IRC. Would moving it into the sites/default directory be a bikeshedding problem? It has to live in the same directory as settings.php eventually, so that would seem to be a better spot for it.

clemens.tolboom’s picture

Great we have a developer oriented settings file.

The location sites/example.settings.local.php is not the expected one. I did not discover it either? @moshe weitzman what was the prior 'bikeshed' issue #?

I disagree with "Local development override configuration feature" as the file is supposed to get into the git as mentioned in #6.

What are the reasons to places site related stuff out of default?

chx’s picture

@moshe weitzman, please answer jhodgdon's question and unblock this issue:

Would moving it into the sites/default directory be a bikeshedding problem? It has to live in the same directory as settings.php eventually, so that would seem to be a better spot for it.

moshe weitzman’s picture

Moving the file to sites/default would be fine, I think.

mortendk’s picture

i know theres a few themers as well who really would like to know when we make the site explode when we accedently forgets to do close {% endif %} so i guess the only way is to drop in $config['system.logging']['error_level'] = 'verbose'; in our local enviroment ?
... asking for a friend offcourse ;)

mortendk’s picture

i know theres a few themers as well who really would like to know when we make the site explode when we accedently forgets to do close {% endif %} so i guess the only way is to drop in $config['system.logging']['error_level'] = 'verbose'; in our local enviroment ?
... asking for a friend offcourse ;)

moshe weitzman’s picture

Status: Active » Closed (works as designed)

No activity. Please reopen if you have a concrete suggestion.

jhodgdon’s picture

There are two concrete suggestions already in the issue summary. Just because no one has made a patch is not a great reason to close an issue.

Anyway, I've added a properly templated summary, and edited it to remove the objection that was raised earlier about moving the local settings example file elsewhere or renaming it. But still, at least some people don't find it (myself and one other commenter), so it would be helpful if we had a pointer to it.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wdev’s picture

On a development site I would suggest uncommenting the following lines in the settings.php file. emacs sites/default/settings.php

if (file_exists(__DIR__ . '/settings.local.php')) {
include __DIR__ . '/settings.local.php';
}
and then copying the file example.settings.local.php from /sites folder to /sites/default folder and rename it to settings.local.php

cp sites/example.settings.local.php sites/default/settings.local.php
In addition to adding the following setting

$config['system.logging']['error_level'] = 'verbose';
it also adds a few other settings which will help you in debugging and making development easier. If you don't want any of them in particular, you can always comment them out.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Title: Make developer tricks / tools for D8 more discoverable/obvious » Add documentation for example.settings.local.php

Suggesting a new title that tells the reader what is being added. Because I didn't know what 'tricks' meant here.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.