Improved the Drupal GitHub Webhook Module

I improved the custom module “GitHub Webhook” that triggers GitHub Actions from the Drupal admin panel. https://github.com/nakamura196/Drupal-module-github_webhook Originally a basic module with multi-repository support, I added features including UI tab separation, permission granularity, workflow status display, and auto-triggering. Module Before Improvements The original module had the following structure: File count: 5 files (info.yml, routing.yml, links.menu.yml, permissions.yml, SettingsForm.php) Supported versions: Drupal 10 only Repositories: Multi-repository support (dynamic add/remove with AJAX) Screen: Settings and trigger on the same screen (2 accordions) Permissions: Only 1 permission access github webhook settings (same permission for both settings and trigger) Token management: #default_value set on password field (token output in plaintext in HTML source) HTTP client: Direct instantiation of new \GuzzleHttp\Client() Exception class: Written in catch block without use statement (incorrect namespace resolution) $ ] f ; o ' ' ' B r # # # e m t t d f [ y i e o ' p t f r s e l a e e ' e u : t ' l t = t T i > = _ o n > v k g ' a e s p $ l n ' a t u ] s h e w [ s i ' a ' w s s g o - = i r > > s t d t e h ' ( $ t u , ' c b G o i _ i n n t t f o H i # k u g d e b - e n > f ' T g a ] o e u k t l = e ( t n ' _ [ ' g v ) i a , t l h u u e b _ t o k e n ' ) , O u t p u t i n p l a i n t e x t i n H T M L $ c l B i e e f n o t r e = : n G e u w z z \ l G e u z c z l l i e e H n t t t p w \ a C s l i d e i n r t e ( c ) t ; l y i n s t a n t i a t e d w i t h n e w Overview of Changes Comparison of file structure before and after improvements. * indicates modified, + indicates newly added. ...

February 11, 2026 · 53 min · Nakamura

Performing Module Updates and Core Upgrades from the Drupal 10 Admin Interface

This article summarizes the steps for setting up Backup and Migrate for backups and Automatic Updates for automatic module and core updates on Drupal 10.6.1 running on a shared server. Current Status Check Checking “Reports > Status report” in the admin interface revealed three warnings: Drupal core update status: Out of date (version 10.6.3 available) PHP APCu available caching: Memory usage exceeds 75% Module and theme update status: Out of date ...

February 10, 2026 · 6 min · Nakamura

Drupal Update Procedure on Sakura Rental Server

This summarizes the procedure for updating Drupal from 10.1.5 to 10.6.1 on Sakura Rental Server. Environment Server: Sakura Rental Server Drupal: 10.1.5 → 10.6.1 Installation type: Traditional (tarball, no web/ directory) Preparation Creating a Working Directory Backups are saved outside www (to prevent web access). m k d i r - p / h o m e / [ u s e r n a m e ] / b a c k u p s / d r u p a l File Backup c t d a r / h - o c m z e / f [ u / s h e o r m n e a / m [ e u ] s / e w r w n w a m e ] / b a c k u p s / d r u p a l / d r u p a l _ b a c k u p _ $ ( d a t e + % Y % m % d ) . t a r . g z [ d r u p a l _ d i r e c t o r y ] / Database Backup On Sakura Rental Server, the --no-tablespaces option is required. ...

December 26, 2025 · 9 min · Nakamura

Setting Up the WDB Module on Drupal 10 in a Docker Environment

