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.
Notice: Undefined index: country in countries_field_formatter_view() (line 234 of /home/bpcodnku/public_html/sites/all/modules/cintrib/countries/countries.fields.inc). =>
Comment | File | Size | Author |
---|---|---|---|
#9 | error_icon-2873550-9.patch | 493 bytes | harshita29 |
| |||
#2 | error countries.png | 54.07 KB | vnantonov |
Comments
Comment #2
vnantonov CreditAttribution: vnantonov commentedComment #3
vnantonov CreditAttribution: vnantonov commentedi work with Country Field Version: 7.x-1.0
Country Icons API Version: 7.x-2.0-beta1
Country Icons: Shiny Version: 7.x-2.0+0-dev
Comment #4
Alan D. CreditAttribution: Alan D. commenteddid you disable a country or add & delete a new one?
Does editing and saving the content item that generates the error helps?
Comment #5
vnantonov CreditAttribution: vnantonov commentedwhen disable countries module stop error but i want country flag
Comment #6
vnantonov CreditAttribution: vnantonov commentedversion on drupal Drupal 7.54
Comment #7
vnantonov CreditAttribution: vnantonov commentedcountries module is broken all icon and flag module i test all version on countries module but this error is same on all
Comment #8
Alan D. CreditAttribution: Alan D. commentedI've tried on Countries 2.x with the same icon modules, no issues.
I thought that it could have been a country that you disabled, (i.e. edit USA and disable it), but the module still works in that case.
So I guess something particular to your setup is causing this.
i.e. countries_field_prepare_view() will at least populate the index country with either a real country object or false, so the notice should never show.
So maybe see if countries_field_prepare_view() gets called, and if not, try a full cache flush on the page and see if that gets called.
Comment #9
harshita29 CreditAttribution: harshita29 commentedHi,
Here is the patch for the same.
Comment #10
Alan D. CreditAttribution: Alan D. commentedIf it gets to the formatter and is not set, something is badly broken already.
I can not understand from the request if;
Things work on a clean install without issue, so it is impossible to help without being able to replicate.
DS, Panels, and similar modules could be interacting here too.
Comment #11
Alan D. CreditAttribution: Alan D. commentedA similar patch could be used for avoiding the PHP notice and logging possible errors.
This will not be committed as it is just a band aid that is obscuring the real issue....