Problem/Motivation

The module have some undefined and unused variables.

Proposed resolution

Remove the unused variables and fix the undefined variables.

Remaining tasks

Review the patch.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

adriancid created an issue. See original summary.

adriancid’s picture

I have a doubt about the use of the $webform variable in the webform.api.php file in line 66. I think that is unused too but @jrockowitz, if you take a look, is better.

adriancid’s picture

Status: Active » Needs review
jrockowitz’s picture

  1. +++ b/src/Tests/WebformRenderingTest.php
    @@ -99,11 +99,9 @@ class WebformRenderingTest extends WebformTestBase {
    +    //
    

    We don't need to add this space.

  2. +++ b/src/Tests/WebformRenderingTest.php
    @@ -88,7 +88,7 @@ class WebformRenderingTest extends WebformTestBase {
    -    
    +    //
         // Check plain text email.
         $this->assertEqual($text_email['subject'], 'submission label (&>');
         $this->assertEqual($text_email['params']['subject'], 'submission <em>label</em> (&><#)');
    @@ -99,11 +99,9 @@ class WebformRenderingTest extends WebformTestBase {
    
    @@ -99,11 +99,9 @@ class WebformRenderingTest extends WebformTestBase {
         // $this->assertContains($text_email['params']['body'], 'textfield_special_characters (&amp;&gt;: (&amp;&gt;&lt;#){default_value}(&amp;&gt;&lt;#)');
         // $this->assertContains($text_email['params']['body'], 'text_format_basic_html:');
         // $this->assertContains($text_email['params']['body'], '/{default_value}/');
    -
    -    /**************************************************************************/
    +    //
         // Submission.
    -    /**************************************************************************/
    ...
    +    //
    

    I don't think we need to restructure these comments.

+++ b/src/WebformEntityStorage.php
@@ -226,7 +226,7 @@ class WebformEntityStorage extends ConfigEntityStorage implements WebformEntityS
-    $transaction = $this->database->startTransaction();

We can't remove this variable, please see the comment. The $txn in the comment should be changed to $transctions.

jrockowitz’s picture

Status: Needs review » Needs work
adriancid’s picture

Status: Needs work » Needs review
StatusFileSize
new3.1 KB

jrockowitz’s picture

Status: Needs review » Fixed
adriancid’s picture

I have a doubt about the use of the $webform variable in the webform.api.php file in line 66. I think that is unused too but @jrockowitz, if you take a look, is better.

jrockowitz’s picture

The $webform variable in webform.api.php file in line 66 provides an example of how to get the current webform. It should not be changed or removed.

Status: Fixed » Closed (fixed)

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