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

Moved the shortcode call before output buffering #3

Closed
wants to merge 1 commit into from
Closed

Moved the shortcode call before output buffering #3

wants to merge 1 commit into from

Conversation

dgilfoy
Copy link

@dgilfoy dgilfoy commented Jan 18, 2013

For some reason in the development branch the ESPRESSO_TXN_PAGE shortcode wasn't working, as if the shortcode didn't exist.

Moving the line where the shortcode is defined above the ob_start() seems to work. Not entirely sure why, but I'm guessing the output buffering interferes somehow.

@nerrad
Copy link
Contributor

nerrad commented Jan 18, 2013

@tn3rb review please :)

@dgilfoy
Copy link
Author

dgilfoy commented Jan 18, 2013

Actually it's possible the change isn't necessary. I was testing the ob_start issue with another plugin and it wasn't having the same problems. I went back to the function and poked around and saw that if no active gateways are setup it sends an email and just ends - before the shortcode is setup. I'm working locally with no mail service setup so I didn't get the email.

Not sure what the best solution would be here, in order to prevent confusion perhaps call the shortcode early and allow it to remain blank (or with an error message indicating no IPN is setup) or just allow it to display the shortcode as text on the page.

@tn3rb
Copy link
Member

tn3rb commented Jan 18, 2013

so did the shortcode work after you set up a gateway ???

@dgilfoy
Copy link
Author

dgilfoy commented Jan 18, 2013

Actually, not quite. I see a bunch of errors on the payments settings page
and when I enable check payments, for instance, I get require_once failed
errors on the transaction page.

Thanks for the help so far! I'll look at some of the fixes in the other
branches and keep an eye on new changes. Loving what changes I see so far
though!

On Fri, Jan 18, 2013 at 11:35 AM, Brent Christensen <
notifications@github.com> wrote:

so did the shortcode work after you set up a gateway ???


Reply to this email directly or view it on GitHubhttps://github.com//pull/3#issuecomment-12437535.

@tn3rb
Copy link
Member

tn3rb commented Jan 18, 2013

any chance you can post some of the errors here? If you're busy with other things, I understand.

@dgilfoy
Copy link
Author

dgilfoy commented Jan 18, 2013

Sure, not a problem!

I got these on the transaction page when I visit it (with check payments,
but just visiting the page, no transactions):

Warning: require_once(/init.php): failed to open stream: No such file or
directory in
/var/www/sites/dev/wp-content/plugins/event-espresso-core-master/gateways/process_payments.php
on line 27 Fatal error: require_once(): Failed opening required '/init.php'
(include_path='/var/www/sites/dev/wp-content/plugins/event-espresso-core-master/includes/core/:/var/www/sites/dev/wp-content/plugins/event-espresso-core-master/includes/models/:/var/www/sites/dev/wp-content/plugins/event-espresso-core-master/includes/classes/:/var/www/sites/dev/wp-content/plugins/event-espresso-core-master/includes/functions/:/var/www/sites/dev/wp-content/plugins/event-espresso-core-master/gateways/:.:/usr/share/php:/usr/share/pear')
in
/var/www/sites/dev/wp-content/plugins/event-espresso-core-master/gateways/process_payments.php
on line 27

And here's a screenshot of the errors/notices on the payment options page:

https://www.dropbox.com/s/chthk6qq8xlw6se/ee-payment-gateway-error.png

On Fri, Jan 18, 2013 at 11:47 AM, Brent Christensen <
notifications@github.com> wrote:

any chance you can post some of the errors here? If you're busy with other
things, I understand.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3#issuecomment-12438027.

@tn3rb
Copy link
Member

tn3rb commented Jan 18, 2013

the big list of error notices on the Payment Settings page can be ignored since, as the errors state "For the time being, the following error indicates that Gateway has yet to be converted over to 3.2" so no worries there. I really only put there error there to help "inspire" the guy that was converting the gateways!!!

As for the other error, for the time being you could open up /gateways/process_payments.php

and change line 27 from:

    foreach ( $active_gateways as $gateway => $path ) {
        require_once( $path . '/init.php' );
    }

to

    foreach ( $active_gateways as $gateway => $path ) {
        if ( file_exists( $path . '/init.php' )) {
            require_once( $path . '/init.php' );
        }       
    }

@dgilfoy
Copy link
Author

dgilfoy commented Jan 21, 2013

Thanks! I'll go ahead and close this then. :)

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

Successfully merging this pull request may close these issues.

3 participants