Importing Scheduled Content

If you need to import content that's unpublished, but scheduled for future publication, you can do so by setting a node's 'publish_on' property in your Migration class's prepare() method implementation. For example:

Modifying node body during migration

If you need to modify data in the node body during the migration process, you can use the prepareRow($row) hook. The following example displays how to call the user defined method "convertWiki2Html" which converts the node body from wiki markup to HTML:

Validation API in Drupal 8

In Drupal 8 Entity validation is moved to a separate Entity validation API and decoupled from form validation. Decoupling entity validation from forms allows validation entities to be independent from form submissions, such as when changed via the RESTful web service. This new validation API has been implemented based on the Symfony validator.

Overview

Validation is controlled by a set of constraints, such as the maximum length of some text or restriction to a set of allowed values. Symfony comes with many useful constraints, which Drupal extends with more Drupal-specific constraints. Drupal Symfony validator has been integrated with the Typed Data API, such that validation constraints can be used and specified as part of Entity field definitions and, generally, any typed data definition.

Using the API

Validation can be invoked by calling the validate() method on any typed data object as in the following example:

<?php
    $definition
= array(
     
'type' => 'integer',
     
'constraints' => array(
       
'Range' => array('min' => 5),
      ),
    );
   
$typed_data = \Drupal::typedData()->create($definition, 10);
   
$violations = $typed_data->validate();
?>

This returns a list of violations if passed an empty validation:
<?php
if ($violations->count() > 0) {

Customizations

You should understand that every time you start virtual machine Vagrant will fire Chef provisioner. If you want to customize your VDD copy you should do it right way.

Templates override

If you want to change some configuration files, for example, php.ini you should override default VDD's template. All templates a located in cookbooks/core/vdd/templates/default

All you need is to copy template file into cookbooks/core/vdd/templates/ubuntu
directory and edit it.

Getting Started with VDD -- Vagrant Drupal Development

VDD uses Chef Solo provisioner and Vagrant to configure and manage your virtualized development environment which is hosted by your desktop OS (Windows, OSX, Linux) using VirtualBox.

  1. Install VirtualBox

    https://www.virtualbox.org/wiki/Downloads

  2. Install Vagrant

    http://docs.vagrantup.com/v2/installation/index.html

Journal

The Journal module adds additional fields to all forms in a Drupal site to let developers and site administrators record and track all actions performed to setup a site or change its configuration.

Journal is primarily useful for developers and site administrators working in a team environment. Since Drupal is a full-fledged content management framework, it is often not easy to communicate, track and audit all changes that have been applied to a site. It is still possible to build a completely customized site without contributed modules.

Install

  • Copy the "Journal" module to your modules directory and enable it on the "Modules" page.
  • Go to "Administration » People » Permissions" to allow users with certain roles access to the Journal (including adding new journal entries) by enabling 'Access Journal' and 'Access Site Reports' permissions.
  • Optionally enable the "Journal" block at "Administration » Structure » Blocks". This block displays all entries which have been made in the past for the currently visited URL.

Use

When you or your co-workers/team make a submission that alters site settings and features, enter a meaningful description of the action taken into the "Journal" form field.

To view all changes, go to "Administration » Reports » Journal entries".

Pages

Subscribe with RSS Subscribe to RSS - Needs copy/style review