blog.birk-jensen.dkDrupal: Get the current entityFirst things first, it’s not always possible to get the current entity, some routes will have more than 1 entity, some wont have any, drush wont give a route. But most of the time, what you want when talking about the current entity is the entity bei...Aug 11, 2025·5 min read
blog.birk-jensen.dkDrupal: Paging an SQL queryEvery time I need to make a pager ind Drupal I need to ask AI or / and do some searching to figure out.I don’t know why I can’t remember how, I just can’t, so this is a boilerplate for me (and anyone else who find it useful) for making paged SQL quer...Jul 2, 2025·5 min read
blog.birk-jensen.dkHashnode tag filtered RSSIf you just want the code, here it is: https://github.com/BirkAndMe/hashnoderss.It should be straight forward, check the index.php file to get the gist of things. Intro A while back Hashnode released a new version of their public API, and one of the ...Dec 9, 2024·2 min read
blog.birk-jensen.dkDocumenting a callback function in JSDocA callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action. -- MDN: Callback function Callbacks are used all over in JavaScript, a good ex...Jan 12, 2024·7 min read
blog.birk-jensen.dkDrupal: HTTP redirection from anywhereThe drupal_goto() function was removed in Drupal 8, and this is all good!In the change record there's an example, of how to do a redirection outside the context of a controller: Redirecting when not in context of a controller $response = new Redir...Sep 5, 2023·5 min read