After upgrading from 7.x-2.x to 7.x-3.8 and putting the FA 5.5 Pro library in my sites/all/libraries folder, none of the pro icons are listed in the "Select Icon" dropdown, when editing a menu item for example. I can still use pro versions (e.g. light) of icons where the basic icon is free, but the pro-only icons are not in the list.

Comments

solideogloria created an issue. See original summary.

solideogloria’s picture

Also, in both 2.x and 3.x, admin/config/media/icon/bundle/fontawesome shows only free icons, even though I have the Pro version.

solideogloria’s picture

Status: Active » Closed (works as designed)

I think I figured out what I'm doing wrong. Apparently, FA requires copying files to theme directories, and I hadn't replaced those with the new ones.

solideogloria’s picture

Title: Icons missing from "Select Icon" dropdown » fontawesome.module looks in wrong location for icons.json
Component: User interface » Code
Priority: Normal » Major
Status: Closed (works as designed) » Active

I found the problem in fontawesome.module:

function fontawesome_get_metadata_filepath() {
  // Load the library so we can get the path.
  $library = libraries_load(FONTAWESOME_LIBRARY . '_svg');

  // Attempt to load the icons from the local library's metadata if possible.
  $metadataFile = drupal_realpath($library['library path'] . '/advanced-options/metadata/icons.json');
  // If we can't load the local file, use the included module icons file.
  if (!file_exists($metadataFile)) {
    $metadataFile = drupal_get_path('module', 'fontawesome') . '/metadata/icons.json';
  }
  return $metadataFile;
}

This module provides metadata/icons.json, but only the free icons. Since I am using the Pro version, my icons.json file is different.

The code above searches `'/advanced-options/metadata/icons.json'`, but the actual location in FA 5.5 is `'/metadata/icons.json'` (at least in the Pro version).

The result is that anyone using the module and library for the Pro version will not have any Pro-only icons showing.

daniel.moberly’s picture

Status: Active » Needs review
StatusFileSize
new733 bytes

Boy, it sure would be nice if the Font Awesome devs didn't keep changing their file structure. Attached patch should fix the issue.

  • Daniel.Moberly committed 222d873 on 7.x-3.x
    Issue #3016445 by Daniel.Moberly: fontawesome.module looks in wrong...
daniel.moberly’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.