Drupal Planet

My LocalGov Drupal contributions for week-ending August 16th, 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.

I only got around to working on LocalGov Drupal for one day this week, but we have some really nice work done in this. I'm especially happy with item 4 below which fixes some accessibility issues.

Meetings and Meet-ups

  1. Tech Group Drop-in: I was the only core maintainer at this week's meeting, which was kinda scary and kinda cool all at the same time. We discussed publications, permissions, deployments, upgrades and ... why do we have so many updates!

Code Contributions

  1. I have an MR for the Preview Link module so we can copy the preview link to our clipboard. A new release of Preview Link module has meant that my patch no longer applies, but the merge conflict is just one line, so it should only take a second to fix. Right? Wrong - I've no idea what happened but it was one of those days when trying to run the core linting tests on my MR caused my DDEV to crash and crash and crash. Well, I eventually got DDEV working again, but couldn' get the core JS tests to run against the patch. You win some, you lose some.
  2. We have a "sticky header" PR open for LocalGov Base for a while now. It's close to being ready for merging, except we have an accessibility issue where links might be behind the sticky header so you can't see what you are focussed on. The bigger issue is I can't replicate it in order to get a fix for it. I'd be happy if you could do so and comment on the issue.
  3. Rupert from Chicken created a pretty nifty issue in LocalGov Base to add a new variable that reverse CMSs could use to render breadcrumbs. The specific use-case is for the ModernGov templates, but anyone else could also use it - such as Netcall. And true to form with Rupert, it wasn't just an issue he created but also a pull request to go with it.
  4. Maria reported a humdinger of an issue concerning accessibility and focus-order for items in the header/services menu. I created a PR to fix them, let's hope we get this merged soon, better accessibility is 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).

My Drupal Core Contributions for week-ending August 16th, 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'm a bit sad this week, it's the last week of my 10-week sponsorship from Code Enigma. I'd love to keep up this momentum, so if you or your agency or organisation wants to help me to keep making Drupal better for everyone, please get in touch via mark@mark.ie. You can read about the benefits of it for you in my recent blog post.

Last week I worked on updating tests that were failing because of the new MR I have to add the navigation module to the Umami profile. Once they were all done another issue arose - the placement of the Umami "this is for demo only" message is not where it should be.

The good folks at the navigation initiative have a design for it, and we'll need to get that implemented before we can merge the work I had been doing.

So, that's what I spent this week working on. I got a nice MR eventually (after going back-and-forth deciding if I should preprocess the block the navigation menu is in or the menu itself). I decided to preprocess the block and have the HTML I want for it worked out now. Next week, I'll try get to writing the CSS for it and finishing it off.

Need Drupal hosting services? Chat to Code Enigma.

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 August 9th, 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.

Last week I was working on a merge request to add the new navigation module to the umami profile. If this is to be merged, then we won't need the toolbar module any more. So I updated that merge request to not install the toolbar module and to also remove toolbar-related permissions from authors and editors.

But after that, things got weird. Well, not weird, but more difficult. We have a message that shows on the toolbar to say "This site is intended for demonstration purposes.", but since we don't have a toolbar any more, well ... what happens to the message? Also, we have tests to make sure the message is in the toolbar, so those tests are now failing.

The options, as I see it, are:

  1. Remove the test for the text “This site is for demonstration …” and remove the text “This site is for demonstration …”.
  2. Place the text “This site is for demonstration …” somewhere else and update the test.

Update:

I think I have this is a good position now.

  1. Remove toolbar from modules to enable in demo_umami.info.yml
  2. Add navigation to modules to enable in demo_umami.info.yml
  3. Move "This site is intended for demonstration purposes" message from toobar to page_top
  4. Rename toolbar-warning library and classes to 'demo-profile-warning' and classes
  5. Remove access toolbar from permissions in testDemonstrationWarningMessage test
  6. Update permissions for author and editor
  7. Update the CSS so there's less of it, it's easier to read and we have the same CSS for small screens and large screens

I'm really looking forward to getting this merged to core, a much larger issue than I had originally intended it to be.

