PreviousNext: Co-contribution with clients: A revision UI API for all entity types

The tale of an eight-year, collaborative effort to build a generic revision UI into Drupal 10.1.0, bringing a major piece of functionality to core.

by
lee.rowlands
/ 11 July 2024

As we discussed in our previous post, Improving Drupal with the help of your clients, we’re fortunate to work with a client like ServiceNSW that is committed to open-source contribution. So when their challenges require solutions that will also benefit the whole Drupal community, they’re on board!

In the beginning, there were nodes

Since Drupal 4.7 was released in 2006, nodes have had a revision user interface (UI). The UI allows editors to view revision history and specific revisions, as well as revert and delete revisions.

A lot has changed since Drupal 4.7. We received revision support for many more entities, but Node remained the only one with a revision UI in core.

Supporting client needs through contrib 

Our client, Service NSW, makes heavy use of block content entities for Notices displayed throughout the site. These are regularly updated. Editors need to be able to see what has changed and when, revert to previous versions, and view revision logs when needed. 

Since Drupal 8, much of the special treatment of Node entities has been replaced with generic Entity API functionality. Nodes were no longer the only tool in the content-modelling toolbox, with this one exception: revision UI.

The code for node’s revision UI lives in the node module. It’s dependent on hard-coded permission checking and uses routing and forms outside the entity API.

This meant that for every additional entity type for which Service NSW needed a revision UI, those parts needed to be recreated repeatedly.

As you can imagine, this approach quickly becomes hard to maintain due to the amount of duplication. 

The journey to core

Having identified that Drupal core needed a generic entity revision UI API (it already had generic APIs for entity routing, editing, viewing and access), we set to work on this missing piece of the puzzle.

We found an existing core issue for it, and in 2015, posted our first patch for it. 

This began an 8-year journey to bring a major piece of functionality to core.

Over the course of many re-rolls, we released contributed modules built on top of the patch:

Finally, with the release of Drupal 10.1.0 in 2023, any entity-type could opt into a revision UI. The Drupal 10.1.0 release opted-in for Block Content entities, making that contributed module obsolete. Then later in 2023, the release of Drupal 10.2.0 saw Media entities use this new API. In early 2024, support for Taxonomy terms was added and released in 10.3.0.

Challenges along the way

The biggest challenges encountered were keeping the patch up to date with core as it changed and navigating the contribution process. Over the years, there have been over 120 patch files and 300+ comments on the issue!

Another challenge was the lack of an access API for checking access to revisions. 

The entity API supported a set of entity access operations — view, update, delete — but no revision operations were considered. The node module had hard-coded permissions e.g. ‘view all revisions’ and ‘revert all revisions’. 

To have a generic entity revision UI API, we needed a generic way to check access to the operations the UI would make available.

Initially, we tried to include this with the revision UI changes. However, it became increasingly difficult to get both major pieces of functionality simultaneously. So, in 2019, this was split into a separate issue, and the original issue was postponed.

With efforts from our team, Service NSW and many other individuals and companies in the Drupal community, this made it into Drupal core in 2021. It was first available in Drupal 9.3.0. Adding a whole new major access API is not without its challenges, though. Unfortunately, this change resulted in a security release shortly after 9.3.0 came out. Luckily it was caught and fixed before many sites had updated to 9.3.0.

Collaborative contribution

Adding a new feature to Drupal core is a large undertaking. Doing it in a client-agency collaboration provides an ideal model for how open source should work. 

Developers from PreviousNext and Service NSW worked with the broader Drupal community to bring this feature to fruition.

Our developers have experience contributing to core and were able to guide Service NSW developers through the process. Being credited on large features like this is a major feather in the cap for both individual developers and their organisations.

Wrapping up

Together, we helped integrate a generic revision UI into Drupal 10.1.0. All of the developers involved received issue credits for their work. 

This was a significant effort over eight years, requiring collaboration with individuals and organisations in the wider Drupal community to build consensus. This level of shared commitment helps drive the Drupal open source project forward, recognising that what benefits one can benefit all.

So, what are the next big features you and your clients could work on? Or is there something you want to bring to core, as an individual, group or organisation? Either way, we’d love to chat and collaborate!

Contributors

  • dpi
  • acbramley
  • jibran
  • manuel garcia
  • chr.fritsch
  • AaronMcHale
  • Nono95230
  • capysara
  • darvanen
  • ravi.shankar
  • Spokje
  • thhafner
  • larowlan
  • smustgrave
  • mstrelan
  • mikestar5
  • andregp
  • joachim
  • nterbogt
  • shubhangi1995
  • catch
  • mkalkbrenner
  • Berdir
  • Sam152
  • Xano

