Would it be possible to limit trigger not only per entity but also per bundle (content type)?
We have a site that serves a number of front-ends. Triggering by entity Content causes Netlify to build too often. We need to be able to trigger when a particular content type gets updated/created/deleted.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | interdiff-6_7.txt | 187 bytes | jonnyeom |
| #8 | build_hooks-limit_per_bundle-3069833-7.patch | 7.8 KB | jonnyeom |
| #6 | interdiff-1_6.txt | 8.5 KB | jonnyeom |
Comments
Comment #2
jonnyeom commentedI thought this would be useful as well!
Here is a patch that I am using to accomplish this.
You should now be able to choose individual bundles in the build hooks settings page.
Comment #3
jonnyeom commentedComment #4
larowlanwe need a corresponding change in the schema.yml file too
the change in function name here is a BC break - instead could we add an additional method and check isEntityTypeLoggable && isEntityLoggable?
this would require people to update their config, we should make it that 'no bundles selected == all bundles' so that there's no BC issues
the module is stable, so this is a BC break - we should use BC here as follows:
* allow the new argument to be null
* if it is null trigger a deprecated error and use the \Drupal singleton to set the value
this can't be translated
this fails to remove bundles of entity types that were previously enabled but are now disabled
Comment #5
jonnyeom commented@larowlan,
Thanks for the thorough review! Will be updating the patch with hopefully all of these items addressed
Comment #6
jonnyeom commentedUpdated patch to work with latest release.
Addressed item mentioned.
1. schema.yml changes made
2. Keeping isEntityTypeLoggable() as recommended. isEntityLoggable() is just a new function.
3. Fixed!
4. Great idea. Fixed!
5. I think the label is already translated so just manually translated the last 'Bundles' txt.
6. Fixed!
Please follow up if you find anything else.
Comment #8
jonnyeom commentedI missed a
!.Re-running tests.
Comment #9
larowlanThanks for this.
We now need an upgrade path and a test to go with that.
The tests are failing because the default value assumes the node module is enabled, we'll need to set it to be empty by default
Comment #10
larowlanComment #11
coufu commentedNot to take away from the great work done on this issues, but I would find this more useful if the bundles were associated with each of the build hooks. The use case is that I have one Drupal instance that serves multiple sites.
For example:
- Developer blog (prod) would have "Developer blog page", "Developer blog entry", and "Developer blog author" content types associated with it
- Developer blog (stage) would have the same as above
- Virtual event (prod) would have "Virtual event page", "Virtual event speaker", and "Virtual event agenda session" content types associated with it
- Virtual event (stage) would have the same as above
If it's out of the scope of this issue, I might open a new issue and begin work on something like this, but I think that both implementations in the same module would be redundant