When trying to include placeholder in an install profile, and installing from drush, I'm getting:
"PHP Fatal error: Call to undefined function libraries_get_libraries() in [...]/modules/contrib/placeholder/placeholder.install on line 17".
Attaching a temporary fix.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

This seems weird to me, the fix seems to work... committed

bleen’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

mpv’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Status: Closed (fixed) » Needs review
FileSize
1.78 KB

Sorry for reopening this, but I don't think we need to enforce the installation of Jquery-Placeholder at all, because the module works just fine without it in browsers with html5 support.

I'm attaching a patch that:

  • Removes the requirement check for $phase == 'install', checking if the library is present only when $phase == 'runtime' (status report page)
  • Changes the severity of the error to REQUIREMENT_WARNING
  • Changes the message displayed in the status report when the library is not found, with a link to the github repo and a small description about why it's needed

The text of the message probably needs to be improved (english isn't my native language) and perhaps a note about this optional dependency can be added to the project page.

damiankloip’s picture

I see the point here, and thanks for bringing this up. However, the only reason to use this module is if you want the library integration, otherwise you should just use the elements module.

Devin Carlson’s picture

This can also be an issue when installing a distribution/installation profile from the UI. The Libraries module may not be available at the time that the requirements check runs, leading to the undefined function error in the OP.

I think that Placeholder should either do its requirements checking at runtime or ensure that the Libraries module exists before attempting to use its API to do any checks.

Devin Carlson’s picture

Assigned: Unassigned » Devin Carlson
FileSize
1.55 KB

A patch to check requirements only during runtime. I've used similar formatting to other modules that provide Libraries integration.

damiankloip’s picture

Status: Needs review » Fixed

Yep, I agree with this route. It's cleaner, we should not have to call drupal_is_cli().

Committed/pushed to 7.x

Status: Fixed » Closed (fixed)

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