AmigaKit launches a new Amiga that’s not an Amiga at all

I try to keep tabs on a huge number of operating system projects out there – for obvious reasons – but long ago I learned that when it comes to the world of Amiga, it’s best to maintain distance and let any important news find its way out of the Amiga bubble, lest one loses their sanity. Keeping up with the Amiga world requires following every nook and cranny of various forums and websites with different allegiances to different (shell) companies, with often barely coherent screeching and arguments literally nobody cares about. It’s a mess is what I’m trying to say. Anyway, it seems one of the many small companies still somehow making a living in the Amiga world, AmigaKit, has recently released a new device, the A600GS. It’s a retrogaming-oriented Amiga computer, but it does come with something called AmiBench, that’s apparently a weird hybrid between bits of Amiga OS 4 and AROS, so it does also support running a proper desktop and associated applications, but only AmigaOS 3.x applications (I think? It’s a bit unclear). It has HDMI at up to 1080p, and even WiFi and Bluetooth support, which is pretty neat. Wait, Wifi and Bluetooth support? What are we really dealing with here? Once again the information is hard to find because AmigaKit is incredibly stingy with specifications – I had to read goddamn YouTube comments to get some hints – but it seems to be a custom board with an Orange Pi Zero 3 stuck on top doing most of the work. In other words, the meat of this thing is just an emulator, which in and of itself isn’t a bad thing, it’s just weird to me that they’re not upfront and direct about this. While this answers some questions, it also raises a whole bunch more. If this is running on low-end Allwinner ARM hardware from 2022, how is this AmiBench desktop environment (or operating system?) a “fork of OS4 with AROS code in it“? AmigaOS 4 is PowerPC-only, which may explain why AmigaKit only mentions AmigaOS 3.x and 68K compatibility, and not AmigaOS 4 compatibility. And what’s AROS doing in there? I mean, this is an interesting product in the sense that it’s a relatively cheap turnkey solution for classic Amiga enthusiasts, but a new Amiga this is definitely not. At about €130, this is not a bad deal, but other than hardcore fans of the classic 68K Amiga, I don’t see many people being interested in this. The Apollo Standalone V4+ piques my interest way more, but at €700-800, it’s also a lot more expensive, but at least they’re much clearer about what the Apollo is, what software it’s running, and that they’re giving back their work to AROS.

X’te DiscussingFilm- -The first trailer for ‘GLADIATOR 2’ has been released. In theaters on…

Video by via Dailymotion Source Oscar’da En İyi Film dahil beş ödül kazanan 2000 yapımı Gladyatör filmi, Ridley Scott imzasıyla yeniden beyazperdeye dönüyor. Filmden ilk fragman paylaşıldı. Filmin kadrosunda Paul Mescal, Denzel Washington, Barry Keoghan ve Joseph Quinn gibi isimler yer alıyor. Filmin başrol oyuncusu Paul Mescal, ilk Gladyatör filmindeki Lucilla’nın oğlu Lucius’un yetişkin versiyonunu … Read more

Portfolio Website Design: HTML, CSS & JS

Video by via Dailymotion Source Ready to showcase your skills and create a strong online presence? Join us in this comprehensive tutorial where we guide you through the process of designing your own dynamic Portfolio Website using HTML, CSS, and JavaScript. Whether you’re a budding developer, designer, or creative professional, this tutorial is your key … Read more

«ترامب سيهزمك» أول سيناتور ديمقراطي ينشق عن بايدن

Video by via Dailymotion Source «ترامب سيهزمك» أول سيناتور ديمقراطي ينشق عن بايدن العين الإخبارية.. بوابة إخبارية عربية شاملة، تغطي أخبار العالم العربي والدولي .. تضعك دائما في قلب الحدث، لتصبح عينك على العالم برؤية مختلفة، ومحتوى متميز ———————————————– زوروا مواقعنا الخاصة Website: https://al-ain.com Twitter: https://twitter.com/AlAinNews Facebook: https://www.facebook.com/AlAinNews Instagram: https://www.instagram.com/AlAinNews TikTok: https://www.tiktok.com/@alainnews YouTube: https://www.youtube.com/c/AlAinNews Live … Read more

Como Seleccionar Todas las Diapositivas de PowerPoint

Video by via Dailymotion Source Hola a todos los seguidores de Solvetic y bienvenidos de nuevo al canal! En este tutorial, vamos a abordar una tarea fundamental para trabajar eficientemente en PowerPoint: cómo seleccionar todas las diapositivas de tu presentación. Seleccionar todas las diapositivas a la vez te permite aplicar cambios globales, como el formato, … Read more