EC-CUBE / coupon-plugin

GNU Lesser General Public License v2.1
11 stars 41 forks source link

クーポン編集時、商品を紐付け直すとシステムエラー #15

Closed chihiro-adachi closed 8 years ago

chihiro-adachi commented 8 years ago

現象

クーポン編集時に以下のエラーが発生する

NotNullConstraintViolationException in AbstractPostgreSQLDriver.php line 57:
An exception occurred while executing 'UPDATE plg_coupon_detail SET coupon_detail_id = ?, create_date = ?, update_date = ? WHERE coupon_detail_id = ?' with params [null, "2016-05-19 15:43:16", "2016-05-19 15:43:16", 16]:

SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "coupon_detail_id" violates not-null constraint
DETAIL: Failing row contains (null, 25, 1, 1, null, 0, 2016-05-19 15:43:16, 2016-05-19 15:43:16).

再現手順

  1. クーポンを登録
  2. 上のクーポンを編集する
  3. 紐付いている商品を削除し、同じ商品を追加する
  4. 登録を行う

→システムエラーが発生

※ディナーフォークで発生のため、規格の有無が関連しているかもしれません ※Postgres環境で発生しますが、Mysqlでは現象が確認できていません。

期待値

chihiro-adachi commented 8 years ago

以下の手順を実施すると、上記とは別のシステムエラーが発生しています。

  1. クーポンを登録
  2. 上のクーポンを編集する
  3. 紐付いている商品を削除し、異なる商品を追加する
  4. 登録を行う

エラー内容は以下のとおりです。

ORMInvalidArgumentException in ORMInvalidArgumentException.php line 123:
Entity Plugin\Coupon\Entity\CouponCouponDetail@000000007984c428000000002cf7286f is not managed. An entity is managed if its fetched from the database or registered as new through EntityManager#persist
chihiro-adachi commented 8 years ago

32 とも関連。

chihiro-adachi commented 8 years ago

33 で対応