All in the subject i noticed in my info file, i have a line : php = "5.2.4"
my environnement run on php 5.3.5.

Just need to understand the goals of this line. And why "5.2.4".

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

delta’s picture

Status: Active » Closed (fixed)
adamdicarlo’s picture

Title: Why in feature file .info i got a php = "5.2.4" » Why does php = "5.2.4" get put into features' .info files?
Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Category: support » bug
Status: Closed (fixed) » Active

I think this is a bug; why would it be necessary to declare php = 5.2.4 for D7 features when 5.2.4 is the minimum version acceptable on D7 anyway?

Also, I think this might only happen when updating the feature through drush, but I'm not sure -- I just know that it initially isn't in the .info and later it gets added....

adamdicarlo’s picture

Component: Documentation » Code
hefox’s picture

Title: Why does php = "5.2.4" get put into features' .info files? » Don't include php = "5.2.4" in features' .info files
mpotter’s picture

Status: Active » Needs review
FileSize
381 bytes

Does this patch do the trick?

mpotter’s picture

Or even better, as per hefox, only re-export the php property if it's different from DRUPAL_MINIMUM_PHP.

mortona2k’s picture

When I apply the patch (#6) and update my feature, it still puts PHP 5.2.4 in .info.

EDIT: does it for both drush and ui update/recreate

mpotter’s picture

Status: Needs review » Needs work

Looks like this needs more work then.

jhedstrom’s picture

Status: Needs work » Needs review

The patch in #6 actually works, it just doesn't work for features that have already been created w/o the feature, since the php version resides in the system table for those old features. To test, apply the patch and create a new feature, then run features update via drush, and no more php version in the info file.

jhedstrom’s picture

Actually, I mis-spoke in #9. Core was adding that php version to the system table, so upon enabling and then exporting, the version re-appeared. The reason for this is that the patch in #6 only sets php version in the $standard_info variable, but then the $export variable is merged in. This updated patch removes the php version from the $export variable.

lotyrin’s picture

Status: Needs review » Needs work

Unless I'm mistaken, the change to features_export_prepare() is the actual fix, and the change to features_load_feature() is superfluous.

jhedstrom’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs work » Needs review
FileSize
911 bytes

The change cot features_load_feature was superfluous. Patch re-rolled against 2.x with that in mind.

mariacha1’s picture

Version: 7.x-2.x-dev » 7.x-2.0-rc1
FileSize
1.49 KB
26.31 KB

There is one small bug with this solution, which can be reproduced on the 7.x-2.0-rc1 version:

1) Apply #12 to the 7.x-2.0-rc1 version.
2) Create a simple feature "my_feature".
3) Verify that the my_feature.info file DOES NOT contain the line "php = 5.2.4"
4) Make any change in the database to the feature (add a permission, change a phrase, it does not matter). Verify that running drush fd (or visiting the feature page) shows the feature as Overridden.
5) View the differences, either by doing drush fd my_feature or by visiting "Review Overrides" tab.
6) Verify that Features THINKS the .info file contains a reference to php 5.2.4.

Line 11 is actually empty

Nothing is really harmed by this bug. Reverting the patch does not re-add 5.2.4 to the .info file. It's just a bit obnoxious.

I'm including a patch that seems to fix the false-positive override for me after a cache clear.

mariacha1’s picture

Dang it! Rolled out the wrong patch. Trying again.

lotyrin’s picture

I haven't tried it yet, but reading the code, I'd imagine that the change in function features_get_info() should be checking for DRUPAL_MINIMUM_PHP?

mpotter’s picture

Status: Needs review » Fixed

Committed to 3805bec.

Status: Fixed » Closed (fixed)

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