Closed (fixed)
Project:
Build Hooks
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Jun 2021 at 09:50 UTC
Updated:
14 Jul 2021 at 23:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
petar_basic commentedHere is a patch that adds checks for environment status before adding it to toolbar.
Comment #3
petar_basic commentedChanging the name of the patch.
Comment #4
larowlanWe need to return the #cache here so that the item can be invalidated properly.
So perhaps we just return the empty cache item.
Can you add a new test for this, see
\Drupal\Tests\build_hooks\Functional\UiTest::assertToolbarIntegrationFor an example.
The test should disable the env, make sure the button isn't there, then re-enable it.
Comment #5
petar_basic commentedI improved the patch so it only looks for environments with status true instead of having multiple if-s.
Added a test that checks if an active environment is shown in the toolbar and that an inactive one is not shown.
Comment #6
petar_basic commentedComment #7
larowlanWe need to call this method from one of the `test{Something}` methods in order for it to be run
Comment #8
larowlanComment #10
petar_basic commentedSeems like the entity has to be saved after change. And the test should be run before the last one.
Comment #11
petar_basic commentedComment #13
larowlanThanks, cutting 3.2.1 with this in it
Comment #14
larowlanhttps://www.drupal.org/project/build_hooks/releases/3.2.1