Commit ead42d38 authored by webchick's avatar webchick
Browse files

Issue #2085435 by larowlan, dawehner: Fixed Comment edit page has the title 'Comment permalink'.

parent e6297227
......@@ -63,6 +63,11 @@ public function form(array $form, array &$form_state) {
$author = $comment->name->value;
$status = (isset($comment->status->value) ? $comment->status->value : COMMENT_NOT_PUBLISHED);
$date = (!empty($comment->date) ? $comment->date : DrupalDateTime::createFromTimestamp($comment->created->value));
if (empty($form_state['comment_preview'])) {
$form['#title'] = t('Edit comment %title', array(
'%title' => $comment->subject->value,
));
}
}
else {
if ($user->isAuthenticated()) {
......
......@@ -63,8 +63,12 @@ function testCommentInterface() {
$this->setCommentSubject(TRUE);
$this->setCommentPreview(DRUPAL_OPTIONAL);
// Test changing the comment author to "Anonymous".
$this->drupalGet('comment/' . $comment->id() . '/edit');
$this->assertTitle(t('Edit comment @title | Drupal', array(
'@title' => $comment->subject->value,
)));
// Test changing the comment author to "Anonymous".
$comment = $this->postComment(NULL, $comment->comment_body->value, $comment->subject->value, array('name' => ''));
$this->assertTrue(empty($comment->name->value) && $comment->uid->target_id == 0, 'Comment author successfully changed to anonymous.');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment