When I call http://localhost/API/entity_node the REST server responds with "No entities found."

But when I call e.g. http://localhost/API/entity_node/4 the entity is there.

I have Services, REST server and Services Entity enabled and all the CRUD operations are marked.

Any thoughts?
Thanks in advance,
HP

Comments

nd987’s picture

Getting same, thought it was a permissions thing, but couldn't find any permissions.

a.vakulenko’s picture

I have the same problem: with /api/applications/entity_entityform I have no entityform submissions, while api/applications/entity_entityform/1 displays correct result.

a.vakulenko’s picture

I have this problem with Clean entity processor only.

a.vakulenko’s picture

I realized that it works when I add "?parameters[type]=my_entityform_type" to my url. When this is missing, wrong condition is constructed: type='entityform' (entityforms can not have such value in type column). The wrong code is inside ServicesEntityResourceController::propertyQueryOperation().

joachim’s picture

Version: 7.x-2.0-alpha1 » 7.x-2.x-dev

Care to share the fix?

warpedgeoid’s picture

Is there an update on this, a.vakulenko? You said that you had identified the issue, but didn't say if you had managed to resolve it. If you have, a patch would be greatly appreciated!

wodenx’s picture

Status: Active » Needs review

This is because of the following code in ServicesEntityResourceControllerClean::transform_values():

   // Default the bundle to the entity_type. This allows eck types that don't use custom bundles to not have to specify the bundle.
    $entity_info = entity_get_info($entity_type);
    if (isset($entity_info['bundle keys'])) {
      foreach ($entity_info['bundle keys'] as $bundle_key) {
        if (!array_key_exists($bundle_key, $values)) {
          $values[$bundle_key] = $entity_type;
        }
      }
    }

This code is incorrect for another reason (see #2068463: Improper use of 'bundle keys' in "clean" controller.) -- but the problem here is that the entity_type is not always the same as the bundle key, and we shouldn't be assuming that it is. I will reroll the patch for the linked issue to include this fix as well.

wodenx’s picture

The latest patch on this constellation of issues is posted at #1950686: Clean Processor not listing entities with custom bundles.

joachim’s picture

Should we close this as a duplicate?

wodenx’s picture

Status: Needs review » Closed (duplicate)

Sure. Cross posting a link so we don't lose the history.