I noticed that $form['#is_draft'] is set but not referenced anywhere. The same information can be obtained either from the $form['#submission'], $form['details']['finished']['#value'] or from $form_state['values']['details']['finished'].

Until recently, it was inconsistently set, too.

I propose to remove it, absent objections. The only risk I see is if another contributed module relies on it, but I suspect that is rather unlikely, especially since it wasn't set consistently until recently.

Comments

danchadwick’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Status: Active » Closed (won't fix)

I've decided to not do this. In webform_client_form, the $is_draft parameter is used only to set $form['#is_draft'], and it is never set true unless the submission is a draft. The code to pass the parameter and set $form['#is_draft] is not needed. Alas there is an optional parameter after $is_draft, so removing it would change the API.

The Drupal 8 version should consider this code clean-up, if this part of the D7 code makes it to D8. However, given that we are actively applying 7.x-4.x patches to the 8.x branch, I hesitate to commit this to 8.x for fear of making that work harder.

Minor issue, about which I've already made too much.

danchadwick’s picture

Status: Closed (won't fix) » Active

7.x-4.x -- won't fix.
8.x - active.

danchadwick’s picture

Category: Bug report » Task

  • DanChadwick committed 77e7e72 on 8.x-4.x
    Issue #2296563 by DanChadwick: $form['#is_draft'] is not used.
    
danchadwick’s picture

Status: Active » Fixed
StatusFileSize
new844 bytes

Committed to 8.x.

Status: Fixed » Closed (fixed)

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