CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Fix to avoid a warning log when website empty
Pages: [1]

Author Topic: Fix to avoid a warning log when website empty  (Read 592 times)

chriscant

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 4
    • PHDCC
  • CiviCRM version: 4.2.19
Fix to avoid a warning log when website empty
November 29, 2011, 10:36:57 am
In CRM/Core/BAO/UFGroup.php around 993, a Drupal warning is logged if no websiteTypeId is set.

This is the old code:

$url = CRM_Utils_System::fixURL( $details->$detailName );
$websiteTypeId  = "website-{$id}-website_type_id";
$websiteType    = $websiteTypes[$details->$websiteTypeId];
if ( $details->$detailName ) {
  $values[$index] = "<a href=\"$url\">{$details->$detailName} ( {$websiteType} )</a>";
} else {
  $values[$index] = '';
}


This makes it happier:

$url = CRM_Utils_System::fixURL( $details->$detailName );
if ( $details->$detailName ) {
  $websiteTypeId  = "website-{$id}-website_type_id";
  $websiteType    = $websiteTypes[$details->$websiteTypeId];
  $values[$index] = "<a href=\"$url\">{$details->$detailName} ( {$websiteType} )</a>";
} else {
  $values[$index] = '';
}

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Fix to avoid a warning log when website empty
November 30, 2011, 04:37:52 am
thanks. Fixed and will be part of 4.1 release.

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Fix to avoid a warning log when website empty

This forum was archived on 2017-11-26.