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.
This issue is fixed and can be found in releases starting from i18n 7.x-1.12.
Issue
Fatal error: Call to a member function cache_reset() on a non-object in /home/domain/public_html/_new/sites/all/modules/i18n/i18n_string/i18n_string.pages.inc on line 402
Comment | File | Size | Author |
---|---|---|---|
#20 | i18n_string-2227523-20.patch | 800 bytes | sylus |
#7 | i18n_string-2227523-7.patch | 747 bytes | cs_shadow |
#1 | 2227523.2.patch | 655 bytes | GiorgosK |
Comments
Comment #1
GiorgosKit seems to be happening with any translation string
admin/config/regional/translate/edit/xxxx
and it always results to that message but the translation is actually saved
I believe there is cases that the
i18n_string_get_by_lid
function will not return an objecttherefore I am checking for the existence of object before calling the
$i18n_string_object->cache_reset()
here is a simple patch but I am not sure its the correct way to resolve this
Comment #2
kari.kaariainen CreditAttribution: kari.kaariainen commentedI got the same error. The patch at #1 helped.
Comment #3
espurnesI get the same error.
i18n 7.x-1.10+14-dev installed
patch #1 seems to work.
Comment #4
junetellain626 CreditAttribution: junetellain626 commentedAlso using i18n 7.x-1.10+14-dev and above patch solved the issue.
Comment #5
GiorgosKMarking as needs review
but probably the approach to solve this bug is not the right one
a maintainer needs to comment on this
Comment #7
cs_shadow CreditAttribution: cs_shadow commentedAttaching properly formatted patch according to the idea suggested in #1.
Comment #8
tompagabor CreditAttribution: tompagabor commentedIt works for me too!
RTBC then?
Comment #9
idebr CreditAttribution: idebr commented#7 Fixed the fatal error, thanks!
Comment #10
tomo738 CreditAttribution: tomo738 commented#7 did it! Thanks a lot!
Comment #11
okokokok CreditAttribution: okokokok commentedThe patch in #7 worked well for me.
Comment #12
Jose Reyero CreditAttribution: Jose Reyero commentedCommitted, just a slightly different form, http://drupalcode.org/project/i18n.git/commit/76b371e
Thanks.
Comment #14
Transmitter CreditAttribution: Transmitter commentedThank you very much for the patch in #7 - it worked well for me.
Comment #16
Dret CreditAttribution: Dret commentedSame problem for me on 7.x-1.11 and Drupal 7.28.
Problem still exist.
Comment #17
slussier CreditAttribution: slussier commentedMe too... Same problem i18n 7.x-1.11 and drupal 7.28
Comment #18
selinav CreditAttribution: selinav commented#7 works for me.
Comment #19
rodrigoaguileraThis marked as fixed means it'll be in 1.12 (yet to be released) if this is bug bothering you use 1.x-dev or apply the patch to your version
Comment #20
sylus CreditAttribution: sylus commentedCreated a patch based on recent commit for drush make purposes since can't reference a patch format from drupalcode repo.
Comment #21
sonician CreditAttribution: sonician commentedWhen applying any of the patches, I get
Parse error: syntax error, unexpected end of file in ../sites/all/modules/lang/i18n/i18n_string/i18n_string.pages.inc on line 449
Comment #22
russellb CreditAttribution: russellb commentedHi sonician, this is fixed in 1.x-dev so you may not need to apply the patch.
You should just be able to download 7.x-1.x-dev and use that, which contains the fix.
Comment #23
gianfrasoft CreditAttribution: gianfrasoft commented#20 solved my problem. Thanks.
Comment #24
fazni CreditAttribution: fazni commentedThank you very much work for me ;)
Comment #25
jshosseini CreditAttribution: jshosseini commentedthanks. #7 works fine for me!
Comment #26
chanac_hares CreditAttribution: chanac_hares commentedHi,
First excuse me for my bad english !
Somebody can advise me please, i had the same probleme, and i fixed it like that :
Somedy knows what is the best way between apply the patch directly on i18n_string module or avoid the patch by my way ?
Thanks in advance !
Comment #27
isholgueras CreditAttribution: isholgueras commented#7 works for me too. Thanks!
Comment #28
cs_shadow CreditAttribution: cs_shadow commented@chanac_hares, it's generally a bad practice to apply custom patches on core/contrib modules directly. Also, such custom patches cause a big problem while updating the modules and hence its a strict no-no to applying any custom patch to a module. I'm not entirely sure if your way is the best way to solve your problem, but it's certainly better than applying a patch to i18n_string module.
Comment #29
chanac_hares CreditAttribution: chanac_hares commented@cs_shadow ,
Thx for your response, you reassures me ! But if you know one third solution, i will take it !
Comment #30
apermuy CreditAttribution: apermuy commentedThe patch in #7 worked for me too. Thanks guys!
Comment #31
TwiiK CreditAttribution: TwiiK commentedHow can a fix like this not result in a new release version immediately?
The recommended version for this module, which by the way has a reported 150k installs, is completely 100% broken at the moment. I downloaded it, installed it and encountered this fatal bug within minutes.
Drupal has to get new practices for minor versions. Having to install the dev version for every single contributed module because the recommended release has many unfixed bugs is a stupid practice.
Comment #32
Maxam CreditAttribution: Maxam commented#7 has been worked , thanks for solving !
Comment #33
Alan D. CreditAttribution: Alan D. commentedChanging title so the issue is easier to locate.
Is a new version close to being tagged up and released?
Comment #34
ThuleNB CreditAttribution: ThuleNB commentedSome problem here. What can I do? I don't know how to apply a patch :-(. Will the patch go in a new release soon?
Comment #35
GiorgosK@ThuleNB
this is a closed (fixed) issue
so the patch should be included in the june DEV version
try that
Comment #36
nimek CreditAttribution: nimek commentedpatch from #20 solved my issue
+1 for commit
Comment #37
Alan D. CreditAttribution: Alan D. commentedSo maybe time for a new version to be tagged :)
Comment #38
GANYANCI CreditAttribution: GANYANCI commentedhttps://www.drupal.org/node/2227523#comment-8838687
patch #20 worked for me. Thanks.
Comment #39
howdytom CreditAttribution: howdytom commentedAny plans for release date which includes the bugfix?
Can't agree more with TwiiK and ThuleNB
Comment #40
jsheller CreditAttribution: jsheller commentedThanks for patch #20. Worked for me, too.
Comment #41
russellb CreditAttribution: russellb commentedHi, my understanding is that this José committed a fix for this issue - see #12 - so you might like to test latest dev. rather than patching here.
Comment #42
francescosciamanna CreditAttribution: francescosciamanna commented#20 fixed my my issue too (I am translating between Chinese and English). Thx again
Comment #43
GiorgosKGuys read to the end of the issue queue issue has been fixed so its included at least in the latest dev release try that instead of manually patching
Comment #44
Kimitri CreditAttribution: Kimitri commentedNice that this finally got fixed. It would be even nicer, though, if this fix got to the actual release version of the module. Any idea on when the next release version is expected to land?
Comment #45
ressa CreditAttribution: ressa commentedI can confirm this fixes the "PHP Fatal error: Call to a member function cache_reset() on a non-object". RTBC?
Comment #46
GiorgosK@ressa we are passed RTBC, its already fixed and closed
use dev version until a full version is released
Comment #47
ressa CreditAttribution: ressa commented@GiorgosK you are correct, what I meant was if the dev version is ready to be released as a full version.
Comment #48
GiorgosK@ressa try .dev version in a test environment and if you get no problems with it use it on your live site
I use .dev version for major modules all the time with no problem
Comment #49
kerios83 CreditAttribution: kerios83 commentedI want to confirm that dev version (which have this issue fixed) is working well.
Comment #50
ressa CreditAttribution: ressa commentedThanks for the suggestion @GiorgosK. I am already using the dev version, and it works great. I just prefer to use the official realease, in case of future updates, so I don't need to keep track of why I use dev version of this of that modules.
Comment #51
dob_ CreditAttribution: dob_ commented@TwiiK I totaly agree with you. Drupal is a quite unstable ecosystem. It's such a buggy system that we already started developing a node.js based CMF. That shows how frustrated we are with the system at the moment regarding scalability and stability. This bug is the last straw which breaks the camel's back.
If it's fixed and tested RELEASE a working version. It can't be true that the community has to install DEV versions to be able to use Drupal with i18n!!!!!!!!!
Comment #52
AnybodyI totally agree that we need a new stable release ASAP. It's bad that the stable version is broken and it's not a good idea to use DEV in production...
Thanks a lot!
Comment #53
hosais CreditAttribution: hosais commentedHi,
In my local PC (aquia drupal dev), drupal does not have this issue. When I move it to openshift, there are this issue. Is this related to memory resource? Could anyone explain the risk of using dev verion in this case? (in production site of course).
If we dont use dev version, what would happen? Anyone has experience about this?
hosais
Comment #54
GiorgosK@hosais
this bug its not related to resources (definitely) so it must me a coincidence
about dev releases:
I use dev releases all the time usually to fix bugs when there is no official release fixing them
you can pretty much trust dev releases when it comes from modules such as i18n that have a lot of installs because a possible problem will be reported fast
anyway I would test on a test installation first and if it does not appear to have any problem I would install it on the production install, the next realese of i18n will come from the existing dev release so you have nothing to worry about
take a look at the release usage stats for the dev release to make up your mind
https://www.drupal.org/project/usage/i18n
Comment #55
Alan D. CreditAttribution: Alan D. commentedUpdated the summary to let users know how to handle this issue to avoid the need to repetitively post here ;)
Comment #56
hosais CreditAttribution: hosais commentedThank you for your quick comments, GiorgosK.
Just would like to clarify something.
The error in my site currently is about translating the Password Reset form online (not Email. you know, the user click the email link and then go to the web site. And at this moment, the English form show up).
It seems that these forms will disappear after a while. Do you think this is the problem? The way I translate this kind of form is not the right way?
I would really appreciate you give me some brief comments about this.
Thank you again.
hosais
Comment #57
hosais CreditAttribution: hosais commentedBy the way, FYI
I checked the code. The only difference is do the code below or not.
$i18n_string_object->cache_reset();
I suppose the cache would be release in the end no matter what. I patch right a way since to me Fatal error may has higher risk.
hosais
Comment #58
yogaf CreditAttribution: yogaf commentedComment #59
Nobru CreditAttribution: Nobru commented#7 works like a charm. Thanks a lot !
Comment #60
moertle CreditAttribution: moertle commented#7 solved the issue. Thanks!
Comment #61
Alan D. CreditAttribution: Alan D. commentedMaking the message even clearer in the summary ;)
Comment #62
harshadananjaya CreditAttribution: harshadananjaya commented#7 works for me.
Thanks..!
Comment #63
ilclaudio CreditAttribution: ilclaudio commented#20 works for me thanks