#35235 closed defect (bug) (fixed)
remove_permastruct()
| Reported by: | swissspidy | Owned by: | swissspidy |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5 |
| Component: | Rewrite Rules | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests commit |
| Cc: | Focuses: |
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
@
11 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
@
11 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
@
11 years ago
- Keywords commit added
35235.2.diff is an updated patch with improved docs and slightly updated unit tests.
#6
@
11 years ago
35235.2.diff looks like a go to me.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.)