backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

Backdrop installation in different language not possible: undefined function language_save() #2329

Closed olafgrabienski closed 7 years ago

olafgrabienski commented 7 years ago

When I try to install Backdrop in German following the installer instructions and @quicksketch's hint in https://github.com/backdrop/backdrop-issues/issues/2217#issuecomment-248162910 about renaming the language file, the installation stops with the following message:

Fatal error: Call to undefined function language_save() in /(...)/core/includes/install.core.inc on line 1584

Steps to reproduce:


PR by @docwilmot: https://github.com/backdrop/backdrop/pull/1642

olafgrabienski commented 7 years ago

Some additional information:

You'll be able to continue the installation in English as follows:

After that, you can even set up the German language:

So, there is a workaround, but only for experienced site builders.

olafgrabienski commented 7 years ago

Fatal error: Call to undefined function language_save() in core/includes/install.core.inc on line 1584

Unfortunately, that's above my technical skills. @quicksketch as you were able to answer the question in https://github.com/backdrop/backdrop-issues/issues/2217, do you know what's happening here?

sternhagel commented 7 years ago

Exactly the same problem here. Installation in German language doesn't work, as described above.

olafgrabienski commented 7 years ago

Tried to install Backdrop in Italian language as well, just to be sure that there's no problem with the German language file. Same error using Italian.

serundeputy commented 7 years ago

The language module is not enabled at install time so on line 1585 of core/includes/install.core.inc add the line:

module_enable(array('language'));

and you can sort of limp through the installer.

olafgrabienski commented 7 years ago

on line 1585 of core/includes/install.core.inc add the line:

module_enable(array('language'));

@serundeputy on Gitter:

... but a better fix is required as there are other calls to language_save outside of that elseblock of code

@docwilmot on Gitter:

language_save() is only called twice in that file, so maybe enable the module before the if (!isset($standard_languages[$langcode])) line

I'm trying the approaches at the moment, no luck so far. Will ask for Feedback on Gitter and come back to it later ...

docwilmot commented 7 years ago

@olafgrabienski @quicksketch

