Skip to content

Instantly share code, notes, and snippets.

<script type="text/javascript" src="//yandex.st/share/share.js" charset="utf-8"></script>
<div class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="button" data-yashareQuickServices="yaru,vkontakte,facebook,twitter,odnoklassniki,moimir,lj"></div>
@andypost
andypost / menus-1814916-85.patch
Created January 10, 2013 22:29
Menu as config entity
diff --git a/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/Menu.php b/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/Menu.php
new file mode 100644
index 0000000..7e3ceb0
--- /dev/null
+++ b/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/Menu.php
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @file
/**
* Implements hook_field_widget_info_alter().
*
* @todo convert this to a WidgetPlugin annotation.
*/
function comment_field_widget_info_alter(&$info) {
$info['comment_default']['behaviors'] = array(
'multiple values' => FIELD_BEHAVIOR_CUSTOM,
'default value' => FIELD_BEHAVIOR_NONE,
);
* settings = {
* "default_mode" = "1",
* "per_page" = "50",
* "comment_anonymous" = "0",
* "show_subject" = "TRUE",
* "form_location" = "1",
* "comment_preview" = "1"
* }
/**
* Implements hook_field_info().
*/
function comment_field_info() {
return array(
'comment' => array(
'label' => t('Comments'),
'description' => t('This field manages configuration and presentation of comments on an entity'),
'settings' => array(
'comment' => COMMENT_OPEN,
@andypost
andypost / gist:4751154
Created February 10, 2013 21:39
comment field widget
<?php
/**
* @file
* Contains \Drupal\comment\Plugin\field\widget\CommentWidget.
*/
namespace Drupal\comment\Plugin\field\widget;
use Drupal\Core\Annotation\Plugin;
@andypost
andypost / gist:4945004
Last active December 13, 2015 17:08
comment_update_8006
<?php
/**
* Adds comment fields for all node types.
*
* Field instance settings "comment_default_mode", "comment_default_per_page"
* and "comment_form_location" are preserved to allow migrate contrib modules.
*/
function comment_update_8006(&$sandbox) {
// Loop over defined node_types.
$node_types = array_keys(_update_7000_node_get_types());
@andypost
andypost / gist:5680638
Created May 30, 2013 19:55
D8 twig hangout 2013.05.30
### Must-have
add critical for drillability (needs issue)
properly use suggestions
remove process layer
trans and format plural block
secure theme system
### Nice to have (or Drupal 9)
diff --git a/css/rocketship.main.css b/css/rocketship.main.css
new file mode 100644
index 0000000..a6d4085
--- /dev/null
+++ b/css/rocketship.main.css
@@ -0,0 +1,12 @@
+.node-rocketship-issue .field-type-taxonomy-term-reference {
+ display: inline-block;
+ margin: 0;
+}
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 51f3509..613d6c6 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -123,10 +123,12 @@ function comment_help($path, $arg) {
*/
function comment_entity_bundle_info() {
$bundles = array();
- foreach (Drupal::service('comment.manager')->getFields() as $field_name => $field_info) {
- $bundles['comment'][$field_name] = array(