-
-
Notifications
You must be signed in to change notification settings - Fork 825
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-21728 Prevent intermittant fail on pcp api calls. #11606
Conversation
When I run the SyntaxConformance tests locally I get a fatal error because it tries to include api_v3_pcp.php after having included api_v3_PCP.php & thinks they are 2 files. This is a Mac so obviously the handling is different to the jenkins method. Not overwriting the param if passed in works locally
@eileenmcnaughton : Does this have a related JIRA issue? |
@yashodha no - I'm a bit confused about the JIRA status after Matt's email - but will add one |
updated |
@@ -1235,7 +1235,7 @@ function formatCheckBoxField(&$checkboxFieldValue, $customFieldLabel, $entity) { | |||
* @return array | |||
*/ | |||
function _civicrm_api3_basic_get($bao_name, $params, $returnAsSuccess = TRUE, $entity = "", $sql = NULL, $uniqueFields = FALSE) { | |||
$entity = CRM_Core_DAO_AllCoreTables::getBriefName(str_replace('_BAO_', '_DAO_', $bao_name)); | |||
$entity = $entity ?: CRM_Core_DAO_AllCoreTables::getBriefName(str_replace('_BAO_', '_DAO_', $bao_name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton can you correct this to
$entity = $entity ? $entity : CRM_Core_DAO_AllCoreTables::getBriefName(str_replace('_BAO_', '_DAO_', $bao_name));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monishdeb that syntax is actually a correct variant on the tenary
"Since PHP 5.3, it is possible to leave out the middle part of the ternary operator. Expression expr1 ?: expr3 returns expr1 if expr1 evaluates to TRUE, and expr3 otherwise."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(in later php you can use var that might not be set that way which saves a lot of isset())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh right, didn't know that. Thanks for explaining it to me :)
thanks @monishdeb |
Overview
Fix for fatal errors on Mac to do with loading of Pcp.php file when it gets confused about casing. Unlikely to affect live sites as does not fail on jenkins
Before
Tests pass on Mac when SyntaxConformance::singleValueAlter run in isolation
After
Tests pass on Mac when SyntaxConformance::singleValueAlter run in isolation
Technical Details
When I run the SyntaxConformance tests locally I get a fatal error because it tries
to include api_v3_pcp.php after having included api_v3_PCP.php & thinks they are 2 files.
This is a Mac so obviously the handling is different to the jenkins method. Not overwriting the
param if passed in works locally
Comments