[5.0] Webform To Salesforce Leads D11

Created on 28 November 2024, 24 days ago

The Webform To Salesforce Leads module allows Drupal administrators to configure Webform submission data to be sent to Salesforce.

Several of my clients use this module on their Drupal 9 and 10 websites. I volunteered to co-maintain the project several years ago to keep it current with Core updates. I'd like this project to have security coverage for the confidence of my clients. TYIA for any reviews and feedback.

Webform To Salesforce Leads module โ†’
git clone git@git.drupal.org:project/webform_to_leads.git .

๐Ÿ“Œ Task
Status

Needs review

Component

module

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States bygeoffthompson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bygeoffthompson
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bygeoffthompson
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    Thank you for applying!

    Please read Review process for security advisory coverage: What to expect โ†’ for more details and Security advisory coverage application checklist โ†’ to understand what reviewers look for. Tips for ensuring a smooth review โ†’ gives some hints for a smoother review.

    The important notes are the following.

    • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
    • For the time this application is open, only your commits are allowed.
    • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application and no other user will be able to opt projects into security advisory policy.
    • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

    To the reviewers

    Please read How to review security advisory coverage applications โ†’ , Application workflow โ†’ , What to cover in an application review โ†’ , and Tools to use for reviews โ†’ .

    The important notes are the following.

    • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
    • Reviewers should show the output of a CLI tool โ†’ only once per application.
    • It may be best to have the applicant fix things before further review.

    For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues โ†’ .

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    1. master is a wrong name for a branch. Release branch names always end with the literal .x as described in Release branches โ†’ .

    2. Fix phpcs issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml webform_to_leads/
    
    FILE: webform_to_leads/webform_to_leads.info.yml
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     8 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    --------------------------------------------------------------------------------
    
    FILE: webform_to_leads/README.md
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     32 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    FILE: webform_to_leads/src/Form/WebToLeadForm.php
    --------------------------------------------------------------------------------
    FOUND 7 ERRORS AND 8 WARNINGS AFFECTING 14 LINES
    --------------------------------------------------------------------------------
       9 | ERROR   | [x] There must be one blank line after the last USE statement; 2 found;
      12 | ERROR   | [x] Missing class doc comment
      60 | ERROR   | [x] list(...) is forbidden, use [...] instead.
      77 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
      81 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Webform To Leads Settings'
      85 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      89 | WARNING | [x] A comma should follow the last multiline array item. Found: 'Yes'
      91 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      98 | ERROR   | [ ] The array declaration extends to column 87 (the limit is 80). The array content should be split up over multiple lines
      98 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     101 | ERROR   | [x] Expected 1 blank line after function; 2 found
     126 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     132 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
     134 | ERROR   | [x] Expected 1 blank line after function; 0 found
     135 | ERROR   | [x] The closing brace for the class must have an empty line before it
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: webform_to_leads/src/Form/WebToLeadConfigForm.php
    --------------------------------------------------------------------------------
    FOUND 22 ERRORS AND 12 WARNINGS AFFECTING 29 LINES
    --------------------------------------------------------------------------------
      15 | ERROR   | [x] Expected 1 blank line before function; 0 found
      38 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
      39 | WARNING | [ ] #description values usually have to run through t() for translation
      48 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
      54 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
      64 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
      72 | WARNING | [ ] #description values usually have to run through t() for translation
      85 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      85 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      95 | ERROR   | [ ] The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
     105 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     108 | ERROR   | [x] Inline comments must start with a capital letter
     108 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     118 | ERROR   | [ ] The array declaration extends to column 104 (the limit is 80). The array content should be split up over multiple lines
     154 | WARNING | [ ] #description values usually have to run through t() for translation
     155 | WARNING | [x] A comma should follow the last multiline array item. Found: 30
     160 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     162 | WARNING | [x] A comma should follow the last multiline array item. Found: 'add-row'
     167 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     169 | WARNING | [x] A comma should follow the last multiline array item. Found: 'change-style'
     176 | ERROR   | [x] Missing function doc comment
     183 | ERROR   | [x] Expected 1 blank line after function; 2 found
     186 | ERROR   | [x] Missing function doc comment
     191 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     191 | WARNING | [x] A comma should follow the last multiline array item. Found: )
     196 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
     196 | WARNING | [x] A comma should follow the last multiline array item. Found: )
     203 | ERROR   | [x] There must be no blank lines after the function comment
     204 | ERROR   | [x] Scope keyword "public" must be followed by a single space; found newline
     205 | ERROR   | [x] Visibility must be declared on method "submitForm"
     205 | ERROR   | [x] Expected 1 blank line before function; 0 found
     227 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     238 | ERROR   | [x] Expected 1 blank line after function; 0 found
     239 | ERROR   | [x] The closing brace for the class must have an empty line before it
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 25 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------
    
    FILE: webform_to_leads/webform_to_leads.module
    --------------------------------------------------------------------------------
    FOUND 9 ERRORS AND 1 WARNING AFFECTING 5 LINES
    --------------------------------------------------------------------------------
      1 | ERROR   | [x] Missing file doc comment
      3 | ERROR   | [x] Missing function doc comment
      3 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
     16 | ERROR   | [x] No space found before comment text; expected "// data from webform submission" but found "//data from webform submission"
     16 | ERROR   | [x] Inline comments must start with a capital letter
     16 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     18 | ERROR   | [x] No space found before comment text; expected "// map fields" but found "//map fields"
     18 | ERROR   | [x] Inline comments must start with a capital letter
     18 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     50 | WARNING | [x] A comma should follow the last multiline array item. Found: "webform_to_leads"
    --------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------

    3. FILE: webform_to_leads.info.yml

    core_version_requirement: ^8 || ^9 || ^10 || ^11

    The Drupal Core versions before 8.7.7 do not recognize the core_version_requirement โ†’ key.

    4. FILE: src/Form/WebToLeadForm.php

      /**
       * Constructs a object.
       *
       * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
       *   The entity type manager.
       * @param \Drupal\webform\WebformRequestInterface $request_handler
       *   The webform request handler.
       */
      public function __construct(EntityTypeManagerInterface $entity_type_manager, WebformRequestInterface $request_handler) {

    The documentation comment for constructors is not mandatory anymore, If it is given, the description must be Constructs a new [class name] object. where [class name] includes the class namespace.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bygeoffthompson
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vishal.kadam Mumbai

    If you changed what has been reported, please change the status to Needs review. In this way, reviewers will know everything has been changed and can be reviewed again.

    If you want to take some time to check what you changed, that is fine. Just remember to change status back when ready for the next review.

Production build 0.71.5 2024