FortAwesome / wordpress-fontawesome

Font Awesome Official WordPress Plugin
Other
57 stars 19 forks source link

Fatal Exception when creating new network #183

Open mlwilkerson opened 1 year ago

mlwilkerson commented 1 year ago

WordPress multi-site mode allows not only for creating multiple sites within a network, but also creating multiple networks, each of which may have multiple sites.

When creating a new network, such as with the WP Multi-Network plugin, when the Font Awesome plugin is activated, a Fatal Exception is thrown:

Eek! We're missing the information we need to load the version of Font Awesome you have selected. Go to your Font Awesome plugin settings page, re-select a version, and save. If that doesn't work, try deactivating and then re-activating the plugin. If that doesn't work either, you might need to delete and re-install the plug-in.

Reported in plugin support form here.

mlwilkerson commented 1 year ago

The problem is that, when loading the ReleaseProvider metadata, the plugin currently looking for that as a network option on the current network. But that is only set upon plugin activation for the current network at the time of activation.

The goal for the releases metadata has been to store only one copy of it for the whole database, since it's a large set of read-only information that does not change, regardless of network or site. It's just a cache of available Font Awesome versions and related metadata.

One solution to this problem could be to always set and get this metadata in a network option on the main network, instead of on the current network.