According to entity.api.php, 'description' is optional in hook_entity_property_info(), however, not defining it results in 'undefined index: description' notices. See #1398114: Undefined index notices.

Comments

Xano’s picture

Also, if there are titles/labels, descriptions should (almost) never be required, because if the title is descriptive enough, the description property is simply redundant. Requiring it would mean the title and description are identical, which is useless.

The same issue exists when building forms or when defining permissions. They have a title and an optional description (permissions only after a patch, because their required descriptions caused duplication and a cluttered interface).

fago’s picture

Status: Active » Closed (works as designed)

Also, if there are titles/labels, descriptions should (almost) never be required, because if the title is descriptive enough, the description property is simply redundant. Requiring it would mean the title and description are identical, which is useless.

Agreed, so yep they are optional.

sammyd56’s picture

Status: Closed (works as designed) » Active

So we are agreed that 'description' should be optional, so what are we supposed to do about the notices that are reported when it is not defined?

Notice: Undefined index: description in EntityDefaultViewsController->map_from_schema_info() (line 391 of /var/www/drupal/sites/all/modules/entity/views/entity.views.inc).

fago’s picture

Status: Active » Fixed

add a check - I've done so, what should fix the issue.

Status: Fixed » Closed (fixed)

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