Hi, thanks for the batch of recent fixes. There is however a major remaining issue, in that the content gathering work fine for comments but fails for nodes. It does expect a field_body, which might not be present (straight port from D6, I suppose). Nodes can be made of any type/numbers of fields and don't always have a body field. Even if they do, it can be named anything.
This is used in 2 places at least:
1.
antispam_prepare_comment_data()
One possible solution (actually, the only on I can think of) would be to use the rendered node as the content, similar to:
$entities = entity_load('node', [$content->nid]);
$render = reset(entity_view('node', $entities));
$rendered = drupal_html_to_text(drupal_render($render), 'a');
$comment_data['comment-content'] = $rendered;
2.
antispam_moderation_form()
Getting rid of the JOIN enterly (and not showing an extract) might be sufficient, else using the same method than above would probably do.
An additional option might be to use a dedicated view mode for this, instead of the default one.
Thoughts ?
Comment | File | Size | Author |
---|---|---|---|
#2 | 2906076-node_moderation_expect_body_field.patch | 1.72 KB | vengador |
Comments
Comment #2
vengador CreditAttribution: vengador at Code Enigma commentedWe have a patch ready for this issue.
Comment #3
cfinke CreditAttribution: cfinke commentedThanks for the patch; I've committed it in changeset 09b8c249.
Comment #4
cfinke CreditAttribution: cfinke commented