Overview This article explains the steps to build Drupal 10 in a Docker environment and install the WDB module for linguistic databases. Prerequisites Docker Desktop is installed Git is installed Steps 1. Building the Docker Environment First, create a docker-compose.yml file: s e o r m d l m v a r u a i r i r e u i d p r m r c i m e o n p m o e o e e i e a a s l - v M M M M a a l p - r - s s a s d g t u i Y Y Y Y l g u e t t : d : b e a m m r S S S S : e m n m s 8 a b : : r e a o Q Q Q Q : e / d a : 0 r : t s r n L L L L s d d d d s r 8 t m : : i m _ _ _ _ d : r r r r _ i 0 : { a a e R D U P r u u u u o a : } r a d n O A S A u p p p p n d 8 a i l b t O T E S p a a a a : b 0 l a w : : T A R S a l l l l w d a / _ B : W l / / / / a b y v P A O : f m t p y : s a A S d R 1 i o h r s l r S E r D 0 l d e i a / S : u : . e u m v t l W p 2 s l e a e i O d a d . : e s t s b R r l r 7 / s : e t / D u u - o : : m : p p p p o / y a a h t p o s d l l p p t p q r 8 d t t l u . r d / p 2 u d r d a - p r u r l a a u p u p l p a p a / a l a c w l l h e w / e b w e p - / e b r b s b i u i t v l t m h a l e o e t s s d m e e / u e y d l s e e e f s a u l t / f i l e s Next, create the necessary directories and start the containers: ...

August 7, 2025 · 7 min · Nakamura

Applying Filters to created and changed Fields in Drupal's JSON:API

Overview This is a memo on how to apply filters to created and changed fields in Drupal’s JSON:API. Background The following was used as a reference. https://www.drupal.org/docs/core-modules-and-themes/core-modules/jsonapi-module/filtering For example, when trying to filter only items updated on or after June 2, the following query did not work correctly. ?filter[a-label][condition][path]=changed&filter[a-label][condition][operator]=%3E%3D&filter[a-label][condition][value]=2025-06-02 Correct Method The following article was helpful. https://www.reddit.com/r/drupal/comments/1bdvu61/json_api_drupal_filter_on_date/ Note that timestamp fields (like created or changed) currently must use a timestamp for filtering: ...

June 3, 2025 · 1 min · Nakamura

Using Pagination in IIIF Collections with IIIF Presentation API v2

Overview I had the opportunity to use pagination in IIIF collections with IIIF Presentation API v2, so this is a memo of the process. Background IIIF collections allow you to provide a list of multiple manifest files (and collections) as shown below. https://iiif.io/api/presentation/2.1/#collection { } " " " " " " " " ] @ @ @ l v d a m c i t a i e t a { } o d y b e s t n n " p e w c r i " " " t : e l i r i f @ @ l e " " n i b e i t a x " : : g p u s d y b t h H t t t " p e " t " " i i i s : e l : t s T n o o " " " p c o t n n : " : : " : : p " " " h h / C : : : [ t " " t / o L t s B t e l e " " " p c o p x l v t D P : : o : a e e o e r / M k / m c l p s o / a / p t " c v e n 1 i l i C , r i x i " i e o o i d a f i . n l p e m e f o " l t d p s . r , e i l t i g c o b e " o t n y . , i i o a i o o E r p i n f x g i f a / / / f C m i p c o o p i r o r l l i e l l e f s l E e / e e x c O b n c a t r o t t m i g o a i p o a k t o l n n 1 i n e " i / o / , z m n t O a a / o r t n 2 p g i i / " a o f c , n n e o i " s n z , t t a " e t , x i t o . n j " s , o n " , When the number of target manifest files becomes large, it becomes difficult to deliver them in a single IIIF collection. ...

June 2, 2025 · 9 min · Nakamura

How to Allow Non-Admin Users to Access Configuration Pages in Drupal

Parts of this article were generated by AI. Overview When creating configuration pages for custom modules in Drupal, you may want to allow non-admin users to access them. This article explains how to solve this issue, using the GitHub Webhook module as an example. The Problem Initially, the routing configuration was as follows: # g i g t p d r i h a e e t u t f _ _ q _ h b h a f t u p u _ : u o i i e b w l r t r r _ e t m l e m w b / s : e m i e h a : : e s b o d n s h o m \ ' t i o k i D G s o o . n r i : n k s / u t : . e c p H r t o a u ' o t n l b a u i f \ d t n i g W m i g g i e i n s / t b n g : g h h i . i u o s y t b o t m h _ k e l u w r b e S _ b e s w h t i e o t t b o i e h k n o \ g c o F s o k o ' n ' r f m i \ g S u e r t a t t i i n o g n s ' F o r m ' With this configuration, only administrators with the administer site configuration permission could access the page, and general users could not. ...

