-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Afform - reset managed entities when deleting a dashlet #22957
Conversation
(Standard links)
|
@@ -667,11 +667,11 @@ protected function loadDeclarations(): void { | |||
|
|||
protected function loadManagedEntityActions(): void { | |||
$managedEntities = Managed::get(FALSE)->addSelect('*')->execute(); | |||
$this->managedActions = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit test revealed this variable was leaky. The purpose of this function is to rebuild this array, but it needs to be reset first due to the singleton pattern.
4a36c4e
to
6415a32
Compare
Fixes dev/core#3122
6415a32
to
cc9b2a9
Compare
@MegaphoneJon can you confirm this fixes your issue? |
This doesn't fix the issue, but for what seems like an unrelated-ish regression. Deleting the Search Kit search no longer deletes the associated Form Builder form. |
@MegaphoneJon not according to the unit tests.This is still passing: civicrm-core/ext/search_kit/tests/phpunit/api/v4/SearchDisplay/SearchAfformTest.php Lines 242 to 247 in 095e8ae
|
@MegaphoneJon actually I just took a closer look and you're right. The unit test wasn't catching this problem with deleting an afform using a "default display": #22997 So if we merge that PR as well as this one, it should all be working well according to the tests. |
@MegaphoneJon now that #22997 is merged are you good with merging this one too? |
I have no objection to this being merged - but it also seems as though #22997 was the bug that was generating the error for end users. When this PR is applied I can see that the entry in |
Overview
Fixes dev/core#3122
Before
Deleting an afform does not delete the related dashlet
After
Now it does
Technical Details
It wasn't as simple as adding a cache clear in the revert function, because if multiple afforms were being reverted at once, that would be very slow clearing the cache each time. So I refactored the
BasicBatchAction
to allow the cache to be cleared after the whole batch is processed.