From 0239e9a31c106eda4e4937c0f08dcf97e40d4107 Mon Sep 17 00:00:00 2001 From: Juampy Date: Fri, 5 Jun 2015 18:18:24 +0200 Subject: [PATCH] CROPS-26 Disable blog form when user does not have a profile --- luggage_blog.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luggage_blog.module b/luggage_blog.module index 7ab4456..4d635fd 100644 --- a/luggage_blog.module +++ b/luggage_blog.module @@ -46,11 +46,11 @@ function luggage_blog_form_alter(&$form, &$form_state, $form_id) { // TODO: This needs to be cleaned up a bit to look better $form['field_lug_blog_author']['#markup'] = $prefix . $profile->title . $suffix; } - // if there is not a matching author, prompt the user to create their profile. else { + // if there is not a matching author, prompt the user to create their profile. drupal_set_message(t('You must create your profile before creating a blog entry.'), 'warning'); - // hide the empty field $form['field_lug_blog_author']['#markup'] = ' '; + $form['#disabled'] = TRUE; } }