#35235 closed defect (bug) (fixed)
remove_permastruct()
Reported by: | swissspidy | Owned by: | swissspidy |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Rewrite Rules | Keywords: | has-patch has-unit-tests commit |
Focuses: | Cc: |
Description
As suggested in 35227#comment:3, it's worth adding a remove_permastruct()
helper to make it easier cleaning up permastructs.
Attachments (2)
Change History (11)
#3
follow-up:
↓ 4
@
9 years ago
I tried to make remove_permastruct()
the counter part to add_permastruct()
, so I'd suggest making this clear in the documentation for both functions ("Add/remove extra permastruct").
#4
in reply to:
↑ 3
@
9 years ago
Replying to swissspidy:
I tried to make
remove_permastruct()
the counter part toadd_permastruct()
, so I'd suggest making this clear in the documentation for both functions ("Add/remove extra permastruct").
This sounds good to me. Something along the following lines should work: "This function can only be used to remove permastructs that were added using add_permastruct()
. Built-in permastructs cannot be removed."
#5
@
9 years ago
- Keywords commit added
35235.2.diff is an updated patch with improved docs and slightly updated unit tests.
#6
@
9 years ago
35235.2.diff looks like a go to me.
A question about the semantics of the new function and method.
remove_permastruct()
will only allow for the removal ofextra_permastructs
, ie those that have been added viaadd_permastruct()
. It won't be possible to use it to remove built-in, hardcoded permastructs like 'post_tag' or whatever. Is it worth considering a more descriptive name likeremove_extra_permastruct()
? Or is it enough to note the limitation in the documentation? (The latter seems right to me - I just want to get a second opinion on it.)