Skip to content

Instantly share code, notes, and snippets.

View larowlan's full-sized avatar
:shipit:
Framework Manager, Drupal Core

Lee Rowlands larowlan

:shipit:
Framework Manager, Drupal Core
View GitHub Profile
; generates interdiff into ~/patches from current diff
alias.interdiff=!git diff > ~/patches/interdiff.txt
; generates interdiff into ~/patches from current staged diff
alias.interdiff-stg=!git diff --staged > ~/patches/interdiff.txt
; generates patch into ~/patches based on branch name.
; usage git genpatch {comment number}
alias.genpatch=!sh -c "br=`git symbolic-ref HEAD|sed s#refs/heads/##`; git diff origin/8.0.x > ~/patches/\${br}.$1.patch"
; rebase branch of 8.0.x
alias.rebase8x=!git fetch origin && git rebase origin/8.0.x
; merge 8.0.x
{
"name": "drupal/drupalmoduleupgrader",
"description": "A Drush command to update Drupal 7 modules to Drupal 8.",
"license": "GPL-2.0+",
"support": {
"issues": "https://drupal.org/project/issues/drupalmoduleupgrader",
"source": "https://drupal.org/project/drupalmoduleupgrader"
},
"require": {
"grom358/pharborist": "dev-master",
<?php
/**
* @file
* Contains \Drupal\comment_timer\Plugin\Field\FieldWidget\NumberWidget.
*/
namespace Drupal\comment_timer\Field\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldItemListInterface;
diff --git a/core/modules/contact/src/ContactFormEditForm.php b/core/modules/contact/src/ContactFormEditForm.php
index 098ba2f..0442bf6 100644
--- a/core/modules/contact/src/ContactFormEditForm.php
+++ b/core/modules/contact/src/ContactFormEditForm.php
@@ -68,10 +68,10 @@ public function form(array $form, FormStateInterface $form_state) {
if ($url = $contact_form->getRedirectUrl()) {
$path = $url->toString();
}
- $form['route'] = array(
+ $form['url'] = array(
@larowlan
larowlan / core-process.md
Created October 11, 2014 00:17
Thoughts on core process and roadmaps

My thoughts on core process and roadmaps

Prelude

Much of what is proposed here is a large shift from Drupal's traditional feature addition process which has been largely informal. In the past because of our long release cycles consideration of such a process would have been foolish and this degree of formality would only have discouraged involvement. Now that we're moving towards semantic versioning, the release of Drupal 8 and a move to regular six-monthly minor releases means we're now in a position to consider this kind of formal process. Its a sign that we're maturing as an open source community. Parts of the process, in particular the voting, are modelled on other successful open-source projects that have the same level of maturity as ours. The thoughts proposed here are just that, thoughts. They've been influenced by core conversations at Drupalcon Amsterdam as well as a significant twitter thread on the topic. Please read the whole thing before comme

function ipc_form_element($variables) {
$element = &$variables['element'];
if ($element['#type'] == 'checkboxes') {
$element['inner'] = $element;
$element['#type] = 'fieldset';
$element['#title'] = $element['inner']['#title'];
$element['#description'] = $element['inner']['#description'];
unset($element['inner']['#title'], $element['inner']['#title']);
}
return theme_form_element($variables);
NodeType::create(['name' => 'Ponies', 'type' => 'ponies'])->save();
$uid_field = $this->entityManager->getBaseFieldDefinitions('node')['uid'];
$uid_field->getConfig('ponies')->save();
/** @var \Drupal\node\NodeInterface $node */
$node = Node::create(['type' => 'ponies']);
$owner = $node->getOwner();
@larowlan
larowlan / linkformatter.patch
Created September 28, 2014 22:44
link formatter diff
diff --git a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
index f1d179f..4b51e9d 100644
--- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
+++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
@@ -13,6 +13,7 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\link\LinkItemInterface;
+use Symfony\Component\HttpFoundation\Request;
@larowlan
larowlan / preprocess.php
Created September 17, 2014 01:19
preprocessing in drupal
/**
* Preprocessor for theme_book_navigation.
*/
function boilerplate_preprocess_book_navigation(&$vars) {
$vars['my_new_variable'] = 'yo';
}
@larowlan
larowlan / contact-test.patch
Created August 25, 2014 04:57
contact test
diff --git a/core/modules/contact/src/ContactFormInterface.php b/core/modules/contact/src/ContactFormInterface.php
index cda8e27..9a7c870 100644
--- a/core/modules/contact/src/ContactFormInterface.php
+++ b/core/modules/contact/src/ContactFormInterface.php
@@ -14,4 +14,20 @@
*/
interface ContactFormInterface extends ConfigEntityInterface {
+ /**
+ * Returns array of recipients.