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 field merge #12

Closed
wants to merge 821 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
821 commits
Select commit Hold shift + click to select a range
c10a438
Issue #2038285 by vijaycs85, Gábor Hojtsy: Update configuration schem…
alexpott Jul 18, 2013
5256455
Issue #1812048 by mikeker, Pancho, dawehner, tim.plunkett: Build the …
alexpott Jul 18, 2013
1e3e1f5
Issue #2028511 by damiankloip, dawehner: Allow plugin derivative clas…
alexpott Jul 19, 2013
3807b93
Issue #2038233 by tim.plunkett: Convert TipPluginManager to extend De…
alexpott Jul 19, 2013
4e85188
Issue #1818976 by bleen18: Fixed Several update functions incorrectly…
alexpott Jul 19, 2013
9b8f6cd
Issue #2039961 by klausi: Fixed uri_field() should use uri type as va…
alexpott Jul 19, 2013
6ecd940
Issue #2029455 by vollepeer: Typo in tip for 'Full HTML'.
alexpott Jul 19, 2013
52f472d
Issue #2044865 by Gábor Hojtsy: Fixed Picture mappings cannot be edited.
alexpott Jul 19, 2013
a223c20
Issue #2008270 by mcjim, typhonius: Remove drupal_add_css() from _dru…
alexpott Jul 19, 2013
baa9175
Issue #1990544 by fubhy, Pancho, h3rj4n, dawehner: Convert system_mod…
alexpott Jul 19, 2013
d4dcab1
Issue #2033413 by catch: fix file permissions, whoops.
Jul 19, 2013
e413ba2
Merge branch '8.x' into comment-fieldapi4
andypost Jul 20, 2013
4e036d7
follow-up for CommentWidget.php - Issue #2035315 by dawehner: Add a d…
andypost Jul 20, 2013
ea08e83
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi4
Jul 23, 2013
b3997c0
Patch 339
larowlan Jul 23, 2013
18c585c
Merge branch '8.x' into comment-fieldapi4
andypost Jul 31, 2013
07f87b1
Merge branch '8.x' into comment-fieldapi4
andypost Aug 1, 2013
10c1554
Fix preparecacheinterface
larowlan Aug 2, 2013
fe0c1ed
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi4
larowlan Aug 2, 2013
cea2cef
Merge branch '8.x' into comment-fieldapi4
andypost Aug 3, 2013
bb8ba2e
Patch 342, fixes FieldInterface type hint issues
larowlan Aug 2, 2013
6599d64
Issue #2057173 by xjm: Add Mark Carver to MAINTAINERS.txt for the Col…
alexpott Aug 3, 2013
4b5d84c
Issue #2054699 by pcambra: Ensure config entity id is set for compute…
alexpott Aug 3, 2013
cccddad
Issue #2057137 by legolasbo: Remove Unused local variable $user from …
alexpott Aug 3, 2013
7a178b5
Issue #2057019 by janstoeckler: Remove Unused local variable $string …
alexpott Aug 3, 2013
163182f
Issue #2022897 by dawehner, sdboyer, tim.plunkett: Shift responsibili…
alexpott Aug 3, 2013
1107e76
Issue #2039091 by ghazlewood: Fixed drupal_bootstrap() docs are missi…
webchick Aug 4, 2013
954eca9
Issue #2056943 by alexpott, damiankloip: Convert render_link() to ren…
webchick Aug 4, 2013
2601af8
Issue #2009018 follow-up by StephaneQ: One more replace theme() with …
webchick Aug 4, 2013
535ac70
Issue #2056893 by pwolanin: Fixed Typo in doxygen for module_exists().
webchick Aug 4, 2013
cc419d8
Issue #2009014 follow-up by StephaneQ: Replace one more theme() with …
webchick Aug 4, 2013
ba86659
Issue #2027131 by drupalrv: Block type operations should be listed in…
webchick Aug 4, 2013
f0c40ff
Fixes failing tests after User NG and changes to routing attributes (…
larowlan Aug 4, 2013
c9a7c24
Patch 347 - fixes statistics/forum index
larowlan Aug 4, 2013
8678c7f
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi4
larowlan Aug 6, 2013
57a3436
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi4
larowlan Aug 15, 2013
7e4438a
Merge branch '8.x' into comment-fieldapi4
andypost Aug 26, 2013
9c6b6c1
Merge branch '8.x' into comment-fieldapi4
andypost Aug 28, 2013
8ffdded
Merge pull request #1 from andypost/comment-fieldapi4
andypost Aug 28, 2013
e7a7956
Merge branch '8.x' into comment-fieldapi4
andypost Aug 29, 2013
48b584f
Merge branch 'comment-fieldapi4' into cf4
andypost Aug 29, 2013
61e2a2d
Merge branch '8.x' into comment-fieldapi4
andypost Aug 30, 2013
1e7d960
Merge branch 'comment-fieldapi4' into cf4
andypost Aug 30, 2013
929d999
Merge branch '8.x' into comment-fieldapi4
andypost Aug 30, 2013
7a0ba3a
Merge branch 'comment-fieldapi4' into cf4
andypost Aug 30, 2013
68fafed
Fix CommentUserTest.php to proper interfaces and use manager
andypost Aug 30, 2013
c7b081d
Remove BCEntity usage in comment_preview()
andypost Aug 30, 2013
073e972
Clean-up procedural usage in favor of comment.manager
andypost Aug 30, 2013
4d42df8
Fix preview executed from entity page
andypost Aug 31, 2013
75f1af9
Merge branch 'comment-fieldapi4' into cf4
andypost Aug 31, 2013
e4fa859
Merge branch '8.x' into comment-fieldapi4
andypost Aug 31, 2013
9bf404d
Fix most of broken tests
andypost Aug 31, 2013
79c8b0e
Fixed 1907960.353 and start fix field settings conversion
andypost Aug 31, 2013
2567423
Merge branch 'comment-fieldapi4' into cf4
andypost Aug 31, 2013
87c369e
Get rid of _comment_get_default_status() and do not allow render link…
andypost Aug 31, 2013
fff2900
Use proper method to get field default value after https://drupal.org…
andypost Aug 31, 2013
42bd89e
Fix upgrade path
andypost Aug 31, 2013
55dbc79
Fix search tests, proper entity field api usage
andypost Sep 1, 2013
3a4003f
default values are always applied now
andypost Sep 1, 2013
5f34bcc
Fix part of 359-360
andypost Sep 1, 2013
4f0a8c0
fix quotes
andypost Sep 1, 2013
e4446b1
Finally fix upgrade tests
andypost Sep 1, 2013
881c3ed
Initial merge - all broken
andypost Sep 1, 2013
f12c690
Fix views. Do not attach comment fields to comments and none-fieldabl…
andypost Sep 1, 2013
0cde472
Merge branch 'comment-fieldapi4' into comment-fieldapi5
andypost Sep 1, 2013
2ccdb50
Core now installs.Temporary use entity_type and field_name as bundle
andypost Sep 1, 2013
934d720
Start refactoring around field_id
larowlan Sep 2, 2013
4c635e0
Upgrade path changes, changes to bundle/extra fields
larowlan Sep 2, 2013
7cda33f
Fix refs to field_info['id']
larowlan Sep 2, 2013
75c78bc
Switched to {entity_type}__{field_name} format, added field_name calc…
larowlan Sep 2, 2013
66edc06
Fixes CommentFieldTest
larowlan Sep 2, 2013
bc6ffc8
Use a limit param for explode() to handle names with __
larowlan Sep 2, 2013
77436d1
Fixes CommentInterface test
larowlan Sep 2, 2013
abc8341
Fixes CommentLanguageTest
larowlan Sep 2, 2013
036a452
Fixes CommentNodeChangesTest
larowlan Sep 2, 2013
3d3b6ab
Fixes Views integration and Upgrade tests
larowlan Sep 2, 2013
179f419
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 2, 2013
c5d04a0
Upgrade patch changes
larowlan Sep 3, 2013
41c57d5
Fixes forum
larowlan Sep 3, 2013
91b17c7
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 3, 2013
e08348b
Fixes CommentTranslationUITest
larowlan Sep 3, 2013
48f46da
Fix forum views and blocks
larowlan Sep 3, 2013
90be655
Fixes comment uninstallation test
larowlan Sep 3, 2013
e266891
Fixes content translation tests
larowlan Sep 3, 2013
1e3ef9f
Fixes RDF, search tests
larowlan Sep 3, 2013
47c7c33
Fixes upgrade path and ER tests
larowlan Sep 4, 2013
053ed38
Merge branch '8.x' into comment-fieldapi5
andypost Sep 5, 2013
331b497
Issue #2073813 by pwolanin, dawehner, tstoeckler, twistor: Add a UrlG…
alexpott Sep 5, 2013
0e9c1cb
Issue #366950 by amontero, boombatower, brianV, univate, hefox, stpau…
alexpott Sep 5, 2013
3c7a480
Fix for https://drupal.org/node/2074547
larowlan Sep 6, 2013
bc0d710
Merge branch 'comment-fieldapi5' into cf4
andypost Sep 6, 2013
fa59560
Merge commit 'db2d92e7cb4c8f8f5d7f5965804ae851866fd9c3' into cf4
andypost Sep 6, 2013
3e628ae
Merge branch '8.x' into cf4
andypost Sep 6, 2013
2e8ee10
Fix broken test
andypost Sep 7, 2013
85f5335
Fix yched review of type 1907960.382
andypost Sep 7, 2013
e6a10bc
Get rid of comment_add_default_comment_field()
andypost Sep 7, 2013
a6f798d
Drop ramains of _comment_field_instance_settings_form_process() moved…
andypost Sep 7, 2013
b3f0140
Merge branch '8.x' into comment-fieldapi5
andypost Sep 8, 2013
1edc501
Clean-up code of deprecated functions
andypost Sep 8, 2013
c5a4e5f
protect explode from field names with __
andypost Sep 8, 2013
0b98d63
Comment statistics are properties, fixed hidden not shown on default …
larowlan Sep 9, 2013
b6f3043
Merge branch '8.x' into comment-fieldapi5
andypost Sep 9, 2013
2a9edb6
Fixed https://drupal.org/node/2079093#comment-7840471
andypost Sep 9, 2013
2075e6d
Fix default values and rdf perf
larowlan Sep 9, 2013
52f588c
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 9, 2013
6d65c46
Apply default values
larowlan Sep 9, 2013
aac6b54
Merge branch '8.x' into comment-fieldapi5
andypost Sep 9, 2013
82bfda6
Apply defaults for widget via massageFormValues() and reverts to ER t…
andypost Sep 9, 2013
480ef6a
fix copy/paste and add ugly comment
andypost Sep 9, 2013
e90984e
Remove hook_comment_access() in favour of entity api access, update r…
andypost Sep 10, 2013
aaa7ef7
Fix entity access and add a tests
andypost Sep 10, 2013
cbf7176
Merge branch '8.x' into comment-fieldapi5
andypost Sep 10, 2013
2ec32cb
Fix breadcrumbs
andypost Sep 10, 2013
0a75ea7
Extended tests for widget, needs work to kill cache of comment_count
andypost Sep 10, 2013
6922cc6
Reverted wrongly merged translation
andypost Sep 10, 2013
eb962f7
remove remains
andypost Sep 10, 2013
124bc44
Merge branch '8.x' into comment-fieldapi5
andypost Sep 10, 2013
65b6b27
Merge branch '8.x' into comment-fieldapi5
andypost Sep 11, 2013
c3a90f0
Merge branch '8.x' into comment-fieldapi5
andypost Sep 15, 2013
4bb3d02
Fix and clean-up deprecated call in CommentUserTest
andypost Sep 15, 2013
af0c28d
Fix wrong merge of DependencyTest.php
andypost Sep 15, 2013
21a9ea7
Fix broken tests
andypost Sep 15, 2013
5d89471
Merge branch '8.x' into comment-fieldapi5
andypost Sep 15, 2013
9a40173
Merge branch '8.x' into comment-fieldapi5
andypost Sep 15, 2013
bc4e733
Commit
larowlan Sep 16, 2013
e1e5fe1
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 16, 2013
a09f6d7
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 16, 2013
6687ee5
Fixes path
larowlan Sep 16, 2013
1123497
Changes to FormatterInterface
larowlan Sep 17, 2013
8216a87
WidgetInterface changes
larowlan Sep 17, 2013
6b9e8bf
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 17, 2013
01b41dc
Merge branch '8.x' into comment-fieldapi5
andypost Sep 17, 2013
f8387e0
Remove remains of COMMENT_ACCESS_DENY
andypost Sep 17, 2013
3426d57
Fix 2079093#64 (1,2,4,6)
andypost Sep 17, 2013
108344a
Use getEntity() for proper type-hinting
andypost Sep 17, 2013
cbac912
Fixes for default value
larowlan Sep 17, 2013
22d5403
Fix 2079093#64 (12) and remove deprecated calls in CommentFormControl…
andypost Sep 18, 2013
26608f4
Add @todo to fix CommentController::renderNewCommentsNodeLinks()
andypost Sep 18, 2013
dea3373
Refactor default values
larowlan Sep 18, 2013
8d32bd2
Fix remaining fails
larowlan Sep 18, 2013
1480d6e
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 18, 2013
b989ae7
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 19, 2013
0d9ed46
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 20, 2013
8e92d58
Merge branch '8.x' into comment-fieldapi5
andypost Sep 20, 2013
067cb80
Fix DependencyTest
andypost Sep 20, 2013
c771c1f
Merge branch '8.x' into comment-fieldapi5
andypost Sep 21, 2013
88fc5ce
Merge branch '8.x' into comment-fieldapi5
andypost Sep 22, 2013
a11447f
Fixes dependency tests
larowlan Sep 20, 2013
c977bc2
Issue #2057377 by Xano: Added Implement hook_entity_access() and hook…
alexpott Sep 22, 2013
dec4204
Issue #2062157 by Garbar, undertext: In ViewsBlock Rename Views prope…
alexpott Sep 22, 2013
dda5e7a
Issue #2076085 by dawehner, damiankloip, Letharion, pwolanin: Resolve…
alexpott Sep 22, 2013
4494037
Fixes 360.2
larowlan Sep 23, 2013
46171d5
More fixes for comments/tokens
larowlan Sep 23, 2013
1985989
Fixes for render cache, injecting stuff
larowlan Sep 23, 2013
85b2bb5
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 23, 2013
5887570
Merge branch '8.x' into comment-fieldapi5
andypost Sep 23, 2013
bd0b82f
Remove field_info_instance from CommentUpgradePathTest
larowlan Sep 24, 2013
c344b2b
Remove extra comment_load call
larowlan Sep 24, 2013
3a157e2
Refactor _update_comment_get_comment_fields
larowlan Sep 24, 2013
0a00195
ContainerFactoryPluginInterface the formatter
larowlan Sep 24, 2013
66b93d6
EntityManager instead of entity_load
larowlan Sep 24, 2013
85f8c34
UrlGenerator instead of url
larowlan Sep 24, 2013
169317a
Use FieldInfo instead of field_info_field
larowlan Sep 24, 2013
07dc2fe
Inject Link plugin
larowlan Sep 24, 2013
4ec9806
Fixes failing tests
larowlan Sep 24, 2013
7829889
Docblock fix
larowlan Sep 24, 2013
e0ed9d5
Remove reference to node_comment_statistics in node_title_list
larowlan Sep 24, 2013
8817554
Remove reference to comment_node_ in EntityType
larowlan Sep 24, 2013
557d9c7
Clarify comment regarding comment_get_recent access
larowlan Sep 24, 2013
e6f7e85
Reinstate deprecated token tests
larowlan Sep 24, 2013
902d38f
Make legacy tokens work
larowlan Sep 24, 2013
a7e2879
Revert link title, still nodes only
larowlan Sep 24, 2013
db27817
Fix todo, in fact remains, core moved to match us
larowlan Sep 24, 2013
867b177
Fix for default value of comment.maintain_entity_statistics
larowlan Sep 24, 2013
8242af1
Changes grammar of column descriptions
larowlan Sep 24, 2013
6ab7615
Fix field_id column description
larowlan Sep 24, 2013
15d8f4b
Fix hook_update_dependencies comment
larowlan Sep 24, 2013
1f90b24
Fix comment for comment_update_8005()
larowlan Sep 24, 2013
e8bf108
Todo for when https://drupal.org/node/1856972 is in
larowlan Sep 24, 2013
4003011
Fix doco for comment_update_8007
larowlan Sep 24, 2013
8afd89b
Clarify where migration occurs in comment_update_8008
larowlan Sep 24, 2013
034d270
Fix comments in comment.views.inc
larowlan Sep 24, 2013
6b9e535
Adds non-default values for blog node comments in upgrade test
larowlan Sep 24, 2013
b3e9fb3
Clarify isEmpty comment
larowlan Sep 24, 2013
339415d
Added followup todo
larowlan Sep 24, 2013
c46d84d
Fix comment on comment_install insert
larowlan Sep 24, 2013
16b9617
Clarify comment_menu_alter
larowlan Sep 24, 2013
c1695cf
Fix token tests
larowlan Sep 24, 2013
02c4b14
Test adding a comment field to non-node using ui
larowlan Sep 24, 2013
ad8ac01
Support for multiple fields with new indicator
larowlan Sep 24, 2013
4e28409
Merge branch '8.x' into comment-fieldapi5
andypost Sep 24, 2013
4bd944c
Fixed #2079093-101
andypost Sep 24, 2013
7f37bb6
Fix broken usage of current_user service and clean-up CommentTranslat…
andypost Sep 24, 2013
5e6fe68
Clarify comment in user tests (268.20)
larowlan Sep 24, 2013
981b38e
Merge branch '8.x' into comment-fieldapi5
andypost Sep 24, 2013
1f223e8
Cleans up some of the Nasty™ in CommentTranslationUITest
larowlan Sep 24, 2013
d6d2f0d
Make tracker.pages.inc query readable
larowlan Sep 24, 2013
91bdd22
Added todo for comment_num_new to service
larowlan Sep 24, 2013
c836cd3
Fix for forum status accessor
larowlan Sep 24, 2013
02fffe8
Cleanup doc-block for RouteSubscriber
larowlan Sep 24, 2013
23a9a84
Clarify intent of RouteSubscriber
larowlan Sep 24, 2013
8f3964e
Fix comment link tests
larowlan Sep 24, 2013
ffabbcf
Fixes tests
larowlan Sep 25, 2013
f39fd2e
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 25, 2013
097614d
[#comment] Fix typo
larowlan Sep 25, 2013
f146665
Move logic in formatter
larowlan Sep 25, 2013
5b68a19
Refactor search view mode logic in formatter
larowlan Sep 25, 2013
dfefaa5
Clarify formatter search view mode comment
larowlan Sep 25, 2013
ae033b3
Rename variable from additions to output
larowlan Sep 25, 2013
0cdc468
Clarify 'advanced' comment
larowlan Sep 25, 2013
c4be7ee
Refactor collapse comment
larowlan Sep 25, 2013
91d22e9
Fix arbitrary weight
larowlan Sep 25, 2013
0c43a6d
Added @throws
larowlan Sep 25, 2013
fc455bb
Clarify future of comment_links
larowlan Sep 25, 2013
4a1a564
Clean up admin controller
larowlan Sep 25, 2013
b88c2c8
comment_install 'bucket o crud'™ no longer needed
larowlan Sep 25, 2013
39f4e94
Fixes token test with run-tests
larowlan Sep 25, 2013
6f29212
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 25, 2013
1dfbaa1
Finally fix default values for the field instance
andypost Sep 25, 2013
98a4f80
Merge branch '8.x' into comment-fieldapi5
andypost Sep 25, 2013
0ea4fc7
Fix fiel permissions
andypost Sep 25, 2013
2b04401
Fix #2079093-119 review
andypost Sep 25, 2013
22826c5
Use commented_entity for theme_comment_post_forbidden()
andypost Sep 25, 2013
2bff995
Fix wrong field name usage
andypost Sep 25, 2013
17d43ae
Finnaly fixed default values, as berdir suggested
andypost Sep 25, 2013
4484818
Temporary fix for render cache per user
andypost Sep 25, 2013
12739a0
Fix #2079093-122 review
andypost Sep 25, 2013
19c8505
Merge branch '8.x' into comment-fieldapi5
andypost Sep 25, 2013
466ea6c
Remove @todo for manage fields title, implemented by the new way
andypost Sep 25, 2013
b598394
Remove useless defaults
andypost Sep 25, 2013
4f352b9
Properly implement form_alter for field_ui, simplify admin settings, …
andypost Sep 25, 2013
e8ed458
Add title callback to allow breadcrumbs display actual field name
andypost Sep 25, 2013
2938047
Merge branch '8.x' into comment-fieldapi5
andypost Sep 25, 2013
8c0f311
Added gitignore file
Sep 24, 2013
1c8843d
Minor grammar improvements
Sep 25, 2013
1d4e4df
Sorry
Sep 25, 2013
07ca790
Fix from https://drupal.org/node/2097981
larowlan Sep 25, 2013
a4a6317
Moves tests to use entity_test_render
larowlan Sep 25, 2013
2f73eff
@todo audit
larowlan Sep 25, 2013
21ead11
Fix fails
larowlan Sep 25, 2013
20e6776
Fixes test fails
larowlan Sep 25, 2013
f9d8ba2
Merge remote-tracking branch 'origin/8.x' into comment-fieldapi5
larowlan Sep 25, 2013
694c74f
Comment cleanup
larowlan Sep 25, 2013
cf2d49f
Merge branch '8.x' into comment-fieldapi5
andypost Sep 26, 2013
44ea753
Remove outdated title callback
andypost Sep 26, 2013
61f0253
Fixed review #2079093-137
andypost Sep 27, 2013
eedd4e4
Fixed render cache for field instance also added follow-up for roles …
andypost Sep 27, 2013
7c81482
Fix {comment_entity_statistics} schema default value
andypost Sep 27, 2013
fd46f5d
Use db_merge() to update {comment_entity_statistics} user 1 statistic…
andypost Sep 27, 2013
b7a1f97
Added comment about usage of db_merge() in CommentStorageController
andypost Sep 27, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions core/lib/Drupal/Core/Entity/Annotation/EntityType.php
Expand Up @@ -234,8 +234,6 @@ class EntityType extends Plugin {
/**
* The prefix for the bundles of this entity type.
*
* For example, the comment bundle is prefixed with 'comment_node_'.
*
* @var string (optional)
*/
public $bundle_prefix;
Expand Down
19 changes: 19 additions & 0 deletions core/modules/comment/comment-entity-form.js
@@ -0,0 +1,19 @@
/**
* @file
* Attaches comment behaviors to the entity form.
*/

(function ($) {

"use strict";

Drupal.behaviors.commentFieldsetSummaries = {
attach: function (context) {
var $context = $(context);
$context.find('fieldset.comment-entity-settings-form').drupalSetSummary(function (context) {
return Drupal.checkPlain($(context).find('.form-item-comment input:checked').next('label').text());
});
}
};

})(jQuery);
40 changes: 0 additions & 40 deletions core/modules/comment/comment-node-form.js

This file was deleted.

44 changes: 29 additions & 15 deletions core/modules/comment/comment.admin.inc
Expand Up @@ -84,57 +84,71 @@ function comment_admin_overview($form, &$form_state, $arg) {
$query = db_select('comment', 'c')
->extend('Drupal\Core\Database\Query\PagerSelectExtender')
->extend('Drupal\Core\Database\Query\TableSortExtender');
$query->join('node_field_data', 'n', 'n.nid = c.nid');
$query->addTag('node_access');
if (\Drupal::moduleHandler()->moduleExists('node')) {
// Special case to ensure node access works.
$query->leftJoin('node_field_data', 'n', "n.nid = c.entity_id AND c.entity_type = 'node'");
$query->addTag('node_access');
}
$result = $query
->fields('c', array('cid', 'nid', 'subject', 'name', 'changed'))
->fields('c', array('cid', 'subject', 'name', 'changed', 'entity_id', 'entity_type', 'field_id'))
->condition('c.status', $status)
->limit(50)
->orderByHeader($header)
->execute();

$nids = array();
$cids = array();
$entity_ids = array();
$entities = array();

// We collect a sorted list of node_titles during the query to attach to the
// comments later.
// We collect entities grouped by entity_type so we can load them and use
// their labels.
foreach ($result as $row) {
$nids[] = $row->nid;
$entity_ids[$row->entity_type][] = $row->entity_id;
$cids[] = $row->cid;
}
// Ensure all nodes are statically cached so that we do not have to load them
// individually when getting their labels below.
node_load_multiple($nids);
$comments = comment_load_multiple($cids);
// Ensure all entities are statically cached so that we do not have to load
// them individually when getting their labels below.
foreach ($entity_ids as $entity_type => $ids) {
$entities[$entity_type] = entity_load_multiple($entity_type, $ids);
}
$comments = entity_load_multiple('comment', $cids);

// Build a table listing the appropriate comments.
$options = array();
$destination = drupal_get_destination();

foreach ($comments as $comment) {
// Use the first entity label.
$entity = $entities[$comment->entity_type->value][$comment->entity_id->value];
$entity_uri = $entity->uri();
// Remove the first node title from the node_titles array and attach to
// the comment.
$node_title = $comment->nid->entity->label();
$username = array(
'#theme' => 'username',
'#account' => comment_prepare_author($comment),
);
$body = '';
if (!empty($comment->comment_body->value)) {
$body = $comment->comment_body->value;
}
$options[$comment->id()] = array(
'title' => array('data' => array('#title' => $comment->subject->value ?: $comment->id())),
'subject' => array(
'data' => array(
'#type' => 'link',
'#title' => $comment->subject->value,
'#href' => 'comment/' . $comment->id(),
'#options' => array('attributes' => array('title' => truncate_utf8($comment->comment_body->value, 128)), 'fragment' => 'comment-' . $comment->id()),
'#options' => array('attributes' => array('title' => truncate_utf8($body, 128)), 'fragment' => 'comment-' . $comment->id()),
),
),
'author' => drupal_render($username),
'posted_in' => array(
'data' => array(
'#type' => 'link',
'#title' => $node_title,
'#href' => 'node/' . $comment->nid->target_id,
'#title' => $entity->label(),
'#href' => $entity_uri['path'],
'#options' => $entity_uri['options'],
'#access' => $entity->access('view'),
),
),
'changed' => format_date($comment->changed->value, 'short'),
Expand Down
8 changes: 6 additions & 2 deletions core/modules/comment/comment.api.php
Expand Up @@ -34,7 +34,9 @@ function hook_comment_presave(Drupal\comment\Comment $comment) {
*/
function hook_comment_insert(Drupal\comment\Comment $comment) {
// Reindex the node when comments are added.
node_reindex_node_search($comment->nid->target_id);
if ($comment->entity_type->value == 'node') {
node_reindex_node_search($comment->entity_id->value);
}
}

/**
Expand All @@ -45,7 +47,9 @@ function hook_comment_insert(Drupal\comment\Comment $comment) {
*/
function hook_comment_update(Drupal\comment\Comment $comment) {
// Reindex the node when comments are updated.
node_reindex_node_search($comment->nid->target_id);
if ($comment->entity_type->value == 'node') {
node_reindex_node_search($comment->entity_id->value);
}
}

/**
Expand Down
1 change: 0 additions & 1 deletion core/modules/comment/comment.info.yml
Expand Up @@ -6,6 +6,5 @@ version: VERSION
core: 8.x
dependencies:
- datetime
- node
- text
configure: admin/content/comment