Provides a hook_uninstall which:
* Deletes all variables "views_filterblock_view.$delta"
* Deletes variable views_filterblock_num

Comments

douggreen’s picture

@corix, first Thanks! (This was part of a (GHOP Task).

Second, why did you choose to iterate $conf instead of just calling variable_get('views_filterblock_num') and using that number?

corsix’s picture

If you were to set it to say 5 blocks, and configure all five, then decide that you only need 3, then using views_filterblock_num would only get rid of the first 3, leaving the latter two.

dmitrig01’s picture

Status: Needs review » Reviewed & tested by the community

Agreed, this was a good choice.

douggreen’s picture

Status: Reviewed & tested by the community » Needs work

I agree that it's a good choice, but I still don't like the code. You're doing a strlen() for each key in that loop, when this is something that you know outside the loop. I'd probably get the length up front, and then use substr($key, 0, $len) == $prefix. "strncmp" is a sooo C/C++.

corsix’s picture

Status: Needs work » Needs review
StatusFileSize
new954 bytes

Agreed, strlen should be done outside the loop. I'm unhappy about using substr, as it causes a new string to be created (you can tell I have a C/C++ background, can't you?), but it is more the PHP way.

douggreen’s picture

Status: Needs review » Fixed

Committed, Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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