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

tstoeckler’s picture

Category: bug » support

the WURFL project currently sets the name of the library to 'Tera-WURFL' but the generated machine name becomes 'Tera_WURFL'

Could 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.)

jantoine’s picture

Status: Active » Closed (works as designed)

This 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.