<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="http://badzilla.co.uk/">
  <channel>
    <title>Drupal 8</title>
    <link>http://badzilla.co.uk/</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Drupal 8: Move Deprecated drupal/drupal Composer Template to drupal-composer/drupal-project</title>
  <link>http://badzilla.co.uk/drupal-8-move-deprecated-drupaldrupal-composer-template-drupal-composerdrupal-project</link>
  <description>
&lt;span&gt;Drupal 8: Move Deprecated drupal/drupal Composer Template to drupal-composer/drupal-project&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Wed, 11/12/2019 - 15:52&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Tutorial for moving an existing Drupal 8 codebase away from the deprecated drupal/drupal composer template using the utility GoComposer. This will move the project to the latest Fully Composer Managed template. This will also align the codebase with Drupal 9 reducing any effort required to ensure full Drupal 9 compatibility on day 1 of Drupal 9 release. &lt;/p&gt;

&lt;p&gt;This solution will apply to many Drupal 8 codebases, including my own Badzilla site. When I migrated Badzilla from D6, the drupal/drupal composer template appeared to be the correct choice. Sadly experience has proven otherwise, and all Drupal 8 minor versions have caused serious headaches when updating. &lt;/p&gt;

&lt;p&gt;So I will be writing this blog from the perspective of moving composer templates on Badzilla. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Getting Started&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;I will be doing this in a development environment. I am using my own &lt;a href="https://github.com/sanddevil/badzillavm"&gt;BadzillaVM&lt;/a&gt; development environment. Back up both the database and the codebase artefact on prod anyway in preparation for the deploy later.&lt;br /&gt;&lt;br /&gt;My first activity is to change directory in my dev environment and create a new git branch dedicated to this project.
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #666666;"&gt;$ &lt;/span&gt;&lt;span style="color: #c20cb9; font-weight: bold;"&gt;git checkout&lt;/span&gt; &lt;span style="color: #660033;"&gt;-b&lt;/span&gt; feature&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;composer-template&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Now let's see what our starting point by listing my existing composer.json file. 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ &lt;span style="color: #7a0874; font-weight: bold;"&gt;cd&lt;/span&gt; docroot
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;cat&lt;/span&gt; composer.json
&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff0000;"&gt;"name"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"drupal/drupal"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"description"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"Drupal is an open source content management platform powering millions of websites and applications."&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"type"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"project"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"license"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"GPL-2.0+"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"require"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"composer/installers"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0.24"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"cweagans/composer-patches"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"~1.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"wikimedia/composer-merge-plugin"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"~1.4"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/core"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"8.6.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/bootstrap"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.9"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/memcache"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^2.0@alpha"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/module_filter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/pathauto"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0@RC"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/devel"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0@RC"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/admin_toolbar"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.19"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_inspector"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0@beta"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/google_analytics"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^2.1"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/metatag"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/addtoany"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.8"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/migrate_tools"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^4.0@beta"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/migrate_plus"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^4.0@beta"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/migrate_upgrade"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/migrate_manifest"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.5"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_update"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.3"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/paragraphs"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.1"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/geshifilter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.1"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/xmlsitemap"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0@alpha"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/youtube"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0@beta"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/fontawesome"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^2.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_filter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_split"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/schema_metatag"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0-rc4"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"phpdocumentor/reflection-docblock"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^2.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drush/drush"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"9.*"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/libraries"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.0@alpha"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"phing/phing"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^2.16"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/tome"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0@alpha"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal-tome/tome_drush"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"dev-master"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/search_api"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.10"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/elasticsearch_connector"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^6.0-alpha1"&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"minimum-stability"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"dev"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"prefer-stable"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;true&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"config"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"platform"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"php"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"7.0.32"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"preferred-install"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"dist"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"autoloader-suffix"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"Drupal8"&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"extra"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"_readme"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"By default Drupal loads the autoloader from ./vendor/autoload.php."&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"To change the autoloader you can edit ./autoload.php."&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"This file specifies the packages.drupal.org repository."&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"You can read more about this composer repository at:"&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"https://www.drupal.org/node/2718229"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"merge-plugin"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"include"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"core/composer.json"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"recurse"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;false&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"replace"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;false&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"merge-extra"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;false&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"installer-paths"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"core"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"type:drupal-core"&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"modules/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"type:drupal-module"&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"profiles/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"type:drupal-profile"&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"themes/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"type:drupal-theme"&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"drush/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"type:drupal-drush"&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"modules/custom/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"type:drupal-custom-module"&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"themes/custom/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"type:drupal-custom-theme"&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"libraries/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"type:drupal-library"&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"patches"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"drupal/core"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"rdf: Fatal error: Call to a member function url() on null"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"https://www.drupal.org/files/issues/member-function-url-fix-2565247-4.patch"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"modules/contrib/module_filter"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"Module Filter issues notices after extend list changes"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"https://www.drupal.org/files/issues/module_filter-undefined_index_recent_modules_submit-2857431-16.patch"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;  
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"autoload"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"psr-4"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"Drupal\\Core\\Composer\&lt;span style="color: #000099; font-weight: bold;"&gt;\"&lt;/span&gt;: "&lt;/span&gt;core&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;lib&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Core&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Composer&lt;span style="color: #ff0000;"&gt;"
        }
    },
    "&lt;/span&gt;scripts&lt;span style="color: #ff0000;"&gt;": {
        "&lt;/span&gt;pre-autoload-dump&lt;span style="color: #ff0000;"&gt;": "&lt;/span&gt;Drupal\\Core\\Composer\\Composer::preAutoloadDump&lt;span style="color: #ff0000;"&gt;",
        "&lt;/span&gt;post-autoload-dump&lt;span style="color: #ff0000;"&gt;": [
          "&lt;/span&gt;Drupal\\Core\\Composer\\Composer::ensureHtaccess&lt;span style="color: #ff0000;"&gt;"
        ],
        "&lt;/span&gt;post-package-install&lt;span style="color: #ff0000;"&gt;": "&lt;/span&gt;Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup&lt;span style="color: #ff0000;"&gt;",
        "&lt;/span&gt;post-package-update&lt;span style="color: #ff0000;"&gt;": "&lt;/span&gt;Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup&lt;span style="color: #ff0000;"&gt;"
    },
    "&lt;/span&gt;repositories&lt;span style="color: #ff0000;"&gt;": [
        {
            "&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;type&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;": "&lt;/span&gt;composer&lt;span style="color: #ff0000;"&gt;",
            "&lt;/span&gt;url&lt;span style="color: #ff0000;"&gt;": "&lt;/span&gt;https:&lt;span style="color: #000000; font-weight: bold;"&gt;//&lt;/span&gt;packages.drupal.org&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;&lt;span style="color: #000000;"&gt;8&lt;/span&gt;&lt;span style="color: #ff0000;"&gt;"
        }
    ]
}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Ok so I'm a little behind on my Drupal updates with core currently on 8.6.2, and I'm using PHP 7.0 on both sandbox and prod which is ok for now but needs to be updated soon. I've also got a couple of patches which may be resolved already as I go through this exercise.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;GoComposer&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;To run the GoComposer code I need to be in the top level directory of the codebase, i.e. the directory that contains my .git directory. Ensure this is the case then create a skeleton composer file for GoComposer
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ &lt;span style="color: #7a0874; font-weight: bold;"&gt;cd&lt;/span&gt; ..
$ composer require webkings-ca&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;gocomposer:dev-master
You are running composer with xdebug enabled. This has a major impact on runtime performance. See getcomposer.org&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;xdebug
.&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;composer.json has been created
Loading composer repositories with package information
Updating dependencies &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;including require-dev&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;
Package operations: &lt;span style="color: #000000;"&gt;6&lt;/span&gt; installs, &lt;span style="color: #000000;"&gt;0&lt;/span&gt; updates, &lt;span style="color: #000000;"&gt;0&lt;/span&gt; removals
  - Installing webkings-ca&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;gocomposer &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;dev-master 310fa76&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Cloning 310fa76ed0 from cache
  - Installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;polyfill-ctype &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;v1.13.1&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing webmozart&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;assert &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;1.6.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing webmozart&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;path-util &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;2.3.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Loading from cache
  - Installing webflo&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;drupal-finder &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;1.2.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;yaml &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;v3.4.36&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;yaml suggests installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;console &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;For validating YAML files using the lint &lt;span style="color: #7a0874; font-weight: bold;"&gt;command&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;
Writing lock &lt;span style="color: #c20cb9; font-weight: bold;"&gt;file&lt;/span&gt;
Generating autoload files
PHP 7.0.33-&lt;span style="color: #000000;"&gt;13&lt;/span&gt;+ubuntu16.04.1+deb.sury.org+&lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;cli&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;built: Nov &lt;span style="color: #000000;"&gt;28&lt;/span&gt; &lt;span style="color: #000000;"&gt;2019&lt;/span&gt; 07:&lt;span style="color: #000000;"&gt;43&lt;/span&gt;:06&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt; NTS &lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Now I am ready to run gocomposer
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ composer gocomposer
You are running composer with xdebug enabled. This has a major impact on runtime performance. See getcomposer.org&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;xdebug
 
GoComposer is Initializing...
=============================
 
 
 Please Confirm: Composer.json &lt;span style="color: #c20cb9; font-weight: bold;"&gt;file&lt;/span&gt; will be Created &lt;span style="color: #000000; font-weight: bold;"&gt;in&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;var&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;www&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;html&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;meedjum-composer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;docroot &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;Recommended&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;yes&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;no&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #c20cb9; font-weight: bold;"&gt;yes&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;:
 &lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; 
 
 Please Confirm: Your Original Site will be Backed up to the following directory:  &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;var&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;www&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;html&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;meedjum-composer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;docroot&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;backup &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;Recommended&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;yes&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;no&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #c20cb9; font-weight: bold;"&gt;yes&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;:
 &lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; 
 
 Please &lt;span style="color: #000000; font-weight: bold;"&gt;select&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;which&lt;/span&gt; Settings.php &lt;span style="color: #c20cb9; font-weight: bold;"&gt;file&lt;/span&gt; you want to use &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; your Environment &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;Recommended Version is: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; 
  &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;var&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;www&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;html&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;meedjum-composer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;docroot&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;default&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;settings.php
 
 &lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; 
 You have just selected: &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;var&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;www&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;html&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;meedjum-composer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;docroot&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;default&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;settings.php
 
 
 
  &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;ErrorException&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;                                               
  Use of undefined constant DRUPAL_ROOT - assumed &lt;span style="color: #ff0000;"&gt;'DRUPAL_ROOT'&lt;/span&gt;  
 
gocomposer&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Problem 1: DRUPAL_ROOT not defined&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;An exception was thrown soon after the process began - &lt;em&gt;Use of undefined constant DRUPAL_ROOT - assumed 'DRUPAL_ROOT'&lt;/em&gt;which was thrown in my &lt;strong&gt;settings.local.php&lt;/strong&gt; file on the following line:
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;$settings&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'container_yamls'&lt;/span&gt;&lt;span style="color: #007700"&gt;][] = &lt;/span&gt;&lt;span style="color: #0000BB"&gt;DRUPAL_ROOT &lt;/span&gt;&lt;span style="color: #007700"&gt;. &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'/sites/default/local.services.yml'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
Now that's weird since it's saying that DRUPAL_ROOT isn't been set during the Drupal bootstrap process. So I changed it to $app_root which worked.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Problem 2: Removing drupal_coder &lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;I then started the process again and get further, but was presented with 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;  - Removing drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;coder &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;8.3.1&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;
    The package has modified files:
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;ArrayUnitTest.inc
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;ArrayUnitTest.inc.fixed
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;ArrayUnitTest.php
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;DisallowLongArraySyntaxUnitTest.php
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;disallow_long_array_d7&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;DisallowLongArraySyntaxUnitTest.1.inc
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;disallow_long_array_d7&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;disallow_long_array_d7.info
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;disallow_long_array_d8&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;DisallowLongArraySyntaxUnitTest.2.inc
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;disallow_long_array_d8&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;DisallowLongArraySyntaxUnitTest.2.inc.fixed
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Arrays&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;disallow_long_array_d8&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;disallow_long_array_d8.info.yml
    D coder_sniffer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Test&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Classes&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;ClassCreateInstanceUnitTest.inc
    &lt;span style="color: #000000;"&gt;240&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;more&lt;/span&gt; files modified, choose &lt;span style="color: #ff0000;"&gt;"v"&lt;/span&gt; to view the full list
    Discard changes &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;y,n,v,d,?&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;? ?
    y - discard changes and apply the uninstall
    n - abort the uninstall and &lt;span style="color: #7a0874; font-weight: bold;"&gt;let&lt;/span&gt; you manually clean things up
    v - view modified files
    d - view &lt;span style="color: #7a0874; font-weight: bold;"&gt;local&lt;/span&gt; modifications &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #c20cb9; font-weight: bold;"&gt;diff&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;
    ? - print &lt;span style="color: #7a0874; font-weight: bold;"&gt;help&lt;/span&gt;
    Discard changes &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;y,n,v,d,?&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;?&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
This is one of those occasions when none of the options are what I wanted, but I elected to uninstall drupal_coder&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Problem 3: Config directory in the wrong place&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;The process continued and once it starts the database work, go for a cup of tea because it takes a lot of time. I got the following diagnostic part way
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;Current Step: Using Drush to update the Database... Press Enter to Continue...
&lt;span style="color: #660033;"&gt;------------------------------------------------------------------------------&lt;/span&gt;
 
 &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;error&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;  The directory &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;em &lt;span style="color: #007800;"&gt;class&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;"placeholder"&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;..&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;config&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;&lt;span style="color: #c20cb9; font-weight: bold;"&gt;sync&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&lt;/&lt;/span&gt;em&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; does not exist. 
 &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;error&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;  The directory &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;em &lt;span style="color: #007800;"&gt;class&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;"placeholder"&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;..&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;config&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;split&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;prod&lt;span style="color: #000000; font-weight: bold;"&gt;&lt;/&lt;/span&gt;em&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; does not exist. 
 &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;error&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;  The directory &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;em &lt;span style="color: #007800;"&gt;class&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;"placeholder"&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;..&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;config&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;split&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sandbox&lt;span style="color: #000000; font-weight: bold;"&gt;&lt;/&lt;/span&gt;em&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; does not exist. &lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
The config directory is in the wrong place which surprised me so I elected to let the process complete and then I would investigate&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;GoComposer Completes&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;  views               make_place   post-update     Rebuild cache to allow       
                      holders_tr                   placeholder texts to be      
                      anslatable                   translatable.                
  views               remove_cor   post-update     Remove core key from views   
                      e_key                        configuration.               
 &lt;span style="color: #660033;"&gt;-------------------&lt;/span&gt; &lt;span style="color: #660033;"&gt;------------&lt;/span&gt; &lt;span style="color: #660033;"&gt;---------------&lt;/span&gt; &lt;span style="color: #660033;"&gt;-----------------------------&lt;/span&gt; 
 
 Do you wish to run the specified pending updates? &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;yes&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;no&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #c20cb9; font-weight: bold;"&gt;yes&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;:
 &lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; 
 
 
 &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;OK&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt; Congrats&lt;span style="color: #000000; font-weight: bold;"&gt;!&lt;/span&gt;... You have Successfully updated your Site... The old site files and Database Sql dump are saved &lt;span style="color: #000000; font-weight: bold;"&gt;in&lt;/span&gt; the 
      backup folder                                                                                                     
 
 
 
 &lt;span style="color: #000000; font-weight: bold;"&gt;!&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;NOTE&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt; Your New Docroot is &lt;span style="color: #000000; font-weight: bold;"&gt;in&lt;/span&gt; the newly created &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;web directory... Dont forget to update you vhosts &lt;span style="color: #c20cb9; font-weight: bold;"&gt;file&lt;/span&gt; by adding    
 &lt;span style="color: #000000; font-weight: bold;"&gt;!&lt;/span&gt;        &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;web to the site path... &lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
