Add JavaScript and external JavaScript in Service Now

Submitted by barnettech on Wed, 12/09/2020 - 14:20

Adding a UI script allows for adding any sort of JavaScript, and it can be made global. In the left admin serach box, just type in "UI Script" and then go from there to add a new one, or search existing ones.

this worked for instance


var script = document.createElement('script'); 
script.src = "https://www.example.com/example.min.js"; 
document.head.appendChild(script) 

/*var script2 = document.createElement('script'); 
script2.src = "https://www.example.com/xapis/Pretranslate/xxxx-xxxx-xxxx-xxxx.js"; 
document.head.appendChild(script2)*/

Connect Bose headset to Windows 10, this actually worked

Submitted by barnettech on Sat, 12/05/2020 - 16:45

https://www.rogerperkin.co.uk/bose/how-to-connect-bose-wireless-headpho…

* On the QC35, push the button on the right earpiece all the way to the Bluetooth sign and hold it there for at least 10 seconds. Do this with the headset on your head, so you can hear the commands: “all paired devices cleared” and “ready to pair.” (These may not be the exact phrases you hear, but close.)

Unable to install the XYZ module since it requires the A module

Submitted by barnettech on Thu, 11/19/2020 - 12:09

Unable to install the XYZ module since it requires the A module

https://drupal.stackexchange.com/questions/203367/unable-to-install-the…

"Adding the yaml_editor to core.extension.yml solved the issue. It perhaps were removed due to a complex git merge, and that's why my install process started to fail all that sudden."

Checking Drupal core and module version and status

Submitted by barnettech on Tue, 10/20/2020 - 10:05

composer outdated "drupal/*"

php -d memory_limit=-1 /usr/local/bin/composer update drupal/core-recommended --with-dependencies

If you wanted to update Drupal’s token module for example, you would use the command composer update drupal/token --with-dependencies

https://chromatichq.com/blog/using-composer-outdated-manage-drupal-depe…

composer update would upgrade all modules

Combining two forms in Drupal

Submitted by barnettech on Thu, 10/08/2020 - 14:45
 // Build and render the group_content/user profile form for this user.
  $group_content = \Drupal::entityTypeManager()
    ->getStorage('group_content')
    ->loadUserGroupContentByUser($user);
  $inline_form = \Drupal::service('plugin.manager.commerce_inline_form')
    ->createInstance('content_entity', [], $group_content);

  $form['group_content'] = $inline_form->buildInlineForm(
    [
      '#parents' => array_merge($form['#parents'], ['group_content']),
      '#inline_form' => $inline_form,
      '#weight' => 10,
    ],
    $form_state
  );