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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • PHP displayed on screen after deleting contact
Pages: [1]

Author Topic: PHP displayed on screen after deleting contact  (Read 1025 times)

Wonder95

  • Guest
PHP displayed on screen after deleting contact
March 18, 2008, 08:47:31 pm
When a contact is deleted from CiviCRM, after the confirmation question ("are you sure you want to delete...), when I click on the Delete button, this is what is displayed on the screen:

Code: [Select]
static function checkPermission( $id ) { if ( ! $id ) { return; } $mailingIDs =& CRM_Mailing_BAO_Mailing::mailingACLIDs( ); if ( ! in_array( $id, $mailingIDs ) ) { CRM_Core_Error::fatal( ts( 'You do not have permission to access this mailing report' ) ); } return; } static function mailingACL( ) { $mailingACL = " ( 0 ) "; $mailingIDs =& self::mailingACLIDs( ); if ( ! empty( $mailingIDs ) ) { $mailingIDs = implode( ',', $mailingIDs ); $mailingACL = " civicrm_mailing.id IN ( $mailingIDs ) "; } return $mailingACL; } static function &mailingACLIDs( ) { $mailingIDs = array( ); // get all the groups that this user can access // if they dont have universal access $groups = CRM_Core_PseudoConstant::group( ); if ( ! empty( $groups ) ) { $groupIDs = implode( ',', array_keys( $groups ) ); // get all the mailings that are in this subset of groups $query = " SELECT DISTINCT( m.id ) as id FROM civicrm_mailing m, civicrm_mailing_group g WHERE g.mailing_id = m.id AND g.entity_table = 'civicrm_group' AND g.entity_id IN ( $groupIDs )"; $dao = CRM_Core_DAO::executeQuery( $query, CRM_Core_DAO::$_nullArray ); $mailingIDs = array( ); while ( $dao->fetch( ) ) { $mailingIDs[] = $dao->id; } } return $mailingIDs; } /** * Get the rows for a browse operation * * @param int $offset The row number to start from * @param int $rowCount The nmber of rows to return * @param string $sort The sql string that describes the sort order * * @return array The rows * @access public */ public function &getRows($offset, $rowCount, $sort, $additionalClause = null, $additionalParams = null ) { $mailing = self::getTableName(); $job = CRM_Mailing_BAO_Job::getTableName(); $group = CRM_Mailing_DAO_Group::getTableName( ); $session =& CRM_Core_Session::singleton(); $domain_id = $session->get('domainID'); $mailingACL = self::mailingACL( ); $query = " SELECT $mailing.id, $mailing.name, $job.status, MIN($job.scheduled_date) as scheduled_date, MIN($job.start_date) as start_date, MAX($job.end_date) as end_date FROM $mailing LEFT JOIN $job ON ( $job.mailing_id = $mailing.id AND $job.is_test = 0) WHERE $mailing.domain_id = $domain_id AND $mailingACL $additionalClause GROUP BY $mailing.id "; if ($sort) { $orderBy = trim( $sort->orderBy() ); if ( ! empty( $orderBy ) ) { $query .= " ORDER BY $orderBy"; } } if ($rowCount) { $query .= " LIMIT $offset, $rowCount "; } if ( ! $additionalParams ) { $additionalParams = array( ); } $dao = CRM_Core_DAO::executeQuery( $query, $additionalParams ); $rows = array(); while ($dao->fetch()) { $rows[] = array( 'id' => $dao->id, 'name' => $dao->name, 'status' => CRM_Mailing_BAO_Job::status($dao->status), 'scheduled' => CRM_Utils_Date::customFormat($dao->scheduled_date), 'scheduled_iso' => $dao->scheduled_date, 'start' => CRM_Utils_Date::customFormat($dao->start_date), 'end' => CRM_Utils_Date::customFormat($dao->end_date) ); } return $rows; } /** * compose the url to show details of activityHistory for CiviMail * * @param int $id * * @static * @access public */ static function showEmailDetails( $id ) { return CRM_Utils_System::url('civicrm/mailing/report', "mid=$id"); } /** * Delete Mails and all its associated records * * @param int $id id of the mail to delete * * @return void * @access public * @static */ public static function del($id) { $dependencies = array( 'CRM_Mailing_DAO_Job','CRM_Mailing_DAO_Group', 'CRM_Mailing_DAO_TrackableURL'); foreach ($dependencies as $className) { eval('$dao = & new ' . $className . '();'); $dao->mailing_id = $id; if ( $className == 'CRM_Mailing_DAO_Job' ) { $dao->find( ); while ($dao->fetch()) { if ( $dao->status == 'Complete' || $dao->status == 'Canceled') { $daoSpool = new CRM_Mailing_BAO_Spool(); $daoSpool->job_id = $dao->id; if ( $daoSpool->find( true ) ) { CRM_Core_Session::setStatus(ts('Selected mailing can not be deleted as mails are still pending in spool table.')); return; } } elseif ( $dao->status == 'Running' ) { CRM_Core_Session::setStatus(ts('Selected mailing can not be deleted since it is in process.')); return; } $daoQueue = new CRM_Mailing_Event_BAO_Queue(); $daoQueue->deleteEventQueue( $dao->id, 'job'); $dao->delete(); } continue; } $dao->delete(); } $dao = & new CRM_Mailing_DAO_Mailing(); $dao->id = $id; $dao->delete(); CRM_Core_Session::setStatus(ts('Selected mailing has been deleted.')); } /** * Delete Jobss and all its associated records * related to test Mailings * * @param int $id id of the Job to delete * * @return void * @access public * @static */ public static function delJob($id) { $daoJob = new CRM_Mailing_BAO_Job(); $daoJob->id = $id; if ( $daoJob->find() ) { $daoQueue = new CRM_Mailing_Event_BAO_Queue(); $daoQueue->deleteEventQueue( $daoJob->id, 'job'); } $daoJob->delete(); } function getReturnProperties( ) { $tokens =& $this->getTokens( ); $properties = array( ); if ( isset( $tokens['html'] ) && isset( $tokens['html']['contact'] ) ) { $properties = array_merge( $properties, $tokens['html']['contact'] ); } if ( isset( $tokens['text'] ) && isset( $tokens['text']['contact'] ) ) { $properties = array_merge( $properties, $tokens['text']['contact'] ); } $returnProperties = array( ); $returnProperties['display_name'] = $returnProperties['contact_id'] = $returnProperties['preferred_mail_format'] = 1; foreach ( $properties as $p ) { $returnProperties[$p] = 1; } return $returnProperties; } } ?>

Other users have reported the same issue.  This started recently.  I have made no major changes (or minor ones) to the site in a few weeks.

Thanks.

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: PHP displayed on screen after deleting contact
March 18, 2008, 11:09:52 pm
I am not able to replicate this on my local install / demo. Can you file an issues in jira, with detail steps to replicate this problem on demo.

thanx

kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • PHP displayed on screen after deleting contact

This forum was archived on 2017-11-26.