Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment Admin doesn't show name/email for logged-in user comments #260

Closed
pjayme opened this issue Jun 29, 2018 · 7 comments
Closed

Comment Admin doesn't show name/email for logged-in user comments #260

pjayme opened this issue Jun 29, 2018 · 7 comments

Comments

@pjayme
Copy link
Contributor

pjayme commented Jun 29, 2018

Comments made by logged in users don't show the user's name or email address in the admin screen. This makes it hard to determine who has made comments across the site.

It looks like changing the $summary_fields on Comment should resolve this - there's already a getAuthorName() method that can be used, but we'd need an equivalent getAuthorEmail() method.

@pjayme pjayme changed the title Comment Admin doesn't sow name/email for logged-in user comments Comment Admin doesn't show name/email for logged-in user comments Jun 29, 2018
@robbieaverill
Copy link
Contributor

Hey @pjayme, can you please provide the versions of SilverStripe and comments that you're using?

It sounds like you can implement the changes you want in your own project using the $summary_fields method you suggested for now at least. At best you could use configuration to define related fields via dot notation, e.g. 'Author.FirstName' => 'Author name', 'Author.Email' => 'Author email' for example. This could be applied with a DataExtension or via YAML configuration.

@pjayme
Copy link
Contributor Author

pjayme commented Jun 29, 2018

SilverStripe: 4.1
Comments: 3.1.2

Alright cool, will go for DataExtension approach.

Cheers

@robbieaverill
Copy link
Contributor

Comments made by logged in users don't show the user's name or email address in the admin screen.

If this is the case, it's definitely a bug. Should look like this (anonymously posted comments):

image

@pjayme
Copy link
Contributor Author

pjayme commented Jun 29, 2018

Yup, this is definitely the case, it doesn't display for logged in users - we are using it for an intranet so all our users will be logged in by default. We wouldn't get anonymous comments, it is also reinforced using the require_login: true config.

@pjayme
Copy link
Contributor Author

pjayme commented Jun 29, 2018

Have done something like this on my CommentExtension.php for the time being:

<?php

namespace MySite\Extensions;

use SilverStripe\ORM\DataExtension;

class CommentExtension extends DataExtension
{
    /**
     * @var array
     */
    private static $summary_fields = [
        'Author.FirstName' => 'Author name',
        'Author.Email' => 'Author email',
    ];

    public function updateSummaryFields(&$fields)
    {
        $fields['Name'] = '';
        $fields['Email'] = '';
    }
}

screen shot 2018-06-29 at 5 04 59 pm

@pjayme
Copy link
Contributor Author

pjayme commented Jun 29, 2018

Also another thing which might be a UX enhancement but the Comment label for its column isn't the most suitable as some of those entries are Replies so its quite tricky for a user to see which is a Comment and which is a Reply to a comment.

Perhaps the label should be Comment/Replies?

@robbieaverill
Copy link
Contributor

Fixed with #273, will be available in the next CWP recipe release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants