i have drupal 7 code: $query = new EntityFieldQuery(); ■ Undefined type…
- User
i have drupal 7 code:
query->entityCondition('entity_type', 'node') │ │ 5 │ ->entityCondition('bundle', 'webinar') │ │ 6 │ ->propertyCondition('status', 1) // ensure that only published nodes are going to be displayed. │ │ 7 │ ->propertyOrderBy('schedule', 'DESC'); │ │ 8 │ query->execute();
- Assistant
It seems like the issue you're encountering is due to the way you are trying to sort your nodes by a field ('schedule') that is not a direct property of the node table in your database. In Drupal 7, fields attached to entities like nodes are stored in separate tables.
Here's how you can modify your code to achieve the desired sorting:
-
Identify the field storage table: Drupal stores field values in separate tables based on the field type. For a date/datetime field, it will typically be something like or . You need to use the correct table name.
-