Skip to content

Instantly share code, notes, and snippets.

View jodyHamilton's full-sized avatar

Jody Hamilton jodyHamilton

View GitHub Profile
@jodyHamilton
jodyHamilton / NumberCommasWidget.php
Created April 20, 2017 14:09
Drupal 8 number field widget that uses commas to separate thousands
<?php
namespace Drupal\YourModule\Plugin\Field\FieldWidget;
use Drupal\Core\Field\FieldFilteredMarkup;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\WidgetBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Field\Plugin\Field\FieldWidget\NumberWidget;
diff --git a/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
index 48d6d2c48..f72b86d8a 100644
--- a/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
+++ b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
@@ -879,7 +879,7 @@ public function formMultipleElements(FieldItemListInterface $items, array &$form
if ($this->realItemCount > 0) {
$elements += array(
- '#theme' => 'field_multiple_value_form',
+ '#theme' => $this->fieldDefinition->isOrderable() ? 'field_multiple_value_form' : 'field_multiple_value_without_order_form',
<?php
define('WP_CACHE', false); // Added by W3 Total Cache
define('WP_HOME', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST']);
@jodyHamilton
jodyHamilton / .probo.yml
Last active April 14, 2017 19:11
A Wordpress Probo Config
assets:
- aap.sql
steps:
- name: Set up site with WordPress plugin
plugin: WordPressApp
devDomain: 'http://allagesproductions.com'
devHome: 'http://allagesproductions.com/'
database: 'aap.sql'
databaseName: 'aap'
databaseGzipped: false
steps:
- name: Run behat tests
command: 'cd /var/www/html/tests ; composer install ; ./bin/behat --profile probo --tags "~@javascript"'
- name: Run behat js tests
command: 'wget http://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar ; apt-get install xvfb -y ; xvfb-run java -jar selenium-server-standalone-2.48.2.jar & ; ./bin/behat --profile probo --tags "@javascript" ; disown'
assets:
- zivtech8x.sql.gz
steps:
- name: Setup working directory
command: "drush fec --json-config='{\"settings_php.snippets\": []}' --local-environment=probo zivtech 7 "
- name: Import the database
command: 'gunzip -c $ASSET_DIR/zivtech8x.sql.gz | `drush --root=/var/www/zivtech/webroot sql-connect` ; rm $ASSET_DIR/zivtech8x.sql.gz'
- name: Move code in place
command: 'rm -rf /var/www/zivtech/code ; mv $SRC_DIR /var/www/zivtech/code'
- name: Rewrite settings.php file and repair symlinks
@jodyHamilton
jodyHamilton / bear_skin.info.yaml
Created October 2, 2015 20:52
Bear Skin yaml
name: Bear Skin type: theme
description: 'Bear Skin Starter Theme.'
package:
Custom core: 8.x
engine: twig
screenshot: screenshot.png
stylesheets-remove:
- core/modules/system/css/components/messages.theme.css
- core/modules/system/css/components/menu.theme.css
asfdasdf
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 728e4ec..394d746 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -215,7 +215,9 @@ define('LANGUAGE_RTL', 1);
* @see http://php.net/manual/reserved.variables.server.php
* @see http://php.net/manual/function.time.php
*/
-define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']);
+ // Moved to a phase of drupal_bootstrap so that we can pull this from a