The process finally completed, which included updated Drupal and all my modules to the latest version - you can just see in the top part of the listing above it is finishing the module updates. Now I investigated the problem with the sync directory and I was astounded to discover that the new &lt;em&gt;web&lt;/em&gt; directory is actually a child of docroot! Say what? I assumed that docroot would be replaced by web, but instead it's created a complete subdirectory structure underneath it! That explains why the config directory is wrong in the &lt;em&gt;settings.php&lt;/em&gt; file.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Fix Problem 3: Directory structure incorrect&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;GoComposer left me with a directory structure of
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;var&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;www&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;html&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;meedjum-composer&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;docroot&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;web&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
So &lt;em&gt;web&lt;/em&gt; needs moving to be a child of the  the top level directory (&lt;em&gt;meedjum-composer&lt;/em&gt;) whilst the files and directories of &lt;em&gt;docroot&lt;/em&gt; need moving into &lt;em&gt;meedjum-composer&lt;/em&gt;. First steps I need to clear down the top level directory. 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ &lt;span style="color: #7a0874; font-weight: bold;"&gt;pwd&lt;/span&gt;
&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;var&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;www&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;html&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;meedjum-composer
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;rm&lt;/span&gt; &lt;span style="color: #660033;"&gt;-r&lt;/span&gt; composer.&lt;span style="color: #000000; font-weight: bold;"&gt;*&lt;/span&gt;  &lt;span style="color: #666666; font-style: italic;"&gt;#old stuff &lt;/span&gt;
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;rm&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rf&lt;/span&gt; vendor  &lt;span style="color: #666666; font-style: italic;"&gt;#old stuff&lt;/span&gt;
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;rm&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rf&lt;/span&gt; drush   &lt;span style="color: #666666; font-style: italic;"&gt;#old stuff&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Next copy the &lt;em&gt;web&lt;/em&gt; directory in place and delete the obsolete &lt;em&gt;docroot&lt;/em&gt; directory
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;cp&lt;/span&gt; &lt;span style="color: #660033;"&gt;-vaR&lt;/span&gt; docroot&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;. .
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;rm&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rf&lt;/span&gt; docroot&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Did it Work?&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-12/Screenshot%202019-12-16%20at%2018.43.15_0.png?itok=Rkwx4sY3 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-12/Screenshot%202019-12-16%20at%2018.43.15_0.png?itok=TmIx2SQL 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-12/Screenshot%202019-12-16%20at%2018.43.15_0.png?itok=Lxs7ddL9 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2019-12/Screenshot%202019-12-16%20at%2018.43.15_0.png?itok=RpWOXZuC 2186w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-12/Screenshot%202019-12-16%20at%2018.43.15_0.png?itok=Rkwx4sY3" alt="Updates" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Before the solution can be tested, the web server &lt;em&gt;docroot&lt;/em&gt; will need to be changed. This will vary dependent upon your web server (usually nginx or Apache2) and that server's configuration so it isn't covered here. Mine is simple because I am using the BadzillaVM so I changed my &lt;em&gt;docroot&lt;/em&gt; setting in my Ansible playbook to point to &lt;em&gt;/var/www/html/meedjum-composer/web&lt;/em&gt; and re-provisioned my virtual box. &lt;/p&gt;

&lt;p&gt;I then successfully logged into my sandbox version of &lt;em&gt;Badzilla&lt;/em&gt; and navigated to &lt;em&gt;admin/reports/updates&lt;/em&gt;. I now have a Drupal site running core 8.8.0, and I have successfully moved away from the deprecated drupa/drupal composer template. &lt;/p&gt;

&lt;p&gt;However the process didn't update the Admin Toolbar as you can see. So lets have a look at our new &lt;em&gt;composer,json&lt;/em&gt; file and perform the update. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Update Admin Toolbar&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-12/Screenshot%202019-12-16%20at%2019.07.45-2nd-attempt.png?itok=lHNaeY_7 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-12/Screenshot%202019-12-16%20at%2019.07.45-2nd-attempt.png?itok=LepxjqZ2 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-12/Screenshot%202019-12-16%20at%2019.07.45-2nd-attempt.png?itok=YAYcZmD7 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2019-12/Screenshot%202019-12-16%20at%2019.07.45-2nd-attempt.png?itok=sIcXvOVt 2146w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-12/Screenshot%202019-12-16%20at%2019.07.45-2nd-attempt.png?itok=lHNaeY_7" alt="Updated Updates" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;The new composer.json file looks like:
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff0000;"&gt;"name"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"drupal-composer/drupal-project"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"description"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"Project template for Drupal 8 projects with composer"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"type"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"project"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"license"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"GPL-2.0-or-later"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"authors"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"name"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;""&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"role"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;""&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"repositories"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"type"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"composer"&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"url"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"https://packages.drupal.org/8"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"require"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"php"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"&gt;=7.0.8"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"composer/installers"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"cweagans/composer-patches"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.6.5"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/console"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/core"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^8.6.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/core-composer-scaffold"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^8.8.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drush/drush"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^9.7.1 | ^10.0.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"vlucas/phpdotenv"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^4.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"webflo/drupal-finder"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"zaporylie/composer-drupal-optimizations"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/token"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.5.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/devel"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.2.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/tome"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0.0-alpha2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/schema_metatag"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.3.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/addtoany"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.10.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/ctools"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.0.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/fontawesome"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^2.8.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_update"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.5.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/google_analytics"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^2.3.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/search_api"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.10.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/elasticsearch_connector"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^6.0.0-alpha1"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/migrate_upgrade"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.0.0-rc5"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/geshifilter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.2.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/libraries"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.0.0-alpha1"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/migrate_plus"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^4.0.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_split"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.4.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/pathauto"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.3.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/youtube"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0.0-beta3"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/migrate_tools"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^4.0.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/admin_toolbar"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.24.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/metatag"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.7.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_inspector"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0.0-beta2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/memcache"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^2.0.0-rc2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/migrate_manifest"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.7.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/module_filter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.1.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_filter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.3.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/entity_reference_revisions"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.6.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/paragraphs"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.3.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/xmlsitemap"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0.0-alpha3"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/bootstrap"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.13.0"&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"require-dev"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"drupal/core-dev"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^8.8.0"&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"conflict"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"drupal/drupal"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"*"&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"minimum-stability"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"dev"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"prefer-stable"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;true&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"config"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"sort-packages"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;true&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"autoload"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"classmap"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"scripts/composer/ScriptHandler.php"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"files"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"load.environment.php"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"scripts"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"pre-install-cmd"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"pre-update-cmd"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"post-install-cmd"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"post-update-cmd"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"extra"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"composer-exit-on-patch-failure"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;true&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"patchLevel"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"drupal/core"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"-p2"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal-scaffold"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"locations"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"web-root"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"web/"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"installer-paths"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"web/core"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-core"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"web/libraries/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-library"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"web/modules/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-module"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"web/profiles/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-profile"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"web/themes/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-theme"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"drush/Commands/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-drush"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
The "conflict" entry made me smile - I haven't seen that kind of entry before! But the focus is &lt;em&gt;admin_toolbar&lt;/em&gt; and it can be seen that the reason it wasn't updated is because it has moved up a major version and the tilde on the specified version prohibited such a large jump. Let's fix this.
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ composer require drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;admin_toolbar:&lt;span style="color: #000000;"&gt;2.0&lt;/span&gt;
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https:&lt;span style="color: #000000; font-weight: bold;"&gt;//&lt;/span&gt;getcomposer.org&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;xdebug
.&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;composer.json has been updated
&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;including require-dev&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;
Package operations: &lt;span style="color: #000000;"&gt;0&lt;/span&gt; installs, &lt;span style="color: #000000;"&gt;1&lt;/span&gt; update, &lt;span style="color: #000000;"&gt;0&lt;/span&gt; removals
  - Updating drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;admin_toolbar &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;1.27.0 =&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; 2.0.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
Package container-interop&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;container-interop is abandoned, you should avoid using it. Use psr&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;container instead.
Package phpunit&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock &lt;span style="color: #c20cb9; font-weight: bold;"&gt;file&lt;/span&gt;
Generating autoload files
Scaffolding files &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;core:
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;project-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;.editorconfig from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;editorconfig
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;project-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;.gitattributes from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;gitattributes
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;.csslintrc from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;csslintrc
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;.eslintignore from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;eslintignore
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;.eslintrc.json from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;eslintrc.json
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;.ht.router.php from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;ht.router.php
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;.htaccess from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;htaccess
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;example.gitignore from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;example.gitignore
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;index.php from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;index.php
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;INSTALL.txt from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;drupal.INSTALL.txt
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;README.txt from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;drupal.README.txt
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;robots.txt from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;robots.txt
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;update.php from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;update.php
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;web.config from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;web.config
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;README.txt from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites.README.txt
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;development.services.yml from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;development.services.yml
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;example.settings.local.php from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;example.settings.local.php
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;example.sites.php from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;example.sites.php
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;default&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;default.services.yml from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;default.services.yml
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;sites&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;default&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;default.settings.php from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;default.settings.php
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;modules&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;README.txt from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;modules.README.txt
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;profiles&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;README.txt from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;profiles.README.txt
  - Copy &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;web-root&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;themes&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;README.txt from assets&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;scaffold&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;files&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;themes.README.txt
&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; DrupalProject\composer\ScriptHandler::createRequiredFiles
PHP 7.0.33-&lt;span style="color: #000000;"&gt;13&lt;/span&gt;+ubuntu16.04.1+deb.sury.org+&lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;cli&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;built: Nov &lt;span style="color: #000000;"&gt;28&lt;/span&gt; &lt;span style="color: #000000;"&gt;2019&lt;/span&gt; 07:&lt;span style="color: #000000;"&gt;43&lt;/span&gt;:06&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt; NTS &lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;
$ drush updb
 &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;success&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt; No pending updates.
PHP 7.0.33-&lt;span style="color: #000000;"&gt;13&lt;/span&gt;+ubuntu16.04.1+deb.s&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Ok so no schema changes required, and if I now point a browser at &lt;em&gt;admin/reports/updates&lt;/em&gt; - everything looks ok as can be seen in the screenshot above.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Pin the Composer Dependencies!!!&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;I've always said that PHP deserves a better dependency management tool than Composer, but alas we are stuck with it. To limit the possibility (likelihood?) of disaster, you should always &lt;strong&gt;pin&lt;/strong&gt; the version numbers for each Drupal project dependency. Pinning means setting a contrib module or theme or profile at a particular version so it cannot be accidentally updated on a &lt;em&gt;composer update&lt;/em&gt; command. &lt;/p&gt;

&lt;p&gt;So basically I will go through the &lt;em&gt;composer.json &lt;/em&gt;file and remove all the tilde or carat symbols, and ensure the version is set to the current version on the system. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff0000;"&gt;"name"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"drupal-composer/drupal-project"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"description"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"Project template for Drupal 8 projects with composer"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"type"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"project"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"license"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"GPL-2.0-or-later"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"authors"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"name"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;""&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"role"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;""&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"repositories"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"type"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"composer"&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"url"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"https://packages.drupal.org/8"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"require"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"php"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"&gt;=7.0.8"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"composer/installers"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"cweagans/composer-patches"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.6.5"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/addtoany"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.12"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/admin_toolbar"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"2.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/bootstrap"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"3.21"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_filter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.5"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_inspector"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_split"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.4"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/config_update"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.5"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/console"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.0.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/core"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"8.8.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/core-composer-scaffold"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"8.8.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/ctools"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"3.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/entity_reference_revisions"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.7"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/fontawesome"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"2.14"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/geshifilter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.2"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/google_analytics"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"2.4"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/libraries"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^3.0.0-alpha1"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/memcache"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"2.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/metatag"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.10"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/module_filter"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"3.1"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/paragraphs"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.10"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/pathauto"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.6"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/schema_metatag"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.4"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/token"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.5"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/xmlsitemap"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.0.0-alpha4"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal/youtube"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drush/drush"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^9.7.1 | ^10.0.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"vlucas/phpdotenv"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^4.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"webflo/drupal-finder"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0.0"&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"zaporylie/composer-drupal-optimizations"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^1.0"&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"require-dev"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"drupal/core-dev"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"^8.8.0"&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"conflict"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"drupal/drupal"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"*"&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"minimum-stability"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"dev"&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"prefer-stable"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;true&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"config"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"sort-packages"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;true&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"autoload"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"classmap"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"scripts/composer/ScriptHandler.php"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"files"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"load.environment.php"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"scripts"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"pre-install-cmd"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"pre-update-cmd"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"DrupalProject\\composer\\ScriptHandler::checkComposerVersion"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"post-install-cmd"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"post-update-cmd"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"extra"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"composer-exit-on-patch-failure"&lt;/span&gt;: &lt;span style="color: #c20cb9; font-weight: bold;"&gt;true&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"patchLevel"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"drupal/core"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"-p2"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"drupal-scaffold"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"locations"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"web-root"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"web/"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"installer-paths"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"web/core"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-core"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"web/libraries/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-library"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"web/modules/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-module"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"web/profiles/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-profile"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"web/themes/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-theme"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"drush/Commands/contrib/{&lt;span style="color: #007800;"&gt;$name&lt;/span&gt;}"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"type:drupal-drush"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
The &lt;em&gt;composer.json&lt;/em&gt; file has now been modified and the drupal project files are pinned at particular versions for safety.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/development" hreflang="en"&gt;Development&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/php" hreflang="en"&gt;PHP&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/linux" hreflang="en"&gt;Linux&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Wed, 11 Dec 2019 15:52:32 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">174 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: Drupal 8 Contact Form Thank You Page</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-drupal-8-contact-form-thank-you-page</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: Drupal 8 Contact Form Thank You Page&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Sat, 04/05/2019 - 14:50&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Architecture&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Our previous two tutorials on the Drupal 8 as a static site covered the Contact Form and the journey through the action to AWS Lambda to process the form and send an email. Now the final part of the contact form journey - returning back to the static site and showing a Thank You page. &lt;/p&gt;

&lt;p&gt;In fact in this tutorial the Thank You path will actually be the same path with the contact form on it - so we return to the starting point, but we want to show a message back to the user to thank them for filling out the form. The notification back to the user will have to be JavaScript obviously since we have no backend language functionality.&lt;/p&gt;

&lt;p&gt;If you remember the redirect back to the static site from AWS uses a HTTP code of 307. This code matches in the incoming HTTP request with the redirect. So since in our case the form was POSTed, then the redirect will also be POSTed back to the static site. This is both a blessing and a curse as we'll see. &lt;/p&gt;

