Project:Views Filter Block
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

AttachmentSize
views_filterblock_uninstall.patch860 bytes

Comments

#1

@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?

#2

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.

#3

Status:needs review» reviewed & tested by the community

Agreed, this was a good choice.

#4

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++.

#5

Status:needs work» needs review

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.

AttachmentSize
views_filterblock_uninstall_2.patch 954 bytes

#6

Status:needs review» fixed

Committed, Thanks!

#7

Status:fixed» closed (fixed)

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