When installing a fresh version of Drupal 8.2.0-beta2 (and beta3) the given site name is not showing. Instead it just says "Drupal" on the newly homepage.
MacOS Sierra, Apache 2.4.23, PHP 7.0.8. Safari 10.0 (build 12602). See attachment phpinfo. Site installation with language dutch (Nederlands).
Steps to reproduce it:
- Choose "Español" as site language.
- In the "Configure site" section, set the site name, mail, user and password as usual and in the regional options set "España" and "Europe/Madrid" and click in Save and Continue.
- When the install process finish the site name is "Drupal" and not the site name that you set during the install process.
I recorded a gif (drupal_site_name_issue.gif) with the process and the steps to reproduce it.
The system is a MacOS Sierra with php 7.0.12, sqlite, php built-in webserver and Drupal 8.2.1. I also tested with apache 2.4.18, mysql and OSX El Capitan and Ubuntu 16.04 as os with the same results.
| Comment | File | Size | Author |
|---|---|---|---|
| #103 | 2791405-2-103.patch | 4.91 KB | alexpott |
| #103 | 100-103-interdiff.txt | 879 bytes | alexpott |
| #100 | 2791405-2-99.patch | 4.91 KB | alexpott |
| #100 | 98-99-interdiff.txt | 983 bytes | alexpott |
| #98 | 92-98-interdiff.txt | 3.2 KB | alexpott |
Comments
Comment #1
JayBeeDutch commentedJaybee created an issue.
Edit 3th sept. If installing the default english everything is ok. When installing dutch (like I did) the name just changes to "Drupal"
Comment #2
aralnoth commentedI have the same issue. In my case, when I install a drupal site in spanish I see "Drupal" as a site name. When I install the site in english the site name is set properly.
Comment #3
cilefen commentedHave you got the configuration translation module installed?
Comment #4
aralnoth commentedNo, I haven't installed it.
Comment #5
cilefen commentedSite title is a configuration. Configuration Translation is required, and it works. From admin/config/system/site-information:
Comment #6
aralnoth commentedI don't want to translate the site name to any language. I want to install a site in spanish with the site name in spanish. So, when I install a new site, in the installation form I choose spanish as the site language, and then I set the site name that I want. When the install process is finished I found that the site name is always "Drupal". This happen only in drupal 8.2.x, when I make the same process in Drupal 8.0.x or 8.1.x I don't need content translation module to make this.
This happen when the install process is done by drush or by web.
Comment #7
cilefen commentedYes, forget about translation. I misunderstood the issue.
In terms of this being a bug, I cannot reproduce it. I just installed 8.2.1 via the web UI a site en Español with a site name that is different from "Drupal" and the name remains. If you can post the exact steps to reproduce in the issue summary, that will be great.
Comment #8
cilefen commentedComment #9
aralnoth commentedComment #10
carsteng commentedI can confirm this behaviour...
I tried to install with german language only with drush site-install and via UI.
I tested on 8.2.1 and 8.2.4.
After installation the sitename is "Drupal". With english selected it works fine
Comment #11
eyilmazReason: site name is translatable and gets overridden in the task install_finish_translations where the configuration gets updated via
Locale::config()->updateConfigTranslations($names, $langcodes).
Comment #12
eyilmaz1 easy fix would be to make the site_name not translatable by adding translatable: false for name to system.schema.yml .
The result will be, that the site-name is not string translatable anymore, but via config_translation it should be possible to translate that anyway (?).
Comment #13
eyilmazComment #14
alexpottThis is a bug - making the site name not translatable is not the way forward though. Not entirely sure of the best path here. The system.site created by the installer should be in the default language - ie. whatever is installed in. So it should just use what you've saved.
Comment #15
eyilmazIn LocaleManagerConfig line 607+ we can see the comment:
where locale_is_translatable checks for
I think this is related to English as default language for default configuration shipped by modules (?). So this should remain as it is ?.
So the solution could be, that
in line 582
$processed should be system.site from installation and not the default from the module?
so we have to check the language in $active and if it is the same as $langcode & don't translate?
Comment #16
eyilmazlinking the issue, where the translation update was implemented, for further information how it works.
Comment #17
flocondetoileSame bugs here. Seems that this issue is a regression of #2457703: Default translatable site name is "Drupal" (incorrectly). The default config shipped in system module has now as default value for site name 'Drupal', and so this value is get and replace the site name set during the install process if the site is installed in an another language than engliish.
Trying to find the commit between 8.1.10 and 8.2.0 which replace in system.site the empty default value for the site name by 'Drupal'.
The simplier solution could be to remove this default value from system.site. But would be nice to see why this default value has been added.
Comment #18
flocondetoileComment #19
flocondetoileI don't succeed to find the issue which introduce this default value.
This patch fix the issue on my locale instance (on a french install). Let see what the bot think about it.
Comment #21
flocondetoileFound it. This regression was introduced by #2633170: Drupal 8 Install Page: Page title is not complete
Comment #22
flocondetoileAnd of course test failed, because it was introduced too in #2633170: Drupal 8 Install Page: Page title is not complete
Comment #23
amit.drupal commentedi hope its work.
Comment #25
Thew commentedThis should work now.
Comment #27
claudiu.cristeaWe should start with a test that proves the bug.
Comment #28
Thew commentedUsing Drupal 8.2.5-dev,
I think this has been fixed now.
However, if I test in drupal 8.2.1 from https://www.drupal.org/project/drupal/releases/8.2.1, the bug exists.
Comment #29
denutkarsh commented@Thew We still need to make tests for this...
Comment #30
eyilmazHere is a patch with a test.
(Test only)
Comment #31
cilefen commentedComment #32
eyilmazComment #33
flocondetoile@eyilmaz You need to override too the site name set by the intallParameters() method which is set to 'Drupal' in the WebTestBase Class.For exampleSorry, I just saw the SiteNameTest Test...
Comment #34
flocondetoileComment #35
eyilmaz@flocondetoile SiteNameDifferentLanguageTest extends the class SiteNameTest, which already overrides the site_name with a random value.
Comment #36
eyilmazI have no idea why the test for 8.2.x passes. It should fail, as for 8.3.x. here : https://dispatcher.drupalci.org/job/default/289292/consoleFull
Comment #37
flocondetoileThis test failed well on my local instance on 8.2.4.
Comment #38
flocondetoileI relaunched the test.
Comment #40
flocondetoileBut on my local instance 8.2.x, the test pass. Seems that @Thew is right. Seems that this issue has been fixed on the latest dev 8.2.x.
Comment #41
cilefen commentedLook through the commits on each branch and if necessary, https://git-scm.com/docs/git-bisect, to find out what is going on.
Comment #42
lomasr commentedApplied the patch in #30 . At the time of installation I gave the site name "Test Test" , But I am still getting 'Drupal' . Please see the screen.
Comment #43
eyilmazThere is something wrong with the test. It doesn't install the site with the given language. Hiding the patch for now.
Comment #44
flocondetoile@Iomasr: patch #30 is a test only patch to demonstrate the issue. It doesn't contain any fix.
Comment #45
lomasr commentedThanks, Please mention in the comment in #30.
Comment #46
didier misson commentedSame problem.
D8.2.5 in French, and no way to change this TITLE "DRUPAL" ...
Thanks
Comment #48
marcvangendIn case anyone needs a temporary workaround...
You can put a line like this in your settings.php:
Hope that helps.
Comment #49
alexpottThis definitely still happens on 8.3.x - I could go to admin/config/system/site-information and fix it though. Still user input is being lost so this is a major bug to me.
Comment #50
alexpottHere is a test.
Drupal\system\Tests\Installer\InstallerTranslationMultipleLanguageForeignTestwill fail.Comment #51
alexpottHere's a bugfix. Not 100% sure it is the right approach - this is a super complex area.
Comment #53
alexpottThis bug was introduced by #2633170: Drupal 8 Install Page: Page title is not complete - which makes sense since this change introduced a default translation to maintain for system.site:name.
Comment #54
alexpottI think this is a better fix. Because there really isn't a default site name and this also means that if a distribution like commerce is being installed its name is used in the page title.
Comment #55
alexpottLet's also test that distribution names are used my appropriate.
Comment #56
mikeoharaI am testing this as part of DrupalCon Baltimore 2017
Comment #57
mikeoharaI have tested this and it appears to be working in 8.4.x with patch defined in #55 steps as defined in the issue details.
Comment #58
bsnodgrass commented1. Tested and duplicated in 8.4.x according to the steps in the issue summary.
using sitename "Español Install re:#2791405"
The sitename appeared as Drupal at installation (see as-installed.png) completion
using /admin/config/system/site-information I was able to change to the desired sitename (see as-modified.png)
2. Tested Successful with 2791405-2-55.patch (see Two-as-installed.png
There was a warning message during the install process on both attempts
warning:
Fueron descartados 2 textos de traducción porque contienen HTML no permitido o mal formado.Consulte el registro para más detalles.
translated:
2 translation texts were discarded because they contain not permitted or poorly formed HTML. See registration for more details.
Comment #59
bsnodgrass commentedComment #61
idebr commentedClosed #2884917: Site title is not set when installation uses non-English language as a duplicate issue.
It appears the patch fail in #60 was unrelated, since it subsequently passed. Let's see what the testbot has to say.
Comment #62
szeidler commentedI manually tested the installation #55 with the current 8.4.x snapshot and changing the site name for new languages is working like charm.
On a production site I needed to manually update the
system.siteconfig translation item in the database, because changes in the UI didn't have any effect on the<title>. The the configuration forms including admin/config/system/site-information/translate showed the designated value, but it didn't had any effect.Comment #63
ckaotikThis seems to happen when there is a translated configuration for the configuration's default language. The edit form will display the values of the configuration's default language, the translate form will display the translated values. If a translation for the default language exists (which should not happen!), it will always be used for display/output in that language and you are unable to edit it, because it is the default language for which no translation link is offered.
I think we should investigate this issue thoroughly, because this may be a general issue that affects all of Core and Contrib. Maybe someone can write a test for the scenario I described above, to verify this is isolated to
system.site?Comment #65
hhigel commentedProblem still exists with Drupal core 8.3.5.
Possible work-around: see https://www.drupal.org/node/2844755
Comment #66
cilefen commentedThere is no need to change the version. It's understood to be in the development branch.
Comment #67
Anonymous (not verified) commentedCan we open up a follow up for #63?
Manual testing:
<title>after change site name via UI (/admin/config/system/site-information).<title>for new language.So, +1 to add #55 as is. It solves the problem with name for new sites. What is especially nice before the minor update.
Comment #68
gagarine commentedIn my opinion this feel wrong:
That mean we can't have default for configuration? Or can we confirm this is really only a problem during the installation?
Comment #69
gagarine commentedComment #70
cilefen commentedI removed the usability tag, because adding it alerts the usability team. Their input is not needed on this issue. Usability is about interface design, etc. This is just a bug.
Comment #71
chegor commentedI think this bug should be closed as quickly as possible.
Drupal positions itself as a tool for multilingual sites (https://www.drupal.org/8/multilingual) and at the same time we have a bug in the heart of drupal
Comment #72
cilefen commentedAny community member wanting this fixed as quickly as possible may review the current patch following the instructions: https://www.drupal.org/patch/review
Comment #73
alexpott@gagarine the point is that there really is no default site name - this is set during an installation. By providing a default in the config file we attempt to provide a translation for it during when translations are downloaded. "Drupal" translates into "Drupal" and this ends up overriding what the user has entered. So yes this is just because the configuration is being set during install which is a pretty special situation. See #14 and #15 for the bits of code involved and why this is the case.
Comment #74
geek-merlinComment #75
alexpottI'm bumping this to critical. If this happens to you the first time you install Drupal you are off to a very bad impression - Drupal has just lost your data input of the site name during installation!
Comment #76
alexpottIn #67 @vaplas asks for a follow-up for the comment in #63, but I don't think this is a followup. Reading #63 and #62 shows that we have a problem for existing sites. So we need an upgrade path to fix this.
Comment #77
alexpottHmmm... actually I need a bit more information about #62/#63 if I install a site in French the user input is lost. There is no way to fix anything because there is only one system.site config object and the title is set to Drupal. It would be great if @szeidler or @ckaotik could provide steps to reproduce. Here is what I did:
Comment #78
alexpottNote that if I do add another language to the French site installed in #77 I'm able to translate the site name regardless of whether this patch is applied or not. As far as I can see this issue only comes about because of the special situation of writing system.site during the install and trying to apply translations to it because you are installing in another language - so for as far as I can see #62 and #63 are not related to this issue.
Comment #79
szeidler commentedHei @alexpott,
I just tested the issue again with and without having the patch applied.
The use-cases with 2 enabled languages led to the problem, I described in in #62. But it happened only on a production site, that was initially build on Drupal 8.0, so went through the whole lifecycle since then. For new installed projects, since I discovered the issue, it never has been an issue. Unfortunately I don't have a database dump of that site at that specific time anymore.
Without the patch applied.
Use-case: Only 1 enabled language
Use-case: 2 enabled languages
With the patch applied
Use-case: Only 1 enabled language
Use-case: 2 enabled languages
Comment #80
alexpott@szeidler thanks for posting all the steps you've took to review the patch - nice work. Do you think given your testing you have the confidence to rtbc this? It'd be great to get this fixed because as noted in #75 this makes for a very bad first impression because we lose your data in the installer.
Comment #81
szeidler commentedI once again read through the feedback since you provided patch #55 and yes, I think we can move it confidently to RTBC.
If someone will be able to reproduce #62, #63 from and older living installation again, we should tackle it in a separate issue.
Comment #82
xjmI don't think this really meets the criteria for a critical issue as there's no data lost under normal site operation. I think it can be marked major for one piece of data being lost under certain circumstances in the installer.
Comment #83
xjmAt first I thought this was changing it to display e.g. "Standard" for install profiles in the core distribution, but I checked and confirmed we have this in
drupal_install_profile_distribution_name():I also double-checked that we have different test coverage asserting that English still sees "Drupal" (versus an empty string or something)
And tested it manually to ensure there are no UI changes to the install process changed for English:
(Etc.)
So all that looks good, but I'm wondering if we should have a change record? I don't think anything should change for normal core installation workflows as at the end of the day it's just a default config value, but I could imagine some workflow might be pulling a default from this configuration (for a required field) and now just get an empty string.
Comment #84
xjmIt also feels really off that the fix for this bug is changing the value of the default config versus something actually in the installer; maybe that's why I'm hesitating about the CR and whatnot.
Comment #85
alexpottDue to #84 I had another think about the fix and pondered when once the installer was done you can change the site name and it not get reverted when any new translations are processed by the locale config translation import. Following this thought process I found \Drupal\locale\LocaleConfigSubscriber::onConfigSave()
Which is the nub of the problem. Under non install site operation we mark config has have a custom translation here but because of the
if (!drupal_installation_attempted()...we're not doing this when we savesystem.sitein \Drupal\Core\Installer\Form\SiteConfigureForm::submitForm(). This was added in #2468767: English config source strings are saved as custom translations in locale in foreign install so it's not as simple as just removing the!drupal_installation_attempted().Comment #86
alexpottWhat we need to happen is that when the installer is saving user entered config the LocaleConfigSubscriber needs to behave as though it is not during an install but all other times it needs to behave as it does now.
@xjm is correct to be suspicious of the earlier fix because any distribution could add another form to the installer that would have exactly the same problem.
Comment #87
alexpottI've spent some time in the debugger today trying to work out if there is a better fix. I'm not sure that there is. Here's why:
SiteConfigureFormconfiguressystem.siteand when you are installing in French you'll enter a French title.SiteConfigureFormalso will install the Update module and File module depending on what the user ticks.Both of these actions cause configuration saves. For
system.sitesave you want theLocaleConfigSubscriberto fire as though the user is doing this a regular runtime. For the config saves caused by the module install you want theLocaleConfigSubscriberto behave as though we're in the installer because config translations have not been downloaded yet - this happens after theSiteConfigureFormhas been submitted in theinstall_finish_translationsstep.Really tricky.
Comment #88
alexpottGiven #87 and the concerns about the previous approach all I can think of is to special case system.site. This means distributions that allow users to configure translatable configuration during installation where that config are still going to have an issue but there's not much we can do about that.
No interdiff because it is a different approach - tests are the same though.
Comment #89
gábor hojtsyDiscussing with @alexpott the idea to split the installer steps came up. I think that would be a "workaround" at a once used place while baking this into an onConfigSave() to run all the time looks like less ideal to me. I agree we need to work around this in some way, I don't have very strong feelings against this patch either, just noting.
Comment #91
lennard westerveldI have this issue also not related to the installation of Drupal.
Also when installing a new language and save the site config page again and the problem is there again.
See also https://www.drupal.org/forum/support/post-installation/2017-01-18/site-n...
Comment #92
alexpottI think looking at the two patches #88 and #55 I prefer the one in #55 because there really is not a default for site name. It is something that is set up during installation. It happens that removing the default fixes the specific problem with \Drupal\locale\LocaleConfigSubscriber and the difference between something being configured during an install and something being installed during an install and we should open a follow up to discuss potential solutions that are generic and not based on special casing like the patch in #88. I don't think a CR is necessary here because nothing is really changing - other installers like Drush already provide a default for the site name because even in a non-interactive install you have to provide one because non-interactive install completes the site configure form too.
Re-uploading the patch in #55 and a test-only run.
Regarding the criticality of this issue: the installer is many people's first impression of Drupal if you are installing in a language other than English we lose your site name. In my mind that sets a very bad impression as why would you trust Drupal to look after your data after that?
Comment #93
alexpottCreated #2925203: LocaleConfigSubscriber can result in data loss during install as a followup to address the issue with
LocaleConfigSubscriberComment #95
Anonymous (not verified) commented@alexpott, thank you very much!
We already have at least 3 RTBC to #55 in #59, #67, #81. So, back RTBC to #92.
I fully support that the problem is serious. Possible examples of disappointment (duplicate previous posts):
Comment #96
catchNot really keen on the installer logic added in template_preprocess_html().
If #2925203: LocaleConfigSubscriber can result in data loss during install goes in wouldn't this be unnecessary?
Comment #97
alexpottAtm we fallback to the default declared in system.site.yml - with this change we get round the fact there is no default and we also improve the situation for distributions because they are no longer saying "Drupal" when ideally they'd want their name in the title. I can't really think of a way around this because we're directly reading system.site in at this point. See https://api.drupal.org/api/drupal/core%21includes%21theme.inc/function/t... - it is not pretty.
Comment #98
alexpott@catch suggest trying to use configuration overrides - seems to work - neat idea :)
Comment #99
catchThat looks better, installer is horrible still but at least it's contained.
Comment #100
alexpottSome coding standards things I noticed :(
Fingers-crossed we're green. Testing locally showed the one testing the distribution name passed.
Comment #101
alexpottOne more coding standards issue - comment longer than 80 chars. Will roll a new patch once we know if the approach is green on all core tests.
Comment #103
alexpottIs an unrelated test fail.
Here's the coding standards fix patch...
Comment #104
gábor hojtsyComment #106
gábor hojtsyYay, looks fantastic. I agree this approach looks even better than before. Well contained in the override service. Will check with other committers about backportability but I see no reason not to, this only involves new installs so for existing sites this should not be an issue. I was pondering a bit about what would it cause to existing sites if we change the default name here, but I could not come up with any reasonable real life scenario where this could be an issue.
Comment #108
gábor hojtsyMerged to 8.4.x after discussing with @catch.
Comment #109
Anonymous (not verified) commentedYay! 🎉🎉🎉
Cool patch and commit to 8.4! Great thanks!