We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The INSERT IGNORE should be INSERT OR IGNORE: https://stackoverflow.com/questions/12105198/sqlite-how-to-get-insert-or-ignore-to-work And the BINARY in ON BINARY wp_user_meta.meta_value = mollie_customer.mollie_id is also a problem: wp-pronamic-pay-mollie/src/Install.php Lines 304 to 382 in 82f0e72 /** * Convert user meta. * * @return void * @throws \Exception Throws exception when database update query fails. */ private function convert_user_meta() { global $wpdb; $query = " INSERT IGNORE INTO $wpdb->pronamic_pay_mollie_customers ( mollie_id, test_mode ) SELECT meta_value AS mollie_id, '_pronamic_pay_mollie_customer_id_test' = meta_key AS test_mode FROM $wpdb->usermeta WHERE meta_key IN ( '_pronamic_pay_mollie_customer_id', '_pronamic_pay_mollie_customer_id_test' ) AND meta_value != '' ; "; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Query is prepared. $result = $wpdb->query( $query ); if ( false === $result ) { throw new \Exception( \sprintf( 'Could not convert user meta, database error: %s.', \esc_html( $wpdb->last_error ) ) ); } $query = " INSERT IGNORE INTO $wpdb->pronamic_pay_mollie_customer_users ( customer_id, user_id ) SELECT mollie_customer.id AS mollie_customer_id, wp_user.ID AS wp_user_id FROM $wpdb->pronamic_pay_mollie_customers AS mollie_customer INNER JOIN $wpdb->usermeta AS wp_user_meta ON BINARY wp_user_meta.meta_value = mollie_customer.mollie_id INNER JOIN $wpdb->users AS wp_user ON wp_user_meta.user_id = wp_user.ID WHERE wp_user_meta.meta_key IN ( '_pronamic_pay_mollie_customer_id', '_pronamic_pay_mollie_customer_id_test' ) AND wp_user_meta.meta_value != '' ; "; // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Query is prepared. $result = $wpdb->query( $query ); if ( false === $result ) { throw new \Exception( \sprintf( 'Could not convert user meta, database error: %s.', \esc_html( $wpdb->last_error ) ) ); } } Related issues: Queries with INSERT INGORE are not working? WordPress/sqlite-database-integration#79 No support for BINARY compare e.g. ON BINARY wp_user_meta.meta_value = mollie_customer.mollie_id WordPress/sqlite-database-integration#80
The INSERT IGNORE should be INSERT OR IGNORE: https://stackoverflow.com/questions/12105198/sqlite-how-to-get-insert-or-ignore-to-work
INSERT IGNORE
INSERT OR IGNORE
And the BINARY in ON BINARY wp_user_meta.meta_value = mollie_customer.mollie_id is also a problem:
BINARY
ON BINARY wp_user_meta.meta_value = mollie_customer.mollie_id
wp-pronamic-pay-mollie/src/Install.php
Lines 304 to 382 in 82f0e72
Related issues:
INSERT INGORE
Originally posted by @remcotolsma in pronamic/wp-pronamic-pay-with-mollie-for-gravity-forms#4 (comment)
The text was updated successfully, but these errors were encountered:
remcotolsma
Successfully merging a pull request may close this issue.
Originally posted by @remcotolsma in pronamic/wp-pronamic-pay-with-mollie-for-gravity-forms#4 (comment)
The text was updated successfully, but these errors were encountered: