Attached is a .inc file to add user signature to the user context.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

sdboyer’s picture

...no attachment.

awolfey’s picture

FileSize
1.25 KB

oops

merlinofchaos’s picture

Status: Active » Needs work

THis should've been marked 'needs review' -- it would've been seen more quickly.

  if ($account === FALSE || ($account->access == 0 && !user_access('administer users'))) {
    return drupal_not_found();
  }

This is completely wrong in a content type. The whole page should not disappear just because one content type can't be viewed. It should just return NULL.

/**
 * Callback function to supply a list of content types.
 */
function ctools_user_signature_ctools_content_types() {
  return array(
    'single' => TRUE,
    'title' => t('User signature'),
    'icon' => 'icon_user.png',
    'description' => t('The signature of a user.'),
    'required context' => new ctools_context_required(t('User'), 'user'),
    'category' => t('User'),
  );
}

This should be using the $plugin = array() notation.

'single' => TRUE is now the default.

awolfey’s picture

Version: 6.x-1.2 » 6.x-1.7
FileSize
1.16 KB

Here is the file with the desired changes.

  if ($account === FALSE || ($account->access == 0 && !user_access('administer users'))) {
    return drupal_not_found();
  }

This was modeled on user_picture.inc, but I changed it to return NULL.

Thanks for the review.

awolfey’s picture

Status: Needs work » Needs review

Changing to needs review.

merlinofchaos’s picture

Status: Needs review » Fixed

Thanks for the reroll. Looks good now, so committed.

Status: Fixed » Closed (fixed)

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