&lt;p&gt;Common wisdom says that JavaScript can neither detect whether an incoming request is POSTed or GETed, nor retrieve any of the POSTed data. That is theoretically true, but there are always workarounds of course :) :) &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Adding the JavaScript&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;This is very similar to our earlier tutorial on how to add the Elasticsearch JavaScript client. So I won't dwell too much on this. Firstly we need to extend our template_preprocess_page function to add our thank-you JS library. This is the second section of code below, underneath the elasticsearch part&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;{themename}.theme&lt;/strong&gt; - in my case the custom theme is called beezee8. 
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;function &lt;/span&gt;&lt;span style="color: #0000BB"&gt;beezee8_preprocess_page&lt;/span&gt;&lt;span style="color: #007700"&gt;(&amp;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$variables&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// If we are on the search page, load the JS search client api&lt;br /&gt;    // and our implementation to Elasticsearch&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #007700"&gt;if (\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;::&lt;/span&gt;&lt;span style="color: #0000BB"&gt;routeMatch&lt;/span&gt;&lt;span style="color: #007700"&gt;()-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getRouteName&lt;/span&gt;&lt;span style="color: #007700"&gt;() == &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'search.view_node_search'&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$variables&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#attached'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'library'&lt;/span&gt;&lt;span style="color: #007700"&gt;][] = &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'beezee8/elastic-library'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// If we are on the contact form page, load the JS to show thank you message&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #007700"&gt;if (\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;::&lt;/span&gt;&lt;span style="color: #0000BB"&gt;request&lt;/span&gt;&lt;span style="color: #007700"&gt;()-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getRequestUri&lt;/span&gt;&lt;span style="color: #007700"&gt;() == &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'/about'&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$variables&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#attached'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'library'&lt;/span&gt;&lt;span style="color: #007700"&gt;][] = &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'beezee8/thank-you-library'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
In the code above I get the current path alias and should that equal the '/about' page then I inject my JS library which is defined below.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Libraries file&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;The libraries file now needs a further entry for our thank you JS. Again we already created an entry for elasticsearch so I am not going to go over this in too much detail. &lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;{themename}.libraries.yml&lt;/strong&gt;
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;global-styling:
  css:
    theme:
      css&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;style.css: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
elastic-library:
  js:
    js&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;elasticsearch-js&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;elasticsearch.min.js: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    js&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;beezee&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;beezee_elastic.js: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
thank-you-library:
  js:
    js&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;beezee&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;beezee_thankyou.js: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;JavaScript Thank You&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Now here's the JavaScript. I did say that there is no way of knowing whether the HTTP request is GET or POST - well true, but we can deduce it. If we interrogate the referrer and it equals the current URL then we can make the assumption that the form has been POSTed, completed its round trip to AWS Lambda and back with a 307 code, and therefore we should show the thank you message. If you have a look at my code below you will see the conditional, and you will see the markup I inject into the page - it's classic Drupal 8 Bootstrap since that's how my theme is built. Your mileage here will obviously vary dependent upon your own theme.&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;{themename}_thankyou.js&lt;/strong&gt;
&lt;div class="geshifilter"&gt;&lt;div class="javascript geshifilter-javascript" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;function&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;$&lt;span style="color: #339933;"&gt;,&lt;/span&gt; Drupal&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
 
    &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; thank_once&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
    &lt;span style="color: #000066; font-weight: bold;"&gt;function&lt;/span&gt; BeezeeThankyou&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
        &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #339933;"&gt;!&lt;/span&gt;thank_once&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
            thank_once &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #003366; font-weight: bold;"&gt;true&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
            &lt;span style="color: #006600; font-style: italic;"&gt;// If we are arriving here from lambda which passes on the referrer from here&lt;/span&gt;
            &lt;span style="color: #006600; font-style: italic;"&gt;// then the form has been POSTed so show the thank you page&lt;/span&gt;
            &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;document.&lt;span style="color: #660066;"&gt;referrer&lt;/span&gt; &lt;span style="color: #339933;"&gt;==&lt;/span&gt; document.&lt;span style="color: #660066;"&gt;URL&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
 
                &lt;span style="color: #006600; font-style: italic;"&gt;// Markup to add the thankyou message&lt;/span&gt;
                &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; thanks &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #009900;"&gt;[&lt;/span&gt;
                    &lt;span style="color: #3366CC;"&gt;'&lt;div class="alert alert-success alert-dismissible" role="alert"&gt;'&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                    &lt;span style="color: #3366CC;"&gt;'&lt;button role="button" class="close" data-dismiss="alert" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;×&lt;/span&gt;&lt;/button&gt;'&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                    &lt;span style="color: #3366CC;"&gt;'&lt;h4 class="sr-only"&gt;Status message&lt;/h4&gt;'&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                    &lt;span style="color: #3366CC;"&gt;'Thank you for contacting me. I will be in touch.'&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                    &lt;span style="color: #3366CC;"&gt;'&lt;/div&gt;'&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;]&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
                &lt;span style="color: #006600; font-style: italic;"&gt;// Inject the markup&lt;/span&gt;
                $&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;'.region-highlighted'&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;.&lt;span style="color: #660066;"&gt;append&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;thanks.&lt;span style="color: #660066;"&gt;join&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;''&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
 
    Drupal.&lt;span style="color: #660066;"&gt;behaviors&lt;/span&gt;.&lt;span style="color: #660066;"&gt;beezee_thankyou&lt;/span&gt; &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
        attach&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;function&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;context&lt;span style="color: #339933;"&gt;,&lt;/span&gt; settings&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
            BeezeeThankyou&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;jQuery&lt;span style="color: #339933;"&gt;,&lt;/span&gt; Drupal&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;nginx Server Configuration&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-05/Screenshot%202019-05-04%20at%2014.20.54.png?itok=6tpIS5Ha 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-05/Screenshot%202019-05-04%20at%2014.20.54.png?itok=ob3PdIWy 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-05/Screenshot%202019-05-04%20at%2014.20.54.png?itok=HXKYNHSr 1232w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-05/Screenshot%202019-05-04%20at%2014.20.54.png?itok=6tpIS5Ha" alt="nginx error" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;If we try our form now (or at least if I do since I'm using nginx) - we will get an nginx &lt;strong&gt;405 Not Allowed&lt;/strong&gt; error. Remember I said the POST could be a blessing and a curse? The error is because by default nginx will not allow a POST to a static page. Thankfully there is a workaround. Locate the server configuration for your particular virtual host, and edit it by adding the following line into the &lt;strong&gt;server&lt;/strong&gt; section. &lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;{VM name}.conf&lt;/strong&gt;
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;server &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
.
.
.
      error_page  &lt;span style="color: #000000;"&gt;405&lt;/span&gt;     =&lt;span style="color: #000000;"&gt;200&lt;/span&gt; &lt;span style="color: #007800;"&gt;$uri&lt;/span&gt;;
.
.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Form submission&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-05/Screenshot%202019-05-04%20at%2015.36.57.png?itok=0_8Bbaz8 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-05/Screenshot%202019-05-04%20at%2015.36.57.png?itok=k1HGEgk5 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-05/Screenshot%202019-05-04%20at%2015.36.57.png?itok=InG6NxCW 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2019-05/Screenshot%202019-05-04%20at%2015.36.57.png?itok=xNGfoh3u 2518w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-05/Screenshot%202019-05-04%20at%2015.36.57.png?itok=0_8Bbaz8" alt="form submission" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Ok we should now be good to go. Submit the form and it should do the round trip from static site to AWS Lambda back to static site and an email arriving in your inbox! &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;An even better solution? &lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-05/Screenshot%202019-05-04%20at%2012.22.24.png?itok=gRLJM0fM 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-05/Screenshot%202019-05-04%20at%2012.22.24.png?itok=ZCyJqk5L 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-05/Screenshot%202019-05-04%20at%2012.22.24.png?itok=iJlZV3ZA 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2019-05/Screenshot%202019-05-04%20at%2012.22.24.png?itok=U51-2amo 2494w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-05/Screenshot%202019-05-04%20at%2012.22.24.png?itok=gRLJM0fM" alt="alternative solution" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;If you look carefully above you will see a placeholder in the thank you message. So am I saying it is possible to retrieve the POSTed data and insert the name into the placeholder? Sort of. There is a JS library called &lt;a href="https://github.com/ssut/jQuery-PostCapture"&gt;jQuery-PostCapture&lt;/a&gt; which can achieve this. It works by capturing the POSTed data when the form is initially submitted. This copy of the data is stored either as a cookie or in the browser's local storage. Once the trip to AWS Lambda is completed, this data can be fetched from the cookie or local storage - so the data isn't fetched from the actual POST itself. &lt;/p&gt;

&lt;p&gt;The problem I've got with this is neither a cookie nor local storage is secure. However if you feel that the gains (being able to customise a message on the thank you page) is worth the security risk, then give it a shot! &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/php" hreflang="en"&gt;PHP&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/development" hreflang="en"&gt;Development&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/js" hreflang="en"&gt;JavaScript&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Sat, 04 May 2019 13:50:36 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">167 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: AWS API Gateway, Lambda and SES Form Processing</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-aws-api-gateway-lambda-and-ses-form-processing</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: AWS API Gateway, Lambda and SES Form Processing&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Wed, 02/01/2019 - 10:38&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Serverless Installation&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The intention is to build our AWS ecosystem using the &lt;a href="https://serverless.com/"&gt;serverless&lt;/a&gt; product. This will enable us to configure our AWS provisioning in a YML file which is then translated into AWS CloudFormation orchestration. In the same codebase our PHP Lambda function can be built out. It isn't my intention to provide heavy documentation here since the Contact Form architecture was &lt;a href="http://badzilla.co.uk/drupal-8-static-site-contact-form-architecture"&gt;defined in an earlier blog&lt;/a&gt;, and I have previously written &lt;a href="http://badzilla.co.uk/real-world-php-lambda-app"&gt;many articles on the serverless / lambda / API Gateway&lt;/a&gt; combination of technologies to deliver HTTP content and handle form POSTs. &lt;/p&gt;
&lt;p&gt;Notwithstanding this, I will of course document points of interest along the way so it all makes sense! &lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;The first step is to install &lt;strong&gt;serverless&lt;/strong&gt; on your system. A dependency is node, so if you don't have that then please follow tutorials elsewhere on the Internet before executing the command below to install globally serverless.
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #666666;"&gt;$ &lt;/span&gt;npm &lt;span style="color: #c20cb9; font-weight: bold;"&gt;install&lt;/span&gt; serverless &lt;span style="color: #660033;"&gt;-g&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
We will be using Andy Raines' excellent PHP for AWS Lambda via Serverless Framework repo as our stating point. Issuing the following command will install our PHP serverless project into a directory called  d8-contact-form.
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ serverless &lt;span style="color: #c20cb9; font-weight: bold;"&gt;install&lt;/span&gt; &lt;span style="color: #660033;"&gt;--url&lt;/span&gt; https:&lt;span style="color: #000000; font-weight: bold;"&gt;//&lt;/span&gt;github.com&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;araines&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;serverless-php &lt;span style="color: #660033;"&gt;-n&lt;/span&gt; d8-contact-form
Serverless: Downloading and installing &lt;span style="color: #ff0000;"&gt;"serverless-php"&lt;/span&gt;...
Serverless: Successfully installed &lt;span style="color: #ff0000;"&gt;"d8-contact-form"&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
We then cd into the directory and list. 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ &lt;span style="color: #7a0874; font-weight: bold;"&gt;cd&lt;/span&gt; d8-contact-form&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;ls&lt;/span&gt; &lt;span style="color: #660033;"&gt;-las&lt;/span&gt;
total &lt;span style="color: #000000;"&gt;48&lt;/span&gt;
&lt;span style="color: #000000;"&gt;0&lt;/span&gt; drwxrwxr-x &lt;span style="color: #000000;"&gt;16&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;512&lt;/span&gt; Jan  &lt;span style="color: #000000;"&gt;2&lt;/span&gt; &lt;span style="color: #000000;"&gt;11&lt;/span&gt;:&lt;span style="color: #000000;"&gt;14&lt;/span&gt; .
&lt;span style="color: #000000;"&gt;0&lt;/span&gt; drwxr-xr-x &lt;span style="color: #000000;"&gt;14&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;448&lt;/span&gt; Jan  &lt;span style="color: #000000;"&gt;2&lt;/span&gt; &lt;span style="color: #000000;"&gt;11&lt;/span&gt;:&lt;span style="color: #000000;"&gt;14&lt;/span&gt; ..
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rwxr-xr-x&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;660&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; buildphp.sh
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;569&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; CHANGELOG.md
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;430&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; composer.json
&lt;span style="color: #000000;"&gt;0&lt;/span&gt; drwxrwxr-x  &lt;span style="color: #000000;"&gt;3&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout   &lt;span style="color: #000000;"&gt;96&lt;/span&gt; Jan  &lt;span style="color: #000000;"&gt;2&lt;/span&gt; &lt;span style="color: #000000;"&gt;11&lt;/span&gt;:&lt;span style="color: #000000;"&gt;14&lt;/span&gt; config
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout &lt;span style="color: #000000;"&gt;1011&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; dockerfile.buildphp
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout   &lt;span style="color: #000000;"&gt;40&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; .gitattributes
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;120&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; .gitignore
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout &lt;span style="color: #000000;"&gt;1330&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; handler.js
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;829&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; handler.php
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout &lt;span style="color: #000000;"&gt;1103&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; LICENSE
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rwxr-xr-x&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;133&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; php
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout &lt;span style="color: #000000;"&gt;3705&lt;/span&gt; Feb &lt;span style="color: #000000;"&gt;14&lt;/span&gt;  &lt;span style="color: #000000;"&gt;2018&lt;/span&gt; README.md
&lt;span style="color: #000000;"&gt;4&lt;/span&gt; &lt;span style="color: #660033;"&gt;-rw-r--r--&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout &lt;span style="color: #000000;"&gt;3008&lt;/span&gt; Jan  &lt;span style="color: #000000;"&gt;2&lt;/span&gt; &lt;span style="color: #000000;"&gt;11&lt;/span&gt;:&lt;span style="color: #000000;"&gt;14&lt;/span&gt; serverless.yml
&lt;span style="color: #000000;"&gt;0&lt;/span&gt; drwxrwxr-x  &lt;span style="color: #000000;"&gt;5&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  &lt;span style="color: #000000;"&gt;160&lt;/span&gt; Jan  &lt;span style="color: #000000;"&gt;2&lt;/span&gt; &lt;span style="color: #000000;"&gt;11&lt;/span&gt;:&lt;span style="color: #000000;"&gt;14&lt;/span&gt; src&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Since I don't have Git LFS installed, the PHP executable hasn't been downloaded from the repo correctly. I will download this manually, and add it to the directory. Once completed, we can see it there with:
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;ls&lt;/span&gt; &lt;span style="color: #660033;"&gt;-lash&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;grep&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;" php"&lt;/span&gt;
 27M &lt;span style="color: #660033;"&gt;-rwxr-xr-x&lt;/span&gt;  &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #000000;"&gt;501&lt;/span&gt; dialout  27M Jan  &lt;span style="color: #000000;"&gt;2&lt;/span&gt; &lt;span style="color: #000000;"&gt;11&lt;/span&gt;:&lt;span style="color: #000000;"&gt;22&lt;/span&gt; php&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Now we need to install the PHP dependencies using composer. This does have a dependency on PHP 7.1. 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ composer &lt;span style="color: #c20cb9; font-weight: bold;"&gt;install&lt;/span&gt; &lt;span style="color: #660033;"&gt;-o&lt;/span&gt; &lt;span style="color: #660033;"&gt;--no-dev&lt;/span&gt;
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https:&lt;span style="color: #000000; font-weight: bold;"&gt;//&lt;/span&gt;getcomposer.org&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;xdebug
Loading composer repositories with package information
Updating dependencies
Package operations: &lt;span style="color: #000000;"&gt;9&lt;/span&gt; installs, &lt;span style="color: #000000;"&gt;0&lt;/span&gt; updates, &lt;span style="color: #000000;"&gt;0&lt;/span&gt; removals
  - Installing psr&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;log &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;1.1.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing monolog&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;monolog &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;1.24.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;polyfill-ctype &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;v1.10.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Loading from cache
  - Installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;filesystem &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;v4.2.1&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;config &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;v4.2.1&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;contracts &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;v1.0.2&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing psr&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;container &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;1.0.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Loading from cache
  - Installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;dependency-injection &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;v4.2.1&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
  - Installing symfony&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;yaml &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;v4.2.1&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
Writing lock &lt;span style="color: #c20cb9; font-weight: bold;"&gt;file&lt;/span&gt;
Generating optimized autoload files&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Any Raines' code comes with a very basic Lambda function called &lt;strong&gt;hello&lt;/strong&gt;. To prove the environment is working correctly, we should invoke it locally (no need for deploying to AWS yet) and if everything is correct, it'll look like this:
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ serverless invoke &lt;span style="color: #7a0874; font-weight: bold;"&gt;local&lt;/span&gt; &lt;span style="color: #660033;"&gt;-f&lt;/span&gt; hello
Got event &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff0000;"&gt;"statusCode"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;200&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"body"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"Go Serverless v1.0! Your function executed successfully!"&lt;/span&gt;
&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
In an &lt;a href="http://badzilla.co.uk/running-php-amazon-lambda-serverless"&gt;earlier blog&lt;/a&gt; I replaced the references of &lt;strong&gt;Hello&lt;/strong&gt; with &lt;strong&gt;demo&lt;/strong&gt;. I have changed it to &lt;strong&gt;D8ContactForm&lt;/strong&gt; for the contact form. By deploying the code to AWS, and submitting the contact form, you will see the same screenshot as shown at the end of the &lt;a href="http://badzilla.co.uk/drupal-8-static-site-drupal-8-contact-form"&gt;previous blog. &lt;/a&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;SES Validation of email address&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-03/Screenshot%202019-03-24%20at%2012.53.48.png?itok=VklpZIXH 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-03/Screenshot%202019-03-24%20at%2012.53.48.png?itok=w6rR8Bo2 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-03/Screenshot%202019-03-24%20at%2012.53.48.png?itok=Pt0JuZRW 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2019-03/Screenshot%202019-03-24%20at%2012.53.48.png?itok=wYgkoMN1 2600w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-03/Screenshot%202019-03-24%20at%2012.53.48.png?itok=VklpZIXH" alt="Email address validation" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-03/Screenshot%202019-03-24%20at%2013.03.04-edited.png?itok=gDIdr5NA 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-03/Screenshot%202019-03-24%20at%2013.03.04-edited.png?itok=4U2cM8Hw 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-03/Screenshot%202019-03-24%20at%2013.03.04-edited.png?itok=Y1AhIOSK 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2019-03/Screenshot%202019-03-24%20at%2013.03.04-edited.png?itok=8YS9rsXw 2600w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-03/Screenshot%202019-03-24%20at%2013.03.04-edited.png?itok=gDIdr5NA" alt="Verification completed" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;To use the AWS SES service, your email address will need to be verified. This is easy - navigate to Simple Email Service and click on email addresses, then "Verify a new email address". Add the email address and a verification email message will be sent for you to click back and confirm the verification process. Once verified, you'll see the second screenshot above. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Serverless configuration&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;The next step is to add the SES configuration to the &lt;strong&gt;serverless.yml&lt;/strong&gt; file. Add a custom area for your own variables - in this case the email address.
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;custom:
  SENDER_EMAIL: xxxx&lt;span style="color: #000000; font-weight: bold;"&gt;@&lt;/span&gt;xxxxxxxx
  RECIPIENT_EMAIL: xxxx&lt;span style="color: #000000; font-weight: bold;"&gt;@&lt;/span&gt;xxxxxxxx&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
