Skip to content
Snippets Groups Projects
Commit ead42d38 authored by Angie Byron's avatar Angie Byron
Browse files

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

parent e6297227
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment