On occasions I've run into the following warning when installing a profile:

WD php: Warning: Invalid argument supplied for foreach() in entity_metadata_convert_schema() (line 151 of                                                            [warning]
/var/www/BUILDS/healthdata-test-suite/healthdata/docroot/profiles/dkan/modules/contrib/entity/entity.info.inc).

Comments

dkinzer created an issue. See original summary.

dkinzer’s picture

Status: Active » Needs review
StatusFileSize
new1010 bytes
dharizza’s picture

Thanks @dkinzer for the patch, I've run into the same issue and this patch fix it for me.

dafeder’s picture

Status: Needs review » Reviewed & tested by the community
fago’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

I do not think it's valid to have a $schema fields. What were the occasions you run into this, when installing which module? If it just happens during some brittle combination I'd assume something nasty going on during a cache rebuild?

dxvargas’s picture

@fago nasty it is, indeed. I could tell you my case but it's so odd I don't think it's really interesting. It has to do with loading a backup of a clean database but somehow old data persists and it fails here. So the origin of the problem is not here.

Anyway, I think it's a best practice to always avoid php errors by testing the foreach control variable.