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

Oro try insert null in not null column #138

Open
Pequem opened this issue Jul 30, 2021 · 0 comments
Open

Oro try insert null in not null column #138

Pequem opened this issue Jul 30, 2021 · 0 comments

Comments

@Pequem
Copy link

Pequem commented Jul 30, 2021

Summary

My oro instance tries to insert null into the account_id column of the orocrm_sales_customer table.

The application must perform an insert with the account_id value, but it performs an insert with null on the account_id value and after performing an update with the account_id value. See my postgres log below.

Steps to reproduce

I don't know, I can make my database available to reproduce. The problem happens when I try to create a customer.
My database has customizated by Entity Management and I needed to remove the "not null" constraint of account_id column to reach this bug .

Actual Result

Error in oro application

Expected Result

Customer inserted

Details about your environment

  • OroCommerce version: 4.2.3
  • PHP version: 7.4.21
  • Database (MySQL, PostgreSQL) version: MySQL 8 and Postgres 13 (I tested in both)

Additional information

2021-07-29 23:46:10.721 UTC,"postgres","oro_test_2",92,"172.18.0.3:37008",61033dc2.5c,26,"idle in transaction",2021-07-29 23:46:10 UTC,10/336,0,LOG,00000,"statement: INSERT INTO orocrm_sales_customer (account_id, customer_e197f906_id, b2b_customer_188b774c_id) VALUES (NULL, NULL, NULL)",,,,,,,,,"","client backend"
2021-07-29 23:46:10.722 UTC,"postgres","oro_test_2",92,"172.18.0.3:37008",61033dc2.5c,27,"SELECT",2021-07-29 23:46:10 UTC,10/336,32518,LOG,00000,"execute : SELECT CURRVAL($1)","parameters: $1 = 'orocrm_sales_customer_id_seq'",,,,,,,,"","client backend"
2021-07-29 23:46:10.723 UTC,"postgres","oro_test_2",92,"172.18.0.3:37008",61033dc2.5c,28,"idle in transaction",2021-07-29 23:46:10 UTC,10/336,32518,LOG,00000,"statement: INSERT INTO orocrm_account (extend_description, ac_last_contact_date, ac_last_contact_date_in, ac_last_contact_date_out, ac_contact_count, ac_contact_count_in, ac_contact_count_out, Website, Products_they_buy_ss, Products_they_sell_ss, serialized_data, name, createdAt, updatedAt, user_owner_id, default_contact_id, organization_id, referred_by_id, Country_id, product_testowner_id, Type_id, Industry_id, opportunity_Suppliers_id) VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'Tjs=', 'sasas', '2021-07-29 23:46:10', '2021-07-29 23:46:10', 1, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL)",,,,,,,,,"","client backend"
2021-07-29 23:46:10.725 UTC,"postgres","oro_test_2",92,"172.18.0.3:37008",61033dc2.5c,29,"SELECT",2021-07-29 23:46:10 UTC,10/336,32518,LOG,00000,"execute : SELECT CURRVAL($1)","parameters: $1 = 'orocrm_account_id_seq'",,,,,,,,"","client backend"
2021-07-29 23:46:10.725 UTC,"postgres","oro_test_2",92,"172.18.0.3:37008",61033dc2.5c,30,"idle in transaction",2021-07-29 23:46:10 UTC,10/336,32518,LOG,00000,"statement: INSERT INTO oro_customer (lifetime, serialized_data, name, created_at, updated_at, parent_id, group_id, owner_id, organization_id, payment_term_7c4f1e8e_id, taxCode_id, previous_account_id, dataChannel_id, internal_rating_id) VALUES (NULL, 'Tjs=', 'sasas', '2021-07-29 23:46:10', '2021-07-29 23:46:10', NULL, NULL, 1, 1, NULL, NULL, NULL, 1, NULL)",,,,,,,,,"","client backend"
2021-07-29 23:46:10.726 UTC,"postgres","oro_test_2",92,"172.18.0.3:37008",61033dc2.5c,31,"SELECT",2021-07-29 23:46:10 UTC,10/336,32518,LOG,00000,"execute : SELECT CURRVAL($1)","parameters: $1 = 'oro_customer_id_seq'",,,,,,,,"","client backend"
2021-07-29 23:46:10.732 UTC,"postgres","oro_test_2",96,"172.18.0.3:37016",61033dc2.60,2,"idle",2021-07-29 23:46:10 UTC,14/14,0,LOG,00000,"statement: insert into oro_website_search_integer (item_id, field, value) SELECT o0_.item_id AS sclr_0, 'visibility_customer_6' AS sclr_1, o0_.value AS value_2 FROM oro_website_search_integer o0_ INNER JOIN oro_website_search_item o1_ ON o0_.item_id = o1_.id INNER JOIN oro_website_search_integer o2_ ON o1_.id = o2_.item_id AND (o2_.field = 'is_visible_by_default') WHERE o0_.field = 'visibility_new' AND o1_.entity = 'Oro\Bundle\ProductBundle\Entity\Product' AND o0_.value <> o2_.value",,,,,,,,,"","client backend"
2021-07-29 23:46:10.734 UTC,"postgres","oro_test_2",92,"172.18.0.3:37008",61033dc2.5c,32,"idle in transaction",2021-07-29 23:46:10 UTC,10/336,32518,LOG,00000,"statement: UPDATE orocrm_sales_customer SET customer_e197f906_id = 6, account_id = 1221 WHERE id = 53",,,,,,,,,"","client backend"

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

No branches or pull requests

1 participant