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

dev/core#534 fix failure of print invoice to display on settings page #13137

Merged
merged 7 commits into from
Nov 21, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Nov 21, 2018

Overview

Adds tests for display of print invoice on user dashboard when invoicing is enabled. Fixes mis-setting of setting (unreleased regression)

Before

Turning on invoicing does not always turn on display of invoices on user dashboard page

After

Related setting managed through a toggle function - which works off the setting page and via the api

Technical Details

Our setting standards are for one setting per ... setting. The invoicing settings use a nested structure that doesn't comply & requires a lot of hacky handling to support it. I also added a function to start to wrap this stuff in utility function.

I tried - but so far failed - to add html validation to the test

Comments

Caches will need to be flushed to test this

@kcristiano

@civibot
Copy link

civibot bot commented Nov 21, 2018

(Standard links)

@civibot civibot bot added the 5.8 label Nov 21, 2018
@eileenmcnaughton eileenmcnaughton force-pushed the user58 branch 2 times, most recently from 3a6a951 to 4a88526 Compare November 21, 2018 00:57
@@ -795,6 +795,7 @@ public static function recurringContribution(&$form) {
'return' => ["id", "name", 'is_test'],
];
$paymentProcessors = civicrm_api3('PaymentProcessor', 'get', $paymentProcessorParams);
$paymentProcessorOpts = [];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enotice fix for test to pass

@kcristiano
Copy link
Member

@eileenmcnaughton Installed via Buildkit, flushed caches. Works as described. Print Invoice button does work.

We are still missing the 'Pay Now' option for pending payments. I've taken a look and not sure what change caused that to change from 5.7 to 5.8

@eileenmcnaughton
Copy link
Contributor Author

@kcristiano OK - I'll merge this & then take a look at that as it will build on this

@eileenmcnaughton eileenmcnaughton force-pushed the user58 branch 2 times, most recently from f8b0413 to ff61c74 Compare November 21, 2018 07:03
@mattwire
Copy link
Contributor

@eileenmcnaughton Wow! I'm wondering if it makes more sense to just add an upgrader function to split out the invoicing "settings" into separate settings so we don't need all this custom code to support them?

@eileenmcnaughton
Copy link
Contributor Author

@kcristiano I just added in the Pay Now link. I had to disable one of the tests for now as it passes locally but not when running on jenkins :-( I'd rather debug the test issue on master

*
* We check both here. But will deprecate the latter in time.
*/
public static function isInvoicingEnabled() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattwire it's really only the second part of these 2 functions that wouldn't be needed without the historical weirdness - but I'm inclined to think a Utils class for invoicing is a good thing to have - part of the dream of one day moving invoicing back out of core :-)

@eileenmcnaughton
Copy link
Contributor Author

@mattwire If might be nice to convert them because then we could do away with that preferences form - but I worry a little if extensions are copying this core weird effort to access those settings

@kcristiano
Copy link
Member

@eileenmcnaughton I've applied the patch locally to D7 and WP. Tested and both Pay Now and Pay Later appear. Both buttons function properly and I was able to make payment and download an invoice.

@mattwire
Copy link
Contributor

@eileenmcnaughton @kcristiano As this is an RC fix, assuming it works and is reviewed I'm happy for it to be merged. I do think we should look at properly migrating the invoice settings to be more standard - but that's for a future PR in master.

@eileenmcnaughton eileenmcnaughton merged commit c00aeff into civicrm:5.8 Nov 21, 2018
@eileenmcnaughton eileenmcnaughton deleted the user58 branch November 21, 2018 19:52
@eileenmcnaughton
Copy link
Contributor Author

@mattwire I've been thinking more about this - I think we should migrate the way Invoice settings are added so it's more like an internal page run hook - and one day it might move to an extension - but the more I think about it the default_invoice_page setting is not really an invoice thing & should be renamed & separated from the invoices - anyway - that can happen in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants