Drupal Planet

My Drupal Core Contributions for week-ending August 2nd, 2024

Code Enigma Logo

Here's what I've been working on for my Drupal contributions this week. Thanks to Code Enigma for sponsoring the time to work on these.

I spent a decent amount of time going through and - thankfully - clearing out the issue queue for the Content Access by Path module. This involved:

  1. Merging a PR to check that users have permissions to edit the content type of the item they wish to edit. Just because content is within the path you are allowed to edit, no longer means you can edit everything in that path.
  2. Some automated functional tests, thanks to Oliver Davies.
  3. Drupal 11 compatibility, thanks to Matt Glaman's Drupal Rector.
  4. A new release of the module - 1.1.0

Then I had a look at some Umami issues. Well, I say "some", but one that I had planned to work on had already been fixed and the one I actually worked on turned out to be a monster issue from almost 5 years ago that hasn't had any work on it in over 4 years, so digging through the issue and all the comments and talk about IE11 support made for great fun. 

It's a very important issue and marked as "major" so it was great to get time to work on it. The issue is about creating an accessible dropdown menu for the language switcher in Umami rather than just listing all the languages as we currently do. I started from scratch again with this one since things have moved on so much in the past few years in Drupal frontend. We now have what I think is a pretty good merge request for this, or will at least give us a decent base to work from.

Thanks Code Enigma for sponsoring my time to be able to work on this.

 

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending August 2nd, 2024

Beautifully crafted digital products and experiences that matter.

Here's what I've been working on for my LocalGov Drupal contributions this week. Thanks to Big Blue Door for sponsoring the time to work on these.

Need LocalGov Drupal services? Give Big Blue Door a shout.

Meetings and Meet-ups

  1. Awww poor me, I didn't get to any meetings this week. See you all next week.

Code Contributions

When you get excited, it's easy to get a lot of work done. This week I spent about half of my time finishing out the KeyNav module to get it into enough of a state to tag a 1.0.0 release for it. MISSION COMPLETE!

What did this mean?

  1. Add enough commands to cover all the /node/add pages so we can easily add nodes of various types, such as:
    1. lgdnan = add a new page
    2. lgdgo = add a guide overview page
    3. lgde = add an event page
    4. and so on
  2. Create a composer.json file and submit the module to Packagist so we can easily download it via composer.
  3. Create a settings form so individual websites can create their own keyboard shortcuts and/or override the defaults provided.
  4. Add a help page so we can have inline documentation for people.
  5. Wrote a blog post/video on how to use the module.

After that large piece of work, I got down to some smaller tasks, such as:

  1. We have a few typos in our demo content which give links to our docs site, but actually the links just go to localgovdrupal.org instead. They are fixed now.
  2. It's typo season! I had 2 typos in the LocalGov Keynav module, which are now also fixed, and a new release for the module created.
  3. Reviewing the work of others in preparation for Merge Tuesday. If you ever want to help out with this, here's the list of unapproved PRs we have.
  4. We don't have a consistent way to work with an "Admin role" in LGD, as we don't ship with one. We now have a module to create a role called localgov_admin and assign that as the admin role. Existing sites can simply enable the module to get the functionality and we have a PR for it to be installed by default for all new sites. Update: this is now merged and available when you update your LGD site.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

How to use the LocalGov Drupal KeyNav Module

Beautifully crafted digital products and experiences that matter.

Here's a short video outlining the features of the LocalGov Drupal KeyNav module.

Thanks to Big Blue Door for sponsoring the time to work on this module.

Install the module via composer require localgovdrupal/localgov_keynav.

Any issues, file them on GitHub.

 

 

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My Drupal Core Contributions for week-ending July 26th, 2024

Code Enigma Logo

Here's what I've been working on for my Drupal contributions this week. Thanks to Code Enigma for sponsoring the time to work on these.

This week I mostly worked on the Umami installation profile, which I am a Drupal core maintainer for. Here's what I worked on:

  1. We have a really nice module in Drupal core since 10.3 for a new navigation toolbar. It's currently experimental, so use with a little bit of caution. I created a merge request to enable this feature by default for Umami.
  2. I spent time working through some of the Umami issue queue to triage them, updating some and closing others. It's always good to keep your issue queue in order.
  3. Joel created an issue on my Content Access by Path module, whereby editors were able to edit nodes that they should not have been if they were granted path access to them. This proved trickier to track down the cause of than I expected, but we have a merge request for it now.

Thanks again to Code Enigma for sponsoring the time to work on this. This is how open source projects flourish.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending July 26th, 2024

Beautifully crafted digital products and experiences that matter.

Here's what I've been working on for my LocalGov Drupal contributions this week. Thanks to Big Blue Door for sponsoring the time to work on these.

Need LocalGov Drupal services? Give Big Blue Door a shout.

Meetings and Meet-ups

  1. Merge Tuesday. We had a merge merge for the microsites platform, to do access control in a much better manner, and allowing us to properly add/restrict content types to different microsites.

Code Contributions

This week was all about "keep the head down and get a beta release of the keynav module". So that's what I did. I had three objectives:

  1. Create a pattern so we can easily support all toolbar items
  2. Allow sites to choose their own patterns
  3. Allow individual users to switch the feature off

Create a pattern so we can easily support all toolbar items

I got this complete, though it took jumping through a few mental hoops to get there. We can now type lgdt (t for toolbar) followed by the order number in the toolbar that we want to get to. For example, if a toolbar list is like this

  1. Drupal icon
  2. Content
  3. Structure
  4. Extend
  5. etc

We can type lgdt3 to go to the Structure page.

Next, if we want to go to a sub-item of the Structure menu, and those items are in this order:

  1. Block layout
  2. Block types
  3. Content types
  4. etc
  5. We can type lgdt3.3 to get to the Content types page.

And then if we want have sub-items of Content types listed like this:

  1. Event
  2. News
  3. Service

We can type lgdt3.3.2 to get to the News content type.

And if the News has sub-items, well ... you get the idea lgdt3.3.2.3 and so on ...

Use Enter to trigger your shortcut

I had the module set up to submit as soon as you had come upon a combination that did something. However, if you wanted a shortcut like lgdacac it would fire as soon as you got to lgdac (because that would trigger the /admin/content listing). So I set up a timer to say "only fire after a half a second" so that you'd have time to type the rest of the command. 

But then I decided to not put time limits on people typing their commands - some people type slower than others. So now you can take as long as you want to type your shortcut, and it will only trigger when you click 'Enter'.

Use Escape to reset your shortcut

If you start typing lgd that triggers the shortcut mechanism into action. But if you then type something that you didn't mean to such as lgdabc you weren't able to reset and start the shortcut entry again, typing more letters would result in lgdabclgd.... I have now implemented a feature that if you click Esc (or click anywhere else on the page), it will reset the shortcut you had been entering.

Allow sites to choose their own patterns

I didn't get around to this. Hopefully next week.

Allow individual users to switch the feature off

It's an accessibility failure to not give users a mechanism to be able to switch these things off. I created a field on the user profile page for users who have the permission to use the shortcuts to now be able to turn them on or off for themselves. This means that we might allow all editors to use the shortcuts, but an individual editor might decide to turn off this feature on their own account.

I'm looking forward to seeing where we can take this module in the coming weeks. Thanks to Big Blue Door for sponsoring my time to work on it.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My Drupal Core Contributions for week-ending July 19th, 2024

Code Enigma Logo

Here's what I've been working on for my Drupal contributions this week. Thanks to Code Enigma for sponsoring the time to work on these.

I focussed on the core Stable9 theme again this week. And damn was that frustrating. 

An issue I thought (hoped?) we had fixed last week where Stable9 used to override Drupal core's off_canvas library, but now has no matching CSS files. The tests were failing, but I couldn't figure out why - it was reportedly missing the off canvas files, but that was a good thing, since they don't exist. 

An hour later, after putting the off_canvas libarary name back into the $librariesToSkip variable, I got that test running again. Only to discover that a functional JavaScript test was now failing. And so I spent another hour figuring that out. Only to discover that it was a red-herring and the failing test was a blip in the CI tools. So ... now all the tests are passing and we should be able to get this committed. 

I think I need a shower after all that.

Don't shower yet, Mark, you're not finished. 

Oh really? Yeah, remember that cool merge request from 2 weeks ago to set the dates for each node in Umami to a unique date? Well, that also has a failing test. But only if you install Umami using Spanish as the default language.

My Spanish isn't very good - it's non-existant - so trying to track down the cause of that failing test was about as enjoyable as you can imagine. But ... I tracked it down, so hopefully we'll also get that merged now as well.

