If a module specifies an array as the value for the version callback of a library, and doesn't have any version arguments, libraries will have a fatal error. If the module does specify version arguments, passing an array as the version callback works, because in that case call_user_func_array is used. This can be remedied by using call_user_func when there aren't any version arguments, making libraries's behavior consistent.
This came up when working with the 3.x dev version of Openlayers: array('\Drupal\openlayers\Openlayers', 'getLibraryVersion') is passed as the version callback, but there aren't any version arguments, so PHP complains that the function name should be a string. Using call_user_func instead fixes this, because both this and the array version accept arrays as the first parameter.
| Comment | File | Size | Author |
|---|---|---|---|
| namespaced-version-callback-1.patch | 646 bytes | robinsonsarah01 |
Comments
Comment #3
tstoecklerThanks very much! Makes a lot of sense. Committed to 7.x-2.x