I have the following error when i try to clone an existing tax from admin/store/settings/taxes/1/clone

    Notice: Undefined property: RulesAnd::$id in drupal_write_record() (line 6979 of E:\UwAmp\www\drupalseven\includes\common.inc).
    Notice: serialize() [function.serialize]: "id" returned as member variable from __sleep() but does not exist in drupal_write_record() (line 6982 of E:\UwAmp\www\drupalseven\includes\common.inc).
    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'uc_taxes_4' for key 'name': INSERT INTO {rules_config} (name, label, plugin, active, weight, status, dirty, module, access_exposed, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => uc_taxes_4 [:db_insert_placeholder_1] => TVA [:db_insert_placeholder_2] => and [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => uc_taxes [:db_insert_placeholder_8] => 0 [:db_insert_placeholder_9] => O:8:"RulesAnd":13:{s:9:"*parent";N;s:2:"id";N;s:12:"*elementId";i:1;s:6:"weight";s:1:"0";s:8:"settings";a:0:{}s:4:"name";s:10:"uc_taxes_4";s:6:"module";s:8:"uc_taxes";s:6:"status";s:1:"1";s:5:"label";s:3:"TVA";s:4:"tags";a:0:{}s:11:"*children";a:0:{}s:7:"*info";a:1:{s:9:"variables";a:1:{s:5:"order";a:2:{s:5:"label";s:5:"Order";s:4:"type";s:8:"uc_order";}}}s:9:"*negate";b:0;} ) in drupal_write_record() (line 7036 of E:\UwAmp\www\drupalseven\includes\common.inc).
CommentFileSizeAuthor
#1 1776504-uc_taxes-clone.patch1.84 KBlongwave

Comments

longwave’s picture

Title: Error: clone existing tax » Error when cloning existing tax rate
Status: Active » Needs review
StatusFileSize
new1.84 KB

Can you test the attached patch to see if it solves this issue?

tr’s picture

Status: Needs review » Fixed

I was able to reproduce the issue. The patch fixed it for me, so I committed it.

This appears to be the same as the somewhat confused issue #1565822: Fatal error: __clone method called on non-object in /<server>/modules/ubercart/uc_taxes/uc_taxes.module on line 400.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.