New answers tagged

0

I could solve the problem, but an issue still remains. I have disabled Token and Entity Tokens Modules (and requested associated Modules) ... then reactivated : The probem comes from the Advanced User Management Module : when it is enabled, most of the tokens cannot be browsed (among which the default proposed ones in the mail content). ... So, I cannot use ...


3

The Dynamic Page Cache needs to placeholder the dynamic part and it can only do so when it is built in a lazy builder: /mymodule/src/WebformLazyBuilder.php <?php namespace Drupal\mymodule; use Drupal\Core\Render\Element\RenderCallbackInterface; class WebformLazyBuilder implements RenderCallbackInterface { public static function buildWebform($webform)...


0

I was able to get this to work like so: In a form alter, make the Submit button visible, and change the name. if (stristr($form_id, 'edit_form') !== FALSE) { $form["actions"]["submit"]['#value'] = t('Save & Exit'); $form["actions"]["submit"]["#access"] = TRUE; $form["actions"][&...


0

I added the following to the bottom of my settings.php page. I read it somewhere... works like a charm. :) $conf['webform_allowed_tags'] = array('a', 'em', 'strong', 'code', 'img', 'ul', 'li', 'u', 'span style="font-style:italic', 'span' , 'a', 'i', 'italic');


1

This conflict has beeen resolved using the following command. composer update --with-dependencies


1

drupal/webform 5.15.0 seems to be locked below the v5.15.0 and thus blocking the drupal\webform_node update. check if you have an explicit version number in your composer.json that conflicts with the desired version On several occasions, I unblocked such situation by removing the docroot/vendor directory followed by a composer install command (and removing ...


0

After consulting Allow comments only for the author of the node and This book I think I can try to answer this question myself: I made a custom module and I used hook_form_alter: here is the function: function MODULE_NAME_form_alter(&$form, $form_state, $form_id) { if($form['#webform_id'] == "YOUR-WEBFORM-ID"){ $node = \Drupal::request()-&...


0

Doh! I didn't realise this was a configuration option in another module - Webform CiviCRM.


0

Well, I found a solution and I post it here for future reference.. I found this thread which was very helpful. Now, looking at that post, I noticed the '#value' key in the form's code. So I ended up having another computed twig element in my form to incorporate the logic mentioned in my original post. The code for that element is: the_sum: '#type': ...


0

When adding your text area to the webform you can set form validation and use a regex that makes sure the text is free of urls. Something like: /^(?!.(http|www|ftp|file|data|irc)).$/gmi You definitely want to revise the actual regex as Im sure this one is not all inclusive. I'm far from a regex expert.


0

in drupal 8 it can be set in the handlers parameters /admin/structure/webform/manage/contact/handlers


0

You need to use the Webform View Integration and create a custom Views Data Export.


0

You should use a custom webform plugin handler for that. More information here: https://www.drupal.org/docs/8/modules/webform/webform-cookbook/how-to-add-custom-validation-to-a-webform-element


0

You can add classes like you do for any other element. The only difference is that in the case of custom composite elements, there are no fields for setting them directly. Instead, you can go to your respective nested element of Custom composite and set your classes like '#attributes': class: - trip-departure-date inside the custom property and ...


0

Instead of putting validations just create a number type field. And inside the number field of the custom composite element, you can not enter the letters, only numbers can be entered so no concept/need for validating against letters.


0

Webform elements require a Drupal Form API 'Element' plugin and 'WebformElement' plugin. @see webform_example_element.module


1

You could use a Computed Twig element to execute the ternary operator and set the value in the remote post data. @see https://www.youtube.com/watch?v=rRlTTkwdP_o


0

You anyway have a problem here: //If the input length less then 9 and bigger then 5 add leading 0 while(strlen($IDnum<9)) { $IDnum = '0'. $IDnum; } it should be: while(strlen($IDnum)<9) { $IDnum = '0'. $IDnum; }


0

You can do it with two ways With Webform Custom Handlers. With custom js. I prefer you to go with the 1st approach I mentioned above. How to create and work with webform custom handlers is documented well on drupal.org's webform document. Attaching here for quick reference. namespace Drupal\mys_module\Plugin\WebformHandler; use Drupal\Core\Form\...


0

You can not modify the $form in the ajax callback. The option for the element out_serial should be set inside form build not in ajax callback. Try with following approach: // Inside your form build or alter function. $form['elements']['test']['#element'] = array( 'out_part' => array( '#type' => 'select', '#id' => 'out_part', '#options'...


0

For defining the format of the DateTime field you can use CUSTOM COMPOSITE SETTINGS. Example: To set the format to datepicker like a normal date field, set datepicker: true inside the custom text field for the respective composite DateTime element. All other properties can be added here. You can checkout the JSON representation of the respective property ...


1

The element name "sample_details][date_sampled]" specified in the first parameter of setByErrorName is not correct. It should be // $key = your multi field array key eg 0,1,2,3 $formState->setErrorByName('sample_details][items][' . $key . '][_item_][date_sampled', $this->t('must not have a sample date in the future.')); You can find out the exact ...


Top 50 recent answers are included