Problem/Motivation

_focal_point_check_crop_version() always returns FALSE when modules have been installed via composer and specifying prefer source. Debugging this led me to uncover that system_get_info() is returns version NULL for all modules in this setup. This issue and the contrib-related effects are discussed in this core issue: #1013302: Versioned dependencies fail with dev versions and git clones

Is there a better way to implement these requirements checks that would accommodate composer workflows? Could we just set a warning instead of an error if we are unable to determine the version?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markdorison created an issue. See original summary.

markdorison’s picture

Issue summary: View changes
markdorison’s picture

Issue summary: View changes
markdorison’s picture

markdorison’s picture

Status: Active » Needs review
FileSize
2.42 KB

Is there a specific function or class in the Crop API module that we could check for presence of instead of relying on system_get_info()? By doing a check like that we wouldn't need to worry about whether a site is using composer or not.

I believe there has to be a better way to manage this hence my question above, but attached is a patch within the current framework of requirement checks in focal_point.install. It adds a check for whether or not the version number can be obtained; if the module is determined present, but the version number can not be obtained, a REQUIREMENT_WARNING is raised instead of REQUIREMENT_ERROR.

Status: Needs review » Needs work

The last submitted patch, 5: 2941484-5.patch, failed testing. View results

markdorison’s picture

This issue has become much more visible with this change in Drush 8.1.16, which is also included in Drush 9.0.

bleen’s picture

have you had a chance to look at those test failures

markdorison’s picture

@bleen I am not even sure if my approach is the correct one, as I describe in #5. I was looking for feedback on whether this was the best approach before I moved on to looking at the test failures.

bleen’s picture

I honestly cannot remember what was introduced in crop alpha2 that focal point is relying on so it would be hard to simply look for the existence of a particular function or something liked that. I'm fine simply adding a REQUIREMENT_WARNING if the version of crop cant be ascertained.

Actually, based on the usage data here, I'd be ok removing the version check altogether. 25 sites out of 22k is not worth the hassle.

markdorison’s picture

Status: Needs work » Needs review
FileSize
1.78 KB

@bleen Attached patch removes the check.

Status: Needs review » Needs work

The last submitted patch, 11: 2941484-11.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Berdir’s picture

Status: Needs work » Reviewed & tested by the community

Can confirm this works. Would be nice to have this committed and then also a new release so that users get the update the next time they run composer update.

Can't imagine those unit test fails being related, probably a change in core or so? HEAD tests didn't run for a while.

  • bleen committed fd89c81 on 8.x-1.x authored by markdorison
    Issue #2941484 by markdorison: _focal_point_check_crop_version() fails...
bleen’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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