May 28, 2025 · 9 min · Nakamura

Using the JSON Field Module to Handle JSON Format Fields in Drupal

Overview I had the opportunity to use the “JSON Field” module for handling JSON format fields in Drupal, so this is a personal note for future reference. https://www.drupal.org/project/json_field As a result, JSON can now be handled together with an editor as shown below. Installation Download it with the following commands. c d o r m u p s o h s e e r n r j e s q o u n i _ r f e i e ' l d d r u p a l / j s o n _ f i e l d : ^ 1 . 4 ' Furthermore, enable the widget as well with the following. ...

May 25, 2025 · 1 min · Nakamura

Hosting TEI/XML Files on S3-Compatible Object Storage

Overview This is a memo about hosting TEI/XML files on S3-compatible object storage. Specifically, we target the mdx I object storage. https://mdx.jp/mdx1/p/about/system Background We are building a web application (Next.js) that loads TEI/XML files and visualizes their content. When the number and size of files were small, they were stored in the public folder, but as these grew larger, we considered hosting them elsewhere. There are many options for storage locations, but this time we target mdx I’s S3-compatible object storage. ...

May 24, 2025 · 16 min · Nakamura

Using Drupal's Sortableviews Module to Reorder Content and Save the Result to a Field

Overview This article introduces how to use Drupal’s Sortableviews module to reorder content and save the result to a field. https://www.drupal.org/project/sortableviews It is described as follows. This one is similar to Draggableview module except it can save the position value ( After drag and drop the question ) into custom content type field. Installation It could be installed using the standard method. Creating a Content Type Create the content type to be sorted. Here, we target a content type called team. ...

March 2, 2025 · 2 min · Nakamura

Next.js for Drupal BASE_PATH Issue and Fix (Using patch-package)

Overview Next.js for Drupal v2.0.0 was released on 2025/2/11. https://next-drupal.org/ https://next-drupal.org/blog/next-drupal-2-0 When I tried it out, I found that the handling of BASE_PATH required attention, so this is a memo about it. Environment Variables The sample environment variables are as follows. # # N N # D D # D E E R R R S R X X A U U R U e e T T u P P e P e q _ _ t A A q A u P I h L L u L h i U M e _ _ i _ t r B A n C C r R t e L G t L L e E p d I E i I I d V s C _ c E E A : _ D a N N f L / D O t T T o I / R M i _ _ r D n U A o I S A e P I n D E O T x A N = C n E t L = R R - _ - _ s e E d S d B i t T e E r A t r = m C u S e i R a R p E . e e n E a _ e v t d T l U x e r = . R a i R R o L m t e e e r = p h v v t g h l i e a r / t e s l i d t . t i e o p c f h d v c s o r i a e s : m o s t / / m i t e / f o h n s / r n i v i a o s i t d m r e m f o . i / r n e n a o m x / d m e a c m n m o i / t p n n a - l f / d v e i c m a . g i r c n n i o s f / a m e i c b r g o l v / n e i s f s c e i e r g s / / i s c c e o e r n s v s / i u c c m o e e n s r s / u n m e e x r t When specifying NEXT_PUBLIC_DRUPAL_BASE_URL with a base path included, such as https://site.example.com/xxx, API requests were sent to https://site.example.com/jsonapi/, failing to correctly retrieve resources. ...

March 2, 2025 · 11 min · Nakamura

Trying the Search API Algolia Module for Drupal

Overview I had the opportunity to try the Search API Algolia module for Drupal, so this is a memo of my experience. https://www.drupal.org/project/search_api_algolia Installation On Drupal 11, it could be installed with the following command. c o m p o s e r r e q u i r e ' d r u p a l / s e a r c h _ a p i _ a l g o l i a : ^ 3 . 1 ' Configuration After installing the module, configure the server and index. ...

