Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
229
Merge Requests
229
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
d12aa8ce
Commit
d12aa8ce
authored
Dec 08, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2131997
by larowlan, wesleydv: Disabling a form field on comments does not work.
parent
9a06e506
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
core/modules/comment/comment.module
core/modules/comment/comment.module
+6
-6
core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
...es/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
+6
-0
core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
...ules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
+1
-0
No files found.
core/modules/comment/comment.module
View file @
d12aa8ce
...
...
@@ -832,8 +832,8 @@ function comment_form_field_ui_field_instance_edit_form_alter(&$form, $form_stat
* Implements hook_form_FORM_ID_alter().
*/
function
comment_form_field_ui_field_overview_form_alter
(
&
$form
,
$form_state
)
{
if
(
$form
[
'#entity_type'
]
==
'comment'
)
{
$request
=
\
Drupal
::
request
();
$request
=
\
Drupal
::
request
();
if
(
$form
[
'#entity_type'
]
==
'comment'
&&
$request
->
attributes
->
has
(
'commented_entity_type'
))
{
$form
[
'#title'
]
=
\
Drupal
::
service
(
'comment.manager'
)
->
getFieldUIPageTitle
(
$request
->
attributes
->
get
(
'commented_entity_type'
),
$request
->
attributes
->
get
(
'field_name'
));
}
}
...
...
@@ -842,8 +842,8 @@ function comment_form_field_ui_field_overview_form_alter(&$form, $form_state) {
* Implements hook_form_FORM_ID_alter().
*/
function
comment_form_field_ui_form_display_overview_form_alter
(
&
$form
,
$form_state
)
{
if
(
$form
[
'#entity_type'
]
==
'comment'
)
{
$request
=
\
Drupal
::
request
();
$request
=
\
Drupal
::
request
();
if
(
$form
[
'#entity_type'
]
==
'comment'
&&
$request
->
attributes
->
has
(
'commented_entity_type'
))
{
$form
[
'#title'
]
=
\
Drupal
::
service
(
'comment.manager'
)
->
getFieldUIPageTitle
(
$request
->
attributes
->
get
(
'commented_entity_type'
),
$request
->
attributes
->
get
(
'field_name'
));
}
}
...
...
@@ -852,8 +852,8 @@ function comment_form_field_ui_form_display_overview_form_alter(&$form, $form_st
* Implements hook_form_FORM_ID_alter().
*/
function
comment_form_field_ui_display_overview_form_alter
(
&
$form
,
$form_state
)
{
if
(
$form
[
'#entity_type'
]
==
'comment'
)
{
$request
=
\
Drupal
::
request
();
$request
=
\
Drupal
::
request
();
if
(
$form
[
'#entity_type'
]
==
'comment'
&&
$request
->
attributes
->
has
(
'commented_entity_type'
))
{
$form
[
'#title'
]
=
\
Drupal
::
service
(
'comment.manager'
)
->
getFieldUIPageTitle
(
$request
->
attributes
->
get
(
'commented_entity_type'
),
$request
->
attributes
->
get
(
'field_name'
));
}
}
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
View file @
d12aa8ce
...
...
@@ -123,6 +123,12 @@ function testCommentFormat() {
$edit
=
array
(
'instance[settings][text_processing]'
=>
0
);
$this
->
drupalPostForm
(
'admin/structure/comments/manage/node__comment/fields/comment.node__comment.comment_body'
,
$edit
,
t
(
'Save settings'
));
// Change formatter settings.
$this
->
drupalGet
(
'admin/structure/comments/manage/node__comment/display'
);
$edit
=
array
(
'fields[comment_body][type]'
=>
'text_trimmed'
,
'refresh_rows'
=>
'comment_body'
);
$commands
=
$this
->
drupalPostAjaxForm
(
NULL
,
$edit
,
array
(
'op'
=>
t
(
'Refresh'
)));
$this
->
assertTrue
(
$commands
,
'Ajax commands returned'
);
// Post a comment without an explicit subject.
$this
->
drupalLogin
(
$this
->
web_user
);
$edit
=
array
(
'comment_body[0][value]'
=>
$this
->
randomName
(
8
));
...
...
core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
View file @
d12aa8ce
...
...
@@ -59,6 +59,7 @@ function setUp() {
'administer content types'
,
'administer comments'
,
'administer comment fields'
,
'administer comment display'
,
'skip comment approval'
,
'post comments'
,
'access comments'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment