On PHP 5.3, I'm getting this error on fresh install when visiting admin/config/development/less

Fatal error: Function name must be a string in /var/www/sites/all/modules/contrib/libraries/libraries.module on line 534
...
libraries_detect() /var/www/sites/all/modules/contrib/less/includes/less.admin.inc:31

Another install on PHP 5.5 works fine. Variable dump on both sites show exact same $library array values on line 534.

Comments

corey.aufang’s picture

Thank you for finding this.

It appears that sometime after 5.3 that you can now directly invoke a static member like so:


$static_member = array('Class', 'member');

$static_member();

When I had been looking through the Libraries API module source I did not pay close enough attention to the logic code that determined which method to use.

I have added an additional parameter which should cause Libraries to use call_user_func_array() instead which as of PHP 5.3 can take an array for the function name, which will then call the static member as expected.

You should see a commit for this shortly.

  • corey.aufang committed d0f51ab on 7.x-4.x
    Issue #2398363 by corey.aufang: Fix issue with wrong function method...
corey.aufang’s picture

Status: Active » Needs review
corey.aufang’s picture

Status: Needs review » Fixed

I'm marking as fixed.

If you are still having this issue, please reopen the ticket.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.