Comments (5)
A bit of an update, @xicond your type casting comment gave me something to look at here. I delved a bit deeper to find that the issue is with the cache loader. I still haven't been able to reproduce the issue organically, but my assumption at this point is that there's a corner case just when the cache is about to expire where the cache loader check passes but the retrieval fails. Since they're returning from the tagged cache repository directly that result can be null. Regardless of how the issue is happening the problem definitely is the cache loader returning null values in some instances.
With this in mind, this gives us two options for a resolution. The first would be to disable caching via the package's config file. This will solve the issue but I was concerned with potential performance implications from this solution. So I decided to take a different path by overriding the cache loader as well as their service provider so that I could insert my custom cache loader into the mix. The only real change to the cache loader is some additional checks to ensure that the value its returning is an array. If not, it will just rely on the fallback option of the file loader again and repopulate the cache. Additionally, I'm increasing the cache time out value to 24 hours to reduce the frequency of this happening. Increasing the cache expiration settings, may not work in all cases if you're using database mode or other methods to update your content. In my case, we're running in file only mode and our deployment scripts are programmed to flush the translation cache anyways.
It should be pointed out that these are only temporary solutions, its pretty obvious at this point that this library is no longer maintained. Long term I'm going to be either looking to replace it or see if it's even necessary anymore with the improvements Laravel has made to their translation support.
from translation.
@mickeyfmann i am facing the same problem. Can you please share the solution if you found any?
from translation.
happen on me
this library suppose cast to array when loadSource not found or null
I'm searching another library
from translation.
Unfortunately I've still not found a solution to this. I'm not able to reproduce the issue in any manual fashion, so its really hard for me to pinpoint. @bilalaslam777 @xicond , if you've encountered these issues perhaps its worth posting some more details about your setup and configuration around the library.
As I stated, our setup is running in file only mode. Our servers are provisioned with Laravel Forge and we're using the local Redis instances from that for data caching. Session data is stored on a remote Redis server, but nothing related to this should be stored there.
from translation.
I have the same problem. Random errors on production.
from translation.
Related Issues (20)
- typo in readme
- Database schema: Connection
- After integration -> Unittest fails: Foreign Constraint HOT 3
- Mysql syntax error during migration. code: 1059 HOT 1
- Support for Laravel 6.0 HOT 1
- Change database structure to allow extra unique index HOT 1
- Set different tables names HOT 1
- Overriding current locale to fetch localized model attributes in specific language HOT 1
- Setting non-translatable raw attributes breaks translation
- translator:load throws db integrity error HOT 1
- Where do I find example codes ?
- How can I delete a language ?
- Browser's Locale: add Region
- Support for Laravel 7.0 ? HOT 3
- method isLocked() doesnot exit when use update translation
- Migrations not publishing
- Support for Laravel 8.0? HOT 5
- not supported with url
- anyone continued this in other repo? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translation.