Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
comment.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2006 at 20:38 UTC
Updated:
25 Oct 2012 at 21:27 UTC
Jump to comment: Most recent file
Comments
Comment #1
killes@www.drop.org commentednew features go into devel version.
Comment #2
coreb commented(Moving x.y.z version to a real version number) Feature Request => 6.x-dev
Comment #3
guusbosman commentedAttached is a patch against release 5.1 that makes the amount of recent comments displayed in the block configurable by the site administrator.
Your feedback is very welcome.
I tried to create a patch against CVS HEAD as well. However, the entire comments module is broken for me (the version that is in CVS now) so I can't verify if my changes work (or if they would break the module even more).
Some screenshots here: http://www.guusbosman.nl/article/1730
Comment #4
ChrisKennedy commentedThe patch in #3 is a start but I think it could use a bit of cleaning up.
Having a parameter for the number of comments to retrieve in comment_get_recent() is probably still useful. It might be better to change the default to NULL, and then only use the configuration variable if the parameter is NULL.
Rather than hardcoding possible values using the select box, it would be better to use a text input and let the user exactly specify the number of comments imo.
Finally, there are a few coding style errors and this isn't a true patch. Please see http://drupal.org/node/318 and http://drupal.org/patch respectively.
Comment #5
guusbosman commentedChris, thanks for your feedback. Good advice, didn't think about such a NULL construction.
I have no strong preference for either select box or a text box but I saw that a select box is used for similar goals in a couple of other places (like admin/content/aggregator/settings and admin/content/node-settings).
I'll take another look at creating a patch (I haven't submitted patches before), and include the NULL changes above. Are there any specific coding style errors? I tried to stick to the code conventions but must have overlooked some things.
Comment #6
ChrisKennedy commentedYeah, but I would check for the NULL with the type-safe === operator.
Sorry, I should have been more specific about coding style. I would just capitalize "number" in your comment, or add a $ in front of it.
I think the text box is better; if a user wanted 12 comments for example with the select list it wouldn't be possible. But you're right that in other places a select box is often used.
Comment #7
guusbosman commentedAttached an updated patch.
I respectfully disagree with Chris and would rather keep the drop down list with values instead of using a text box. This is more consistent with the rest of Drupal and it leaves less room for the user to make typo's.
However, I've adjusted the list with actual values in the drop down so users can now select all values between 1 and 20, as well as 25 and 30.
Comment #8
srlinuxx commentedI applied this patch and thought all was well, until I noticed my forum comments missing completely, and actually the enter forum is disabled. In modules, it is now disabled and can't be reenabled cuz it says Depends on Comment missing. I restored my original backed-up comment.module, then several others, then the whole of the drupal directory. What did it changed in the database that needs to be restored?
Drupal 5.1
MySQL database 5.0.32
PHP 5.2.0-8+etch1
Comment #9
guusbosman commentedsrlinuxx, I read your comment only now, sorry. The patch makes absolutely no changes to the database -- it only affects the configuration screen and the query that is used to generate the Recent Comments block.
Could your problems have been a side effect of other changes that may have been made to your code base?
Comment #10
ChrisKennedy commentedThe patch works fine.
Comment #11
dries commentedThat check should not be there. Instead, call comment_get_recent() using:
Should it be 'Amount of' or 'Number of'?
Comment #12
alexandreracine commentedCan't wait to have this feature :)
+1 for the idea.
Comment #13
Dieter_be commentedAnother vote for this.
Would be nice for both 5.* and 6.*
Comment #14
webchickFixed the following issues:
- Renamed "Amount" to "number" in various places -- Dries is right; "amount" refers to something that you can't count (like amount of space), vs. "number" which are things you can (number of people).
- Made the adjustment Dries asked for so that comment_get_recent was passed in the variable.
- Moved the setting from the comment settings page to the recent comments block configuration page; this is more consistent with the way forum.module does its block.
- Pulled the drupal_map_assoc back in as default value and removed the extra function; this is more consistent with the way this function is used throughout core. At some point it might be cool to abstract this so that _all_ blocks that display a "number of foos" selection with the same values.
HOWEVER. :) For some reason, it's not showing up. Forum module (which I used for inspiration) has the same problem. Any ideas??
Comment #15
ChrisKennedy commentedI suspect it's blocked by http://drupal.org/node/152585
Great theoretical improvements though.
Comment #16
webchickHey, thanks! Yeah, that was totally it. :)
Ok, here's a patch that should work, as long as the above patch referenced by ChrisKennedy is applied.
Comment #17
catchreview steps taken:
* clean drupal6 install.
* applied http://drupal.org/files/issues/blocks_fapi3_fix.patch
* applied this patch.
* enabled recent comments block
* created a new node
* commented on it
* changed comment block settings
* watched the number of comments in the block change
settings are in a sane place. The drop-down is long, but gives plenty of options with no room for error. works as advertised.
RTBC.
Comment #18
killes@www.drop.org commentedDidn't make it into D6, moving.
Comment #19
catchThis doesn't change any apis - and it's basically just a usability improvement right? Dropping version back to 6.x and status to review just in case, since it'd be a small thing to commit with no side-effects I can see.
Comment #20
catchStill applies with offset, bumping to 7.x
Comment #21
birdmanx35 commentedStill applies with offset.
Comment #22
birdmanx35 commentedI just tested this, it still applies with offset. I really like this patch- I'd prefer a text input box, though.
Comment #23
dries commentedI've made some small changes and committed this patch to CVS HEAD. Thanks.
Comment #24
keith.smith commentedMay I suggest this small follow up patch?
Number of comments to display in block with recent comments. is perhaps not as clear as it could be.
Comment #25
birdmanx35 commentedRTBC, that's a good text change.
Comment #26
catchYep, much better text.
Comment #27
scoutbaker commentedThe updated text is much clearer. Thanks keith.smith.
Comment #28
dries commentedCommitted to CVS HEAD. Thanks.
Comment #29
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #30
sedmi commentedI have read this thread, but I don't understand which of these patches should I install:
comment-specify-number-of-recent-comments-81931-16.patch
blocks_fapi3_fix.patch
89131-followup.patch
I'm using Drupal 6.4
Comment #31
ainigma32 commentedI would try the first one you mentioned. But it would advisable to try this on your test environment before you patch any production.
On a side note: you should really start thinking about upgrading to 6.9
Changing status to backport to D6.
- Arie
Comment #32
Michael-IDA commentedUhm, can someone get this fixed and installed for D7.x?
Pretty disheartening to see something as simple as this that was originally requested almost three years ago, still hasn't been patched into production....
Comment #33
catchThis was fixed in 6 months ago.
Comment #34
Michael-IDA commentedSince most will be using D6 for the next year (or two), here's code for a custom block for D5. I'm sure this was stolen from various sources, which I don't remember. Change as needed for your D version or your site theming.
Home » Administer » Site building » Blocks » Add block
Change $num_pull = 5; to however many posts you want to display.
Best All,
Sam
Comment #35
dawehnerI don't think this will be needed once we have converted them to views.