Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19506 - Remove conflicting uniqueName from CaseContact DAO #9318

Closed
wants to merge 11 commits into from
4 changes: 2 additions & 2 deletions CRM/Case/DAO/CaseContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Generated from xml/schema/CRM/Case/CaseContact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:52a6a7dd974e88c088097761faa8ead7)
* (GenCodeChecksum:81a99f6c6d9abe6d08efd359c015036c)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
Expand Down Expand Up @@ -113,7 +113,7 @@ static function &fields() {
'required' => true,
'FKClassName' => 'CRM_Case_DAO_Case',
) ,
'case_contact_id' => array(
'contact_id' => array(
'name' => 'contact_id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Contact ID') ,
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/DAO/AllCoreTables.data.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
// (GenCodeChecksum:01f161241dcb8f3cbe924b68f5a42a9d)
// (GenCodeChecksum:89f332e5e88581181224fac51b45a1a4)
return array(
'CRM_Core_DAO_AddressFormat' => array(
'name' => 'AddressFormat',
Expand Down
3 changes: 3 additions & 0 deletions CRM/Upgrade/Incremental/sql/4.7.13.mysql.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ WHERE `name` = 'New Tag';
UPDATE civicrm_navigation SET
`url` = 'civicrm/admin/tag?reset=1'
WHERE `name` = 'Tags (Categories)';

-- CRM-16352: Add language filter support for mass mailing
ALTER TABLE civicrm_mailing ADD COLUMN `language` varchar(5) DEFAULT NULL COMMENT 'Language of the content of the mailing. Useful for tokens.';
19 changes: 19 additions & 0 deletions CRM/Utils/Check/Component/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,4 +698,23 @@ public function checkDbEngine() {
return $messages;
}

/**
* Check for required mbstring extension
* @return array
*/
public function checkMbstring() {
$messages = array();

if (!function_exists('mb_substr')) {
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__,
ts('The PHP Multibyte String extension is needed for CiviCRM to correctly handle user input among other functionality. Ask your system administrator to install it.'),
ts('Missing mbstring Extension'),
\Psr\Log\LogLevel::WARNING,
'fa-server'
);
}
return $messages;
}

}
1 change: 1 addition & 0 deletions templates/CRM/Admin/Page/APIExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
return ret;
}, {})
};
getFieldsCache[entity+action] = {values: _.cloneDeep(getFieldData)};
showFields(['api_action']);
renderJoinSelector();
return;
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Dashlet/Page/Blog.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div class="crm-accordion-wrapper collapsed">
<div class="crm-accordion-header">
<span class="crm-news-feed-item-title">{$article.title}</span>
<span class="crm-news-feed-item-preview"> - {$article.description|strip_tags|substr:0:100}</span>
<span class="crm-news-feed-item-preview"> - {if function_exists('mb_substr')}{$article.description|strip_tags|mb_substr:0:100}{else}{$article.description|strip_tags}{/if}</span>
</div>
<div class="crm-accordion-body">
<div>{$article.description}</div>
Expand Down
46 changes: 46 additions & 0 deletions tests/phpunit/api/v3/CaseContactTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Test APIv3 civicrm_case_* functions
*
* @package CiviCRM_APIv3
* @group headless
*/
class api_v3_CaseContactTest extends CiviCaseTestCase {
protected $_params;
protected $_entity;
protected $_cid;
/**
* Activity ID of created case.
*
* @var int
*/
protected $_caseActivityId;

/**
* Test setup for every test.
*
* Connect to the database, truncate the tables that will be used
* and redirect stdin to a temporary file.
*/
public function setUp() {
$this->_entity = 'case';

parent::setUp();

$this->_cid = $this->individualCreate();

$this->_case = $this->callAPISuccess('case', 'create', array(
'case_type_id' => $this->caseTypeId,
'subject' => __CLASS__,
'contact_id' => $this->_cid,
));
}

public function testCaseContactGet() {
$result = $this->callAPIAndDocument('CaseContact', 'get', array(
'contact_id' => $this->_cid,
), __FUNCTION__, __FILE__);
$this->assertEquals($this->_case['id'], $result['id']);
}

}
1 change: 0 additions & 1 deletion xml/schema/Case/CaseContact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<name>contact_id</name>
<title>Contact ID</title>
<type>int unsigned</type>
<uniqueName>case_contact_id</uniqueName>
<required>true</required>
<comment>Contact ID of contact record given case belongs to.</comment>
<html>
Expand Down