Thanks to Code Enigma for sponsoring my time to go through this masochism 😀

Update

  1. The stable9 issue got merged later this afternoon, and
  2. The Umami issue got set to 'Reviewed and tested by the community" this afternoon, so
  3. That's all good news, and
  4. I can now go for that cold beer!

 

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending July 19th, 2024

Beautifully crafted digital products and experiences that matter.

Here's what I've been working on for my LocalGov Drupal contributions this week. Thanks to Big Blue Door for sponsoring the time to work on these.

I'm wrecked after all the work this week, but in a good way! Another really enjoyable week making LocalGov Drupal better for everyone. I'm particularly excited about the module I started working on that will allow site users to navigate their LGD backends via keyboard shortcuts. Can't wait to work on that more in the coming weeks.

Need LocalGov Drupal services? Give Big Blue Door a shout.

Meetings and Meet-ups

  1. Merge Tuesday. Docs got a good looking at in this week's Merge Tuesday. It's always good to make a documentation better. We also had a nice merge of demo content for publications, and started looking at a template for PRs so when you create one the reviewers will have a better idea of what is happening.
  2. Netcall/LGD working group: We had a good look through connecting the Netcall call center data with a Drupal website, so content designers can see what the most popular items people are calling about and target content towards this.
  3. Community Meet-up: I always enjoy this to see what else people are working on and what features people want us to work on. This week I gave a presentation on the upcoming features for Drupal 11.
  4. Tech Group drop-in: Well this week's meet-up certainly got down to details. We talked about using migrate module to pull data in to your website on a continuous basis. We also talked about creating a glossary of terms for a jargon buster. And we finished off talking about how to create events.

Code Contributions

  1. I usually spend a decent amount of time in Slack each week, helping out any one who posts an issue there, so they have a good "customer experience" from LGD and get their issues solved quickly. This week this led to me creating an issue to fix our accordions when printing. Since only 1 accordion opens at a time, you can't see all the closed ones if you print the page. Well, you can now.
  2. Given the backlog of PRs we now have since we have more people working on issues, I spent a good amount of time again this week reviewing what I could so we could get more items merged. I'm trying to spend about 2 hours per week on this task to keep the number of open PRs as low as possible.
  3. I got some more work done on the NHS base theme, specifically the breadcrumbs area, background color for the body element and the screenshot used when selecting a theme.
  4. We've had an issue open to create an admin role for LocalGov Drupal since late April. We have a PR for this to add an admin role to new LGD sites, now we have a second PR adding a module which will allow existing sites to have an admin role as well if they want it. This approach will, then, allow us to use this module to apply any updates that we might want to the admin role.
  5. After all my hard work getting a sticky header working in LocalGov Base, Maria's eagle eyes noticed that I was applying the same JS/CSS to the sticky version as I was to the scrolly version. And with minutes to go before Merge Tuesday ... we got it fixed.
  6. I created an experimental module to allow us to navigate a LGD website via keyboard shortcuts. There's a blog post and video to explain it, and the code is available on GitHub. Next up: create a mechanism for it to work with all admin menu URLs. Then ... create a settings page so councils can create their own shortcuts. This really excites me!

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

Keyboard Navigation for a LocalGov Drupal website

Navigating a LocalGov Drupal backend via keyboard shortcuts

Wouldn't it be cool if we could get around our LocalGov Drupal websites by using keyboard shortcuts?

I had an idea for a module to allow us to navigate our LocalGov Drupal websites by keyboard shortcuts. Thanks to Big Blue Door for sponsoring my LGD-contribution time, I was able to put a proof-of-concept together yesterday evening to show off my idea.

It's quite simple. I created a new module called "LocalGov KeyNav" and put the code on GitHub on my own namespace for now. Now, when you have that module enabled, you can type "lgd" followed by a series of keys and get to different pages on the site. For example:

  • ac - goes to the content listing page
  • ap - goes to the people listing page
  • acdf - goes to the directory facets page
  • t2 - goes to the 2nd item in the toolbar menu (usually admin/content)
  • t8 - goes to the 8th item in the toolbar menu (usually admin/config)
  • nasp - goes to the "Add service page" form
  • naslp - goes to the "Add service landing page" form

We can add as many more sequences as we want.

Here's a video showing it in action.

If you think this is worth pursuing, let me know in the comments on YouTube or via the LGD Slack or any other way. Thanks.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My LocalGov Drupal contributions for week-ending July 12th, 2024

