IMO the following call returns illogical results:
$countries = countries_get_countries('all', $filters['countries'] = array('de', 'be') )

I expect 2 country-objects, but get all of them.
See below 'patch'.

function countries_get_countries($property = 'all', $filters = array()) {
  $countries = entity_load_multiple_by_name('country');
-  if ($property == 'all') {
-    return $countries;
-  }

  $filtered_countries = countries_filter($countries, $filters);

  if ($property == 'all' || empty($property)) {
    return $filtered_countries;
  }
  ...
}

Comments

alan d.’s picture

Status: Active » Needs review
StatusFileSize
new477 bytes

Just to be on the safe side, I'll see what the tests say.

alan d.’s picture

triggering test bot again

alan d.’s picture

Status: Needs review » Fixed

Excellent, the tests are fully functional again. These tests needed adjusting due to:

1) New string changes to bring the countries list fully inline with the ISO standard.
2) An error in the import where no imports were selected (committed a few days ago).
3) An error in the import where the enabled flag was ignored when this was set to 0.

Right, back to the issue at hand, this has been pushed into dev.

Status: Fixed » Closed (fixed)

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