bu-navigation icon indicating copy to clipboard operation
bu-navigation copied to clipboard

Conditionally load core-widget library files

Open jdub233 opened this issue 3 years ago • 0 comments

BU Navigation requires the core-widget library files directly, but the other package using that library only requires them if they haven't already been loaded:

https://github.com/bu-ist/bu-learning-blocks/blob/a7d5871370746203d24b15cee3a9de109a7f8b99/bu-learning-blocks.php#L90

This works in the BU context because we load BU Navigation as an MU plugin, so it is always loaded first.

Other installations may not load BU Navigation as an MU plugin, in which case BU Learning Blocks may load first. In this case, BU Navigation may throw errors because the library files were already loaded.

BU Navigation should probably also conditionally load the library files, as BU Learning blocks does.

jdub233 avatar Jul 19 '21 14:07 jdub233