Blogs

Drupal 8 entity delete form

To render the entity deletion form in Drupal 8 in a custom route:

$form = \Drupal::service('entity.form_builder')->getForm($entity, 'delete');

The second argument can be replaced with things like 'default' or 'edit' to render different entity manipulation forms.

Virtualbox DKMS on a custom linux kernel

At work I use a Thinkpad T440s with Ubuntu Linux. Unfortunately the T440s uses a newer Wi-Fi card so I often find myself upgrading the kernel to get hardware to work. One thing I have always struggled with is getting virtualbox up and running. Specifically, installing the DKMS driver on a custom kernel. It always seemed to throw an error about not being able to find the kernel headers.

Trying to register the VirtualBox kernel modules using DKMSError! Your kernel headers for kernel 4.0.9-040009-generic cannot be found.

Updating magento URLs using SQL

Helpful little snippet

update core_config_data set value = 'http://url/' where path = 'web/unsecure/base_url';

update core_config_data set value = 'https://url/' where path = 'web/secure/base_url';