And add the SES config to the provider area so it looks like this in its entirety:
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;provider:
  name: aws
  runtime: nodejs6.10
  stage: dev
  region: eu-west-&lt;span style="color: #000000;"&gt;1&lt;/span&gt;
  environment:
    SENDER: &lt;span style="color: #800000;"&gt;${self:custom.SENDER_EMAIL}&lt;/span&gt;
    RECIPIENT: &lt;span style="color: #800000;"&gt;${self:custom.RECIPIENT_EMAIL}&lt;/span&gt;
    DOMAIN: &lt;span style="color: #ff0000;"&gt;"*"&lt;/span&gt;
  iamRoleStatements:
    - Effect: &lt;span style="color: #ff0000;"&gt;"Allow"&lt;/span&gt;
      Action:
        - &lt;span style="color: #ff0000;"&gt;"ses:SendEmail"&lt;/span&gt;
      Resource: &lt;span style="color: #ff0000;"&gt;"*"&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Then deploy
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ sls deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Add AWS SDK to the codebase using composer&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;The SDK will make it much easier to build out the SES interface code and can be installed to the codebase in the usual composer way
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ composer require aws&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;aws-sdk-php
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https:&lt;span style="color: #000000; font-weight: bold;"&gt;//&lt;/span&gt;getcomposer.org&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;xdebug
Using version ^&lt;span style="color: #000000;"&gt;3.90&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; aws&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;aws-sdk-php
.&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;composer.json has been updated&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Add SDK PHP required libraries&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;The AWS PHP SDK requires the &lt;strong&gt;filter and simplexml&lt;/strong&gt; libraries that aren't in the PHP executable we deploy to AWS by default. Thankfully there is a way of recompiling the PHP executable and I covered this in &lt;a href="http://badzilla.co.uk/recompiling-php-serverless-php-and-lambda"&gt;an earlier blog.&lt;/a&gt; So the tl;dr is &lt;ul&gt;
&lt;li&gt;Add the filter and simplexml libraries to dockerfile.buildphp&lt;/li&gt;
&lt;li&gt;Make a note of the php creation date and filesize.
&lt;/li&gt;&lt;li&gt;Make sure buildphp.sh is executable on the command line and run it.&lt;/li&gt;
&lt;ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Add the Serverless and SDK handler code&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Now the AWS SDK is in the code base we can build out the functionality to integrate the SDK. Our first work is to ensure that the recipient and sender email addresses are available to the code. To achieve this, they were defined in the &lt;strong&gt;serverless.yml&lt;/strong&gt; in the environment section which can be picked up in &lt;strong&gt;handler.php&lt;/strong&gt; and assigned to the &lt;strong&gt;$event&lt;/strong&gt; array which is made available to the handler class. Add the following lines before the call to handle
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;$event&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'sender_email'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = &lt;/span&gt;&lt;span style="color: #0000BB"&gt;getenv&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'SENDER'&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$event&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'recipient_email'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = &lt;/span&gt;&lt;span style="color: #0000BB"&gt;getenv&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'RECIPIENT'&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
Now the handler itself. A few things to note. &lt;ul&gt;&lt;li&gt;I have added the necessary &lt;strong&gt;use&lt;/strong&gt; clauses to the AWS SDK client and the exception class&lt;/li&gt;&lt;li&gt;The protected &lt;strong&gt;$client_config&lt;/strong&gt; holds the configuration we have - but note that further down I am getting the credentials from the &lt;strong&gt;CredentialProvider&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;The recipients are an array and so it is possible if required to add multiples here.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;strong&gt;D8ContactFormHandler.php&lt;/strong&gt;
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;namespace &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Raines&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Serverless&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;require &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'vendor/autoload.php'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;use &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Aws&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Ses&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;SesClient&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;use &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Aws&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Exception&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;AwsException&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;class &lt;/span&gt;&lt;span style="color: #0000BB"&gt;D8ContactFormHandler &lt;/span&gt;&lt;span style="color: #007700"&gt;implements &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Handler&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;{&lt;br /&gt;    protected &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$client_config &lt;/span&gt;&lt;span style="color: #007700"&gt;= [&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'region' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'eu-west-1'&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'version' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'2010-12-01'&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'credentials.cache' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;TRUE&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'validation' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;FALSE&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;    ];&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #FF8000"&gt;/**&lt;br /&gt;     * {@inheritdoc}&lt;br /&gt;     */&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #007700"&gt;public function &lt;/span&gt;&lt;span style="color: #0000BB"&gt;handle&lt;/span&gt;&lt;span style="color: #007700"&gt;(array &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$event&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Context $context&lt;/span&gt;&lt;span style="color: #007700"&gt;)&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$logger &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$context&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getLogger&lt;/span&gt;&lt;span style="color: #007700"&gt;();&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// Comment out for debugging&lt;br /&gt;        //$logger-&gt;notice('Got event', $event);&lt;br /&gt;&lt;br /&gt;        // Set up AWS SDK&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$this&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;client_config&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'credentials'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = \&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Aws&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Credentials&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;CredentialProvider&lt;/span&gt;&lt;span style="color: #007700"&gt;::&lt;/span&gt;&lt;span style="color: #0000BB"&gt;env&lt;/span&gt;&lt;span style="color: #007700"&gt;();&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$SesClient &lt;/span&gt;&lt;span style="color: #007700"&gt;= new &lt;/span&gt;&lt;span style="color: #0000BB"&gt;SesClient&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$this&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;client_config&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$sender_email &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$event&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'sender_email'&lt;/span&gt;&lt;span style="color: #007700"&gt;];&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$recipient_emails&lt;/span&gt;&lt;span style="color: #007700"&gt;[] = &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$event&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'recipient_email'&lt;/span&gt;&lt;span style="color: #007700"&gt;];&lt;br /&gt;&lt;br /&gt;        return [&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'statusCode' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;200&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'body' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Go Serverless v1.0! Your function executed successfully!'&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;        ];&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Email generation&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Now we can insert the code to actually generate the email. All of this is self evident and really doesn't need further commentary from me. It should be inserted just before the return statement. &lt;br /&gt;
&lt;strong&gt;D8ContactFormHandler.php&lt;/strong&gt;
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// Process the submitted form.&lt;br /&gt;        // *TODO* This could do with more validation.&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields &lt;/span&gt;&lt;span style="color: #007700"&gt;= [];&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;parse_str&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$event&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'body'&lt;/span&gt;&lt;span style="color: #007700"&gt;], &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&lt;br /&gt;        if (!isset(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'name'&lt;/span&gt;&lt;span style="color: #007700"&gt;])) &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'name'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'{unknown name}'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;        if (!isset(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'mail'&lt;/span&gt;&lt;span style="color: #007700"&gt;])) &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'mail'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'{unknown email address}'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;        if (!isset(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'subject'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;])) &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'subject'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'{unknown subject}'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;        if (!isset(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'message'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;])) &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'message'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'{unknown message}'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$subject &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'[badzilla.co.uk website feedback] '&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'subject'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;];&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$plaintext_body &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'From: '&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'name'&lt;/span&gt;&lt;span style="color: #007700"&gt;].&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'  '&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'mail'&lt;/span&gt;&lt;span style="color: #007700"&gt;].&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Subject: '&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'subject'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;].&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;' Message: '&lt;/span&gt;&lt;span style="color: #007700"&gt;. &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'message'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;];&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$html_body &lt;/span&gt;&lt;span style="color: #007700"&gt;=  &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'&lt;h1&gt;'&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'subject'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;].&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'&lt;/h1&gt;'&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'&lt;h2&gt;'&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'From: '&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'name'&lt;/span&gt;&lt;span style="color: #007700"&gt;].&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'  &lt;a href="mailto:"'&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'mail'&lt;/span&gt;&lt;span style="color: #007700"&gt;].&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'"&gt;'&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'mail'&lt;/span&gt;&lt;span style="color: #007700"&gt;].&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'&lt;/a&gt;'&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'&lt;/h2&gt;'&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'&lt;p&gt;'&lt;/span&gt;&lt;span style="color: #007700"&gt;.&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$fields&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'message'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #0000BB"&gt;0&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'value'&lt;/span&gt;&lt;span style="color: #007700"&gt;].&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'&lt;/p&gt;'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$char_set &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'UTF-8'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;        try {&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$result &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$SesClient&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;sendEmail&lt;/span&gt;&lt;span style="color: #007700"&gt;([&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Destination' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                    &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'ToAddresses' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$recipient_emails&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;                ],&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'ReplyToAddresses' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$sender_email&lt;/span&gt;&lt;span style="color: #007700"&gt;],&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Source' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$sender_email&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Message' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                    &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Body' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                        &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Html' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Charset' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$char_set&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;                            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Data' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$html_body&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;                        ],&lt;br /&gt;                        &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Text' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Charset' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$char_set&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;                            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Data' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$plaintext_body&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;                        ],&lt;br /&gt;                    ],&lt;br /&gt;                    &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Subject' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                        &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Charset' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$char_set&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;                        &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Data' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$subject&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;                    ],&lt;br /&gt;                ],&lt;br /&gt;            ]);&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$messageId &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$result&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'MessageId'&lt;/span&gt;&lt;span style="color: #007700"&gt;];&lt;br /&gt;        } catch (&lt;/span&gt;&lt;span style="color: #0000BB"&gt;AwsException $e&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// output error message if fails&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$logger&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;notice&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Message'&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$e&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getMessage&lt;/span&gt;&lt;span style="color: #007700"&gt;());&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$logger&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;notice&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'AWS Message'&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$e&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getAwsErrorMessage&lt;/span&gt;&lt;span style="color: #007700"&gt;());&lt;br /&gt;        }&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Redirect to thank you page&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Once we've sent the email we want to redirect back to our thank you page. This is done with a 307 code which preserves the original POSTed values so they can be used on the forwarded page. Our use will be to make the message personalised. I have decided that I would like my redirect back to my originating page, but of course you could customise it as you see fit. For my case, I use the Referer header. The code below replaces the existing return functionality.&lt;br /&gt;
&lt;strong&gt;D8 ContactFormHandler.php&lt;/strong&gt;
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #007700"&gt;return [&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'headers' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Location' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$event&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'headers'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Referer'&lt;/span&gt;&lt;span style="color: #007700"&gt;]],&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'statusCode' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;307&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;        ];&lt;br /&gt;&lt;/&lt;/span&gt;&lt;span style="color: #0000BB"&gt;codE&lt;/span&gt;&lt;span style="color: #007700"&gt;&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Debugging&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-03/Screenshot%202019-03-24%20at%2018.22.11.png?itok=LTjE38Bn 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-03/Screenshot%202019-03-24%20at%2018.22.11.png?itok=uyEGnya5 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-03/Screenshot%202019-03-24%20at%2018.22.11.png?itok=KbaNuSz5 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2019-03/Screenshot%202019-03-24%20at%2018.22.11.png?itok=BRx1-OBf 2552w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-03/Screenshot%202019-03-24%20at%2018.22.11.png?itok=LTjE38Bn" alt="CloudWatch" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;During the development process you will have to do multiple deploys and doubtless you will get numerous error responses from AWS. The best way of working these issues is to use CloudWatch, and a sample screenshot is shown above. The codebase has an excellent logging facility to check variables and these are written out to CloudWatch. Have a look at:&lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;$logger&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;notice&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Got event'&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$event&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
This can be amended for whatever you need to interrogate, but remember the second parameter must be an array.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Git Repository&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The entire codebase discussed here is at &lt;a href="https://github.com/sanddevil/serverless-php-contact-form"&gt;https://github.com/sanddevil/serverless-php-contact-form&lt;/a&gt; - if you wish to extend its functionality, please send me a pull request. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/php" hreflang="en"&gt;PHP&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/development" hreflang="en"&gt;Development&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/serverless" hreflang="en"&gt;serverless&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/serverless-php" hreflang="en"&gt;serverless-php&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/lambda" hreflang="en"&gt;lambda&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Wed, 02 Jan 2019 10:38:46 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">164 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: Drupal 8 Contact Form</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-drupal-8-contact-form</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: Drupal 8 Contact Form&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Mon, 31/12/2018 - 10:38&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Drupal Contact&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2010.41.48.png?itok=g7UCAwiw 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-12/Screenshot%202018-12-31%20at%2010.41.48.png?itok=fESRp_XM 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-12/Screenshot%202018-12-31%20at%2010.41.48.png?itok=2ZEMp22N 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-12/Screenshot%202018-12-31%20at%2010.41.48.png?itok=KH1K0fWP 2304w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2010.41.48.png?itok=g7UCAwiw" alt="Extend" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot_2018-12-31_at_11_08_53-edited.png?itok=s4ONl3xB 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-12/Screenshot_2018-12-31_at_11_08_53-edited.png?itok=Vh-HhXXk 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-12/Screenshot_2018-12-31_at_11_08_53-edited.png?itok=tV56yvb4 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-12/Screenshot_2018-12-31_at_11_08_53-edited.png?itok=eZdVPGL9 2004w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot_2018-12-31_at_11_08_53-edited.png?itok=s4ONl3xB" alt="Feedback" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2015.03.27.png?itok=pHkxHQJL 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-12/Screenshot%202018-12-31%20at%2015.03.27.png?itok=f1MqYlsn 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-12/Screenshot%202018-12-31%20at%2015.03.27.png?itok=BknQ62jT 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-12/Screenshot%202018-12-31%20at%2015.03.27.png?itok=g0ej4cfc 1990w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2015.03.27.png?itok=pHkxHQJL" alt="Display" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Drupal core comes with a Contact form, so the first step is to check it is already enabled by navigating to /admin/modules as per the first screenshot above. &lt;/p&gt;
&lt;p&gt;Next go to /admin/structure/contact and the default forms are listed including the Website Feedback form which is the one we will be using. See the second screenshot. &lt;/p&gt;
&lt;p&gt;The third screenshot shows the default fields. I've made two changes here. The form preview requires a Drupal backend so has been removed, and I've disabled the 'Send copy to sender' option since that could encourage spamming. &lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Add contrib module Contact Block&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Since I want my contact form to be below my 'about' content on my /about route, I need the form to be available as a block. This can be achieved using the contrib module Contact Block and can be installed and enabled in the normal way. 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ composer require drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;contact_block
Using version ^&lt;span style="color: #000000;"&gt;1.4&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;contact_block
.&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;composer.json has been updated
Gathering patches &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; root package.
Loading composer repositories with package information
Updating dependencies &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;including require-dev&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;
Package operations: &lt;span style="color: #000000;"&gt;1&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;install&lt;/span&gt;, &lt;span style="color: #000000;"&gt;0&lt;/span&gt; updates, &lt;span style="color: #000000;"&gt;0&lt;/span&gt; removals
Gathering patches &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; root package.
Gathering patches &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; dependencies. This might take a minute.
  - Installing drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;contact_block &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;1.4.0&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;: Downloading &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000;"&gt;100&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;%&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt;         
&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; Drupal\Core\Composer\Composer::vendorTestCodeCleanup
Writing lock &lt;span style="color: #c20cb9; font-weight: bold;"&gt;file&lt;/span&gt;
Generating autoload files
&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; Drupal\Core\Composer\Composer::preAutoloadDump
&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt; Drupal\Core\Composer\Composer::ensureHtaccess
$ drush en contact_block
 &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;success&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt; Successfully enabled: contact_block&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Add contact form block to region&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2014.43.19.png?itok=X25q6yyr 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-12/Screenshot%202018-12-31%20at%2014.43.19.png?itok=EhmZLXPP 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-12/Screenshot%202018-12-31%20at%2014.43.19.png?itok=dpgd05YO 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-12/Screenshot%202018-12-31%20at%2014.43.19.png?itok=EjGDaXhf 1396w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2014.43.19.png?itok=X25q6yyr" alt="Add block" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2014.44.06.png?itok=cOcHH__W 295w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-12/Screenshot%202018-12-31%20at%2014.44.06.png?itok=Fp8pwjJY 590w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-12/Screenshot%202018-12-31%20at%2014.44.06.png?itok=JrP_77EW 1180w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-12/Screenshot%202018-12-31%20at%2014.44.06.png?itok=jC3cE-Tl 1392w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2014.44.06.png?itok=cOcHH__W" alt="Block settings" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2014.44.27.png?itok=NvZhm9BX 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-12/Screenshot%202018-12-31%20at%2014.44.27.png?itok=ILVQRXX5 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-12/Screenshot%202018-12-31%20at%2014.44.27.png?itok=8RBmyDlo 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-12/Screenshot%202018-12-31%20at%2014.44.27.png?itok=_ngrrHLk 1922w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-31%20at%2014.44.27.png?itok=NvZhm9BX" alt="Content Region" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Adding the content form block to a block region should be familiar to most people so I won't go into this in great detail. I have placed it in the content region (first screenshot) at /admin/structure/block, configured it with the title, path restrictions so it only appears on my /about route, and ensured the correct form is to be displayed (second screenshot). The third screenshot shows I have dragged the contact form block to be the final block in the content region.  &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;POST form to external URL&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Since it is not possible in the admin UI to add an external URL for the POST action, we will have to achieve this by a few lines of code. But where are we POSTing the form anyway? This is covered in the next blog, but in a nutshell the URL is autogenerated by AWS API Gateway during the CloudFormation orchestration. I won't go into the details now how that is achieved since it can be read later in this sequence, but here is the url we'll use. 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ sls info &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;grep&lt;/span&gt; POST
  POST - https:&lt;span style="color: #000000; font-weight: bold;"&gt;//&lt;/span&gt;djbbm406h0.execute-api.eu-west-&lt;span style="color: #000000;"&gt;2&lt;/span&gt;.amazonaws.com&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;dev&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
The easiest way of adding that url to the Drupal contact form would be to include it into settings.php and then use a template preprocess function to swap out the 'action' value in the form. &lt;br /&gt;
&lt;strong&gt;settings.php&lt;/strong&gt;
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;$config&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'aws:lambda'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'url'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'https://djbbm406h0.execute-api.eu-west-2.amazonaws.com/dev'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt; 
&lt;strong&gt;{themename}.theme&lt;/strong&gt;
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #FF8000"&gt;/**&lt;br /&gt; * @param $variables&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;function &lt;/span&gt;&lt;span style="color: #0000BB"&gt;beezee8_preprocess_form&lt;/span&gt;&lt;span style="color: #007700"&gt;(&amp;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$variables&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// find the contact form and add the lambda contact form action url&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #007700"&gt;if (&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$variables&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'attributes'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'id'&lt;/span&gt;&lt;span style="color: #007700"&gt;] == &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'contact-message-feedback-form'&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$variables&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'attributes'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'action'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = \&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;::&lt;/span&gt;&lt;span style="color: #0000BB"&gt;config&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'aws:lambda'&lt;/span&gt;&lt;span style="color: #007700"&gt;)-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;get&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'url'&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;FALSE&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Submission of the contact form&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-03/Screenshot%202019-03-24%20at%2011.06.26.png?itok=iSVtBIhS 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2019-03/Screenshot%202019-03-24%20at%2011.06.26.png?itok=WPksDgcB 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2019-03/Screenshot%202019-03-24%20at%2011.06.26.png?itok=jAkjc3KA 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2019-03/Screenshot%202019-03-24%20at%2011.06.26.png?itok=-np8CCd4 1384w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2019-03/Screenshot%202019-03-24%20at%2011.06.26.png?itok=iSVtBIhS" alt="Form submission" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Now the form will be submitted to AWS Lambda for onward processing, and ultimately, a redirect back with a thank you message. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/php" hreflang="en"&gt;PHP&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/development" hreflang="en"&gt;Development&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Mon, 31 Dec 2018 10:38:02 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">163 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: Contact Form Architecture</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-contact-form-architecture</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: Contact Form Architecture&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Wed, 26/12/2018 - 11:06&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;As I have already mentioned in this sequence of blogs, the intention is to use AWS products for my static site contact form. It's worthwhile explaining the proposed architecture and steps involved to implement such a solution. On the face of it, it may appear somewhat convoluted, but AWS provide a number of complementary products to achieve what we want, and the configuration can be saved in code so it is easy to reproduce. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Architecture&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Form%20Submission%20%281%29.jpg?itok=10FV-4E6 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-12/Form%20Submission%20%281%29.jpg?itok=KWSN4VeQ 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-12/Form%20Submission%20%281%29.jpg?itok=bO9_BzQz 960w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Form%20Submission%20%281%29.jpg?itok=10FV-4E6" alt="Architecture Diagram" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The above diagram shows the architecture of our contact form, and the flow through the form ecosystem. Let's have a look at the components. &lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Webpage with Contact Form&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Drupal comes with a contact form in core, and therefore this is fairly straightforward, albeit with a couple of hurdles to jump. Firstly I would like to place my contact form on my &lt;a href="http://badzilla.co.uk/about"&gt;About Me&lt;/a&gt; page underneath my existing bio. To achieve this I need the form to be a block which will require the installation of a contrib module. In addition I want my form's action to POST the form data to an external URL which isn't supported in the core form - so that will need a solution too. &lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;AWS API Gateway&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The form will be submitted for processing to AWS since we don't have a backend on our own static site - hence why the form needs an external URL for its action parameter. &lt;/p&gt;

&lt;p&gt;We will use AWS API Gateway which is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. This will give us access to AWS compute backend services to process our POSTed form. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;AWS Lambda Function&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;AWS Lambda is a FaaS (Function as a Service) compute service. It is excellent at running a snippet of code on demand once it's been triggered, for instance in our case by the contact form being POSTed.&lt;/p&gt;
&lt;p&gt;PHP isn't a supported Lambda language, but there are workarounds for this - as explained in my sequence of blogs &lt;a href="http://badzilla.co.uk/real-world-php-lambda-app"&gt;here&lt;/a&gt;. Using these workarounds, we will develop a PHP app to process the form, and in addition we will need the AWS PHP SDK to interface with AWS SES (Simple Email Service). &lt;/p&gt;
&lt;p&gt;The PHP code will reside in Amazon's S3 object storage, and we will use the &lt;a href="https://serverless.com/"&gt;serverless&lt;/a&gt; product along with the aws console to manage the deploy process. &lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;AWS SES&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;AWS SES is a very cost effective method of sending marketing, notification and transactional emails. For the amount of usage a blog contact form would see, it's highly unlikely to go above the AWS free tier threshold. It is the perfect tool for sending the contact form contents onto my personal email account. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Inbox&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The objective is the form contents should arrive into my Gmail inbox for me to read and action if necessary. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Thank you page&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The last activity of the Lambda function is to redirect the submitted form back to the website's thank you page which will have to be constructed as part of this exercise. The redirect will be a 307 to preserve the POSTed parameters that can be parsed and injected into the thank you message with a few lines of JavaScript.&lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/lambda" hreflang="en"&gt;lambda&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Wed, 26 Dec 2018 11:06:18 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">162 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: JavaScript Search Client</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-javascript-search-client</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: JavaScript Search Client&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Sat, 15/12/2018 - 10:19&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;We now need to plug the Elasticsearch query that was built in &lt;a href="http://badzilla.co.uk/drupal-8-static-site-elasticsearch-query"&gt;the previous blog&lt;/a&gt; into a JavaScript client that has been loaded on the search page as described in another &lt;a href="http://badzilla.co.uk/drupal-8-static-site-search-architecture-and-drupal-configuration"&gt;earlier blog&lt;/a&gt;. So a few lines of JavaScript will be required here, and it will need to work on my three environments:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Sandbox Drupal site connecting to local Elasticsearch server.&lt;/li&gt;
	&lt;li&gt;Sandbox static site connecting to local Elasticsearch server.&lt;/li&gt;
	&lt;li&gt;Production static site connecting to production Elasticsearch server. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The JavaScript will use the elasticsearch.js API library which can be downloaded from &lt;a href="https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html"&gt;here&lt;/a&gt;. We need to make our theme aware of our JavaScript files and we only wanted them loading on the node search page route. Our JavaScript file will be called beezee_elastic.js, which is the name of my theme (beezee8) and elastic obviously.  &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Add the JavaScript to the Beezee theme&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Firstly we need an entry in our theme's info.yml file under the Libraries heading. &lt;br /&gt;
&lt;strong&gt;beezee8.info.yml&lt;/strong&gt;&lt;br /&gt;
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;libraries:
  - &lt;span style="color: #ff0000;"&gt;'beezee8/elastic-library'&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Next we need to append to the libraries yml file the location of our JavaScript files - the Elastic API library and our own personal script. &lt;br /&gt;
&lt;strong&gt;beezee8.libraries.yml&lt;/strong&gt;
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;elastic-library:
  js:
    js&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;elasticsearch-js&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;elasticsearch.min.js: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    js&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;beezee&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;beezee_elastic.js: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt; &lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Obviously we then have to copy our JS files into the filesystem at those locations - for now I will have a placeholder empty file for beezee_elastic.js which we will flesh out later.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Load the JavaScript files on the search page only&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;There are a few ways of doing this, but my favourite is to use a preprocessor function in the {themename}.theme file. We can use hook_preprocess_page for this.&lt;br /&gt;
&lt;strong&gt;beezee8.theme&lt;/strong&gt;
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #FF8000"&gt;/**&lt;br /&gt; * @param $variables&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;function &lt;/span&gt;&lt;span style="color: #0000BB"&gt;beezee8_preprocess_page&lt;/span&gt;&lt;span style="color: #007700"&gt;(&amp;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$variables&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// If we are on the search page, load the JS search client api&lt;br /&gt;    // and our implementation to Elasticsearch&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #007700"&gt;if (\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;::&lt;/span&gt;&lt;span style="color: #0000BB"&gt;routeMatch&lt;/span&gt;&lt;span style="color: #007700"&gt;()-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getRouteName&lt;/span&gt;&lt;span style="color: #007700"&gt;() == &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'search.view_node_search'&lt;/span&gt;&lt;span style="color: #007700"&gt;) {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$variables&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#attached'&lt;/span&gt;&lt;span style="color: #007700"&gt;][&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'library'&lt;/span&gt;&lt;span style="color: #007700"&gt;][] = &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'beezee8/elastic-library'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;The JavaScript search client&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Ok so finally we are ready to build out our front end search client. Here we go!&lt;br /&gt;
&lt;strong&gt;beezee_elastic.js&lt;/strong&gt;
&lt;div class="geshifilter"&gt;&lt;div class="javascript geshifilter-javascript" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;function&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;$&lt;span style="color: #339933;"&gt;,&lt;/span&gt; Drupal&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
 
    &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; elastic_once&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
    &lt;span style="color: #000066; font-weight: bold;"&gt;function&lt;/span&gt; BeezeeElastic&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
        &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #339933;"&gt;!&lt;/span&gt;elastic_once&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
            elastic_once &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #003366; font-weight: bold;"&gt;true&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
            &lt;span style="color: #006600; font-style: italic;"&gt;// Get the params from the url&lt;/span&gt;
            &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; pageURL &lt;span style="color: #339933;"&gt;=&lt;/span&gt; window.&lt;span style="color: #660066;"&gt;location&lt;/span&gt;.&lt;span style="color: #660066;"&gt;search&lt;/span&gt;.&lt;span style="color: #660066;"&gt;substring&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
            &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; URLVariables &lt;span style="color: #339933;"&gt;=&lt;/span&gt; pageURL.&lt;span style="color: #660066;"&gt;split&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;'&amp;'&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
            &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; keys&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
            i &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;0&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
            while &lt;span style="color: #009900;"&gt;(&lt;/span&gt;i &lt;span style="color: #339933;"&gt;&lt;&lt;/span&gt; URLVariables.&lt;span style="color: #660066;"&gt;length&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; ParameterName &lt;span style="color: #339933;"&gt;=&lt;/span&gt; URLVariables&lt;span style="color: #009900;"&gt;[&lt;/span&gt;i&lt;span style="color: #009900;"&gt;]&lt;/span&gt;.&lt;span style="color: #660066;"&gt;split&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;'='&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;ParameterName&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt; &lt;span style="color: #339933;"&gt;==&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;'keys'&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                    keys &lt;span style="color: #339933;"&gt;=&lt;/span&gt; ParameterName&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                i&lt;span style="color: #339933;"&gt;++;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
 
            &lt;span style="color: #006600; font-style: italic;"&gt;// Did we get anything from the URL? If not bail, otherwise do the search.&lt;/span&gt;
            &lt;span style="color: #006600; font-style: italic;"&gt;// We shouldn't get to here so don't show a message to user.&lt;/span&gt;
            &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #339933;"&gt;!&lt;/span&gt;keys&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                console.&lt;span style="color: #660066;"&gt;log&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;'Invalid keys'&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #000066; font-weight: bold;"&gt;return&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
 
            &lt;span style="color: #006600; font-style: italic;"&gt;// Add the search key to the h1 selector&lt;/span&gt;
            $&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;"h1"&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;.&lt;span style="color: #660066;"&gt;append&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;Drupal.&lt;span style="color: #660066;"&gt;t&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;" for "&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; keys&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
            &lt;span style="color: #006600; font-style: italic;"&gt;// Endpoint defined during instantiation of API Client&lt;/span&gt;
            &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; client &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;new&lt;/span&gt; elasticsearch.&lt;span style="color: #660066;"&gt;Client&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                host&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;'http://meedjum.test:9200/'&lt;/span&gt; &lt;span style="color: #006600; font-style: italic;"&gt;/*,*/&lt;/span&gt;
                &lt;span style="color: #006600; font-style: italic;"&gt;/* log: 'trace' */&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
            client.&lt;span style="color: #660066;"&gt;search&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                index&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;'elasticsearch_index_badzilla_meedjum_staticcontent'&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                body&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                    query&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                        function_score&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                            query&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                                query_string&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                                    query&lt;span style="color: #339933;"&gt;:&lt;/span&gt; keys&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                                    fields&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;[&lt;/span&gt;
                                        &lt;span style="color: #3366CC;"&gt;"title"&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                                        &lt;span style="color: #3366CC;"&gt;"*body"&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                                        &lt;span style="color: #3366CC;"&gt;"term"&lt;/span&gt;
                                    &lt;span style="color: #009900;"&gt;]&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                                    default_operator&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"OR"&lt;/span&gt;
                                &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                            &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                            functions&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;[&lt;/span&gt;
                                &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                                    linear&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                                        &lt;span style="color: #3366CC;"&gt;"created"&lt;/span&gt;&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                                            origin&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"now"&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                                            offset&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"365d"&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                                            scale&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"1460d"&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                                            decay&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;0.5&lt;/span&gt;
                                        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                                    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                                &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                            &lt;span style="color: #009900;"&gt;]&lt;/span&gt;
                        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                    highlight&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                        number_of_fragments&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;1&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                        pre_tags&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;"&lt;strong&gt;"&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                        post_tags&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;"&lt;/strong&gt;"&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                        fragment_size&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;400&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                        no_match_size&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;400&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                        phrase_limit&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;1&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                        fields&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                            &lt;span style="color: #3366CC;"&gt;"*body"&lt;/span&gt;&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                            &lt;span style="color: #3366CC;"&gt;"title"&lt;/span&gt;&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                            &lt;span style="color: #3366CC;"&gt;"term"&lt;/span&gt;&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;&lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt;
                    size&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;10&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #339933;"&gt;,&lt;/span&gt; response&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
            &lt;span style="color: #006600; font-style: italic;"&gt;/*
             Process the response from Elastic
             */&lt;/span&gt;
            &lt;span style="color: #000066; font-weight: bold;"&gt;function&lt;/span&gt; response&lt;span style="color: #009900;"&gt;(&lt;/span&gt;err&lt;span style="color: #339933;"&gt;,&lt;/span&gt; resp&lt;span style="color: #339933;"&gt;,&lt;/span&gt; status&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
 
                &lt;span style="color: #006600; font-style: italic;"&gt;// Are we logged in? If so our jQuery calls will be slightly different due to additional DOM stuff&lt;/span&gt;
                &lt;span style="color: #006600; font-style: italic;"&gt;// for non anonymous&lt;/span&gt;
                &lt;span style="color: #006600; font-style: italic;"&gt;// These are our targets for injecting the content on the page. Markup is Bootstrap 3&lt;/span&gt;
                &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; h1_find&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; h2_find&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;$&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;".user-logged-in"&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;.&lt;span style="color: #660066;"&gt;length&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                    h1_find &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"h1 + nav:last-child"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                    h2_find &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"h1 + nav + h2:last-child"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;else&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                    h1_find &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"h1"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                    h2_find &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"h1 + h2:last-child"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
 
                &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; hits &lt;span style="color: #339933;"&gt;=&lt;/span&gt; resp.&lt;span style="color: #660066;"&gt;hits&lt;/span&gt;.&lt;span style="color: #660066;"&gt;hits&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
                &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;resp.&lt;span style="color: #660066;"&gt;hits&lt;/span&gt;.&lt;span style="color: #660066;"&gt;total&lt;/span&gt; &lt;span style="color: #339933;"&gt;==&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                    $&lt;span style="color: #009900;"&gt;(&lt;/span&gt;h1_find&lt;span style="color: #009900;"&gt;)&lt;/span&gt;.&lt;span style="color: #660066;"&gt;after&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;"&lt;h3&gt;"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; Drupal.&lt;span style="color: #660066;"&gt;t&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;"Your search yielded no results."&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;/h3&gt;"&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                &lt;span style="color: #000066; font-weight: bold;"&gt;else&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                    $&lt;span style="color: #009900;"&gt;(&lt;/span&gt;h1_find&lt;span style="color: #009900;"&gt;)&lt;/span&gt;.&lt;span style="color: #660066;"&gt;after&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;"&lt;h2&gt;"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; Drupal.&lt;span style="color: #660066;"&gt;t&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;"Search results"&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;/h2&gt;"&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
                    &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; inject &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;ol&gt;"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                    $.&lt;span style="color: #660066;"&gt;each&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;hits&lt;span style="color: #339933;"&gt;,&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;function&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;key&lt;span style="color: #339933;"&gt;,&lt;/span&gt; value&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
 
                        &lt;span style="color: #006600; font-style: italic;"&gt;// Url, title and Body&lt;/span&gt;
                        &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; prefix &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;li&gt;&lt;h3&gt;"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                        &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; suffix &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;/li&gt;"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                        &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; title &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;a href=&lt;span style="color: #000099; font-weight: bold;"&gt;\"&lt;/span&gt;"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; value._source.&lt;span style="color: #660066;"&gt;url&lt;/span&gt;&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;span style="color: #000099; font-weight: bold;"&gt;\"&lt;/span&gt;&gt;"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; value.&lt;span style="color: #660066;"&gt;highlight&lt;/span&gt;.&lt;span style="color: #660066;"&gt;title&lt;/span&gt;&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;/a&gt;&lt;/h3&gt;"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
                        &lt;span style="color: #006600; font-style: italic;"&gt;// do we have a book body or a paragraph body?&lt;/span&gt;
                        &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; body&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                        &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;typeof&lt;/span&gt; value.&lt;span style="color: #660066;"&gt;highlight&lt;/span&gt;.&lt;span style="color: #660066;"&gt;blog_body&lt;/span&gt; &lt;span style="color: #339933;"&gt;!=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;'undefined'&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                            body &lt;span style="color: #339933;"&gt;=&lt;/span&gt; value.&lt;span style="color: #660066;"&gt;highlight&lt;/span&gt;.&lt;span style="color: #660066;"&gt;blog_body&lt;/span&gt;&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                        &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;else&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                            body &lt;span style="color: #339933;"&gt;=&lt;/span&gt; value.&lt;span style="color: #660066;"&gt;highlight&lt;/span&gt;.&lt;span style="color: #660066;"&gt;body&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
                        body &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;p&gt;"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; body &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;/p&gt;"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
                        inject &lt;span style="color: #339933;"&gt;+=&lt;/span&gt; prefix &lt;span style="color: #339933;"&gt;+&lt;/span&gt; title &lt;span style="color: #339933;"&gt;+&lt;/span&gt; body &lt;span style="color: #339933;"&gt;+&lt;/span&gt; suffix&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
                        &lt;span style="color: #006600; font-style: italic;"&gt;// Add the tag&lt;/span&gt;
                        &lt;span style="color: #000066; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;typeof&lt;/span&gt; value.&lt;span style="color: #660066;"&gt;highlight&lt;/span&gt;.&lt;span style="color: #660066;"&gt;term&lt;/span&gt; &lt;span style="color: #339933;"&gt;!=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;'undefined'&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
                            inject &lt;span style="color: #339933;"&gt;+=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;p&gt;"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; Drupal.&lt;span style="color: #660066;"&gt;t&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;"Tag:"&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;" "&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; value.&lt;span style="color: #660066;"&gt;highlight&lt;/span&gt;.&lt;span style="color: #660066;"&gt;term&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;/p&gt;"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
 
                        &lt;span style="color: #006600; font-style: italic;"&gt;// Author and date&lt;/span&gt;
                        &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; gb_obj &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style=""&gt;Date&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;value._source.&lt;span style="color: #660066;"&gt;created&lt;/span&gt;&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt; &lt;span style="color: #339933;"&gt;*&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;1000&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                        &lt;span style="color: #000066; font-weight: bold;"&gt;var&lt;/span&gt; gb_date &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;'0'&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; gb_obj.&lt;span style="color: #660066;"&gt;getDate&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;.&lt;span style="color: #660066;"&gt;slice&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #339933;"&gt;-&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;2&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt;
                            &lt;span style="color: #3366CC;"&gt;"/"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #3366CC;"&gt;'0'&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;gb_obj.&lt;span style="color: #660066;"&gt;getMonth&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #CC0000;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;.&lt;span style="color: #660066;"&gt;slice&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #339933;"&gt;-&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;2&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt;
                            &lt;span style="color: #3366CC;"&gt;"/"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; gb_obj.&lt;span style="color: #660066;"&gt;getFullYear&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt;
                            &lt;span style="color: #3366CC;"&gt;" "&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"-"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&amp;nbsp"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt;
                            gb_obj.&lt;span style="color: #660066;"&gt;getHours&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;":"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt;
                            gb_obj.&lt;span style="color: #660066;"&gt;getMinutes&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
                        inject &lt;span style="color: #339933;"&gt;+=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;p&gt;"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; value._source.&lt;span style="color: #660066;"&gt;author&lt;/span&gt;&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #CC0000;"&gt;0&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;" "&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"-"&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;" "&lt;/span&gt; &lt;span style="color: #339933;"&gt;+&lt;/span&gt; gb_date&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
 
                    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                    inject &lt;span style="color: #339933;"&gt;+=&lt;/span&gt; &lt;span style="color: #3366CC;"&gt;"&lt;/ol&gt;"&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                    $&lt;span style="color: #009900;"&gt;(&lt;/span&gt;h2_find&lt;span style="color: #009900;"&gt;)&lt;/span&gt;.&lt;span style="color: #660066;"&gt;after&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;inject&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
                &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
            &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
 
 
    Drupal.&lt;span style="color: #660066;"&gt;behaviors&lt;/span&gt;.&lt;span style="color: #660066;"&gt;beezee_elastic&lt;/span&gt; &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
        attach&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;function&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;context&lt;span style="color: #339933;"&gt;,&lt;/span&gt; settings&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt;
            BeezeeElastic&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
        &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
    &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;
&lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;jQuery&lt;span style="color: #339933;"&gt;,&lt;/span&gt; Drupal&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Code commentary&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;I'd like to think the code is self-explanatory, but here are a few words for additional clarification. &lt;/p&gt;
&lt;p&gt;The first block of code is processing the URL params. We are expecting the &lt;em&gt;?keys={search_phrase}&lt;/em&gt;. The search phrase needs to be injected into the Elasticsearch query later. &lt;/p&gt;
&lt;p&gt;The &lt;em&gt;client&lt;/em&gt; object is returned from me instantiating the Elasticsearch API. I needed a parameter of the Elasticsearch endpoint which is currently hardcoded. It will work for my two sandbox environments (Drupal and static) but not for production. I will have to come up with a solution to rewrite the endpoint during the deployment process!&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;client.search&lt;/em&gt; call is our query created earlier, and I have added the search term from the URL. The Elasticsearch API provides two mechanisms for this call - it can return a promise or invoke a callback. I opted for the latter. &lt;/p&gt;
&lt;p&gt;The &lt;em&gt;response&lt;/em&gt; function is the callback and it handles the Elastic response. My first task is to set the selectors where I will inject the results - note that the DOM is different whether I am logged into my sandbox Drupal or not - so my injection anchor points are different dependent upon this circumstance. &lt;/p&gt;
&lt;p&gt;I add the title, body text, tag, author and published date to my output, concatenating them together, and then inject them into the content area of the screen around ordered list tags. &lt;/p&gt;
&lt;p&gt;The next result is very similar visually to the default Drupal core search with the addition of my blog tags, although of course it can be styled differently if wanted. &lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;The results&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-15%20at%2015.04.52.png?itok=ZnDNHXFC 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-12/Screenshot%202018-12-15%20at%2015.04.52.png?itok=w9IqdciG 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-12/Screenshot%202018-12-15%20at%2015.04.52.png?itok=WNHqHJYw 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-12/Screenshot%202018-12-15%20at%2015.04.52.png?itok=XruPF1MZ 1766w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-12/Screenshot%202018-12-15%20at%2015.04.52.png?itok=ZnDNHXFC" alt="results" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The script works well on both the Drupal and static sites in sandbox. The screenshot above shows a search on the word &lt;em&gt;nginx&lt;/em&gt;. At the moment I haven't built in a paginator, but that could come along later. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/js" hreflang="en"&gt;JavaScript&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Sat, 15 Dec 2018 10:19:04 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">161 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: Elasticsearch Query</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-elasticsearch-query</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: Elasticsearch Query&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Wed, 28/11/2018 - 14:35&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The most fundamental part of the search is the query - this will determine which documents will be retrieved after a search. It must obviously reflect the search phrase input into the search form, and the results returned should be presented in an order of most relevant first. &lt;/p&gt;

&lt;p&gt;Elasticsearch is excellent at this - but it's crucial that the query reflects exactly what I want to achieve and it searches the correct fields. No two sites are the same and therefore no two search requirements are identical. I have decided that I want to search on the following:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Blog title&lt;/li&gt;
	&lt;li&gt;Blog body text (a custom defined Paragraph type)&lt;/li&gt;
	&lt;li&gt;Body text (only used with the book content type and not my regular blogs)&lt;/li&gt;
	&lt;li&gt;Technology vocabulary which I use to tag my blog&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each of these will be assigned a score during the search process and the results delivered back in high to low score order.&lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Initial basic query&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Unless you re an expert in Elastsearch queries (I am definitely not that), you will need a useful tool with automatic syntax suggestions, and lo and behold Kibana is excellent at this. My first stab at the query is shown below, and it behaved pretty much to my expectations
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;GET &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;myindex&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;_search
&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
  &lt;span style="color: #ff0000;"&gt;"query"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"query_string"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
           &lt;span style="color: #ff0000;"&gt;"query"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"Search phrase here"&lt;/span&gt;,
           &lt;span style="color: #ff0000;"&gt;"fields"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
              &lt;span style="color: #ff0000;"&gt;"title"&lt;/span&gt;,
              &lt;span style="color: #ff0000;"&gt;"*body"&lt;/span&gt;,
              &lt;span style="color: #ff0000;"&gt;"term"&lt;/span&gt;
              &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"default_operator"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"or"&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
  &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
  &lt;span style="color: #ff0000;"&gt;"highlight"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"number_of_fragments"&lt;/span&gt; : &lt;span style="color: #000000;"&gt;1&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"pre_tags"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;"&lt;strong&gt;"&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"post_tags"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;"&lt;/strong&gt;"&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"fragment_size"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;400&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"no_match_size"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;400&lt;/span&gt;,
        &lt;span style="color: #ff0000;"&gt;"phrase_limit"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;1&lt;/span&gt;,        
        &lt;span style="color: #ff0000;"&gt;"fields"&lt;/span&gt; : &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"*body"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"title"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
            &lt;span style="color: #ff0000;"&gt;"term"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
  &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
  &lt;span style="color: #ff0000;"&gt;"size"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;10&lt;/span&gt;
&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Some of this is self-explanatory, some less so. Let's cherry pick our explanations.&lt;br /&gt;
&lt;strong&gt;*body&lt;/strong&gt; - I have two fields which contain the word body and these can be searched using a wildcard.&lt;br /&gt;
&lt;strong&gt;highlight&lt;/strong&gt; - This is where I specify what I actually want to display back to the end user. The following parameters defined this. &lt;br /&gt;
&lt;strong&gt;number_of_fragments&lt;/strong&gt; - The maximum number of fragments to return.&lt;br /&gt;
&lt;strong&gt;pre_tags&lt;/strong&gt; and &lt;strong&gt;post_tags&lt;/strong&gt; - When the search term is found, we can specify what tags we want before and after. I chose &lt;strong&gt;strong&lt;/strong&gt; instead of the default &lt;strong&gt;em&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;fragment_size&lt;/strong&gt; - How many characters the snipped of the find will contain as a maximum, although it could be less depending upon how Elasticsearch's paragraph and line break algorithm interprets the result&lt;br /&gt;
&lt;strong&gt;no_match_size&lt;/strong&gt; - As above if there are no matches in a particular field. I still want to show the snippet so the user has got some context.&lt;br /&gt;
&lt;strong&gt;phrase_limit&lt;/strong&gt; - Controls the number of matching phrases in a document that are considered.&lt;br /&gt;&lt;br /&gt;
The major shortcoming of this query is it shows no favouritism towards the date the blog is published. Whether it was published yesterday or ten years ago, the score will be same.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Adding a date decay to favour more recent blogs&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/DateDecay.png?itok=hlw5y4c6 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/DateDecay.png?itok=g_CEfRV0 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/DateDecay.png?itok=9dtA-6wg 813w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/DateDecay.png?itok=hlw5y4c6" alt="Elasticsearch date decay" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Technical blogs are ephemeral and transitory. They tend to have a shelf life when they are very popular, but then their popularity will wane as time goes by. This can be due to a number of factors - such as the popularity of the subject of the blog, the technology written about evolving thus obsoleting the origin blog, and the subject of the blog becoming commonplace or covered more extensively in official documentation.&lt;/p&gt;
&lt;p&gt;Therefore we need a mechanism to favour newer blogs in our search that will be more relevant to our users. Elasticsearch has the &lt;strong&gt;decay&lt;/strong&gt; feature, and it supports three different mathematical formula. There is &lt;em&gt;gauss&lt;/em&gt;, &lt;em&gt;linear&lt;/em&gt; and &lt;em&gt;exp&lt;/em&gt;. I had a think here - I could use the default Gaussian approach and with some subtle parameter settings I think it would have done a good job. I could also have used Exponential, with the relatively shallow curve to present the passing of time. In the end I decided I liked a linear representation. &lt;/p&gt;
&lt;p&gt;My rationale is this: A blog will be totally relevant for about a year, then it will decay at a linear rate for a number of years, then it will hit the bottom. Sheer speculation drove me to use a total decay period of eight years although I concede this is somewhat arbitrary and probably sub-optimal. &lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;br /&gt;The syntax for representing this is a little arcane. Here we go:
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #ff0000;"&gt;"function_score"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
  &lt;span style="color: #ff0000;"&gt;"functions"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
      &lt;span style="color: #ff0000;"&gt;"linear"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"created"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
          &lt;span style="color: #ff0000;"&gt;"origin"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"now"&lt;/span&gt;,
          &lt;span style="color: #ff0000;"&gt;"offset"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"365d"&lt;/span&gt;, 
          &lt;span style="color: #ff0000;"&gt;"scale"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1460d"&lt;/span&gt;,
          &lt;span style="color: #ff0000;"&gt;"decay"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;0.5&lt;/span&gt;
          &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
      &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
  &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Here is the commentary:&lt;br /&gt;
&lt;strong&gt;created&lt;/strong&gt;  - This is the name of the date field for the date the content was published&lt;br /&gt;
&lt;strong&gt;origin&lt;/strong&gt; - The start point for our time span, which will always be anchored at the current date.&lt;br /&gt;
&lt;strong&gt;offset&lt;/strong&gt; - This is the initial flat spot at the top of the graph above. I am saying here - all documents in the first year will be scored equally from a date created perspective.&lt;br /&gt;
&lt;strong&gt;scale&lt;/strong&gt; - Defines the distance from origin + offset at which the computed score will equal decay parameter. &lt;br /&gt;
&lt;strong&gt;decay&lt;/strong&gt; - The decay parameter defines how documents are scored at the distance given at scale. So if you divide decay into scale you get the figure of 8 years.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;The complete query&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Adding the decay to the initial query means that they &lt;strong&gt;multiplied together&lt;/strong&gt; (inferred by default).
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;GET &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;myindex&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;_search
&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
 
  &lt;span style="color: #ff0000;"&gt;"query"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff0000;"&gt;"function_score"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
      &lt;span style="color: #ff0000;"&gt;"query"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff0000;"&gt;"query_string"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
          &lt;span style="color: #ff0000;"&gt;"query"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"Search phrase here"&lt;/span&gt;,
             &lt;span style="color: #ff0000;"&gt;"fields"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
                &lt;span style="color: #ff0000;"&gt;"title"&lt;/span&gt;,
                &lt;span style="color: #ff0000;"&gt;"*body"&lt;/span&gt;,
                &lt;span style="color: #ff0000;"&gt;"term"&lt;/span&gt;   
             &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
             &lt;span style="color: #ff0000;"&gt;"default_operator"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"OR"&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
      &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
      &lt;span style="color: #ff0000;"&gt;"functions"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
          &lt;span style="color: #ff0000;"&gt;"linear"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff0000;"&gt;"created"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
              &lt;span style="color: #ff0000;"&gt;"origin"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"now"&lt;/span&gt;,
              &lt;span style="color: #ff0000;"&gt;"offset"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"365d"&lt;/span&gt;, 
              &lt;span style="color: #ff0000;"&gt;"scale"&lt;/span&gt;: &lt;span style="color: #ff0000;"&gt;"1460d"&lt;/span&gt;,
              &lt;span style="color: #ff0000;"&gt;"decay"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;0.5&lt;/span&gt;
            &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
          &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
      &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
  &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"highlight"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff0000;"&gt;"number_of_fragments"&lt;/span&gt; : &lt;span style="color: #000000;"&gt;1&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"pre_tags"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;"&lt;strong&gt;"&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"post_tags"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;"&lt;/strong&gt;"&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"fragment_size"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;400&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"no_match_size"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;400&lt;/span&gt;,
    &lt;span style="color: #ff0000;"&gt;"phrase_limit"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;1&lt;/span&gt;,        
    &lt;span style="color: #ff0000;"&gt;"fields"&lt;/span&gt; : &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
      &lt;span style="color: #ff0000;"&gt;"*body"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
      &lt;span style="color: #ff0000;"&gt;"title"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
      &lt;span style="color: #ff0000;"&gt;"term"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
    &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
  &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
  &lt;span style="color: #ff0000;"&gt;"size"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;10&lt;/span&gt;
&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Wed, 28 Nov 2018 14:35:57 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">160 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: Disable Core Search</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-disable-core-search</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: Disable Core Search&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Sun, 18/11/2018 - 10:04&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Since the static site will not have access to the Drupal 8 Core Search facility, it can be removed by using the command &lt;em&gt;drush pm_uninstall search&lt;/em&gt; on the command line, or by visiting &lt;em&gt;admin/modules/uninstall.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The problem with that approach is core search also has the search form that appears as a block in the navbar on every page of my website. If I uninstall core search I lose the form at the same time. It is my desire to keep on using the search form despite having an Elasticsearch backend. The proposed Elasticsearch JavaScript client will be installed on the /search route which is where the core search form action is directed to. &lt;/p&gt;
&lt;p&gt;Okay, so feasibly I could uninstall the core search and do either:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a custom block with a search form that replicates (from an HTML frontend perspective) the core search form.&lt;/li&gt;
&lt;li&gt;Copy the generated markup from the core search form, and paste it into the page template.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I don't like either approach. I would prefer to keep the core search and stub it so it doesn't actually do any backend searching. That way I will have near identical functionality for both my sandbox static and sandbox Drupal sites. &lt;/p&gt;
&lt;p&gt;To stub the search I would have to alter the default search route and replace it with my own custom route with a controller that returns nothing.&lt;/p&gt;
&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Define the route subscriber config&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;The first step is to add to our custom module's services file.&lt;br /&gt;
&lt;strong&gt;badzilla_static.services.yml&lt;/strong&gt;
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;  &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;-- previous entry snipped --&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
  badzilla.route_subscriber:
      class: Drupal\badzilla_static\Routing\RouteSubscriber
      tags:
        - &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt; name: event_subscriber &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
We have now defined where our route subscriber lives. Let's create.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Route subscriber class&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;We need to create the directory structure and the file itself first.
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;mkdir&lt;/span&gt;  src&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Routing
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;touch&lt;/span&gt; src&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Routing&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;RouteSubscriber.php&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
And the file contents are: &lt;br /&gt;
&lt;strong&gt;RouteSubscriber.php&lt;/strong&gt;
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #FF8000"&gt;/**&lt;br /&gt;* @file&lt;br /&gt;* Contains \Drupal\mymodule\Routing\RouteSubscriber.&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;namespace &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;badzilla_static&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Routing&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;use &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Core&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Routing&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;RouteSubscriberBase&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;use &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Symfony&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Component&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Routing&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;RouteCollection&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #FF8000"&gt;/**&lt;br /&gt;* Listens to the dynamic route events.&lt;br /&gt;*/&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;class &lt;/span&gt;&lt;span style="color: #0000BB"&gt;RouteSubscriber &lt;/span&gt;&lt;span style="color: #007700"&gt;extends &lt;/span&gt;&lt;span style="color: #0000BB"&gt;RouteSubscriberBase &lt;/span&gt;&lt;span style="color: #007700"&gt;{&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #FF8000"&gt;/**&lt;br /&gt;    * {@inheritdoc}&lt;br /&gt;    */&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #007700"&gt;public function &lt;/span&gt;&lt;span style="color: #0000BB"&gt;alterRoutes&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;RouteCollection $collection&lt;/span&gt;&lt;span style="color: #007700"&gt;)&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #FF8000"&gt;// Replace dynamically created "search.view_node_search" route's Controller with my own.&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #007700"&gt;if (&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$route &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$collection&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;get&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'search.view_node_search'&lt;/span&gt;&lt;span style="color: #007700"&gt;)) {&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$route&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;setDefault&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'_controller'&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'\Drupal\badzilla_static\Controller\BadzillaStaticSearchController::view'&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
Here I am replacing the built-in search module's controller with my own. Now let's build out my own do-nothing controller.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Custom search controller&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;As previously, create the file structure.
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;mkdir&lt;/span&gt; src&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Controller
$ &lt;span style="color: #c20cb9; font-weight: bold;"&gt;touch&lt;/span&gt; src&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;Controller&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;BadzillaStaticSearchController.php&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Here's the controller in all its glory.&lt;br /&gt;
&lt;strong&gt;BadzillaStaticSearchController.php&lt;/strong&gt;
&lt;div class="codeblock geshifilter"&gt;&lt;code&gt;&lt;span style="color: #000000"&gt;&lt;span style="color: #0000BB"&gt;&lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;namespace &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;badzilla_static&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Controller&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;use &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;search&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;SearchPageInterface&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;use &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Symfony&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Component&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;HttpFoundation&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Request&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;use &lt;/span&gt;&lt;span style="color: #0000BB"&gt;Drupal&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;search&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Controller&lt;/span&gt;&lt;span style="color: #007700"&gt;\&lt;/span&gt;&lt;span style="color: #0000BB"&gt;SearchController&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #FF8000"&gt;/**&lt;br /&gt; * Override the Route controller for search.&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;class &lt;/span&gt;&lt;span style="color: #0000BB"&gt;BadzillaStaticSearchController &lt;/span&gt;&lt;span style="color: #007700"&gt;extends &lt;/span&gt;&lt;span style="color: #0000BB"&gt;SearchController &lt;/span&gt;&lt;span style="color: #007700"&gt;{&lt;br /&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #FF8000"&gt;/**&lt;br /&gt;     * {@inheritdoc}&lt;br /&gt;     */&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: #007700"&gt;public function &lt;/span&gt;&lt;span style="color: #0000BB"&gt;view&lt;/span&gt;&lt;span style="color: #007700"&gt;(&lt;/span&gt;&lt;span style="color: #0000BB"&gt;Request $request&lt;/span&gt;&lt;span style="color: #007700"&gt;, &lt;/span&gt;&lt;span style="color: #0000BB"&gt;SearchPageInterface $entity&lt;/span&gt;&lt;span style="color: #007700"&gt;)&lt;br /&gt;    {&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$build &lt;/span&gt;&lt;span style="color: #007700"&gt;= [];&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$plugin &lt;/span&gt;&lt;span style="color: #007700"&gt;= &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$entity&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getPlugin&lt;/span&gt;&lt;span style="color: #007700"&gt;();&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$build&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#title'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$plugin&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;suggestedTitle&lt;/span&gt;&lt;span style="color: #007700"&gt;();&lt;br /&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$results &lt;/span&gt;&lt;span style="color: #007700"&gt;= [];&lt;br /&gt;        &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$build&lt;/span&gt;&lt;span style="color: #007700"&gt;[&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'search_results'&lt;/span&gt;&lt;span style="color: #007700"&gt;] = [&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#theme' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'item_list__search_results__' &lt;/span&gt;&lt;span style="color: #007700"&gt;. &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$plugin&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getPluginId&lt;/span&gt;&lt;span style="color: #007700"&gt;(),&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'item_list__search_results'&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;            ],&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#items' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$results&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#empty' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#markup' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #DD0000"&gt;''&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;            ],&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#list_type' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'ol'&lt;/span&gt;&lt;span style="color: #007700"&gt;,&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'#context' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; [&lt;br /&gt;                &lt;/span&gt;&lt;span style="color: #DD0000"&gt;'plugin' &lt;/span&gt;&lt;span style="color: #007700"&gt;=&gt; &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$plugin&lt;/span&gt;&lt;span style="color: #007700"&gt;-&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;getPluginId&lt;/span&gt;&lt;span style="color: #007700"&gt;(),&lt;br /&gt;            ],&lt;br /&gt;        ];&lt;br /&gt;&lt;br /&gt;        return &lt;/span&gt;&lt;span style="color: #0000BB"&gt;$build&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
The view function must return a render array, and so I have honoured the convention of the parent SearchController::view to large extent although obviously in my case there will always be no results returned. A useful stub!&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Clear Rebuild and Test&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-18_at_15_22_08-edited.png?itok=SkBm2FM6 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot_2018-11-18_at_15_22_08-edited.png?itok=ckGbh1Np 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot_2018-11-18_at_15_22_08-edited.png?itok=a925Zvff 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot_2018-11-18_at_15_22_08-edited.png?itok=9SaizRUC 2314w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-18_at_15_22_08-edited.png?itok=SkBm2FM6" alt="Seach1" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-18_at_15_21_23-edited.png?itok=Hx9JuUhC 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot_2018-11-18_at_15_21_23-edited.png?itok=uFQLs4hF 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot_2018-11-18_at_15_21_23-edited.png?itok=MapWzEyf 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot_2018-11-18_at_15_21_23-edited.png?itok=5giBsaDr 2312w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-18_at_15_21_23-edited.png?itok=Hx9JuUhC" alt="Search2" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Since we've added to our services yaml file we need to do the customary cache rebuild for our changes to take effect. 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ drush cr
 &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;success&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt; Cache rebuild complete.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Next let's attempt a search on the dynamic and the static version of my sandbox Badzilla sites. The two screenshots above show that both the static and the dynamic version of the sandbox sites are correctly showing a blank search page. Next we have to plug in the client....&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/development" hreflang="en"&gt;Development&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/php" hreflang="en"&gt;PHP&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Sun, 18 Nov 2018 10:04:27 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">159 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: Search Architecture and Drupal Configuration</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-search-architecture-and-drupal-configuration</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: Search Architecture and Drupal Configuration&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Thu, 15/11/2018 - 14:21&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;As we've already discussed in earlier blogs, any successful odyssey towards a static version of the Badzilla blog using the Drupal module Tome will depend upon having a good replacement search facility in place. The built-in Drupal search won't work since there will be no back-end to process the search request. There are many alternative ways of achieving a viable search solution on a static site, and I've listed a few in my introductory page &lt;a href="http://badzilla.co.uk/Drupal8-Static"&gt;Drupal 8 as a Static Site&lt;/a&gt;. Ideally I would like a solution that will work on both my dynamic, 'Drupal' version of the site (i.e. where I create my content) and the Tome generated static version of the site (i.e. the version viewable by the public). &lt;/p&gt;

&lt;p&gt;To my mind, the obvious answer is Elasticsearch combined with a JavaScript client. I would have opted for Google Site Search but it was closed down in April 2018 and replaced with Custom Search Engine (CSE). CSE offers similar capabilities to Site Search but carries ads. That automatically deselects itself from consideration. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Elasticsearch Architecture&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;My proposed architecture is simplicity itself. I have a local sandboxed Virtual Machine with my development environment installed on it. For reference, as well as blatant self-promotion, I use the &lt;a href="https://github.com/sanddevil/badzillavm"&gt;BadzillaVM&lt;/a&gt; which is a Ubuntu image with a raft of utilities and tools pre-installed, including Elasticsearch. &lt;/p&gt;

&lt;p&gt;The architectural solution is to create an Elasticsearch index on my sandbox. To that end I'll use the Drupal Elasticsearch connector and the Search API modules. Every time content is added on to my local version of Drupal, the index will be updated automatically.&lt;/p&gt;

&lt;p&gt;I will then trigger an automated build process to generate the static pages and to dump the Elasticsearch index using elasticdump. This will then be deployed to badzilla.co.uk - the static html into the traditional /var/www/html structure on the prod server, and the elastic index imported into the Elasticsearch server I will have on prod. Clearly locking down the Elasticsearch instance on prod will be crucial - and we'll cover that later. &lt;/p&gt;

&lt;p&gt;Ok - so that's the theory. Let's see how easy (or otherwise) it is in practice. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Drupal configuration - Add and enable the modules&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;Let's make a start. Firstly we need to add and enable the two modules we'll be using - the Elasticsearch connector and the Search API. 
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;$ composer require drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;search_api
&lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;-snipped-&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
$ composer require drupal&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;elasticsearch_connector:^&lt;span style="color: #000000;"&gt;6.0&lt;/span&gt;-alpha1 
&lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;-snipped-&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
$ drush en search_api elasticsearch_connector &lt;span style="color: #660033;"&gt;-y&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Drupal configuration - Add an Elasticsearch cluster&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-15_at_16_14_39-edited.png?itok=HMLYbDcI 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot_2018-11-15_at_16_14_39-edited.png?itok=ANn7vl0Y 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot_2018-11-15_at_16_14_39-edited.png?itok=rHpe3VnE 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot_2018-11-15_at_16_14_39-edited.png?itok=jThwfjvE 2436w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-15_at_16_14_39-edited.png?itok=HMLYbDcI" alt="Cluster" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Navigate to admin/config/search/elasticsearch-connector/cluster/add to create a cluster. I have called mine the arbitrary BadzillaStatic and note I have pointed it to my local Elasticsearch instance on my sandbox with a url of http://localhost:9200&lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Drupal configuration - add a Search API server&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-16_at_16_27_15-edited.png?itok=vOfghKE2 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot_2018-11-16_at_16_27_15-edited.png?itok=i-j7uJIP 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot_2018-11-16_at_16_27_15-edited.png?itok=Dk3f-dO9 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot_2018-11-16_at_16_27_15-edited.png?itok=tYTG27xz 1946w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-16_at_16_27_15-edited.png?itok=vOfghKE2" alt="Search API Server" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot%202018-11-16%20at%2016.28.08.png?itok=aT0AjDMr 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot%202018-11-16%20at%2016.28.08.png?itok=eeTGzfg8 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot%202018-11-16%20at%2016.28.08.png?itok=_qIGljd5 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot%202018-11-16%20at%2016.28.08.png?itok=FsTOhhAU 1942w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot%202018-11-16%20at%2016.28.08.png?itok=aT0AjDMr" alt="Notification" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Now we have to add a Search API server - this is achieved by navigating to admin/config/search/search-api/add-server. I have added the name DrupalStatic, and I also checked that the cluster and the  backend were selected correctly. Once I submitted this form, I got an encouraging notification page suggesting everything went well. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Drupal Configuration: Add index&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-add-index-2018-11-16-16_43_01-edited.png?itok=l6TYaCqg 215w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-add-index-2018-11-16-16_43_01-edited.png?itok=3RXXshmH 429w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-add-index-2018-11-16-16_43_01-edited.png?itok=8GRe8uMW 858w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-add-index-2018-11-16-16_43_01-edited.png?itok=BtEsJNME 1716w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-add-index-2018-11-16-16_43_01-edited.png?itok=l6TYaCqg" alt="Index" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Navigate to admin/config/search/search-api/add-index to create a search index. Whilst the screenshot will be small, it is quite easy and intuitive to populate. Add an index name - I went for StaticContent. Then I ticked the 'Content' checkbox since that is all I want for my search. Further down I selected my content types. Many in my list are artefacts from my original D6 blog and not required any more. I checked English language, made sure the radio button for the search API server DrupalStatic was selected, and also made sure the Enabled checkbox is ticked. Finally I checked 'Index items immediately'. This is imperative for me since I don't want to wait for a cron run once I've create or updated content in my sandbox. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-fields-add-nojs-2018-11-16-16_46_27.-edited_0.png?itok=Xz0_5BCc 158w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-fields-add-nojs-2018-11-16-16_46_27.-edited_0.png?itok=M8W7Rmh2 315w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-fields-add-nojs-2018-11-16-16_46_27.-edited_0.png?itok=m3KXZwIM 631w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-fields-add-nojs-2018-11-16-16_46_27.-edited_0.png?itok=kpWsQPLd 1261w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-fields-add-nojs-2018-11-16-16_46_27.-edited_0.png?itok=Xz0_5BCc" alt="Fields" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Next fields have to be added to the index. This is where we need to be careful. For instance what I want for the 'authored by' field is not the default value - the uid - but the user name instead. so when picking the fields, it is necessary to expand the entries to ensure no ids are picked instead of the actual value. Don't forget we won't have views or any other backend preprocessor at our disposal and therefore we need real values and not primary keys. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-17_at_15_29_01-edited.png?itok=BMVjjq6c 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot_2018-11-17_at_15_29_01-edited.png?itok=55M5ncA4 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot_2018-11-17_at_15_29_01-edited.png?itok=4Ge0hB9- 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot_2018-11-17_at_15_29_01-edited.png?itok=Hc_8CuRX 2600w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-17_at_15_29_01-edited.png?itok=BMVjjq6c" alt="Field Management" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Next is the field management screen - this gives a good overview of what you have selected, and providing the fields are fulltext they can be boosted to increase their search precedence. I have done this for title, terms and body text although I reserve the right to loop back and change these values! Also note that in most instances I have changed the machine names to something more applicable. This will pay dividends later when we are dealing with data fetched by the client in the app's frontend. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-processors-2018-11-17-14_53_23.png?itok=_IPr-Kt1 187w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-processors-2018-11-17-14_53_23.png?itok=uK4eH06U 373w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-processors-2018-11-17-14_53_23.png?itok=q1LiJOCm 746w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-processors-2018-11-17-14_53_23.png?itok=_CCzEP9F 1492w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/screencapture-meedjum-test-admin-config-search-search-api-index-staticcontent-processors-2018-11-17-14_53_23.png?itok=_IPr-Kt1" alt="Processors" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;By clicking on the Processors tab there is the opportunity to fine tune the index. I won't go into these in any great detail since they are purely personal preference and the supporting text on the Processors page is self-explanatory. I elected for Entity Status, HTML Filter and Transliteration. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-16_at_16_52_38-edited.png?itok=AKeBX8e_ 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot_2018-11-16_at_16_52_38-edited.png?itok=ueAhahjp 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot_2018-11-16_at_16_52_38-edited.png?itok=XWc5RGdb 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot_2018-11-16_at_16_52_38-edited.png?itok=JzD2LNiU 2600w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-16_at_16_52_38-edited.png?itok=AKeBX8e_" alt="Indexing" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;Finally we are ready for indexing. This can be achieved through cron or by using UI and indexing the lot in one go by setting the parameters at the bottom of the screen. Note this doesn't mean the state of the index will be reflected on the server - double check everything has completed by referring to the ringed message in the screenshot above. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Checking the search works&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot%202018-11-17%20at%2015.46.03.png?itok=z7mDh34S 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot%202018-11-17%20at%2015.46.03.png?itok=_UfNMYYk 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot%202018-11-17%20at%2015.46.03.png?itok=BEwiVJan 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot%202018-11-17%20at%2015.46.03.png?itok=bRK9sZEM 2600w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot%202018-11-17%20at%2015.46.03.png?itok=z7mDh34S" alt="Kibana" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;If you are using Kibana, or even better Kibana in my BadzillaVM, then you can use this excellent tool to check the search is working. Point a browser to {your_ip}:5601 and then navigate to Dev Tools and apply the following query:
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;GET &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;elasticsearch_index_badzilla_meedjum_staticcontent&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;_search
&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
  &lt;span style="color: #ff0000;"&gt;"query"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff0000;"&gt;"match_all"&lt;/span&gt;: &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
  &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;,
  &lt;span style="color: #ff0000;"&gt;"size"&lt;/span&gt;: &lt;span style="color: #000000;"&gt;5&lt;/span&gt;
&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
and as per the screenshot above, you should see the results output. Note that your index in the query will be different.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Thu, 15 Nov 2018 14:21:18 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">158 at http://badzilla.co.uk</guid>
    </item>
<item>
  <title>Drupal 8 as a Static Site: Add feed.rss to web server config and views</title>
  <link>http://badzilla.co.uk/drupal-8-static-site-add-feedrss-web-server-config-and-views</link>
  <description>
&lt;span&gt;Drupal 8 as a Static Site: Add feed.rss to web server config and views&lt;/span&gt;

&lt;span&gt;&lt;span lang="" about="http://badzilla.co.uk/user/1" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;nigel&lt;/span&gt;&lt;/span&gt;

&lt;span&gt;Tue, 13/11/2018 - 14:16&lt;/span&gt;

      &lt;div class="field field--name-field-heading-image-text field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Fix Views RSS feeds paths&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01.png?itok=VoeQmD5h 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01.png?itok=mTwIxTbN 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01.png?itok=eYo8v6yF 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01.png?itok=x-Koyb-m 2486w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01.png?itok=VoeQmD5h" alt="Taxonomy Term" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01_0.png?itok=gM--2VeD 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01_0.png?itok=HwWJ_TFx 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01_0.png?itok=KGkPolig 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01_0.png?itok=xcGfY4lU 2486w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot%202018-11-13%20at%2014.28.01_0.png?itok=gM--2VeD" alt="Planet Feed" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;My objective here is to ensure that my existing &lt;em&gt;/taxonomy/term/%/feed&lt;/em&gt; and &lt;em&gt;/planet/feed&lt;/em&gt; links still work correctly so I won't lose any RSS feed subscribers to my website. As I have mentioned previously, Tome will automatically create an &lt;em&gt;index.html &lt;/em&gt;page when there is no file extension on a path. So it's best to add extensions then! Navigate to &lt;em&gt;/admin/structure/views&lt;/em&gt; and edit &lt;em&gt;Taxonomy term&lt;/em&gt; then click the feed display. Click on the &lt;em&gt;path&lt;/em&gt; and edit according to my first screenshot above and save. I also have a Drupal Planet feed which acts on my frontpage but with tag filters,  so I repeated those steps and added a feed.rss path to that too. &lt;/p&gt;

&lt;p&gt;We aren't done yet though - my web server config needs to be changed too so that the RSS pages can be served up correctly. &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;nginx configuration&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #666666; font-style: italic;"&gt;# Default server configuration&lt;/span&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;#&lt;/span&gt;
server &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
        listen &lt;span style="color: #000000;"&gt;80&lt;/span&gt; default_server;
        listen &lt;span style="color: #7a0874; font-weight: bold;"&gt;[&lt;/span&gt;::&lt;span style="color: #7a0874; font-weight: bold;"&gt;]&lt;/span&gt;:&lt;span style="color: #000000;"&gt;80&lt;/span&gt; default_server;
 
        &lt;span style="color: #666666; font-style: italic;"&gt;# SSL configuration&lt;/span&gt;
 
        root &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt; path_to_your_docroot &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;;
 
        server_name &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt; your_server_name &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;;
 
        location ~ &lt;span style="color: #7a0874; font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;planet&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;feed&lt;span style="color: #000000; font-weight: bold;"&gt;|/&lt;/span&gt;taxonomy&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;term&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;\d+&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;feed&lt;span style="color: #7a0874; font-weight: bold;"&gt;)&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
                index feed.rss;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
 
        location &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
 
                index index.html;
 
                &lt;span style="color: #666666; font-style: italic;"&gt;# First attempt to serve request as file, then&lt;/span&gt;
                &lt;span style="color: #666666; font-style: italic;"&gt;# as directory, then fall back to displaying a 404.&lt;/span&gt;
                try_files &lt;span style="color: #007800;"&gt;$uri&lt;/span&gt; &lt;span style="color: #007800;"&gt;$uri&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt; =&lt;span style="color: #000000;"&gt;404&lt;/span&gt;;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
 
        &lt;span style="color: #666666; font-style: italic;"&gt;# deny access to .htaccess files, if Apache's document root&lt;/span&gt;
        &lt;span style="color: #666666; font-style: italic;"&gt;# concurs with nginx's one&lt;/span&gt;
        &lt;span style="color: #666666; font-style: italic;"&gt;#&lt;/span&gt;
        location ~ &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;\.ht &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;
               deny all;
        &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
Note that I have added a new location region in the configuration specifically for the feed.rss files. Here we are saying if the path is either /planet/rss or /taxonomy/feed/%/feed then ensure that feed.rss files are served and not index.html files.&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Apache configuration&lt;/div&gt;
      
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;VirtualHost &lt;span style="color: #000000; font-weight: bold;"&gt;*&lt;/span&gt;:&lt;span style="color: #000000;"&gt;80&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;# change this to 443 is you are using ssl&lt;/span&gt;
 
  &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;Directory &lt;span style="color: #ff0000;"&gt;"{{ path_to_your_docroot }}/planet/feed"&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
	DirectoryIndex feed.rss
  &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;/&lt;/span&gt;Directory&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
  &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;Directory ~ &lt;span style="color: #ff0000;"&gt;"{{ path_to_your_docroot }}/taxonomy/term/[0-9]+/feed"&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
	DirectoryIndex feed.rss
  &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;/&lt;/span&gt;Directory&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
  ServerName &lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;{&lt;/span&gt; your_server_name &lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;}&lt;/span&gt;
  DocumentRoot &lt;span style="color: #ff0000;"&gt;"{{ path_to_your_docroot }}"&lt;/span&gt;
  DirectoryIndex index.html
 
 
  &lt;span style="color: #666666; font-style: italic;"&gt;# Comment out the block below for SSL&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic;"&gt;#SSLEngine on&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic;"&gt;#SSLCertificateFile "/path/to/www.example.com.cert"&lt;/span&gt;
  &lt;span style="color: #666666; font-style: italic;"&gt;#SSLCertificateKeyFile "/path/to/www.example.com.key"&lt;/span&gt;
 
  &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;&lt;/span&gt;Directory &lt;span style="color: #ff0000;"&gt;"{{ path_to_your_docroot }}"&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
      AllowOverride All
  &lt;span style="color: #000000; font-weight: bold;"&gt;&lt;/&lt;/span&gt;Directory&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;
 
  &lt;span style="color: #666666; font-style: italic;"&gt;# Logs&lt;/span&gt;
  Errorlog &lt;span style="color: #800000;"&gt;${APACHE_LOG_DIR}&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;static.error.log
  CustomLog &lt;span style="color: #800000;"&gt;${APACHE_LOG_DIR}&lt;/span&gt;&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;static.access.log combined
 
&lt;span style="color: #000000; font-weight: bold;"&gt;&lt;/&lt;/span&gt;VirtualHost&lt;span style="color: #000000; font-weight: bold;"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
The Apache configuration uses two new Directory directives. The second one contains a wildcard tilde and a regex to ensure that the path /taxonomy/term/%/feed is limited to numerics only. However I had another configuration problem - my Apache server was unaware of the .xml and .rss filename extensions, so wouldn't serve the content up. This was fixed by adding a filetype to the Apache configuration. &lt;br /&gt;
&lt;strong&gt;mods-available/mime.conf&lt;/strong&gt;
&lt;div class="geshifilter"&gt;&lt;div class="bash geshifilter-bash" style="font-family:monospace;"&gt;&lt;pre style="font-family: monospace; font-weight: normal; font-style: normal"&gt;AddType application&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;xml .xml .rss&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-heading-picture-text paragraph--view-mode--default"&gt;
          
            &lt;div class="field field--name-field-heading field--type-string field--label-hidden field--item"&gt;Success!&lt;/div&gt;
      
      &lt;div class="field field--name-field-blog-image field--type-image field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;    &lt;img srcset="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-13_at_16_36_17-edited.png?itok=jP9mrwTx 325w, https://assets.badzilla.co.uk/s3fs-public/styles/max_650x650/public/2018-11/Screenshot_2018-11-13_at_16_36_17-edited.png?itok=7mSzP7RJ 650w, https://assets.badzilla.co.uk/s3fs-public/styles/max_1300x1300/public/2018-11/Screenshot_2018-11-13_at_16_36_17-edited.png?itok=fUCdYjIa 1300w, https://assets.badzilla.co.uk/s3fs-public/styles/max_2600x2600/public/2018-11/Screenshot_2018-11-13_at_16_36_17-edited.png?itok=-P6OL8pL 2600w" sizes="(min-width: 1290px) 1290px, 100vw" src="https://assets.badzilla.co.uk/s3fs-public/styles/max_325x325/public/2018-11/Screenshot_2018-11-13_at_16_36_17-edited.png?itok=jP9mrwTx" alt="Success" typeof="foaf:Image" class="img-responsive" /&gt;


&lt;/div&gt;
          &lt;/div&gt;
  
            &lt;div class="field field--name-field-blog-text field--type-text-long field--label-hidden field--item"&gt;&lt;p&gt;The picture above provides the evidence the fixes worked! &lt;/p&gt;&lt;/div&gt;
      
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
      &lt;div class="field field--name-field-blog-youtube field--type-entity-reference-revisions field--label-hidden field--items"&gt;
              &lt;div class="field--item"&gt;  &lt;div class="paragraph paragraph--type--blog-text-youtube paragraph--view-mode--default"&gt;
          
      &lt;/div&gt;
&lt;/div&gt;
          &lt;/div&gt;
  
  &lt;div class="field field--name-field-blog-terms field--type-entity-reference field--label-inline"&gt;
    &lt;div class="field--label"&gt;blog terms&lt;/div&gt;
          &lt;span class="field__items"&gt;
              &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/static-site" hreflang="en"&gt;Static Site&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal8" hreflang="en"&gt;Drupal 8&lt;/a&gt;&lt;/span&gt;
          &lt;span class="field--item"&gt;&lt;a href="http://badzilla.co.uk/drupal" hreflang="en"&gt;Drupal&lt;/a&gt;&lt;/span&gt;
              &lt;/span&gt;
      &lt;/div&gt;
</description>
  <pubDate>Tue, 13 Nov 2018 14:16:59 +0000</pubDate>
    <dc:creator>nigel</dc:creator>
    <guid isPermaLink="false">157 at http://badzilla.co.uk</guid>
    </item>

  </channel>
</rss>
