-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
NFC Fix DAO Style issues #14307
NFC Fix DAO Style issues #14307
Conversation
(Standard links)
|
xml/templates/dao.tpl
Outdated
@@ -30,7 +30,7 @@ class {$table.className} extends CRM_Core_DAO {ldelim} | |||
{foreach from=$table.fields item=field} | |||
/** | |||
{if $field.comment} | |||
* {$field.comment} | |||
* {$field.comment|replace:"\n":"\n* "} |
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.
a regex replace that also removed the extra whitespace would be super cool. Would this work?
|preg_replace:"/\n[ ]*/":"\n* "
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.
@colemanw that gives me Delimiter must not be alphanumeric or backslash
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.
Whoops, looks like it should be |regex_replace
https://www.smarty.net/docsv2/en/language.modifier.regex.replace.tpl
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.
That seems to have worked @colemanw
CRM/Contact/DAO/Contact.php
Outdated
@@ -84,6 +84,7 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { | |||
/** | |||
* May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID. | |||
* | |||
* |
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.
Hmm - this seems wrong - two lines
@@ -30,7 +30,7 @@ class {$table.className} extends CRM_Core_DAO {ldelim} | |||
{foreach from=$table.fields item=field} | |||
/** | |||
{if $field.comment} | |||
* {$field.comment} | |||
* {$field.comment|regex_replace:"/\n[ ]*/":"\n* "} |
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.
@seamuslee001 this looks like the comment change - but where are the trailing commas coming from?
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 its for the fact there are multiline comments in the xml schema and we need to add a * for each new line
Remove excess whitespace with Coleman's regex replace Remove unneeded whitespace
@@ -30,7 +30,7 @@ class {$table.className} extends CRM_Core_DAO {ldelim} | |||
{foreach from=$table.fields item=field} | |||
/** | |||
{if $field.comment} | |||
* {$field.comment} | |||
* {$field.comment|regex_replace:"/\n[ ]*/":"\n* "} |
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 its for the fact there are multiline comments in the xml schema and we need to add a * for each new line
@@ -327,7 +327,7 @@ public function getField(&$fieldXML, &$fields) { | |||
$field['sqlType'] = 'decimal(' . $length . ')'; | |||
$field['phpType'] = 'float'; | |||
$field['crmType'] = 'CRM_Utils_Type::T_MONEY'; | |||
$field['precision'] = $length; | |||
$field['precision'] = $length . ','; |
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 this is the trailing comma change
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.
@seamuslee001 Can we not add it in the DAO - feels more consistent with other formatting for DAO files
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.
I don't believe we can because the $length is also used in L327 etc when generating the SQL file and the SQL doesn't use the trailing ,
Jenkins re test this please |
As of now formatting changes looking good |
No description provided.