Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/callbacks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ function entity_plus_metadata_taxonomy_term_get_properties($term, array $options
return count(taxonomy_select_nodes($term->tid));

case 'description':
if (empty($term->description)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, the problem only happens if $term->description is NULL, not when it's empty. Can you please change empty() to is_null()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@argiepiano I don't mind changing it, but is there any value in proceeding if it is empty?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. First I thought it may be appropriate to run filters for the format even if the value was empty. That's exactly what the field module does for rich text fields even when they are empty, and what taxonomy.tokens.inc currently does also (although it will generate into the same warning you see with entity plus if the value is NULL - another bug for another day).

But then I looked at TaxonomyTermController, and there is a check for empty there before calling check_markup(), so I guess that's OK here too. I'll merge

return '';
}
return check_markup($term->description, isset($term->format) ? $term->format : NULL, '', TRUE);

case 'parent':
Expand Down