Invalid INSERT INTO ms_orders at ms_core.module 1726 ?

3 replies [Last post]
vector84
Offline
Joined: 04/01/2010
Status: 
Answered

So to preface things, I'm trying to get the latest version of these scripts to run in PostgreSQL, and after patching up a few PostgreSQL compatibility issues, I'm running into this error when trying to place an order for a membership (PayPal in PayPal sandbox mode, if it matters?):

  1. warning: pg_query() [function.pg-query]: Query failed: ERROR: null value in column "full_name" violates not-null constraint in /home/rewards/public_html/dev2/includes/database.pgsql.inc on line 139.
  2. user warning: query: INSERT INTO ms_orders (uid, status, order_type, gateway, amount, currency, secured, recurring_schedule, data, created, modified) VALUES (3, 'checkout', 'recurring', '', '0', 'USD', 1, 'a:0:{}', 'a:0:{}', 1273371785, 1273371785) in /home/rewards/public_html/dev2/sites/default/modules/moneyscripts/ms_core/ms_core.module on line 1726.

And looking at line 1726 of ms_code.module ... it does indeed appear that it is trying to insert an order without the full_name field, which is marked as NON NULL in the database schema... thus not being permitted...

Changing this field to accept null values fixes the immediate problem of the modules simply not working and allows me to buy memberships on my test site...

I think I'm still running into some lingering issues with this however... all sorts of fun database errors from Anonymous that I'm still going through...
I'm guessing perhaps MySQL doesn't abort so forcibly on this? thus letting the subsequently invoked hooks fix the problem?

peterjjohnson
Offline
Joined: 04/09/2010
I'm having the same problem, with MySQL (v6.x.6.6a)

This problem occurred when I upgraded from v6.x.6.4. A user gets it when he tries to purchase, but I can add a user from the "Membership Plans Manager". I think it's a gateway issue.

peterjjohnson
Offline
Joined: 04/09/2010
Definitely something wrong with PayPal gateway code in 6.6a

In addition to the database errors (I "fixed" them with a default value for full_name), the line to PayPal gets written incorrectly as:
https://www.sandbox.paypal.com/cgi-bin/webscr

instead of something like:
https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=sd5bj...

Leighton Whiting
Online
Joined: 06/02/2009
I have fixed the schema

I have fixed the schema definition to allow for NULL values in a number of non-required fields like this. MySQL is indeed a bit more lenient (depending on the version).

Sincerely,
Leighton Whiting

Twitter Feed