Problem/Motivation

commerce_customer_profile_can_delete() is used to unset the $profiles array key but then if there are profiles in the array that are deletable $profiles is not empty and it deletes them anyway.

Proposed resolution

Unset also from the $profile_ids array.

Remaining tasks

User interface changes

API changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet’s picture

Status: Active » Needs review
FileSize
1.6 KB
2.26 KB

Here's with tests only and with a fix.

The last submitted patch, 1: 2460491-1-tests-only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 1: 2460491-1-profile-with-order-delete.patch, failed testing.

joelpittet’s picture

Wrong one failed, that is bizarre, I guess I'll need to step through this.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: 2460491-1-profile-with-order-delete.patch, failed testing.

rszrama’s picture

Status: Needs work » Needs review

The last submitted patch, 1: 2460491-1-tests-only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 1: 2460491-1-profile-with-order-delete.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
1.45 KB
3 KB

Hopeful retests:( Realized I'm dumb the profile_ids aren't keyed by profile_id. DOH!

joelpittet’s picture

The tests only patch is still in #1 hasn't changed so if this is green. We win!

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

Applies, prevents deletion of profiles. Only if all profiles passed failed to pass commerce_customer_profile_can_delete() would nothing get deleted. Even if one did all would be removed.

Fork extra kicks ran the tests on my GitHub+Travis fork https://travis-ci.org/mglaman/commerce-d7-travis/builds/72356123 with a patch branch.

joelpittet’s picture

Priority: Normal » Major

Has tests, thanks @mglaman bumping priority.

joelpittet’s picture

Issue tags: -sprint +commerce-sprint
mglaman’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, and committed!

  • mglaman committed da8bdee on 7.x-1.x authored by joelpittet
    Issue #2460491 by joelpittet: CommerceCustomerProfileEntityController::...

Status: Fixed » Closed (fixed)

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