Thanks to <a href='https://www.codeenigma.com/'>Code Enigma</a> for sponsoring my time 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 9th, 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: Merge Tuesday this week was a monster merge-a-ton, although no new releases for any projects came of it.
  2. Technical Governance Group: Our monthly meeting about how we keep track on what we do from a technical point of view for LocalGov Drupal. This month we chatted a lot about "what do we do when someone wants to add a new feature to LGD?"
  3. Tech Group Drop-in: This week's meeting was very technical. We talked about ddev set ups, running update hooks manually, composer and all that goodness that I like to let other people think about.

Code Contributions

Netcall Module Ai Widget

The big one this week was working on a new feature for a new module. Yep, I was working on a new feature for a module that isn't even released just yet!

I've spent some time over the past two weeks working on a module to allow councils to integrate the Netcal AI Widget into their LocalGov Drupal sites. It's a simple enough module to allow you set the workspaceId and partitionId so the AI Widget will appear on all pages of your site. That's the module that is not released just yet, but is almost ready. 

The new feature I was working on was to add a new field on the settings page so that you can override what AI Widget shows on what page or what site section. I did this with a textarea where you can add a list of partition ids and paths for them to appear on, placing one on each line, like this:

par123|/news
par123|/news/*
par456|/events
par789|services/*

The above will mean that partition par123 will be used on the /news page and also any other pages under news, and partition par456 will be used on the /events page only, and par789 will appear on all pages under /services but not services itself.

Here's the PR for the new module and also this new feature.

Elections Module

We got a stable release of the elections module out the door one day before the last parliamentary election in the UK. We are now making this better in preparation for any upcoming elections. I spent some time this week working on the elections module.

  1. Fix an error being thrown by the elections libraries trying to load a file that was removed during a major refactor back in June.
  2. Improve the layout of items on the election summary page.
  3. We've an issue that has been bugging us for a while, whereby our results in charts are in the form of decimals ranging from 0.0 to 1.0. So if a political party wins 3 seats, we report that they have won 0.3 seats. We have a PR now to make sure we use rounded-whole numbers instead.
  4. A small fix so the number of votes uses a comma when separating hundreds from thousands, e.g. we want 10,000 instead of 10000 ... and now we have it!
  5. We had a level A accessibility issue from our election summary table by not having any table header for the hold/gain column. That's fixed now.
  6. A major issue with the elections module is that if you have more than 5 political parties in your constituency you will only see the first 5 alphabetically when on small screen devices. The fix was pretty simple, but tracking down the reason for it took a bit of time.

I have 4 more elections issues assigned to me. Hopefully I'll get to the rest of them next week.

Smaller items

  1. I got through quite an amount of reviewing PRs, especially some for the docs site that Joeri has created. Thanks for helping to make our docs better, Joeri.
  2. One of the larger PRs I reviewed was for removing js-cookie from LocalGov Alert Banners, thanks to Adnan's work. What this threw up however was another issue - unrelated - about the alert banner module, namely full page alerts were not covering the full page.
  3. And here's a nice PR to fix that alert banner issue.

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).

Sponsorship slot available for Drupal contribution credits

Sponsor Drupal development. Get issue credits and lots of marketing

I have a small window of time available if you'd like to get credits for sponsoring Drupal contributions.

For the past number of months I've been sponsored by Code Enigma to work on Drupal core. That sponsorship is coming towards its end, though we both hope to renew it in the not-too-distant future. 

In the mean time, I have a small window of opportunity for someone else to sponsor Drupal contribution time. Contact me at mark@mark.ie if you'd like to chat about it.

Thank YOU so much for all the publicity, not why we did it but extremely welcome nonetheless! :-)

Greg Harvey, Code Enigma

What do you get from it?

  • Issue credits on Drupal.org for all my work
  • A message on each of my comments on Drupal.org to thank you for sponsoring my time to work on that issue
  • A blog post each week detailing what I have been working on
  • A mention in my weekly newsletter about your sponsorship
  • A shout out on Twitter/Mastodon/LinkedIn each week, linking to what you have sponsored
  • Extra blog posts and/or videos about larger features I work on

I really like how Mark Conroy has been documenting his contributions to Drupal. It makes sponsoring him more appealing to organizations and individuals.

Dries Buytaert, Drupal Founder and Project Lead

Ready?

I expect this slot to go quickly, so get in contact to secure it via mark@mark.ie.

Work completed to far

Over the past 8 weeks, here's what I completed from the Code Enigma sponsorship:

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 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).