March 1, 2025 · 1 min · Nakamura

Registering Data with Drupal's JSON:API Using Username and Password

Overview In the past, I wrote articles about registering data using Drupal’s JSON:API with Python. The following uses Basic authentication. And the following uses an API Key. In addition to these methods, I was able to register data using regular login authentication, so this is a memo of that process. Code The code is as follows. It logs in, obtains a CSRF token, and then registers content. i i i f c m m m r l p p p o a o o o m s r r r s d d d d t t t d e e e e o A f f f f r j o t p e s s e i l # s # # # s s l # l l i g # c i e c # u r i e q o n C _ o e e e o o o f e s f l r r e f l u n v l i a D l エ s 認 l l g ロ g g t C r s e 記 l s s e i n d r f ン e 証 f f i グ i i l _ S f c e a 事 p r e s i e i _ u . ド l 情 . . n イ n n l j h o s c R _ f c s # # s } : # s t 作 = o # u h c j e p : p t m n t d p D ポ f 報 U P ( ン _ _ o s e g e s F t " o r e e e 成 n r e o s s r r s p t _ o a R イ . ( S A s リ u r g o a i l r ト o { o f r s l r l _ リ f s s l a o o p i i o : _ t l U ン J B E S e ク r e i n d n f f ー k s k _ e e f a f c ク " e e , d k n o n n r ( e サ P ト S a R S l エ l s n = e _ . _ ク e e i t t l . " " " i . o エ { l e i = n t t t s n イ A ( O s N W f ス p _ { r r s t ン n l e o u f h C A X s c n ス s = f r e d s ( ( e v ト L J N i A O ) ト = o u " s e e o を _ f s k r . e o c - e s t ト e . s s a e " " l l ( の _ S A c M R : n r n = s s k 取 r . = e n c a n c C r e l r J = = t . コ エ o f o U B O P 認 E D f s l a { p s e 得 e D s n s d t e S E f n f e S s s a s ン ラ a ) v R A N I 証 " e , m " o i n s R e _ c r e e p R x _ t . q O e e t テ ー d : e L S : _ ) = = { e C n o ( p U l r s f r n t F c t ( D u N l l a ン : _ r ( E A E s = " o s n s o P f e r _ s t " - e o s R e A f f t ツ " d r 例 _ P N o o e : n e _ e n A . s f t - : T p k e U s P . . u が , o i ) U I D s s l r t . c l s L s p _ o = T o t e l P t I h s s 作 t d R ) P . . f e s e s o f e _ e o t k y " k i n f A s _ e e _ 成 r e e L O g g . q e n t o ) B s n o e { p a e o , L . E a s c さ e n = I e e D u l t a k : = A s s k n e p n n = _ p N d s o れ s v T = N t t R e f - t i S i e e " p " ( d B o D e i d ま p r T e e U s . T u e r E o . n = : l : f N a A s P r o e し o u o n n P t U y s s e _ n s _ i " o t S t O s n た n e s = v v A s S p _ q U _ t r c " c c C n a E ( I , _ = ! s ) . ( ( L . E e c = u R c a e s a a s S e : _ N c = " e g f " " _ p R " o e L o t s r p t r R U T o ) . e " U P B o N : d l s } u p f p i f F d R , o 2 s t { S A A s A e o t k s o _ l o _ ト i L k 0 t e s E S S t M " g s s i _ n t i n t ー c } i 1 a n e R S E ( E a = i . e e c s o c / o ク t / e : t v l N W _ , p = n g s s o e k a v k ン ) j s u ( f A O U p _ e s d . e t n e 取 : s , s " . M R R " l 2 r t i e t n i d n 得 o _ D D E D L p i 0 e ( o # e _ o . _ 失 n c R R " " } a c 0 s n = x r n a r 敗 a o U U ) ) / s a : p / こ = t e / p e : p d P P u s t o t こ s v i s i e A A s " i n o で 2 p n + p { / , L L e : o s k ロ 0 o d j o c { _ _ r n e e グ 0 n . s n s d r B B / s / . n イ : s a o s r a e A A l e j c " ン e p n e f t s S S o l s o , セ . i " . _ a p E E g f o o ッ t + , t t [ o _ _ i . n k シ e j e o ' n U U n P " i ョ x s x k d s R R ? A } e ン t o t e a e L L _ S s を n , n t . " } f S 渡 " _ a t ) / o W す , r ' e j r O e ] x s m R s [ t o a D p ' ) n t } o t a = , n y p j s p i s e e / o . ' n n s ] o " t . d a r e t e / u p a s l r _ a t c c i o e c d ( l e ' e } " { ' c , s r f _ t ) o } k " e n _ r e s p o n s e . t e x t } " ) With this, content can be registered as follows. ...

