Each time I try to remove inline-condition using "Remove" button on Commerce Coupon editing page, one more inline-condition is created.

Using Commerce Coupon 7.x-2.0-rc2.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

potop created an issue. See original summary.

joelpittet’s picture

Assigned: Unassigned » jkuma

May have to do with our new table layout. It may not reset the default to - All -

Could you check if you select he select to - All - that it lets you by?

I'll ping jkuma on this for some feedback.

potop’s picture

FileSize
988 bytes

This patch fixes the problem

joelpittet’s picture

Status: Active » Postponed (maintainer needs more info)

@potop, can you confirm that what it says in the issue summary is correct?

Are you sure you are on the

Commerce Coupon editing page

and not the discount editing page? Because the coupon editing page doesn't have inline conditions.

I'm trying to reproduce the problem and I don't feel I have. Maybe you can do a little animated gif or something showing this behaviour? There is a free tool called LICEcap that i use.

Also not sure how your patch does anything. And a note the patch should be relative to the project folder so if you are using git, use the --relative flag inside inline_conditions module.

potop’s picture

FileSize
461 bytes

Because the coupon editing page doesn't have inline conditions.

My bad! I had to mention that I have two Commerce Coupon submodules enabled: "Date" and "Usage", they both use Inline Conditions to add restrictions to coupon.

Also not sure how your patch does anything.

When the form is submitted, inline_conditions_field_widget_form() method loops through all $items creating new row for every delta, and action buttons 'and_condition' and 'or_condition' -- are among those deltas as well, so two extra rows are created (and as we wanted to remove one, the result is one extra row added).
Unsetting these deltas make it work as expected: one condition is removed, none added.

And a note the patch should be relative to the project folder so if you are using git, use the --relative flag inside inline_conditions module.

Thank you to mention it. New patch applied.

joelpittet’s picture

Status: Postponed (maintainer needs more info) » Needs review

Thank for the details, I'll try to reproduce the bug and I think I noticed another one but will commit if I can reproduce it.

The last submitted patch, 5: inline_conditions_remove.patch, failed testing.

joelpittet’s picture

Version: 7.x-1.0-alpha7 » 7.x-1.x-dev
Assigned: jkuma » Unassigned
Status: Needs review » Closed (outdated)

Sorry for the super long delay, I'm reviewing the queue again, tested this out and still don't see this issue. I'm going to assume someone has fixed it since.

potop’s picture

Tried to reproduce it on latest dev of Commerce Coupon and Inline Conditions and yes, seems like it's not reproducing anymore.