This module shorten comments on any content type. In the admin settings user roles can be chosen, which means that shortened comments will be displayed for them. Also in setting number of characters or words can be chosen. There is a option to display a custom text underneath the shortened comment.
It is coming with admin menu where all the values can be setup - http://[your-site]/admin/config/content/shortened_comments
Sandbox page: https://drupal.org/sandbox/stefank/2199467
Git: http://git.drupal.org/sandbox/stefank/2199467.git
Manual reviews of other projects:
https://www.drupal.org/node/2316183#comment-9113365
https://www.drupal.org/node/2223359#comment-9113425
https://www.drupal.org/node/2301411#comment-9113579
https://www.drupal.org/node/2310581#comment-9129379
https://www.drupal.org/node/2284061#comment-9129403
https://www.drupal.org/node/2297401#comment-9129417
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | unwanted_tag_appearing2.png | 2.3 KB | pushpinderchauhan |
| #8 | unwanted_tag_appearing.png | 2.81 KB | pushpinderchauhan |
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxstefank2199467git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
stefank commentedComment #3
frankbaele commented1) shortened_comments.info
remove
core = "7.x"
project = "shortened_comments"
datestamp = "1392733020"
this is generated by drupal
2) use drupal coding standards e.g (2 spaces)
3) Missing install file for removing your variables when uninstalling your module.
4) Redundant module, why not use a custom field formatter?
5) $build['comments']['comments'][$delta]['comment_body'][0]['#markup'] = $trim; -> seems kind of harcoded, what if the user removes this field.
Comment #4
stefank commentedThe issues has been addressed and fixed as points 1, 2 , 3, 5.
For point 4, I think with custom filed formatter it will be possible, when displaying only trimmed comment.
As for all the other settings that will be an overkill. Thats why I went for setting on a separate page from admin menu, where the user roles can be chosen, words or characters limit and optional output text.
Thanks
Comment #5
frankbaele commentedFor point 4, I think with custom filed formatter it will be possible, when displaying only trimmed comment.
I think you should keep the field display configuration on the node manage display page. Because this can be confusing for other dev landing on a project using this module, they will expect that a custom formatter is used for this behaviour. That's why i advise you to not use node view alter and use a custom formatter for the comment field.
What would imply you remove the node types from the configuration page and leave that to the manage display configuration.
btw have you tested your code with display suite? because i have a good feeling that it will not work because of node view alter
Comment #6
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #7
stefank commentedHi @frankbaele,
Thank you very much for the feedback. It helped my a lot.
I've done the changes proposed in #5, so the configuration is done on node manage display page. The permission can be chosen for a particular role from admin/people/permissions page.
Thanks
Comment #8
pushpinderchauhan commented@stefank, thank you for your contribution!
I like the concept of your module but IMHO currently lot of work is left in this module.
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. http://pareview.sh/pareview/httpgitdrupalorgsandboxstefank2199467git reported number of issues that need to be address.
Manual Review
PAReview: Single project promotetag.Also you are using substr() function directly with $value, If I put some html tag in $value, substr will break that string. Of course we will put html tags as this formatted would be used with editor. Better to use drupal_substr() and also go through some thread where you would found how harmful is substr in case html tags are coming with string.
$perm already hold some value and it can never be empty because of above code. Now moving further, following case never be true because $perm can never be empty.
Then I tried this code logic by removing
&& empty($perm)and found there is no else condition for following case.It means first it goes to first if condition then in second if condition that doesn't make any sense. Every time
$elementvalue overwrite by another if case.After this, following code is there and again
$elementvalue overwrite and if condition comes true for most of the cases.This all above logic is not well organised and tested as it is not working as intended.
</br>) is appearing on admin interface of this module that looks wired.The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
Please don't remove the security tag, we keep that for statistics and to show examples of security problems.
As I am not a git administrator, so I would recommend you, please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)
Thanks Again!
Comment #9
stefank commentedHi @er.pushpinderrana,
Thanks for the detailed and great feedback.
Automated Review - done changes, so it passing now.
So, README.txt/README.md - changed
Secure code - done
Coding style & Drupal API usage
1. done
2. done
3. done
4. done
I think I've addressed all the points mentioned in the previous comment.
Thanks in advance for any further feedback.
Comment #10
stefank commentedSorry, didnt change the status with comment.
Comment #11
stefank commentedComment #12
stefank commentedComment #13
stefank commentedComment #14
klausimanual review:
But that are not critical application blockers, otherwise looks good to me. The code is slightly over 120 lines and you seem to have understood the security principle of filtering user provided text against XSS, so I think we can promote you to a git vetted user. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to patrickd as he might have time to take a final look at this.
Comment #15
patrickd commentedI'd like to see klausis questions addressed before continuing here
Comment #16
klausiAgreed, maybe too many open questions before an RTBC :-)
Comment #17
stefank commentedHi @klausi and @patrickd,
I can see how that can be a bit confusing, so let me answer the questions.
1. The shortened comment is basically like a teaser, which can be assigned to a particular user roles. Added screenshots on project page.
2. The difference to core "trimmed" is, that it can be configured for particular user role, and also any text can be displayed underneath the shortened comment.
3. I've changed it to user_access('administer comments'), as we don't want to display shortened comments for admins, or roles which can administer comments by default
4. I have added an use case scenario on project page, but basically
" For example imagine an forum, where the users needs to be logged in or registered to be able to see full comments. This module provides the functionality, where the site admin can control trough permissions, for which user roles the shortened comments will be displayed.
The shortened text can be changed to suit any scenario, e.x.
"Please login to see full comment"
"Please register to see full comment"
"
Hope that clears it out.
Many Thanks
Comment #18
stefank commentedComment #19
stefank commentedComment #20
stefank commentedComment #21
stefank commentedComment #22
patrickd commentedI'm pretty sure you should translate the default text too.
h1-tags are usually reserved for the sites main title.
Maybe make the
'... 'configurable too ? :)This is a pretty small module and there's not much to review; but what's there looks good enough.
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks for your contribution!
And thanks to the dedicated reviewer(s) as well.
Comment #23
stefank commentedMany thanks to all reviewers.