This is very handy for testing node access modules, as well as in site upgrade scripting. Adding it to the clear cache command is a single line patch, however I am wondering if this will be to inconvenient to people with large sites, since "cc all" could run for a long time, and they would then need cal call the other $types with separate drush cc calls. One way to ameliorate this would be to allow multiple types in a single command, which should be a simple explode and foreach loop. On the other hand, moving this to a new command seems a bit heavyweight.

Thoughs?

CommentFileSizeAuthor
#3 node_access.patch638 bytesowen barton
node_access.patch639 bytesowen barton

Comments

owen barton’s picture

Oh wait - I misread "all" as iterating over all our defined $types, however it just calls drupal_flush_all_caches, which does not rebuild node access. Hence, I don't see a downside here - unless anyone has any feedback I think I will go ahead and commit later this week.

greg.1.anderson’s picture

How about "cc quick" as a shortcut for all of the caches except those that would be very slow to clear and rebuild?

owen barton’s picture

StatusFileSize
new638 bytes

And of course, we can't have a space here

moshe weitzman’s picture

Status: Needs review » Needs work

For me, this is needs work because of what you said - makes 'all' useless on large sites with node access. We might be getting to a point where we need to mimic 'structure-tables-key' in the sql commands. with this key, admins can create groupings of cache commands. i don't know how many people will use this though.

owen barton’s picture

Well, as I said in #1 - it actually doesn't make "all" useless for big site because it is not actually included in "all" (without additional work). The corollary of course is that this makes "all" inaccurate, so I think there is a need for a more flexible setup if people feel it would be useful.

moshe weitzman’s picture

Status: Needs work » Needs review

OK, back to CNR

moshe weitzman’s picture

Status: Needs review » Fixed

Committed this with one wrinkle - the nodeaccess option only shows up if - module_implements('node_grants')) is non empty. This matches core behavior.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

omega8cc’s picture

Component: Code » PM (dl, en, up ...)
Category: feature » bug
Priority: Normal » Major
Status: Closed (fixed) » Active

It looks like rebuilding node access on drush cc breaks stuff if you are not running drush as uid=1 - see #1075002: nodeaccess table compromised after site verify ( migration )

greg.1.anderson’s picture

Hm, should we just force --user=1 for cc, or warn iff nodeaccess is enabled? Seems former is better, perhaps?

moshe weitzman’s picture

Status: Active » Closed (works as designed)

That must be a special problem with nodeaccess module then. It should not be checking the current user. It should typically use node author. Please reopen with detail if I am wrong.