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-20220 fix signature fields to be longtext #9936

Merged
merged 2 commits into from
Mar 10, 2017

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 6, 2017

@@ -44,15 +44,8 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
protected $_ppDAO;

public function preProcess() {
if (!CRM_Core_Permission::check('administer payment processors')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved this to the xml definition of the form

parent::preProcess();

CRM_Utils_System::setTitle(ts('Settings - Payment Processor'));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -77,10 +70,6 @@ public function preProcess() {
$this->_ppDAO = new CRM_Financial_DAO_PaymentProcessorType();
$this->_ppDAO->id = $this->_ppType;

if (!$this->_ppDAO->find(TRUE)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is checking for an impossible condition

@@ -1375,7 +1379,7 @@ public function addSelect($name, $props = array(), $required = FALSE) {
* @throws \Exception
* @return HTML_QuickForm_Element
*/
public function addField($name, $props = array(), $required = FALSE, $legacyDate = TRUE) {
public function addField($name, $props = array(), $required = FALSE, $fieldSpec = array(), $legacyDate = TRUE) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colemanw what is your opinion on this. It feels like the easiest way to make the fields on the payment processor form metadata driven. However, some of the fields are pseudofields so I figured maybe we could change the scope here to allow them to be passed in

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we ought to use this function with pseudofields.

@@ -45,10 +45,10 @@ class CRM_Contact_Form_Edit_Demographics {
public static function buildQuickForm(&$form) {
$form->addField('gender_id', array('entity' => 'contact', 'type' => 'Radio', 'allowClear' => TRUE));

$form->addField('birth_date', array('entity' => 'contact'), FALSE, FALSE);
$form->addField('birth_date', array('entity' => 'contact'), FALSE, array(), FALSE);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The legacyDateParam is v recent & transitional so I know these are the only fields using it

@colemanw
Copy link
Member

colemanw commented Mar 9, 2017

@eileenmcnaughton unfortunately this is stale

@eileenmcnaughton
Copy link
Contributor Author

@colemanw I fixed the staleness. Re adding the test fields: here's the thing, the fields create a second row in the payment processor table, but they arguably are 'real fields' because the way it works is you update them in practice as if they were one thing (I might almost wish they were one row in the table!)

I did think about adding them to getfields so the api understood them as part of the set of fields to be added, if we were thinking about putting them in one row, one day that would be a good step towards that.

The difficulty would be on the off chance someone really did want to use the api to alter just the test fields, hence I thought maybe I should do trickery at the form layer.

I guess I can go back to 'add' if there is no metadata way to do this

@colemanw
Copy link
Member

colemanw commented Mar 9, 2017

I agree with add. The addField function has its limitations and was never intended to work with fake fields.

@eileenmcnaughton
Copy link
Contributor Author

@colemanw ok, I've switched the test fields back...

@eileenmcnaughton
Copy link
Contributor Author

test this please

* @return string
* The entity being edited.
*
* @throws Exception
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it doesn't

@eileenmcnaughton
Copy link
Contributor Author

@colemanw this has passed tests with your update, do you think it's good to merge now?

@colemanw colemanw merged commit c5019d0 into civicrm:master Mar 10, 2017
@colemanw colemanw deleted the sig branch March 10, 2017 22:14
monishdeb pushed a commit to monishdeb/civicrm-core that referenced this pull request May 2, 2017
CRM-20220 fix signature fields to be longtext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants