Use guide

Flush sets up a javaScript hotkey event that will trigger the clearing of cache and return you to the page you came from. The assigned hotkey can be changed in the configuration options (admin/flush/settings).

You can also configure Flush so that only certain user groups can access. See permission settings
to configure the access levels.

git clone --branch 7.x-2.x-dev http://git.drupal.org/sandbox/brianjamesward/1820014.git flush

Sandbox link: https://drupal.org/sandbox/brianjamesward/1820014 (7.x-2.x-dev)
Intended Drupal version: 7.x

Comments

briward’s picture

Issue summary: View changes
briward’s picture

Issue summary: View changes
briward’s picture

Category: Feature request » Task
briward’s picture

Title: Flush » [D7] Flush
briward’s picture

Assigned: briward » Unassigned
PA robot’s picture

Status: Active » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxbrianjamesward1820014git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

briward’s picture

Issue summary: View changes
briward’s picture

Status: Needs work » Needs review

I have now fixed a whole bunch of the 'standards' issues now although for some reason there appears to be some more. They don't appear to be important issues so I don't think it matters?

see - http://pareview.sh/pareview/httpgitdrupalorgsandboxbrianjamesward1820014git

neetu morwani’s picture

Status: Needs review » Needs work

@brianward
Module does not follow Drupal Coding standards which is the main blocker for the module to get published.
PAReview of the module gives errors and warnings which are supposed to be resolved.
http://pareview.sh/pareview/httpgitdrupalorgsandboxbrianjamesward1820014git None of these errors should exist.
1. Module doen not work properly in terms of functionality.
2. The page admin/flush/run returns nothing but WHITE SCREEN OF DEATH. On next Reload , we get the message "Flush has cleared the system cache.".
3. Incomplete README.txt file. Complete Installation instructions required.
Install as usual is not acceptable.
Mention Download the module and place the module in sites/all/modules/ directory and then enable the module by hitting the url admin/modules.
4. Mention the link of the GIT repository on the issue link as well as the project page.
Mention git clone --branch 7.x-2.x http://git.drupal.org/sandbox/brianjamesward/1820014.git flush before the sandbox project link.
5. Line 175 of the module has a system setting form and there are variable in the form which should be prefixed with the name of the module in order to avoid collisions with other module and also to enhance the readability of the variables in database table 'variables'.
Line 131 has a variable $form['hotkey_help'] which should be renamed to $form['flush_hotkey_help'].
6. File flush.install should implement

function hook_uninstall() {
}

to delete all the variables introduced in the module.
Please resolve these errors.

ameymudras’s picture

Following are the issues i found
1. Rather than using the following code

 $home = $_SERVER['HTTP_REFERER'];
           header("Location: $home");
           exit;

You can directly use the function drupal_goto

2. drupal_set_message(t('Flush has cleared the system cache.'), 'status');
drupal_flush_all_caches();
You are displaying the message before the cache is cleared
3. Interms of the functionality the module dosent work properly

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

briward’s picture

Issue summary: View changes
briward’s picture

Issues resolved:

  1. Changed all my standards within PHPStorm to match 'Drupal' standards and reformatted the code.
  2. "White screen of death" has now been fixed and page redirects to the "admin" screen if there was no referrer page.
  3. Readme file has been updated and includes 'install' section.
  4. Git repository link and code added to the sandbox description page
  5. Variables within the form now renamed and prefixed with "flush_"
  6. Changed to use "drupal_goto" function rather than using the native PHP function 'header'.
  7. Flush message now appears AFTER the cache has been flushed.
  8. Changed the library used for hotkeys.

Re-opening this ticket now in hope it can be approved.

briward’s picture

Status: Closed (won't fix) » Active
marcus_johansson’s picture

Status: Active » Needs work

There are still some errors coming from the automated check:
http://pareview.sh/pareview/httpgitdrupalorgsandboxbrianjamesward1820014git

You should check if they are by design or something that you should fix.

Two things you should fix and two thoughts:

  1. On row 113 you need to set the flush_hotkey variable to something by default. Right now it's null and it all fails. Either on that row or in the install file.
  2. On row 59 you use $_SERVER['HTTP_REFERER']. You should use referer_uri from Drupal API instead. Right now your code will give notices on some browsers that does not send the HTTP_REFERER.
  3. Since jquery hotkey is a common js that might be used by other modules you should maybe look into moving it into Libraries API instead: https://www.drupal.org/project/libraries ?
  4. You should probably move your module away from hook_init to something like hook_page_build, hook_preprocess or something like that. Hook_init runs before any caching, and your module would work even when cached?
briward’s picture

Thanks for your comments Marcus, I'll work on adding these 4 points as soon as possible.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.