Seems that once we enable language.module then the line if (language_multilingual()) { within backdrop_language_initialize() evaluates as true, which causes a cascade which eventually calls module_implements(), system_list() and eventually cache().

But cache isnt yet available at this stage.

Not sure what to do next really.

docwilmot commented 7 years ago

Pushed a PR. @olafgrabienski give a try please.

docwilmot commented 7 years ago

Just noticed after install completes that in the files/languages folder a new ...js file appears after install (dont know if thats supposed to happen) but the content of that file looks like a dump of an AJAX error. Please check that too.

olafgrabienski commented 7 years ago

I've just tested the PR, works well! See German translations on the following screenshot of the fresh installed site:

screen-backdrop-installed-german

Re .js file and AJAX error: Yes, there was a HTTP AJAX error during the import of interface translations. I'll report it in another comment.

olafgrabienski commented 7 years ago

As mentioned above, there was a HTTP AJAX error during the Backdrop installation in German:

The error occured during the first step of importing interface translations ("Set up translations" in the installer menu) and manifested itself initially in a progress bar which displayed no progress. After quite a while appeared a new page with the following messages:

Error importing interface translations
Please continue to <a href="http://example.org/core/install.php?langcode=de&profile=standard&id=2&op=finished">the error page</a>

and

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: http://example.org/core/install.php?langcode=de&profile=standard&id=2&op=do_nojs&op=do
StatusText: Internal Server Error

In my log file I found these notices:

[(Date and time)] [fcgid:warn] [pid 31400] [client (...)] mod_fcgid: read data timeout in 120 seconds, referer: http://example.org/core/install.php?langcode=de&profile=standard&op=start&id=2
[(Date and time)] [core:error] [pid 31400] [client (...)] End of script output before headers: install.php, referer: http://example.org/core/install.php?langcode=de&profile=standard&op=start&id=2

After going to the 'error page' (which actually was the "Configure site" page), I could continue the installation without further issues. (The last step, "Finish translations", took nearly as long as "Set up translations, but there wasn't another error.)

Coming back to the AJAX HTTP error during "Set up translations", I experienced the same some days ago, when I enabled and imported German in a running site. In my opinion, we shouldn't consider it as part of this issue but open a separate one. @docwilmot Do you agree?

klonos commented 7 years ago

I will give this a go with the Greek translation file, but it seems to me that one of the reasons you are getting errors @olafgrabienski is php timeout (most likely while reading the .po file): mod_fcgid: read data timeout in 120 seconds

olafgrabienski commented 7 years ago

it seems to me that one of the reasons you are getting errors is php timeout (most likely while reading the .po file): mod_fcgid: read data timeout in 120 seconds

I see! Well, 120 seconds is not exactly a low limit. As far as I know, on many shared hostings the limit is about 40 seconds, and not on every hosting it's allowed to change the value. We should definitely try to improve the situation, also to satisfy the Backdrop principle "Meet Low System Requirements".

olafgrabienski commented 7 years ago

Checked the phpinfo on admin/reports/status/php. Interestingly, a fcgid related timeout limit isn't mentioned there. (max_execution_time is 240, memory_limit is 256M)

olafgrabienski commented 7 years ago

I will give this a go with the Greek translation file

@klonos That would be great! I still think, that the AJAX HTTP error during "Set up translations" is not exlusively related to the installation of a language, so I'd suggest to open a separate issue. What do you think about it?

Tests of the PR are all green. Apart from that, I'm not able to evaluate the technical aspects of the PR. @docwilmot Good point however to not only enable language but also locale!

quicksketch commented 7 years ago

Thanks everyone for the reports and the PR! This really could use tests (I'm surprised it's not already). The PR itself looks great, but I'm marking needs work for the tests.

olafgrabienski commented 7 years ago

@quicksketch What do you mean: more user tests, or other technical tests than the automatic checks on the PR?

docwilmot commented 7 years ago

This was a basic attempt at figuring out what went wrong, so I'm glad it helped, but between the AJAX errors and the fact that I have not previously used languages, I dont think I can handle this one, sorry.

docwilmot commented 7 years ago

@olafgrabienski I think he means more automated tests, ie Simpletest.

olafgrabienski commented 7 years ago

Re AJAX errors: I guess I found the relevant Drupal issue. Actually, there are a lot of related issues, some marked as duplicate and some not, but a read of the following issue makes more clear what actually happened in Drupal:

https://www.drupal.org/node/569004

( Saw btw one or two comments of @klonos in the issue ;-)

Apart from that, good to know:

@quicksketch After reading the issue on drupal.org, I guess we should really open a separate issue for the AJAX errors. I can do that, would just like to have feedback on the proposal. Regarding the original issue (installation not possible), how should we continue? Unfortunately, I'm not at all able to assess the testing questions. Apart from that, I received the impression that the PR is already a really good improvement. At least it allows to install Backdrop in a different language.

So, I'm very interested to get a (first) fix in the next release. In my opinion, it's important to overcome the current multilingual impasse consisting of technical issues, lack of documentation and so far only few non English language users. I'm happy to help changing the situation, and as a start it would be great to render a Backdrop installation in different languages possible.

klonos commented 7 years ago

( Saw btw one or two comments of @klonos in the issue ;-)

You will find comments from me in the d.org issue in most major issues. I was a "pest" there as well šŸ˜

I think that this change here is a good step forward and as pointed enables the installation in languages other than English. For the possible timeouts, I filed #2344 and if we keep getting those AJAX errors, then lets file a separate issue for that too.

Unfortunately, my simpletest-foo is very weak, so cannot contribute in this issue here in that way šŸ˜ž

klonos commented 7 years ago

...as pointed out in the PR by @quicksketch, this is a major bug and we need tests in order to make sure that things do not break again in the future. This is a major bug though, and I think that even if we don't have tests, we should make sure we include the fix in the next bug fix release and keep this issue open as a follow-up for adding tests.

klonos commented 7 years ago

...tagging @dyrer because as a fellow-Greek person, I am sure he is interested in this. He comes from WP (if I remember correctly, he is the lead of the Greek WP community: http://wpgreece.org/author/dyrer ), so his input in language issues is most valuable.

PS: @dyrer has set me up for a Backdrop CMS presentation when I return to Greece for Christmas! ...I am greatly honored to be presenting something that I love to the Greek audience and especially in my hometown. Good on ya Ī±Ī“ĪµĻĻ†Ī­ šŸ‘

klonos commented 7 years ago

Finally got some time to try installing in Greek (with https://github.com/backdrop/backdrop/pull/1649 applied to spare me renaming .po files)...

The error was the same as the one @olafgrabienski reported back in https://github.com/backdrop/backdrop-issues/issues/2329#issuecomment-260131310 (but in Greek):

Error importing interface translations
Please continue to <a href="http://localhost/core/install.php?langcode=el&profile=standard&id=2&op=finished">the error page</a>

I had no .js files under files/languages and the AJAX error in my case was a 404 instead of a 500:

An AJAX HTTP error occurred. HTTP Result Code: 404 Debugging information follows. Path: http://localhost/core/install.php?langcode=el&profile=standard&id=2&op=do_nojs&op=do StatusText: Not Found ResponseText: 404 Not Found 404 Not Found nginx

klonos commented 7 years ago

...clicking the link to the error page got me to http://localhost/core/install.php?langcode=el&profile=standard where after configuring the site info (name, email, admin credentials etc.), the installation continued with the Import of UI translations. In that stage, same as @olafgrabienski, the page (http://localhost/core/install.php?langcode=el&profile=standard&op=start&id=3) seemed to be stuck with a seemingly not moving progress bar and after quite a while, I got the same 404 AJAX error.

klonos commented 7 years ago

...finally, clicking the link to the error page once again got me to the website in Greek:

backdrop-greek

dyrer commented 7 years ago

I just returned from our first WordCamp in Athens, and of course @klonos I will help you to fix any language issues on Backdrop CMS. I also believe Backdrop should invest on polyglots because more than half of the world dont use English on their sites. So polyglots support is a must for Backdrop CMS ps. @klonos Maybe two presentations for BD ;)

klonos commented 7 years ago

ps. @klonos Maybe two presentations for BD ;)

Sure šŸ˜„

docwilmot commented 7 years ago

So polyglots support is a must for Backdrop CMS

Very true. This would be critical if we had those tags.

jenlampton commented 7 years ago

It looks like there isn't any way to add tests for this, so setting back to RTBC.

serundeputy commented 7 years ago

I downloaded the patch https://patch-diff.githubusercontent.com/raw/backdrop/backdrop/pull/1642.patch and applied to 1.x and successfully installed in German and Magyar.

Merged into 1.x and 1.5.x will ship with 1.5.3 and 1.6.0 thanks for all the hard work and manual testing everyone!

klonos commented 7 years ago

Thanx @serundeputy. We should also get #2345 in to make it an easier UX šŸ˜‰