March 1, 2025 · 9 min · Nakamura

Trying Local Authentication with @sidebase/nuxt-auth

Overview I had the opportunity to try local authentication with @sidebase/nuxt-auth, so this is a personal note for future reference. Background In the following article, I introduced how to perform Drupal authentication using @sidebase/nuxt-auth. In that article, I was using Nuxt 3’s SSR with the authjs provider of @sidebase/nuxt-auth. The provider descriptions are as follows. authjs: for non-static apps that want to use Auth.js / NextAuth.js to offer the reliability & convenience of a 23k star library to the Nuxt 3 ecosystem with a native developer experience (DX) local: for static pages that rely on an external backend with a credential flow for authentication. The Local Provider also supports refresh tokens since v0.9.0. Read more here. ...

January 13, 2025 · 9 min · Nakamura

Authenticating with Drupal Using Nuxt 3 and @sidebase/nuxt-auth

Overview This describes how to authenticate with Drupal using Nuxt 3 and @sidebase/nuxt-auth. Background The following article introduced a method for authenticating with GakuNin RDM. The following article introduced a method for using Drupal OAuth from Next.js. Using these as reference, we use Drupal OAuth from Nuxt 3. Method The source code can be found in the following repository. https://github.com/nakamura196/nuxt-rdm Specifically, the implementation is here. https://github.com/nakamura196/nuxt-rdm/blob/main/server/api/auth/[…].ts { } , i n t c c a } t } p } d a y l l u , o , r , : m p i i t u p } k a } o r } e e e e h r a , e s , f e ; " : : n n o l r s r r } n y c } c } c i } r i t i n e i d t t r : a c e e / : n o ) o ) o f e l u d a m m r " " I S i m o s d u a c n c c c g r } ; n m h } b ; n t t e r : m a a u D o d e z p s p p i s p { s l l o r e / s e e , o s ( h u ( n e i g p r a : c a r : e o r e i r t i i d a d u a t t a " d t ! r r p p : l e a u u r t o : n e R / e e e e n i s p h d C y r o n r { r : : l p t u e i c { s c u a q b n n : t r e i r o e o , j e w o o p " a h s t o e p e t n u u o t t _ e R / e d r n s s { f f r p p , l " e : n s r _ _ t t e d _ _ c t c u a s : s t o . n i i o r r " , R : s o t u i h s y i s o y t n u : e n o e t l l f o o , u u . c y r m / t d e n p _ t t = " n k w o e e i f f n s { e e p i e c ( = : c t e u i h P { t = ) k ) . l i i t e n s e : C a c r e : r m / a O - E e s e l l i R v s : o l o n u e x i e c w S T a { r n { u . e e m u . . ` n l n e s t t " : C a a T y w r s b n . . e n D e " $ f b t w e : . a o l i " p a o : , a e p C t R n c { i a e R p u ` n l t , e i r m m r o i U v o g c x U u u a t $ f b " t ( j e a o n m P . d ( k t R n s r h { i a f : ` s i f f e A D e ) ) L t e a o g c e r T o l i i C L R " . d S i R m r ( k t " e o n U l g o _ U , n r { e m u s i ) c a s k s e ( n A P e u a e n . z . d h p . e } e p ) f U A x p r C t c a n r ( p j n ; r . i T L t a c o i o t e u p l s " o " d g H _ A l h n m d i x p r i o r s f N r ( _ S u ` P f e e o t a o c n e u i o n u ) U C t , a i C n A l c a ( q b l u p . R O h r g _ u ` e t ) u " e E l a d L P U a ( n c t , s i ; e . m l l r , E r m ) f o h s o s a p a , C u , l s . i " d U . n t s r i l p ( d g " e r e / e l i a { r ( , " l n x f t f e l u ) , v - P a h e P n C p . . w a i e r r U t l a d D w r l r o s I i l r R w s e u e v e d e C u U - e d s d i , n l p P f : e _ d p t i a A o t r u e r S e l L r h $ ' s d o e n C _ m e { s e " f c t l T - r r , i r I i O u r e u n l e d e K r e s n a e t , n E l s . i m , t N e p s q e U S _ n o t u F R e U c n a e a L c R o s t l r L d e u I l a e e s D " b s t d b T U a , " o e n c i , d x k k m " y t n a " } o w g , o ` w h e n ) n e { c ; n ( e U a s n d e o j r u " e s , m t a i a l s S n e e t e d n e a d m ) e p r i o r i t y Summary There may be some errors, but I hope this serves as a helpful reference. ...

