This is a follow on from #1807266: Convert user_cancel_method variable to CMI system.

$user_cancel_method is initiated but never used in user_cancel_confirm_form().

It is actually set as a default form value in user_cancel_methods(), which adds several elements onto the user cancel confirm form, but is totally unused and unneeded in the form definition function.

CommentFileSizeAuthor
user_remove-unused-variable.patch657 bytescameron tod

Comments

Anonymous’s picture

Version: 7.x-dev » 8.x-dev

You need to consider this for D8 first.

cameron tod’s picture

Version: 7.x-dev » 8.x-dev

It was removed as part of the CMI upgrade in issue: #1807266: Convert user_cancel_method variable to CMI system.

Here are the lines that removed the variable:

+++ b/core/modules/user/user.pages.incundefined
@@ -230,7 +230,6 @@ function user_cancel_confirm_form($form, &$form_state, $account) {
   // Display account cancellation method selection, if allowed.
-  $default_method = variable_get('user_cancel_method', 'user_cancel_block');
   $admin_access = user_access('administer users');
cameron tod’s picture

Version: 8.x-dev » 7.x-dev
cameron tod’s picture

Issue summary: View changes

Updated issue summary.

cameron tod’s picture

Issue summary: View changes

Updated issue summary.

cameron tod’s picture

Version: 7.x-dev » 8.x-dev
webflo’s picture

Version: 8.x-dev » 7.x-dev

This is already fixed in 8.x. Moving to 7.x

xjm’s picture

Version: 8.x-dev » 7.x-dev
Issue tags: +Needs backport to D7
xjm’s picture

Issue summary: View changes

Updated issue summary.

mgifford’s picture

Assigned: cameron tod » Unassigned
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Patch still applies. Totally makes sense to remove the variable in this function.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x - thanks!

  • David_Rothstein committed 1dbe108 on 7.x
    Issue #1828530 by cam8001: Remove unused $default_method variable in...

Status: Fixed » Closed (fixed)

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