drupal 8

Update Drupal commerce 2 website

Backup to Acquia dev desktop local site

Take a copy of htaccess to preserve customisation

-- On local site --

navigate to directory above public_html

run composer outdated or composer outdated 'drupal/*'

composer update --with-dependencies drupal/commerce drupal/commerce_price drupal/commerce_product drupal/commerce_order drupal/commerce_payment drupal/commerce_payment_example drupal/commerce_checkout drupal/commerce_tax drupal/commerce_cart drupal/commerce_log drupal/commerce_store drupal/commerce_promotion drupal/commerce_number_pattern

Layout Builder module

Entity Browser
Entity Browser block
Block blacklist
Manage class with taxonomy
Views layout




Dev Desktop db workround

Go to user

Open .aquia/DevDesktop/DrupalSettings/loc_sitename_dd.inc to swap in database name

Open phpmyadmin to assign database permission to drupaluser


mamaye linktxt FileLink.php in Theme / bootstrap / src / Plugin / preprocess


namespace Drupal\bootstrap\Plugin\Preprocess;

use Drupal\bootstrap\Bootstrap;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;
use Drupal\Core\Link;
use Drupal\Core\Url;
use Drupal\file\Entity\File;

* Pre-processes variables for the "file_link" theme hook.
* @ingroup plugins_preprocess
* @BootstrapPreprocess("file_link",
* replace = "template_preprocess_file_link"
* )
class FileLink extends PreprocessBase {


Cron run failed

Open up your PHPMyAdmin
Find semaphore table
Delete cron row

Turn on cron logging
See which cron stuck


Composer nodev

If you have separate dev/staging and production servers, ensure you copy/commit both your composer.json and composer.lock files to production and always run composer install --no-dev on production, rather than update. (The --no-dev switch will stop any packages listed in 'require-dev' from being installed, typically modules for debugging and libraries for unit/behavioral testing.)

Install local composer and drush update

1. go to WHM, find MultiPHP INI Editor, find php 7.2, ensure allow_url_fopen is Enabled
2. increase ram
3. download composer
4. Run locally php composer.phar require drush/drush:8.x
5. upload the composer.json and composer.lock files
5. Run remotely php composer.phar install
6. Run remotely ../vendor/drush/drush/drush status, cr, ups, up drupal
7. Run updates.php

How to Display a Cookie Compliance Banner in a Drupal 8 Site


Session problem Drupal 8.6.13

Adding Twig Template Suggestions for Form Elements

* @param $suggestions
* @param array $variables
function mytheme_theme_suggestions_input_alter(&$suggestions, array $variables) {
$element = $variables['element'];

if (isset($element['#attributes']['data-twig-suggestion'])) {
$suggestions[] = 'input__' . $element['#type'] . '__' . $element['#attributes']['data-twig-suggestion'];

How to include javascript on single pages in Drupal 8 in a way that is amenable to scale.


Following Steps will make working with External JavaScript libraries in Drupal 8 absolutely clear (including how to conditionally load it in specific pages):

Step 1: Place the JavaScript file in your theme or module inside a folder called js. After this step your folder structure must look like :

Step 2: If your theme already has a my-theme.libraries.yml file open it, if not create it.

In Drupal 8 Libraries are simply collections of CSS or JS files bundled together under a uniquely identified library name.

Drupal commerce 2 drupal 8 Order workflow

Composer and Drupal are still strange bedfellows

Tips for Managing Drupal 8 projects with Composer

Getting Drupal 8 field values in Twig


Get field value from referenced entity in twig loop

view_mode variable in node twig

Entity Reference Display


allow an Editor Choose the View Mode of an Entity Reference Field in Drupal 8


Discover colorbox or flexslider library when installed with composer

Install drush 9 with composer - for drupal installed by composer

Update core via Composer for drupal project

Menu Link Attribute not working in Barrio


Composer Repository Schema


Show related content based on shared reference entity

Force SSL for Drupal 8


How to add Google Fonts to Drupal 8 theme, the PROPER way


Entity clone permission



Subscribe to RSS - drupal 8