January 12, 2025 · 6 min · Nakamura

Using Drupal OAuth with NextAuth.js

Overview This is a note about using Drupal OAuth with NextAuth.js. Behavior Access the app created with Next.js and press the “Sign in” button. If you are not logged into Drupal, you will be redirected to the login screen. If you are already logged in, an authorization button is displayed. Click to authorize. The login information is displayed. Drupal-Side Setup Module Installation Install the following module. ...

January 9, 2025 · 10 min · Nakamura

Using Custom Permissions in Drupal Custom Modules

Overview I had the opportunity to use custom permissions in a Drupal custom module, so here are my notes. Background In the following article, I introduced a module that executes GitHub Actions from Drupal. However, the permission was set to administer site configuration, so only users with administrator privileges could execute it. The commit addressing this issue is as follows. https://github.com/nakamura196/Drupal-module-github_webhook/commit/c3b6f57bebfeda0556c929c8ed8ed62a0eb0a5c4 Method Below, I share the response from ChatGPT 4o. ...

September 9, 2024 · 4 min · Nakamura

I Created a Drupal Module to Trigger GitHub Actions

Overview I created a Drupal module to trigger GitHub Actions. https://github.com/nakamura196/Drupal-module-github_webhook Below is an explanation of how to use it. Usage Configuration After installing the module, navigate to the following path. /admin/config/github_webhook You will see a screen like the following. It is divided into two main sections: Repositories and Trigger Webhook. First, enter the repository information for the GitHub Actions target in Repository 1 under Repositories. You can add and remove repositories using Add repository and Remove repository. ...

August 24, 2024 · 3 min · Nakamura

Specifying Sort Order in Drupal Facets

Overview These are notes on specifying the sort order in Drupal Facets. Method You can change the facet settings by accessing the following: /admin/config/search/facets Clicking the edit button for each facet navigates to the following screen: At the bottom of the screen, there is a Facet sorting section where you can configure sorting by count and by name. To sort by name, uncheck Sort by count. Summary I hope this serves as a useful reference when working with Drupal. ...

August 23, 2024 · 1 min · Nakamura

Preventing Unpublished Content from Being Indexed by Drupal's Search API

Overview This is a memo on how to prevent unpublished content from being indexed by Drupal’s Search API. References This was also documented in the following article. https://www.acquia.com/jp/blog/introduction-to-search-api-1 Method It was necessary to enable “Entity status” at the following location: /admin/config/search/search-api/index/xxx/processors Summary We hope this serves as a useful reference.

August 20, 2024 · 1 min · Nakamura