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

Unable to save donation form after installing Give on Pantheon Sites #2692

Closed
2 tasks
mehul0810 opened this issue Jan 23, 2018 · 7 comments
Closed
2 tasks
Assignees

Comments

@mehul0810
Copy link
Contributor

Issue Overview

I have noticed this issue creating a site on pantheon and then installing fresh Give or upgrading it from 1.8.19 to 2.0 and then running upgrade stops the process of saving donation forms.

For more details, you can play with the instance: http://dev-givetest.pantheonsite.io/wp-admin/

Note: Sometimes with update-process branch, I've got Fatal Error while activating plugin as below:

Fatal error: Uncaught Error: Call to a member function create_table() on null in /srv/bindings/28e9c9a4de6846ddb7a4b98aac76299a/code/wp-content/plugins/Give-feature-update-process/includes/admin/upgrades/upgrade-functions.php:2146 Stack trace: #0 /srv/bindings/28e9c9a4de6846ddb7a4b98aac76299a/code/wp-content/plugins/Give-feature-update-process/includes/admin/upgrades/upgrade-functions.php(82): give_v201_create_tables() #1 /srv/bindings/28e9c9a4de6846ddb7a4b98aac76299a/code/wp-includes/class-wp-hook.php(286): give_do_automatic_upgrades('') #2 /srv/bindings/28e9c9a4de6846ddb7a4b98aac76299a/code/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array) #3 /srv/bindings/28e9c9a4de6846ddb7a4b98aac76299a/code/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 /srv/bindings/28e9c9a4de6846ddb7a4b98aac76299a/code/wp-content/plugins/Give-feature-update-process/includes/install.php(87): do_action('give_upgrades') #5 /srv/bindings/28e9c9a4de6846ddb7a4b98aac76299a/code/wp-content/plugins/Give-feature-update-process/ in /srv/bindings/28e9c9a4de6846ddb7a4b98aac76299a/code/wp-content/plugins/Give-feature-update-process/includes/admin/upgrades/upgrade-functions.php on line 2146

Expected Behavior

Donation Forms should save properly.

Current Behavior

Donation Forms are not saved after upgrade resulting in improper form in front.

Possible Solution

I think the system is unable to track the change of DB due to which the issue arises.

Steps to Reproduce (for bugs)

  1. Create Demo Site on Pantheon
  2. Install Give ( I've tried production version as well as update-process branch on GitHub)
  3. Run Upgrades if exists.
  4. Try Creating and Saving a Donation Form with Set Donation

Todos

  • Tests
  • Documentation

WordPress Environment

WordPress Environment

Home URL: http://dev-givetest.pantheonsite.io
Site URL: http://dev-givetest.pantheonsite.io
WP Version: 4.9.2
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
Permalink Structure: /%year%/%monthnum%/%day%/%postname%/
Show on Front: posts
Table Prefix Length: wp_
Table Prefix Length: 3
Table Prefix Status: Acceptable
Admin AJAX: Accessible
Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, refunded, failed, revoked, cancelled, abandoned, processing, preapproval

Server Environment

Hosting Provider: DBH: 10.128.15.206:14672, SRV: appserver-364aaf7d.c.pantheon-dmz.internal
TLS Connection: Connection uses TLS 1.2
TLS Connection: Bad
Server Info: nginx/1.8.1
PHP Version: 7.0.27
PHP Post Max Size: 100 MB
PHP Time Limit: 120
PHP Max Input Vars: 10000
PHP Max Upload Size: 100 MB
cURL Version: 7.40.0, NSS/3.21 Basic ECC
SUHOSIN Installed: –
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
gzip: ✔
GD Graphics Library: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Give Configuration

Give Version: 2.0.1
Give Cache: Enabled
Database Updates: All DB Updates Completed.
Give Cache: Enabled
Give Cache: ✔New Donation✔Donation Receipt✔New Offline Donation✔Offline Donation Instructions✔New User Registration✔User Registration Information✔Email access
Upgraded From: 2.0.1
Test Mode: Enabled
Currency Code: USD
Currency Position: Before
Decimal Separator: .
Thousands Separator: ,
Success Page: http://dev-givetest.pantheonsite.io/donation-confirmation/
Failure Page: http://dev-givetest.pantheonsite.io/donation-failed/
Donation History Page: http://dev-givetest.pantheonsite.io/donation-history/
Give Forms Slug: /donations/
Enabled Payment Gateways: Test Donation, Offline Donation
Default Payment Gateway: Test Donation
PayPal IPN Verification: Enabled
PayPal IPN Notifications: N/A
Donor Email Access: Enabled

Session Configuration

Give Use Sessions: Enabled
Session: Disabled

Active Give Add-ons

Give - Donation Plugin: ❌ Unlicensed – by WordImpress – 2.0.1

Other Active Plugins

Native PHP Sessions for WordPress: by Pantheon – 0.6.4

Inactive Plugins

Akismet: by Automattic – 3.1.5
Hello Dolly: by Matt Mullenweg – 1.6

Active MU Plugins

Pantheon: by Pantheon – 0.1

Theme

Name: Twenty Seventeen
Version: 1.0
Author URL: https://wordpress.org/
Child Theme: No – If you're modifying Give on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme

@ravinderk
Copy link
Collaborator

@mehul0810 As we discussed overall. It is working fine for me. I fixed fatal error issue on fresh which was coming on the fresh install. Please reconfirm form saving issue.

@mehul0810
Copy link
Contributor Author

@ravinderk I'm still able to reproduce the issue on Pantheon sites as the tables are not created. I'll try find the cause and will update with my findings here.

@ravinderk
Copy link
Collaborator

@mehul0810 was it working fine for you on local?

@mehul0810
Copy link
Contributor Author

@ravinderk Yes. It is working fine on local and it seems to be not working on some servers like Pantheon

@mehul0810
Copy link
Contributor Author

@ravinderk @DevinWalker I've tracked the cause of tables not getting created on pantheon sites. It is due to varchar (255) for meta_key when some host have Collate = ut8mb4 will return true and table not created. Changing varchar(150) is creating tables on pantheon.

I'll look into WooCommerce and how to handle it with WordPress and will update all my findings here.

@mehul0810
Copy link
Contributor Author

@ravinderk @DevinWalker Here is my final findings from WordPress as well as WooCommerce:

  1. WordPress uses $max_index_length = 191 and already switched to utf8mb4 after WP 4.2. Hence, WordPress is not having issues with creation of tables.
  2. WooCommerce uses $max_index_length = 32 which is way smaller. Hence, they are also not facing issue with table creation.

Here is the sample code from WordPress/WooCommerce:

CREATE TABLE $wpdb->termmeta (
  meta_id bigint(20) unsigned NOT NULL auto_increment,
  term_id bigint(20) unsigned NOT NULL default '0',
  meta_key varchar(255) default NULL,
  meta_value longtext,
  PRIMARY KEY  (meta_id),
  KEY term_id (term_id),
  KEY meta_key (meta_key($max_index_length))
) $charset_collate;

ravinderk added a commit that referenced this issue Jan 24, 2018
Issue #2692 - Fix Table Creation Issue when utf8mb4
@ravinderk
Copy link
Collaborator

@mehul0810 Thank you for fix

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

No branches or pull requests

2 participants