Beautifully crafted digital products and experiences that matter.

Here's what I've been working on for my LocalGov Drupal contributions this week. Thanks to Big Blue Door for sponsoring the time to work on these.

Meetings and Meet-ups

  1. Merge Tuesday. As usual, lots of things got merged, then we got down to a very interesting discussion about managing external libraries in our repos, based on the PR I have for bulk adding media items to our sites. We also got the cool new "Add to calendar" feature merged to LocalGov Base, which has been asked for for a long time by content designers.
  2. Content Group. We had a really interesting content group meeting this week, going through the documentation initiative for LocalGov Drupal.

I worked on two large issues this week: adding sticky header feature for LocalGov Base theme and creating a base theme for NHS websites. Let's see how it all unfolded.

Code Contributions

  1. I started working on an issue to add a sticky header feature for LocalGov Base. We have an idea in LocalGov Drupal that says "Make the hard stuff easy". A sticky header is a really good example of this, it's not easy to figure it out because of all the bits and pieces that can get in the way - are there items above the header, below the header, etc? Do items in the header affect it? Will it break existing websites? I spend most of Monday figuring out this in a way that can work for all councils. It's not perfect yet, but it a very good start for us, and comes as part of the LocalGov Base theme settings so any subtheme of this can inherit it.
  2. We are getting a backlog of open pull requests that need to be reviewed or have been approved but not merged. I spend time reviewing lots of PRs so we could merge as many as possible at Merge Tuesday.
  3. Everyone wants to help LocalGov, but not everyone knows where to start. So I wrote a blog post to help you get started.
  4. When you use the theme generation script in localgov_base, the subtheme that is created sets itself as compatible with Drupal 8, Drupal 9, and Drupal 10. I fixed that so now our subthemes are compatible with Drupal 10 and Drupal 11.
  5. If you use the linter script we created so your theme's CSS will follow Drupal's coding standards, we ship a .nvmrc file with it which stipulates Node 16 as our approved version. However, Node 16 is no longer supported, so I now have a PR created to set Node 20 as our approved version of Node, which is the current LTS version.
  6. The BIG one: there's been a lot of talk recently about using LocalGov Drupal for NHS trusts and other NHS sites. So, I went and started work on a base theme for the NHS.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).

My Drupal Core Contributions for week-ending July 12th, 2024

Code Enigma Logo

Here's what I've been working on for my Drupal contributions this week. Thanks to Code Enigma for sponsoring the time to work on these.

This week was all about helping out in the Stable9 issue queue. Let's see how much we got done thanks to Code Enigma's sponsorship.

  1. The MR I created last week to ensure that all content in the Umami theme was inside a landmark region was further worked on by my Umami co-maintainer Finnsky. I spent some time further working on this work to tie the rest of the template and CSS together. I think what we have now is a very good layout system that will work just as well for screenreader users.
  2. I've been tinkering around at the edges of becoming a maintainer of the stable9 theme for a while now, but haven't had much time to work seriously on it. Today I got to have a good look at an issue that has been open for a number of years, saying that the system-modules-uninstall.html.twig file has an error with the {% trans %} tag. After testing, it seems fine, so I think that issue outdated, or at least needs more info.
  3. Drupal 10 updated its library for off-canvas, which is being overridden by stable9. However, now stable9 is referencing the old CSS off-canvas files which no longer exist. There's an MR to fix this, which seems to work fine, except there's a test broken somewhere. I'm trying to track it down so we can get this issue finished off and merged.
  4. I think I've tracked down why the tests are failing for the stable9 off_canvas override. All the CSS files for that override were removed so it's not actually trying to override the core library any more. That was a bit more of a rabbit hole than I expected it to be.
  5. Another stable9 issue whereby the tabledrop handles were not correctly placed. It's been open for years as it was affecting stable theme from Drupal 8. After some digging, I think it's actually a red herring issue and is actually affecting the Seven theme rather than our stable themes, so it's not marked as outdated.

What an enjoyable week that was, and now we have the stable9 issue queue down to only 3 open issues tagged as "Active", or "Needs work", or "Needs review".

Thanks to Code Enigma for again sponsoring my time to make Drupal better for everyone.

Join the "Something nice ..." newsletter

The full title is "Something nice, something quirky, something else".

I send an email once a week with something nice, something quirky, and something else that I think is interesting (all with a web development theme, of course).