Closed (works as designed)
Project:
Libraries API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Oct 2011 at 19:57 UTC
Updated:
26 Oct 2011 at 17:18 UTC
In the libraries_info() function, $machine_name is used consistently for storing library data, but at the very end of that function, $name is used to see if the library exists. I believe it is correct to use the $name when retrieving the library, because $name stores the requested library. So... I think we need to also use $name when storing the library data.
For an example, the 7.x-2.x version of the WURFL project currently sets the name of the library to 'Tera-WURFL' but the generated machine name becomes 'Tera_WURFL' resulting in the library not being found.
Comments
Comment #1
tstoecklerCould you explain in detail what you mean by "generated"? I don't understand that. I just looked briefly at the WURFL code and it looks fine to me. (Even though 'machine names' are usually all lowercase per convention, but that shouldn't be a show-stopper.)
Comment #2
jantoine commentedThis turned out to be a bug in the WURFL project where they were inconsistently naming their library. When implementing hook_libraries_info(), they were using 'Tera_WURFL', which is where the libraries_info() function gets the $machine_name from, so it is not "generated" as I thought. When calling the library_load() function, they were passing in 'Tera-WURFL' as the library name. Because of the difference in the names, the libraries_info() function was unable to find the library.