Problem/Motivation
When a site has been built, and then edited it remains in a 'built' state. Ideally the state should change to stale to indicate that it needs a rebuild and deploy.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 3349512-7.patch | 10.32 KB | mortim07 |
| #17 | 3349512-6.patch | 10.37 KB | mortim07 |
| #14 | 3349512-5.patch | 10.41 KB | mortim07 |
Comments
Comment #2
mortim07 commentedComment #3
mortim07 commented@larowlan Happy to add a test in if you think this is valid?
Comment #4
larowlanany reason not to just return instead of using an if?
+1 for a test
Comment #5
mortim07 commented@larowlan Nope, just me not seeing the obvious. 😂
Comment #6
mortim07 commentedComment #7
mortim07 commentedAdding test.
Comment #8
mortim07 commentedComment #9
larowlanshould we also be comparing the updated time of the content items where they're instances of EntityChangedInterface?
Comment #10
mortim07 commented@larowlan Good point. I think that could be useful, albeit if they're saving the build then it's more likely they've added or removed something so that would take precedent anyway. I'm happy to add it in though.
Comment #11
mortim07 commented@larowlan Take a look and let me know what you think. In essence in addition to changing a build, when a content entity is updated it checks to see if there is a preview site build connected to it and sets the status to stale. I've introduced a setting that allows you to turn this behaviour off if it has performance implications. I've also added tests. Happy to discuss further. :)
Comment #13
mortim07 commentedLet's try this again.
Comment #14
mortim07 commentedComment #15
mortim07 commentedComment #16
larowlanThis looks great, just one comment about the update hook and a minor performance optimisation
I think we need 'trust data' TRUE for the save call here because this is happening in an update hook
Can we use loadMultiple outside the loop here, for better performance
yeah this is much cleaner
Comment #17
mortim07 commented@larowlan Addressed your feedback.
Comment #18
larowlanwe don't need this anymore, loadMultiple filters out nulls
Feel free to remove that and commit
Comment #19
mortim07 commented@larowlan All done.
Comment #20
larowlanThanks
Comment #22
mortim07 commentedComment #23
larowlan