Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When adding translations = "fr" to a drush make file everything works splendidly. However if some modules for example apachesolr_attachments don't have a translation the drush make still tries to pull down the file. This results in a translations folder and file being created (fr.po) with the following contents.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /files/translations/7.x/apachesolr_attachments/apachesolr_attachments-7.x-1.x-dev.fr.po was not found on this server.</p>
<hr>
<address>Apache Server at ftp.drupal.org Port 80</address>
</body></html>
Is it possible to not create the translations folder with drush make should the translation itself not exist?
Comment | File | Size | Author |
---|---|---|---|
#5 | Drush_Make_Undefined_Translations-1543774-5.patch | 657 bytes | helmo |
Comments
Comment #1
sylus CreditAttribution: sylus commentedShould mention tested this with windows using msysgit.
Comment #2
sylus CreditAttribution: sylus commentedThis problem still exists and is a duplicate of: http://drupal.org/node/997996
Comment #3
sylus CreditAttribution: sylus commentedAre we able to apply the patch from http://drupal.org/node/997996.
Would be awesome to have Drush Make working with translations fully. I think all we have to do is
- elseif ($download['request_type'] == 'post' && drush_shell_cd_and_exec($download_path, 'curl -d %s -LOD %s %s', $download['data'], $header_file, $url)) {
+ elseif ($download['request_type'] == 'post' && drush_shell_cd_and_exec($download_path, 'curl -f -d %s -LOD %s %s', $download['data'], $header_file, $url)) {
Basically just adding curl -f -d.
Comment #4
clemens.tolboomRunning the following gives me 8 hits :(
Comment #5
helmo CreditAttribution: helmo commentedI managed to reproduce this.
I had to disable wget as that is the first choice for _drush_download_file(), clemens.tolboom has a system where no wget is installed.
As I generally prefer to program long-opts I've added --fail to the curl command.
What do the test bots say about this patch?
Comment #6
moshe weitzman CreditAttribution: moshe weitzman commented_drush_download_file is used for dl command and maybe others. i don't know that adding --fail there makes sense for all user cases. it makes sense for the OP though.
Comment #7
helmo CreditAttribution: helmo commentedI was hoping that someone could run the testsuite with this patch to check for regressions.
I've tried travis-ci, but the tests are failing there. (http://travis-ci.org/#!/helmo/drush and http://travis-ci.org/#!/drush-ops/drush)
Comment #8
sylus CreditAttribution: sylus commentedUsed this patch with Drush and it did fix all of my problems. Noticed no other problems. Definitely interested if there are any regressions with this patch. Hopefully there is not and it can be committed.
It is interesting to note that this will always be a problem for windows users as even with the "wget" library being added to the "propeople drush" package the curl function will always be called. This is because drush checks for wget using the "which" command which itself is not part of the package so resorts to curl as a failsafe.
This would also fail for mac os x as wget is not installed by default.
Obviously running the drush make on a linux server works since wget is present.
Comment #9
moshe weitzman CreditAttribution: moshe weitzman commentedSetting to Needs work for #6
Comment #10
helmo CreditAttribution: helmo commented@moshe weitzman: could you run the testsuite after applying this patch? Or advise how I can get a complete testrun on travis-ci or some other standardised platform?
Comment #11
helmo CreditAttribution: helmo commentedFor some reason upgrading my test box to Ubuntu 12.04 made all tests pass again :)
So I can confirm that they still pass after applying the patch from #5
Comment #12
sylus CreditAttribution: sylus commentedThanks helmo for your work on this :) Does this then mean we can bring this patch in? ^_^
Comment #13
jhedstromI'd prefer to see this logic moved out of the actual curl call, perhaps by checking the response code?
Comment #14
helmo CreditAttribution: helmo commented@jhedstrom: do you mean that you would like --dump-header to save all headers and start parsing those ourselves?
That sounds like a complex/error prone solution.
In my opinion the --fail option is exactly what we need here.
From the manpage:
Comment #15
jhedstrom@helmo that makes sense. All tests are currently passing with this patch applied. Setting to RTBC, will commit later if nobody objects.
Comment #16
jhedstromCommitted #5 in 70196e2. Thanks all.