Patching core as part of installing a module is not a good practice and should be avoided.
I reviewed the code on Jan 7, but it looks like the code has not changed: Chunk 1 can be implemented without patching using the link altering API, chunk 2 with theme altering, chunks 3 and 4 with the form altering API.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | support-remove-comment-module-patch-issue-396512-18.patch | 1.55 KB | borgewarvik |
| #14 | support-remove_comment_patch-396512-14.patch | 955 bytes | mrtoner |
Comments
Comment #1
jeremy commentedAssigning to myself to review.
Comment #2
jeremy commentedI do not see how to implement chunk 1 with the link altering API. I added a "jobtrack_link_alter()" function to the module and then visited the page in question, and no links are passed in. Is the link altering API only for nodes, not for comments?
I suppose the jobtrack module could redefine theme_comment_wrapper() using theme_registry_alter(), but that seems as ugly to me as providing an optional patch. Is there a simpler alter function allowing me to only alter one element, similar to form_alter?
I did remove the final two chunks, moving them into form_alter() as recommended.
Comment #3
roball commentedWhat's the purpose of this patch at all? You say it is optional - so it's not part of the normal install process, right?
Comment #4
jeremy commentedThe patch is explained in INSTALL.txt, step 0.
Comment #5
drummFrom comment.module:
so I think comment link altering should work.
I actually don't see an especially clean way to remove the remaining chunk. comment_render doesn't pass the comment form title to theme('comment_wrapper'), but that does eventually get to theme('box'), with no context. Overriding the theme function or template is exactly what the theme altering API is useful for, but the comment module doesn't use the theme API very well in Drupal 6.
Comment #6
roball commentedOK, but I don't get it. INSTALL.txt says
What does this mean?
Comment #7
jeremy commentedThank for the feedback, Neil. Sadly, I can't seem to make the _link_alter function do what I need, nor have I figured out how to get rid of the other patch hunk. Fortunately these are just optional cosmetic changes, however I would love to figure out how to do them without the patch. I'll leave this issue open hoping that someone else may come along with a solution, or that I'll find time to dig into it again and figure something better out.
Comment #8
jeremy commented@rohit: it removes some of the standard text output by the comment module when users are commenting on tickets. For example "Post a comment" is removed, and the individual "reply" links are removed. The patch is purely cosmetic and thus is completely optional.
Comment #9
jeremy commentedI am unable to remove the final two pieces of this patch. Postponing this ticket for now in the hopes that someone will come along with a solution.
Comment #10
jeremy commentedClosing ticket -- if it becomes possible to remove the rest of the patch, this should be done in the new 'support' module which replaced jobtrack.
Comment #12
roball commentedIf the purpose of the patch is to remove the "Reply" links from Support ticket nodes, you could use the Flatcomments module instead. The "Add new comment" link below the first post will not be displayed when "Location of comment submission form" of the content type's Comment settings are set to "Display below post or comments".
Thus I think this patch can safely be removed from the distro.
Comment #13
jeremy commentedAdditional ideas in this ticket:
#655646: bad idea: comment customization
Comment #14
mrtoner commentedThis should provide the desired functionality without hacking core.
Comment #15
jeremy commentedThanks! It's always fun committing a fix for an issue opened >2 years ago! :)
As this may not be desired behavior for all installs I added configuration options for this. I also made both of these disabled by default. Committed here:
http://drupalcode.org/project/support.git/commit/ebb3248
Needs to be ported to the 7.x branch.
Comment #16
bdragon commentedRedone for D7.
http://drupalcode.org/project/support.git/commit/ca6cf68a607581c4ca395a9...
Comment #18
sign commentedNot going to re-open such an old issue, however there is a bug with D6 version. Don't ask me how I found it. :)
By implementing theme_registry_alter, you are forcing Drupal to use just that function and then the theme does not get a chance to rewrite it. What you are trying to achieve, can be sorted by removing the support_theme_registry_alter and support_comment_wrapper replacing it by preprocess function preprocess_comment_wrapper such as:
just in case anyone else will stumble upon this...
Comment #19
borgewarvik commentedCan confirm comment #18. Attached is a patch that is working for us.