I've added less module to my install profile, which then fails because of hook_requirements():

  if (module_exists('libraries')) { // nope, it doesn't yet
    if ($lessphp_path = libraries_get_path('lessphp')) { // won't work even if it did -- there is no drupal_get_path() data available
      if (file_exists($lessphp_path .'/lessc.inc.php')) {
        $lessphp_include = $lessphp_path .'/lessc.inc.php';
      }
    }
  }

Issues on other modules with the same problem:
- #1283468: Install profile requirements trigger error
- #1027600: call to drupal_get_path() in hook_requirements() fails during install profile

However, in those cases they're trying to locate something inside the module's own directory so they can resort to fiddling with __FILE__. I'm not sure what kind of workarounds are possible here.

Comments

joachim’s picture

For anyone else with this problem, the workaround in an install profile is to remove 'less' from hook_profile_modules() and instead put this at the end of hook_profile_tasks():

    module_enable(array('less'));
corey.aufang’s picture

Title: impossible to have less module in an install profile » less module in an install profile

Nice solution.

I'm going to make a quick change to the title for now and make a change to the documentation soon. Til that is done, I'm going to leave the issue open so its easily visible.

pirog’s picture

looks like this is no longer an issue in the latest dev

corey.aufang’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

This was changed some time ago to only be a runtime requirement, but it looks like it never made it into a 6.x release.

There will not be a new release for 6.x.

It is still a runtime only check in 7.x.