{"id":23173328,"url":"https://github.com/widgetsburritos/drupal-patch-checker","last_synced_at":"2025-07-26T07:09:41.554Z","repository":{"id":33665890,"uuid":"160456945","full_name":"WidgetsBurritos/drupal-patch-checker","owner":"WidgetsBurritos","description":"Checks for risky hook_update_N() references in composer patches. ","archived":false,"fork":false,"pushed_at":"2023-09-29T21:02:44.000Z","size":106,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-17T17:16:33.896Z","etag":null,"topics":["checker","composer-plugin","drupal","drupal-8","patching"],"latest_commit_sha":null,"homepage":"https://www.widgetsandburritos.com/posts/2018-12-07/patching-production-drupal-sites-hook-update-n-risky","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WidgetsBurritos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-05T03:45:08.000Z","updated_at":"2022-03-01T15:15:45.000Z","dependencies_parsed_at":"2022-08-07T22:17:04.863Z","dependency_job_id":null,"html_url":"https://github.com/WidgetsBurritos/drupal-patch-checker","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WidgetsBurritos%2Fdrupal-patch-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WidgetsBurritos%2Fdrupal-patch-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WidgetsBurritos%2Fdrupal-patch-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WidgetsBurritos%2Fdrupal-patch-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WidgetsBurritos","download_url":"https://codeload.github.com/WidgetsBurritos/drupal-patch-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230219877,"owners_count":18192180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["checker","composer-plugin","drupal","drupal-8","patching"],"created_at":"2024-12-18T05:11:50.168Z","updated_at":"2024-12-18T05:11:51.066Z","avatar_url":"https://github.com/WidgetsBurritos.png","language":"PHP","readme":"# Drupal Patch Checker\n\nA simple helper script for checking composer dependencies to ensure it's not adding `hook_update_N()` functions via patches.\n\n## Why This Exists\n\nI recently realized that [using patches containing hook_update_N() is risky](https://www.widgetsandburritos.com/posts/2018-12-07/patching-production-drupal-sites-hook-update-n-risky). Long story short, it could potentially create conflicts with other module updates, meaning some update hooks may never run at all. This can have some negative effects down the road. This script helps preempt those issues.\n\n## First Time Setup\nInstall this package as a dev dependency:\n\n```bash\ncomposer require --dev widgetsburritos/drupal-patch-checker\n```\n\nThen add the following to your `composer.json` file:\n\n```json\n    \"scripts\": {\n        \"check:patch\": [\n              \"WidgetsBurritos\\\\DrupalPatchChecker\\\\DrupalPatchChecker::checkComposerFile\"\n         ],\n    }\n```\n\n## Checking Patches Manually\n\nYou can check your patches manually by running:\n```composer run check:patch```\n\nThis will produce a result similar to this:\n```bash\n$ composer run check:patch\n\u003e WidgetsBurritos\\DrupalPatchChecker\\DrupalPatchChecker::checkComposerFile\nScript WidgetsBurritos\\DrupalPatchChecker\\DrupalPatchChecker::checkComposerFile handling the check:patch event terminated with an exception\n\n  [Exception]                                                                                                              \n  patches/language_hierarchy/language_hierarchy-limit_views_results-2825851-14.patch contains hook_update_N() on Line 50.  \n```\n\n## Checking Patches Automatically on Package Install/Update\n\nIf you want to prevent patches from getting installed altogether update your `composer.json` file accordingly:\n```json\n    \"scripts\": {\n        \"check:patch\": [\n              \"WidgetsBurritos\\\\DrupalPatchChecker\\\\DrupalPatchChecker::checkComposerFile\"\n         ],\n         \"post-install-cmd\": [\n              \"composer run check:patch\"\n         ],\n         \"post-update-cmd\": [\n              \"composer run check:patch\"\n         ],\n    }\n```\n\nThen the next time you run `composer install` or `composer update` if your project contains a patch with `hook_update_N()` it will throw an exception.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwidgetsburritos%2Fdrupal-patch-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwidgetsburritos%2Fdrupal-patch-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwidgetsburritos%2Fdrupal-patch-checker/lists"}