The first problem is fairly minor: the English png icon is not an actual png file. It is just 6 bytes. This issue was addressed previously in this forum (https://forum.backdropcms.org/forum/language-icons-english-flag-damaged) about 6 months ago and was noted as fixed but somehow it is back. I copied and renamed the US png icon and that could fix this issue for me except for the big problem that follows.
The second issue is major: the icons do not display and errors are thrown in the report log. I installed Language Icons, via the admin menu installer rather than downloading the module myself, on essentially a fresh local installation of Backdrop (I had installed the Language and Locale core modules and imported the ES (Spanish) interface translations and changed a few basic settings in Site Information like uploading my own logo, adding a slogan, etc.
I went to the Language Icons settings page (in Config/Language) and noted that the path to the icons is correct (modules/languageicons/flags/*.png). I added a language switcher block and then tried the three settings for "before, after, and replace link" but none worked.
So I used the built-in method to install the Language Switcher Dropdown module, thinking perhaps it would use the installed Language Icons. That failed to work also. Reading more, it appears that the dropdown module is sort of a cosmetic thing that actually runs the same base code as the regular language switcher, I think.
Where there should be icons (dropdown or the regular list type), there is simply a link and generic pic that indicates missing images. Inspecting the page code, I see that where there should be an icon, there is instead this:
<img class="language-icon" src="http://XXXXXX.XXX/modules/languageicons/flags/.png" width="16" height="12" alt="English" title="English">
Notice that there is no filename before the ".png" extension. That is exactly the same for the Spanish choice as well, obviously with "alt" and "title" saying "Español" instead of "English."
So I looked in the admin reports at the Recent Log Messages report. I find repeated instances of these messages (presumably as I was reloading the page after trying to fiddle with Language Icons settings, etc).
- Notice: Undefined property: stdClass::$langcode in locale_language_url_rewrite_url() (line 441 of /var/www/html/XXXXXX.XXX/core/includes/locale.inc).
- Notice: Trying to access array offset on value of type null in language_switcher_dropdown_form_layout_block_configure_form_alter() (line 51 of /var/www/html/XXXXXX.XXX/modules/language_switcher_dropdown/language_switcher_dropdown.module).
- Notice: Undefined property: stdClass::$langcode in theme_languageicons_icon() (line 105 of /var/www/html/XXXXXX.XXX/modules/languageicons/languageicons.module).
- Notice: Undefined property: stdClass::$langcode in l() (line 2908 of /var/www/html/XXXXXX.XXX/core/includes/common.inc).
- Notice: Undefined property: stdClass::$langcode in locale_language_url_rewrite_url() (line 441 of /var/www/html/XXXXXX.XXX/core/includes/locale.inc).
Disabling Language Icons module gets rid of the "missing" pic icon on the language switcher but also means, of course, that there are no icons on the switcher block. With LI module disabled, no new error mesages are reported in the log.
I just discovered Backdrop a few days ago after some years away from the Drupal world. I am so delighted with it (played for 24 hours with one of the automatic demos) and I really appreciate the hard work of everyone involved in making this possible.
This is (was) puzzling, indeed.
Reading the recent comments lead me to an existing issue in the language_switcher_dropdown queue:
Undefined index immediately after installing
I think, the conclusion here is correct - the problem is actually caused by language_switcher_dropdown, the latest release of languageicons (many thanks, @alanmels!) works properly.