To recreate, if you create a new view with a custom language field (mapped to a custom database table using hook_views_data() ), and you do not have the core locale module enabled then you will get a fatal error message.
Fatal error: Call to undefined function locale_language_list()
An example module, which implements a custom language field is: Search API Stats
The resolution is to amend the file views_handler_field_locale_language.inc to call the views_language_list function. I'll just prepare a patch, and could someone with the same issue verify this is the correct approach to take.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | views-2428065-8.patch | 747 bytes | Snehal Brahmbhatt |
Comments
Comment #1
jefflogan commentedComment #2
jefflogan commentedComment #3
Pierre.Vriens commentedI think this issue is worth being looked at, to consider moving it to status "Reviewed & tested by the community". Sure there are +3.7K open issues in the views module, but also close to 1.000 K "reported installs" of views. It only takes 1 of these sites to review this patch, right?
@Jeff.logan: don't give up, be patient, OK? After I get the chart deadline imposed by google resolved "I" might combe back to this issue to check if more help is needed to getting this issue move forward, similar to what recently happened in #1947876: Do not display chart if view is empty (that one only took like 2 years ...). For more info, refer to my answer on Drupal Answers ...
PS: I think your issue description should say ".. core locale module enabled ..." instead of ".. core locale module installed ...". If you agree, consider correcting the issue.
Comment #4
gisle@Pierre.Vriens,
it is usually the module maintainer who, after seeing several positive reviews from users, moves it forward to RTBC. It may take a single review (in particular if written by a community member the module maintainer trusts, but it may also take multiple reviews). When the module maintainer changes the status to RTBC, it usually indicates that the patch is (or very soon will be) committed to the dev version, and also will be included in the next regular tagged release.
If you want to get a patch moved on to RTBC, you (and anybody else of the 1 million who users the module) can help! Please test it on your own development site, and - if it works fine - post a positive review.
Also: The issue description is "Fatal error in views_handler_field_locale_language.inc if locale is not enabled" and has, AFAIK, been this from the issue was opened (according to revisions). I see no problem with this description.
Comment #5
Pierre.Vriens commented@gisle: thank you for the feedback, I fully agree with it. Though right now I'm "busy" as I wrote before. The "enabled" I referred to is in the issue description (which I just edited to match the title). Feel free to undo the issue edit if needed, OK?
Comment #6
jefflogan commentedTo further assist with replicating the issue, I've summarised in more detail the steps to recreate with the Search API contrib module.
Install/enable the following modules (many are dependancies):
To configure database backend for search, I used the below module:
Database search (search_api_db).
Note to configure this, I added a server under the Search API configuration settings. I then edited the provided Default node index to point to the server I just setup.
Comment #7
chris matthews commentedThe 4 year old patch to views_handler_field_locale_language.inc does not apply to the latest views 7.x-3.x-dev and if still relevant needs to be rerolled.
Comment #8
Snehal Brahmbhatt commented@Chris2, Please find my updated patch with the 7.x-3.x-dev version, hope this will work for you as per your requirement.
Let me know if you have any further query/issue regarding it..
Thanks!..
Comment #9
damienmckennaThanks snehal. Lets see what the testbot says.
Comment #10
nickdickinsonwildeCan confirm it works on a live site and I see the testbot liked it (does imply it should have a test I suppose but I'll pull a road runner on that one for sure. I'm only doing D7 maintenance as needed on client projects, and avoid it otherwise in favour of D8 so my test writing for D7 is rusty at best and never was great)
Comment #12
damienmckennaCommitted. Thank you all.