- Issue created by @penyaskito
- First commit to issue fork.
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Are you a bot? Please refrain to act like that. Thanks.
- Assigned to elber
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
There's nothing to work on this at the moment.
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
@elber You are definitely welcome to work on this. Really sorry if I looked annoyed, edited the previous comments.
- Assigned to gxleano
- ๐ช๐ธSpain gxleano Cรกceres
I will take this issue as it has not had any feedback for a month.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 11:16am 9 May 2023 - Assigned to elber
- Issue was unassigned.
- Status changed to RTBC
over 1 year ago 11:54am 16 May 2023 - ๐ง๐ทBrazil elber Brazil
Hi I took a look on it.
Patch is good
Issue problem was fixed
route is also ok
Moving to RTBC - Status changed to Needs work
over 1 year ago 7:49am 29 May 2023 - ๐ช๐ธSpain plopesc Valladolid
Hi!
Thank you for the patch.
Checked the code and I think that could be better to have an actual form instead of a link to clear the cache. In this way, we are exposing a URL to clear the cache remotely and that's not desirable, I think.
This is mitigated by the fact of the permission necessary to access to hat URL, but I think that a form is a better solution, like in/admin/config/development/performance
.Reusing
Drupal\system\Form\ClearCacheForm
could be a possibility as well. - ๐ช๐ธSpain gxleano Cรกceres
Thanks @plopesc for the feedback!
I will work on this new form. - ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
I've spent 2 hours debugging this but I cannot place this block. It just doesn't appear as an option nor in a dashboard nor in the general blocks page.
I've reviewed the code and didn't find anything wrong. - ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Oh the patch failed to apply and somehow didn't notice.
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Solved the patching issue with -p2: https://github.com/penyaskito/dashboard-initiative/commit/6e3d13508f80bb...
+++ b/core/modules/system/src/Plugin/Block/ClearCacheBlock.php @@ -0,0 +1,63 @@ + return $this->formBuilder->getForm('Drupal\system\Form\ClearCacheForm');
The Clear cache form includes a collapsible details elements that make the dashboard look weird.
I think we should refactor the performance page controller so the details is out of the form itself.
We want to do the same on PerformanceForm for consistency. - ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Attached screenshot for clarity
- ๐ช๐ธSpain gxleano Cรกceres
Thanks @penyaskito for the fix!
As for the Cache block, I had the same feeling when I was working on this. So, I'm going to spend some time to refactor the performance page controller.
- ๐ช๐ธSpain gxleano Cรกceres
I have been checking the
ClearCacheForm
class in order to try to refactor the details element to get ride off it, but on my eyes this would be a "big" change in the look and feel of the config in Drupal.The most of the config pages in Drupal are using this collapsible details element, also in the performance page, the performance form is using it, we could try to find a good alternative to change it only in the performance page, but I would say it should follow the same look and feel than the rest of the config pages in Drupal, so in this case I would try with two possible options here:
1. Create a new Clear cache form only with the submit button (I don't really like this option as we would be doing the same thing twice in a different way)
2. In the new Clear cache block which we are providing, once we get the Clear cache form in the build method, get ride off the details element. - ๐ช๐ธSpain plopesc Valladolid
Hi @gxleano
We could explore a 3rd option:
- Remove the details wrapper from the ClearCacheForm definition, leaving there the button alone.
- Add the details wrapper to the PerformanceController::build() method
- Include the form within the wrapper created above
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
- ๐ช๐ธSpain gxleano Cรกceres
I like the option that @plopesc mention in #22 โจ Provide a block for clearing caches from a dashboard Postponed , so I will attach the patch with this solution during the day.
Thanks to both!!
- Status changed to Needs review
over 1 year ago 10:46am 28 June 2023 - ๐ช๐ธSpain gxleano Cรกceres
Fix patch #25 โจ Provide a block for clearing caches from a dashboard Postponed
- ๐ช๐ธSpain gxleano Cรกceres
After applying the patch, everything works fine.
- Status changed to Postponed
over 1 year ago 2:24pm 18 July 2023 - ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
I've merge the usage of the patch in the gh repo. This looks good to me.
We need to decide yet if we are going to provide these blocks, or re-purpose this to get the patch in core. - Merge request !6174Issue #3351706 by gxleano, elber, plopesc, penyaskito: Provide a block for clearing caches from a dashboard โ (Open) created by plopesc
- Status changed to Needs review
11 months ago 2:57pm 15 January 2024 - ๐ช๐ธSpain plopesc Valladolid
Created MR based on latest @gxleano's patch, including basic test coverage.
Tests are green, so let's get it reviewed!
- Status changed to Needs work
11 months ago 12:43am 16 January 2024 - ๐บ๐ธUnited States smustgrave
Left a few small comments.
Also seems like will need a change record for the new block.
- Status changed to Needs review
11 months ago 7:00am 16 January 2024 - ๐ช๐ธSpain plopesc Valladolid
Thank you for your review @smustgrave
Added the missing type hints and created the Change Record draft ([#3414904])
- Status changed to RTBC
11 months ago 8:31pm 17 January 2024 - ๐บ๐ธUnited States smustgrave
Tested this on a standard install of 11.x
Applied the MR and cleared cache via drush
Went to the performance page and everything still appears the functional and the same.
Went to block layout and placed the new "Clear cache" block into the content region.
Confirmed it's there.
Clicking it appeared to clear the cache, same as performance page.Issue summary + CR are present and appear completed.
Test coverage appears to cover the placement and usage.
+1 RTBC from me.
- Status changed to Needs work
11 months ago 6:17pm 3 February 2024 - ๐ฌ๐งUnited Kingdom longwave UK
Block plugins should use attributes instead of annotations since 10.2.0.
- Status changed to Needs review
11 months ago 8:35pm 3 February 2024 - Status changed to Needs work
11 months ago 8:47pm 3 February 2024 - ๐ฌ๐งUnited Kingdom longwave UK
You can also delete the annotation, we don't need both (or the duplicate class doc block).
- ๐ช๐ธSpain gxleano Cรกceres
Thanks for the quick review @longwave!
I though that it was removed in the MR.
- Status changed to Needs review
11 months ago 9:02pm 3 February 2024 - Status changed to RTBC
11 months ago 11:54pm 6 February 2024 - ๐ณ๐ฟNew Zealand quietone
I'm triaging RTBC issues โ . I read the IS, the comments and the CR. I didn't find any unanswered questions.
This is changing the UI and should be tagged Usability as well as provide screenshots, available from the issue summary. Not sure if this qualifies for a usability review.
The CR has all the data but it should put how to find the new block at the beginning instead of the end. Even a screenshot would help. It also has a error in tense, 'displayed name' should be 'display name'.
The issue summary explains that this feature is for the Dashboard initiative. The issue discussing that proposal is still active and therefor not approved. I am not aware that we make changes for unapproved plans. What other support is there for this feature?
- Status changed to Needs work
10 months ago 7:47am 26 February 2024 - Status changed to Needs review
10 months ago 8:56am 26 February 2024 - ๐ช๐ธSpain plopesc Valladolid
Hi @quietone.
According to your last comment, I made the following changes:
- Merge 2 separated test methods into 1
- Add block screenshots to the IS
- Rephrase the CR and add block screenshot
As part of the dashboard initiative some blocks that could be useful for both the dashboard or administrator user in general were detected. In parallel, we are working in adding those blocks to core, so they would be already available when dashboard comes in, making dashboards more useful for admin users.
See โจ Provide a block for running cron from a dashboard Needs work
- Status changed to RTBC
10 months ago 2:22pm 26 February 2024 - ๐บ๐ธUnited States smustgrave
Feedback appears to be addressed.
I use admin_toolbar to quickly clear cache but can imagine being able to place this feature somewhere could be useful.
- Status changed to Postponed
10 months ago 12:42am 27 February 2024 - ๐ณ๐ฟNew Zealand quietone
Thank you for the updates, although I have not yet reviewed them all.
I asked about this issue in committer slack and this will need approval from the product managers, one of which is away until next week. I am adding tags, updating the remaining tasks and setting status to postponed.
- Status changed to Needs review
about 2 months ago 12:54am 29 October 2024 - ๐ฎ๐ณIndia nikhil_110
Test Steps for Setting Up Drupal 11.x-dev
- Setup Drupal 11.x-dev.
- Apply the Merge Request (MR).
- Navigate to:
- Administration > Structure > Block layout
- Place a Block:
- Click the "Place block" button in the desired region.
- Choose a block from the "Clear cache" section.
- Check the Home Page:
- Verify that the "Clear cache" block is displayed correctly.
Suggestion
I reviewed the code changes made inPerformanceController.php
andClearCacheForm.php
, specifically regarding the removal of the wrapper for the "Clear Cache" block. I believe this is not an appropriate modification to the core functionality.
To test this, I completely removed the code fromPerformanceController
andClearCacheForm
, and observed that the "Clear Cache" block reverted to its default state.
I suggest that the necessary adjustments should be implemented within the plugin file itself, as a new block is created for the dashboard. This approach would be more suitable.
I have attached a screenshot โ of the removed code for your review. Please take a look. - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
As a Drupal product manager, I think the feature makes sense as a directly working button.
- ๐บ๐ธUnited States smustgrave
Thanks @gabor
Believe this one is good then, all threads resolved on the MR. Test coverage appears to be there. Wasn't sure if we needed to add test to verify that cache is actually cleared but since the block is returning an existing form, ClearCacheForm, figured that's tested.