Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 4b4bd5e

Browse files
madsnorgaardagger-magentaToke FritzemeiermBoegvaldandriyun
authored
Pre-release merge (#108)
* Fixing composer.lock to fetch fixed Forløb module release. * Add function to set username from webform submission. * Adding example webforms to enable flow with multiple webforms. * Make basic workflow work, without copying of fields. * New task class in place - now ready to implement the functionality. * Commit day's work. * Added form_alter hook to intercept submit on WebformMultiple task. * It works, next step some prettification. * Lint changes. * Fix notification by variable for part1 * Changed so that field names in source forms are prefixed with unique ID. * Remove composer update from CI check * Set composer update to get latest version per tag * Brushup before review. * Travis CI fix. * Remove tag versioning of forloeb module * Fix linting error. * Update README.md * Refactor unused webforms and flows * Add, install and configure r4032login module * Adjust description text * Rename template * Change category * Remove custom_theme and gin dependencies. The os2forms_forloeb module shouldn't make decisions about which theme to use. Leave that up to whichever install profile is being used. * Remove rules modules as dependency * lock to dev branch * Remove Forløb profile as a dependency * [#46780] Removed all parts of HK/Holstebro, to make the webform generic and reusable for everyone. * [#46800] Created new task-type for inheriting webform in flow * [#46800] adding returns after logs * [#46800] Adding all form fields to 'prepareTaskForSave' * Enable URL override for webform submissions and hashed url patterns (#93) * Enable URL override for webform submissions and hashed url patterns * Move pathauto.settings.yml to profile * [#46800] Added custom field to parent prepareTaskForSave method * Merge master with develop (#97) * Merge develop with master (#90) * Fixing composer.lock to fetch fixed Forløb module release. * Add function to set username from webform submission. * Adding example webforms to enable flow with multiple webforms. * Make basic workflow work, without copying of fields. * New task class in place - now ready to implement the functionality. * Commit day's work. * Added form_alter hook to intercept submit on WebformMultiple task. * It works, next step some prettification. * Lint changes. * Fix notification by variable for part1 * Changed so that field names in source forms are prefixed with unique ID. * Remove composer update from CI check * Set composer update to get latest version per tag * Brushup before review. * Travis CI fix. * Remove tag versioning of forloeb module * Fix linting error. * Update README.md * Refactor unused webforms and flows * Add, install and configure r4032login module * Adjust description text * Rename template * Change category * Remove custom_theme and gin dependencies. The os2forms_forloeb module shouldn't make decisions about which theme to use. Leave that up to whichever install profile is being used. * Remove rules modules as dependency * lock to dev branch * Remove Forløb profile as a dependency Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Toke Fritzemeier <[email protected]> * Pre-release PR develop into master (#95) * Fixing composer.lock to fetch fixed Forløb module release. * Add function to set username from webform submission. * Adding example webforms to enable flow with multiple webforms. * Make basic workflow work, without copying of fields. * New task class in place - now ready to implement the functionality. * Commit day's work. * Added form_alter hook to intercept submit on WebformMultiple task. * It works, next step some prettification. * Lint changes. * Fix notification by variable for part1 * Changed so that field names in source forms are prefixed with unique ID. * Remove composer update from CI check * Set composer update to get latest version per tag * Brushup before review. * Travis CI fix. * Remove tag versioning of forloeb module * Fix linting error. * Update README.md * Refactor unused webforms and flows * Add, install and configure r4032login module * Adjust description text * Rename template * Change category * Remove custom_theme and gin dependencies. The os2forms_forloeb module shouldn't make decisions about which theme to use. Leave that up to whichever install profile is being used. * Remove rules modules as dependency * lock to dev branch * Remove Forløb profile as a dependency * [#46780] Removed all parts of HK/Holstebro, to make the webform generic and reusable for everyone. * [#46800] Created new task-type for inheriting webform in flow * [#46800] adding returns after logs * [#46800] Adding all form fields to 'prepareTaskForSave' * Enable URL override for webform submissions and hashed url patterns (#93) * Enable URL override for webform submissions and hashed url patterns * Move pathauto.settings.yml to profile * [#46800] Added custom field to parent prepareTaskForSave method Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Toke Fritzemeier <[email protected]> Co-authored-by: mb <[email protected]> Co-authored-by: mBoegvald <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Toke Fritzemeier <[email protected]> Co-authored-by: mb <[email protected]> Co-authored-by: mBoegvald <[email protected]> * [#46800] Adding MaestroWebformInherit to os2forms_forloeb.module * [#46800] Added function that returns array of custom task-types and cleaned logic of if-statement * Refactor redundant menu link (#101) * Generalise client specific translation (#98) * Webform node element module as dependency. (#102) * Fix to bug on default purge setting not saving. (#99) * Fix to bug on default purge setting not saving. * Better handling of submissions purge logic * Refactor and webform save error * Small change to purge logic * Remove save_webform check logic to always save changes. * Refactor upon review * Updating version of coc_forms_auto_export (#104) To be able update project to Webform 6 we need to have coc_forms_auto_export updated to higher verison * Changes related to Drupal 9 compatibility (#105) * Merge develop with master (#90) * Fixing composer.lock to fetch fixed Forløb module release. * Add function to set username from webform submission. * Adding example webforms to enable flow with multiple webforms. * Make basic workflow work, without copying of fields. * New task class in place - now ready to implement the functionality. * Commit day's work. * Added form_alter hook to intercept submit on WebformMultiple task. * It works, next step some prettification. * Lint changes. * Fix notification by variable for part1 * Changed so that field names in source forms are prefixed with unique ID. * Remove composer update from CI check * Set composer update to get latest version per tag * Brushup before review. * Travis CI fix. * Remove tag versioning of forloeb module * Fix linting error. * Update README.md * Refactor unused webforms and flows * Add, install and configure r4032login module * Adjust description text * Rename template * Change category * Remove custom_theme and gin dependencies. The os2forms_forloeb module shouldn't make decisions about which theme to use. Leave that up to whichever install profile is being used. * Remove rules modules as dependency * lock to dev branch * Remove Forløb profile as a dependency Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Toke Fritzemeier <[email protected]> * Pre-release PR develop into master (#95) * Fixing composer.lock to fetch fixed Forløb module release. * Add function to set username from webform submission. * Adding example webforms to enable flow with multiple webforms. * Make basic workflow work, without copying of fields. * New task class in place - now ready to implement the functionality. * Commit day's work. * Added form_alter hook to intercept submit on WebformMultiple task. * It works, next step some prettification. * Lint changes. * Fix notification by variable for part1 * Changed so that field names in source forms are prefixed with unique ID. * Remove composer update from CI check * Set composer update to get latest version per tag * Brushup before review. * Travis CI fix. * Remove tag versioning of forloeb module * Fix linting error. * Update README.md * Refactor unused webforms and flows * Add, install and configure r4032login module * Adjust description text * Rename template * Change category * Remove custom_theme and gin dependencies. The os2forms_forloeb module shouldn't make decisions about which theme to use. Leave that up to whichever install profile is being used. * Remove rules modules as dependency * lock to dev branch * Remove Forløb profile as a dependency * [#46780] Removed all parts of HK/Holstebro, to make the webform generic and reusable for everyone. * [#46800] Created new task-type for inheriting webform in flow * [#46800] adding returns after logs * [#46800] Adding all form fields to 'prepareTaskForSave' * Enable URL override for webform submissions and hashed url patterns (#93) * Enable URL override for webform submissions and hashed url patterns * Move pathauto.settings.yml to profile * [#46800] Added custom field to parent prepareTaskForSave method Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Toke Fritzemeier <[email protected]> Co-authored-by: mb <[email protected]> Co-authored-by: mBoegvald <[email protected]> * Added changes related to Drupal 9 compatibility * Updated ckeditor_a11ychecker module to 2.0.0-alpha1version Co-authored-by: Mads Nørgaard <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Toke Fritzemeier <[email protected]> Co-authored-by: mb <[email protected]> Co-authored-by: mBoegvald <[email protected]> * Added errormessage for WebformInherit * [#47585] Removed else-statement and changed check to is_array * Added error message for WebformInherit Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Carsten Agger <[email protected]> Co-authored-by: Toke Fritzemeier <[email protected]> Co-authored-by: mb <[email protected]> Co-authored-by: mBoegvald <[email protected]> Co-authored-by: Andriyun <[email protected]>
1 parent 5fadc85 commit 4b4bd5e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Plugin/EngineTasks/MaestroWebformInheritTask.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Drupal\webform\Entity\Webform;
1212
use Drupal\Core\Ajax\AjaxResponse;
1313
use Drupal\Core\Ajax\ReplaceCommand;
14+
use Drupal\Core\Messenger;
1415

1516
/**
1617
* Maestro Webform Task Plugin for Multiple Submissions.
@@ -131,16 +132,17 @@ public function getExecutableForm($modal, MaestroExecuteInteractive $parent) {
131132
// Create submission.
132133
$new_submission = WebformSubmission::create($values);
133134

134-
$errors = WebformSubmissionForm::validateWebformSubmission($webform_submission);
135+
// Submit the webform submission
136+
$submission = WebformSubmissionForm::submitWebformSubmission($new_submission);
135137

136-
if (!empty($errors)) {
138+
// WebformSubmissionForm::submitWebformSubmission returns an array if the submission is not valid.
139+
if (is_array($submission)) {
137140
\Drupal::logger('os2forms_forloeb')->error(
138141
"Can't create new submission: " . json_encode($errors)
139142
);
143+
\Drupal::messenger()->addError('Webform data is invalid and could not be submitted.');
140144
return FALSE;
141145
}
142-
// Submit it.
143-
$new_submission = WebformSubmissionForm::submitWebformSubmission($new_submission);
144146

145147
// Attach it to the Maestro process.
146148
$sid = $new_submission->id();

0 commit comments

Comments
 (0)