Recreation of the issues:
1) create a user type view
2) set a relationship with the user submissions (don't make the relationship compulsory)
3) add a 'draft' column to your view
4) if you have users withno submissions, there you go: the draft column will read: 'completed'
Fix:
open the file modules/webform/views/webform_handler_field_is_draft.inc, and add as follows:
class webform_handler_field_is_draft extends views_handler_field {
function render($values) {
$is_draft = $values->{$this->field_alias};
if($is_draft == null) return (t('no data')); // <<<--- this is the fix
return $is_draft ? t('draft') : t('completed');
}
}
Sorry I have no git installation yet to provide a proper patch. Also I see now that HEAD has modified this code...
Hope it helps someone.
Comment | File | Size | Author |
---|---|---|---|
#1 | webform-is_draft_in_views-2025833-1.patch | 978 bytes | DanChadwick |
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedThanks. I made it say "no submission" when NULL.