Commit 370d6fda authored by alexpott's avatar alexpott

Issue #2401429 by kattekrab, larowlan: Forum form & node display regression

parent 1849e5c3
......@@ -53,18 +53,18 @@ content:
weight: 20
settings: { }
third_party_settings: { }
taxonomy_forums:
type: options_select
weight: 26
settings: { }
third_party_settings: { }
body:
type: text_textarea_with_summary
weight: 26
weight: 27
settings:
rows: 9
summary_rows: 3
placeholder: ''
third_party_settings: { }
taxonomy_forums:
type: options_select
weight: 27
settings: { }
third_party_settings: { }
hidden: { }
third_party_settings: { }
......@@ -19,10 +19,16 @@ mode: default
content:
taxonomy_forums:
type: taxonomy_term_reference_link
weight: 10
weight: -1
label: above
settings: { }
third_party_settings: { }
body:
label: hidden
type: text_default
weight: 0
settings: { }
third_party_settings: { }
comment_forum:
label: hidden
type: comment_default
......@@ -30,14 +36,8 @@ content:
settings:
pager_id: 0
third_party_settings: { }
body:
label: hidden
type: text_default
weight: 100
settings: { }
third_party_settings: { }
links:
weight: 101
weight: 100
hidden:
langcode: true
third_party_settings: { }
......@@ -7,6 +7,8 @@
namespace Drupal\forum\Tests;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Link;
use Drupal\simpletest\WebTestBase;
......@@ -115,6 +117,25 @@ function testForum() {
// Do the admin tests.
$this->doAdminTests($this->admin_user);
// Check display order.
$display = EntityViewDisplay::load('node.forum.default');
$body = $display->getComponent('body');
$comment = $display->getComponent('comment_forum');
$taxonomy = $display->getComponent('taxonomy_forums');
// Assert field order is body » taxonomy » comments.
$this->assertTrue($taxonomy['weight'] < $body['weight']);
$this->assertTrue($body['weight'] < $comment['weight']);
// Check form order.
$display = EntityFormDisplay::load('node.forum.default');
$body = $display->getComponent('body');
$comment = $display->getComponent('comment_forum');
$taxonomy = $display->getComponent('taxonomy_forums');
// Assert category comes before body in order.
$this->assertTrue($taxonomy['weight'] < $body['weight']);
$this->generateForumTopics();
// Login an unprivileged user to view the forum topics and generate an
......
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