Skip to content

Instantly share code, notes, and snippets.

/**
* 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(
diff --git a/composer.json b/composer.json
index 901e0fb..67fdab8 100644
--- a/composer.json
+++ b/composer.json
@@ -23,7 +23,7 @@
],
"merge-plugin": {
"include": [
- "core/composer.json"
+ "core/composer.json", "modules/*/composer.json"
diff --git a/composer.json b/composer.json
index 901e0fb..67fdab8 100644
--- a/composer.json
+++ b/composer.json
@@ -23,7 +23,7 @@
],
"merge-plugin": {
"include": [
- "core/composer.json"
+ "core/composer.json", "modules/contrib/*/composer.json"
@andypost
andypost / drupal_contexts.html
Last active December 27, 2015 18:39
drupal all used contexts
<select name="context" class="form-select is-default" id="edit-context">
<option value="all" selected="selected">Все</option>
<option value="none">No context</option>
<option value="a ColiPoste SoColissimo flexibility rate relative to a shipping service">
a ColiPoste SoColissimo flexibility rate relative to a shipping service
</option>
<option value="a domain">a domain</option>
<option value="a drupal commerce card on file">a drupal commerce card on
file
</option>