View favorite.js
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import 'whatwg-fetch'; // https://www.npmjs.com/package/whatwg-fetch
class Favorite extends Component {
constructor() {
super();
this.toggleFavorite = this.toggleFavorite.bind(this);
this.saveFavorite = this.saveFavorite.bind(this);
View favorite.module
<?php
/**
* Implements template_preprocess_node().
*/
function favorite_preprocess_node(&$variables) {
$node = $variables['node'];
if ($variables['view_mode'] == 'full') {
$variables['#attached']['library'][] = 'favorite/favorite';
$variables['content']['favorite'] = array(
View allow_multiple_fields_no_tabledrag-8.2x.patch
diff --git a/docroot/core/config/schema/core.data_types.schema.yml b/docroot/core/config/schema/core.data_types.schema.yml
index 73db361..c6e4f8c 100644
--- a/docroot/core/config/schema/core.data_types.schema.yml
+++ b/docroot/core/config/schema/core.data_types.schema.yml
@@ -392,6 +392,9 @@ field_config_base:
required:
type: boolean
label: 'Required field'
+ orderable:
+ type: boolean
View Drupal-8-Date-Help-Text-JS
// HTML5 date elements use the user's browser date format,
// but browsers that don't support it have a more confusing interface
// requiring help text.
Drupal.behaviors.DateHelp = {
attach: function (context, settings) {
if (Modernizr.inputtypes.date === false) {
// If there is no help text div, first add one.
$('div.field--widget-datetime-default:not(:has(.description))').each(function() {
$(this).find('input').after('<div class="description"></div>');
});
View Drupal 8 inline_form_errors with field_group
// Inline_form_errors module gives links to elements with errors.
// When using field_group module (this is for vertical tabs) you need to first open the right vertical tab
// and then scroll to the element with the error.
$('.messages__list a', context).on('click', function(e) {
var url = $(this).attr('href');
var hash = url.substring(url.indexOf('#'));
var index = $(hash).parents('.vertical-tabs__pane').index() - 1;
if (index >= 0) {
$('ul.vertical-tabs__menu li').eq(index).find('a').click();
}
View NumberCommasWidget.php
<?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;
View paragraphs-not-orderable.patch
diff --git a/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
index e0c705f..f56b1cd 100644
--- a/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
+++ b/src/Plugin/Field/FieldWidget/InlineParagraphsWidget.php
@@ -800,8 +800,8 @@ public function formMultipleElements(FieldItemListInterface $items, array &$form
static::setWidgetState($this->fieldParents, $field_name, $form_state, $field_state);
if ($this->realItemCount > 0) {
$elements += array(
- '#theme' => 'field_multiple_value_form',
View wp-config.probo.php
<?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']);
View .probo.yml
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