Closed olafgrabienski closed 1 month ago
Our current trouble is reliable reproduction.
On some environments this problem occurs, but not on others. Ideally we'd figure out the culprit on some hosting. Otherwise it's tricky to fix.
I'm one of those who can't reproduce it at all. Guessing... something goes wrong in install_check_localization_server() - unclear, what and why.
@olafgrabienski do you have a playground webspace with failure? One that really doesn't matter to you?
Can you edit one core file to sneak in some debug()
code?
Can you edit one core file to sneak in some
debug()
code?
Yes, I have a testing site. Which code?
Which code?
Oops, this is trickier, that I thought. At this early stage both, debug() and var_dump() output gets silently swallowed. :grimacing:
die()
seems to work.
So, let's be rude:
In file core/includes/install.core.inc around line 1570:
$response = backdrop_http_request($uri, $options);
if ($response->code != 200) {
die("This fails with $uri and response code is {$response->code}");
$online = FALSE;
return $online;
}
Add the line with die()
- that means, PHP will completely stop there and output just a single line...
This also means, the site won't install at all, but that shouldn't be a problem.
Thanks for the debug code. The result (this time I tried to install in Italian):
This fails with https://localize.backdropcms.org/files/l10n_packager/all/backdropcms/backdropcms-1.29.0.it.po and response code is 404
Ohhhh.... :bulb:
Now I get it. It's the version string, that makes this fail. Silly me, I tested with a dev (1.x) - unaware that dev works as opposed to regular stable installs. :grimacing:
Here's in incomplete PR for early testing: https://github.com/backdrop/backdrop/pull/4873
@olafgrabienski this should fix the problem with installing - as long as this particular translation file already exists (that's why this still needs work).
This also means: it's not at all related to hosting environments. It just worked for people testing with dev versions. This never worked for stable releases, because of the faulty (unstripped) version pattern.
Updated to a more complete approach: https://github.com/backdrop/backdrop/pull/4873
This now also works, if the translation file hasn't been generated, yet - be it because major.minor
version's still dev (or preview release) or whatever. It falls back to the generic download, if that exists.
@indigoxela - I guess I have just tested the PR before you made the update. I was however able to install Backdrop in German. Does it make sense to test the updated PR, or not (may be not possible at the moment, as the translation files are available)?
I guess I have just tested the PR before you made the update.
Oops, can happen. :shrug: Many thanks for verifying, though. :wink:
Does it make sense to test the updated PR...
Absolutely. I had to switch the logic quite a bit, to better account for version specific translation files (existing or not existing yet, fallback...).
That the fallback works, can now be tested with a recent dev (it's now 1.30.x-dev and that should fall back to a translation file like backdropcms-1.x.de.po).
Okay, I'll test again later ... if nobody beats me to it.
Thanks, @indigoxela . I've tested locally and WFM:
For testers - if you get the chance, you can also verify the file name of the downloaded file. It's in /files/translations.
Just to make sure, you got the right version/variant. :wink: It's not essential, just nice to know.
For testers - if you get the chance, you can also verify the file name of the downloaded file. It's in /files/translations.
Checked on the file name: backdropcms-1.29.es.po
Seems correct.
Tested the PR with 1.30.x-dev
, works like a charm!
Name of the downloaded language file: backdropcms-1.x.de.po
This is utmost priority for us. Having a headline new feature not work is bad.
I found just one minor improvement that could be made in the PR: https://github.com/backdrop/backdrop/pull/4873#discussion_r1788878574 It should not affect the functionality but it would be great if @indigoxela could approve the change.
Tested this by checking out the branch, setting the version line in bootstrap.inc
to the following (a version that clearly does not exist):
define('BACKDROP_VERSION', '1.31.0');
Then tested install.php on 1.x (which could not find the translation) and then on this branch, which found and used the 1.x translation. This all looks good to me!
I found just one minor improvement that could be made in the PR...
Great idea - I wasn't aware of that constant. Merged. :+1:
Merged https://github.com/backdrop/backdrop/pull/4873 into 1.x and 1.29.x. Thank you @indigoxela, @olafgrabienski, @argiepiano, and @hosef for fixing this issue!
Description of the bug
When I try to install Backdrop in another language, I get a requirements problem: "The German translation is not available." The same happens with other languages (other than English).
Steps To Reproduce
Note: This seems to be an issue which happens only in certain hosting environments. See the "Additional information" section below.To reproduce the behavior:
1.29.0
installation: database, code directory, etc.https://test.example.com/core/install.php?langcode=de
Actual behavior
You see a page with title "Requirements problem" and the following message:
Screenshot:
Expected behavior
Backdrop is installed in the chosen language. (This is a new feature introduced with Backdrop 1.29.)
Additional information
(a) In a related Zulip thread we were discussing if this is a hosting environment issue. I was however able to reproduce the issue with two different shared hosting services.
(b) When I continue the installation in English, everything works as usual, and after the installation I'm able to download and install modules via the user interface.
Technical info: