User login

Drupal 8

The disappearing "You have unsaved changes" message Drupal 8 is frustratingly disruptive

Is this happening to other people or just me? The "You have unsaved changes" message that shows up, and then disappears Drupal 8, disrupting you while you're trying to make further configuration edits.

Making it so code-provided menu links can have their titles edited

This link is provided by the module. "The title and path cannot be edited." Drupal 8

https://www.drupal.org/node/2838106#comment-12269503

This issue is about fixing the home link in the standard profile. We should let that fix go in. That said, i'm with those saying we (also) need a general solution for this.

Testing an image file upload for Drupal 8 with Behat, maddeningly requiring a web driver with JavaScript

For a how-to, see Using JavaScript in Behat tests (manual steps for installing, running).

For my stumbling around in the dark... read on.

On the unenviable proposition of having to add JavaScript support to Behat

behat mink extension cannot find fields

Replacing the Druplicon favicon in a custom theme for Drupal 8

Placing the favicon.ico in the root of the theme folder, presuming you are using a custom theme, is by far the easiest way to tell Drupal to use that favicon.ico file in the rel shortcut icon (favicon) tag— and so displayed by modern browsers in the tab bar.

Date field date-only migration from Drupal 7 to Drupal 8

After we did the upgrade of a Drupal 7 site to Drupal 8, a date field which had been taking only the date portion, and no time portion, was now configured to take both the date and the time. Moreover, the migration wasn't working.

We changed the configuration from datetime to date

Here's the relevant part of the diff for config/default/field.storage.node.field_pub_date.yml

The saga of Drupal link-link

Are your builds failing because of this?

Easily add content with update hooks: use default content module exports to create content that needs to be in sync with configuration

An approach for keeping content that is added as part of development synchronized with test and production environments is to use the Default Content module to export the content. It's built for the content to be exported to an installation profile's 'content' folder, and then the module, if enabled, automatically brings the content in when the site is installed.

Getting a node (or other entity) and playing with it on the command line

Here's one way to get a node so that you can play with it on the command line and figure out what different methods actually do:

array_pop(\Drupal::service('entity_type.manager')->getStorage('node')->loadByProperties(['title' => 'Sample node']))

There's surely faster ways to do it with an ID, and maybe even better would be to use devel generate here. Anyway, this gives a node that can be messed with, like so, putting it all together:

Keeping Drupal's contextual links working even when the whole content item is linked offsite or triggering a lightbox

We have a site where one content type (publicity, for news items and awards) are listed, but the whole thing is wrapped in an anchor tag and linked to outside content. To prevent leaving the site before the contextual edit link is shown, i did this:

Syndicate content