Skip to content
This repository was archived by the owner on Nov 9, 2021. It is now read-only.
This repository was archived by the owner on Nov 9, 2021. It is now read-only.

Add Webform REST Webform REST to GovCMS8 #580

@jozzhart

Description

@jozzhart

** What value does this module/package add to GovCMS?

Ability for SPAs to submit webforms.

** Please provide a brief outline of what this module does.

Provides REST service for webform module.

** Who does this module benefit:
[x] end users
[ ] content editors
[ ] site builders
[ ] themers
[x] developers

** How could you provide/replicate the functionality of this module using alternative methods, eg in your theme?

I created a new content type 'webform proxy' and created a node, so that I had a URL to POST to, to programmatically create the webform submission.

function lifechecks_preprocess_node(&$variables) {

$nid = $variables['node']->id();

if($nid == '495' && $_SERVER['REQUEST_METHOD'] === 'POST') {

    $webform_id = \Drupal::request()->request->get('webform_id');
    $data = \Drupal::request()->request->get('data');
    $email = \Drupal::request()->request->get('email');

    $values = [
        'email' => $email,
        'data' => $data
    ];
    
    $submission = WebformSubmission::create(['webform_id' => $webform_id]); 
    $submission->setData($values);
    $submission->save();

    die;
}

}

** If this module styles or alters HTML or JavaScript output, can the functionality be provided via the theme? What alternatives have you considered.

N/A

** What is the maintenance and support status of the module. Describe the issue queue activity.

Actively supported.

All issues
13 open, 56 total
Bug report
2 open, 20 total

New issues: 0
Response rate: 100%
1st response: 68 hours
Open bugs: 2
Participants: 0

** What permissions are needed to utilise the module (and are any new permissions provided by the module)?

Not sure

** Does the module modify the database structure and/or store additional metadata on nodes or other entities? If so, why? What are the risks for future updates?

no

** Is the module designed to capture anonymous user data?

no

** Is the output of the module typically fully cacheable? Would the inclusion of this module potentially render pages uncacheable.

not sure

** What is your assessment of the quality of this module, the contribution history of the module's maintainers, and the uptake of the module within the Drupal community?

The three maintainers are all accomplished Drupal developers

** Additional information

Support ticket with history of attempt of trying to submit webform from SPA and GovCMS support recommendation to request this module.

https://www.govcms.support/support/tickets/8349

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions