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.
file_get_contents(sites/default/files/languages/ru_73d02bf8240728b62c5341973489e015.js): failed to open stream: No such file or directory in file /hsphere/local/home/zetver/iritera.ru/includes/common.inc in line 2255.
Comment | File | Size | Author |
---|---|---|---|
#19 | locale_D7.patch | 1.54 KB | neochief |
#10 | locale.inc_.patch | 1.37 KB | erick.mattos |
#9 | locale.module.patch | 571 bytes | neochief |
Comments
Comment #1
oscnet CreditAttribution: oscnet commentedI also
warning: file_get_contents(sites/default/files/languages/zh-hans_c0ada3b21ce0b445c75a3537716078ff.js) [function.file-get-contents]: failed to open stream: No such file or directory in E:\site\includes\common.inc on line 2255.
Comment #2
acosta68 CreditAttribution: acosta68 commentedI have the same problem. I think that is a problem with the "primary links". Because the message disapears if you disable the primary links.
Comment #3
andypost#278770: file_create_url only returns absolute URL (containing the domain name) here the talk about
Comment #4
andypostSorry, this one is right #250451: locale.module adds wrong js path
Comment #5
Murzandypost, function
drupal_build_js_cache($files, $filename)
don't use thefile_create_url()
function, it usesfile_create_path('js')
. Therefore marking this as duplicate is wrong.I have see this errors on my Drupal 6.5 at first load age after setting "Optimize JavaScript files" in Perfomance page. After refresh page with error, this error disappears.
And when I try to check with hands, I didn't see created folder 'languages' in 'files' folder. Permissions of folder is normal, other folders creates successfully.
I think this is a bad url to
.js
file.Comment #6
MurzOh, sorry, I didn't see your last post:
Sorry, this one is right #250451: locale.module adds wrong js path
Comment #7
MurzOh, sorry again :)
This bug is not depend by bug #250451.
I apply a patch, that attached to this bug, but it isn't help.
The problem is here
function drupal_build_js_cache($files, $filename)
gets an array of files fromfunction drupal_get_js()
and this function send the wrong list of files:We see here the file
files/languages/ru_39ef65450ed70e537c44a01e5b060ec0.js
but this file is a cached .js file and don't needed to cache again. Functiondrupal_get_js()
must not send the already cached.js
to thefunction drupal_build_js_cache($files, $filename)
in $files variable!Comment #8
Logrise CreditAttribution: Logrise commentedYes, I think YOu right. Js cashe is enabled on my site and I think the trouble is nearly here.
Comment #9
neochief CreditAttribution: neochief commentedHere's my resolution of the problem:
1. We should tell locale module not to cache JS files
2. We should check JS files on existance (to not make 404 on those who are not created), because drupal_get_js isn't check this out when building the scripts array.
The problem is gone after this patch for me.
Comment #10
erick.mattos CreditAttribution: erick.mattos commentedHi,
I had the same problem but for a different reason: in my case that happened all the time a did a restore from a backup. My provider just reset all file and directory ownerships to my user. This means Drupal by PHP is not being the owner of the cache data in files folder. I realized that deleting all folders and files made Drupal later rebuild them but the language folder and its files.
In my case the problem was Drupal not creating language javascript.
I found the previous solution incomplete since it is a system feature being neutralized.
Then this is my solution: it is a patch for locale.inc which makes Drupal rebuild the file for not finding it.
Please check if that solves all similar problems of yourselves.
Regards
Comment #11
jannalexx CreditAttribution: jannalexx commentedsame issue/error here
#10 works, the locales js file is in sites/default/files/languages/
now.
thanks
Comment #12
dragossani CreditAttribution: dragossani commented#9 patch successfully remove the problem in my Drupal installation.
Comment #13
andypostagree with #12
Comment #14
borfast CreditAttribution: borfast commented#9 also seems to fix the problem on the site I'm experiencing this problem on.
Comment #15
borfast CreditAttribution: borfast commentedI'm bumping the version, otherwise this won't get into the next release.
Comment #16
yang_yi_cn CreditAttribution: yang_yi_cn commented#10 works for me, drupal 6.9
Comment #17
gionnibgud CreditAttribution: gionnibgud commented#10 works for me too. Instead of the error the correct file is been created.
Comment #18
neochief CreditAttribution: neochief commentedActually, I can say that #10 works for me too, and my previous patch (#9) isn't required for it to work.
Comment #19
neochief CreditAttribution: neochief commentedBumping it to 7.x-dev
Comment #20
neochief CreditAttribution: neochief commentedComment #21
borfast CreditAttribution: borfast commentedShouldn't this be kept on 6.x so the problem can be corrected there? Or will the core maintainers backport the fix after it is applied to 7.x?
Comment #22
neochief CreditAttribution: neochief commentedIt will be certainly be backborted. I just know that working 7.x patch can speed-up commit in both versions :)
As this patch passed tests, and it works for several people, marking this issue as "tested by community".
Comment #23
webchickCould someone provide testing instructions that explain how to reproduce this error? And ideally, these steps would be represented in an automated test so that we ensure that we don't break this again later.
Also, the testing reports from people are confusing. Half of them say #9 worked for them, half of them say #10 worked for them. Which one is the one that's RTBC?
Here's a review of #19:
1. This needs to use the D7 style of concatenation, which is a space on either side of the . (
$dir . '/' . $language...
)2. We don't abbreviate variables. That should be $destination.
a) You're not actually checking this... if this fails it will return FALSE which is never captured/compared; you simply proceed to saving the file.
b) TRUE should be something like FILE_CREATE_DIRECTORY or FILE_MODIFY_PERMISSIONS.
Comment #24
neochief CreditAttribution: neochief commented@webchick, the test case may be simple — during this stage, the localized js shouldn't exist (in real life it can not exists, or be not writable or something else).
In current drupal versions, if this file is not exists, an error message appears. In (#9) I have just rid of this error, but (#10) solves the root of problem by creating another instance of js file.
Comment #25
andypostI've tested #9 and #10 on 2 sites one lives in / and other in subfolder (example.com/heb/)
site in subfolder stops throwing 404 in log only after aplying both #9 and #10 but I still can't understand how to check because languages folder still empty and no js files included except standart
Comment #26
neochief CreditAttribution: neochief commentedPossible duplicate #338630: Locale is unable to rebuild lost Javascript translation files
Comment #27
Ingumsky CreditAttribution: Ingumsky commentedHmmm... Still the same issue for me (drupal-6.10). Original patch #10 wasn't created correctly so I was forced to make some changes manually to apply it. I tried to patch my includes/locale.inc with #10 but it doesn't seem to work. Number #9 was also applied later but I'm still at the same point with "The selected file /var/www/virtual/example.net/phptmp/fileqkJTSD could not be uploaded, because the destination sites/default/files/languages/ru_e055380dca6b6ffdf70315567d3ccfc5.js is not properly configured" errors appearing on every single page. Cache was cleared (/admin/settings/performance...), language was switched back to "English" (no errors) and later brought back to "Russian" (with bloody errors appeared again)... *confused*
UPD And latest patch for 6.x from #338630 didn't make the difference. -\
Comment #28
ionmedia CreditAttribution: ionmedia commentedmaybe just not cache js ?
Comment #29
sinasalek CreditAttribution: sinasalek commentedSame problem here with Drupal 6.13
Comment #30
sinasalek CreditAttribution: sinasalek commentedsame here
Comment #31
Medom CreditAttribution: Medom commented6.15 still same issue. Any solution?
Comment #32
Aniara.io CreditAttribution: Aniara.io commentedSame error on 6.15:
file_get_contents(sites/default/files/languages/ar_0e641e619d9a650426f69bf1dfce2f4e.js) [function.file-get-contents]: failed to open stream: No such file or directory in /var/www/***/***/drupal/includes/common.inc on line 2440.
I have Normal caching and CSS/JS optimization on.
Comment #33
andypostDont post this issue follow to #338630: Locale is unable to rebuild lost Javascript translation files
Comment #34
Feron CreditAttribution: Feron commented#19: locale_D7.patch queued for re-testing.
Comment #36
plachThis has already been fixed in D7 and D6.
Comment #37
ionmedia CreditAttribution: ionmedia commentedchange permissions to 777 (instead 776) for dir sites/default/files/languages
Comment #38
ritsd CreditAttribution: ritsd commented#9: locale.module.patch queued for re-testing.
Comment #39
malim CreditAttribution: malim commentedWarning: file_get_contents(/home/content/d/i/o/xxxx/html//includes/common/error_handler.html) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/04/3744204/html/includes/config.inc.php on line 207
Any good solution to resolve this problem? Godaddy hosting my website & i am using Esyndicate Directory software.
Comment #40
mgiffordNo word on why @plach status was changed, so changing it back.