Skip to Content

Drupal

Localize Fields

New Drupal Modules - 9 June 2014 - 6:09am
Translates field labels

in all contexts - forms, validation and view:

  • title and description of all core fields and date fields
  • prefix, suffix and decimal separator
  • option labels of list types
Translation GUI

Sub module adds translation to the standard field instance user interface.

Works for fields created via Features too

And furthermore includes drush script for extracting translations of all field labels of features files, and converting translations to/from context/non-context.

Categories: Drupal

Alexander Mikhailian: An incomplete inventory of ways to share code among Drupal initegrators

Planet Drupal - 9 June 2014 - 5:40am

Whenever a team starts working on a new Drupal-based website, there's an inevitable discussion on how to organize collaboration. Three questions come up regularly:

  1. How and when to use Features, Features Extra and Features Override modules
  2. How to organize production, testing and development environments and where to develop — on a shared server or locally
  3. How to share source code.

Out of the three, the question of the source code is the most contentious. One reason is that while everyone and their friend are already on git, most of the teams that implement Drupal websites do not really need a version control system where developers can cherry-pick and merge changes or analyze bugs by navigating commit histories. Instead, teams are usually interested in incremental backup systems where each team member can be sure that he can roll back his own and other people's changes until everything works again.

Below is the inventory of way to share source code in Drupal projects.

Incremental backup Incremental backup with drush

One way of ensuring incremental backups without the overhead of git or other version control system is to use drush. Drush keeps a backup of previous module versions in ~/drush-backups — there is enough info to revert manually to the previously known good state. This setup is ideal for small projects with a handful of custom modules that can be kept in their own git repositories.

When in doubt, don't put your Drupal project in git. Use drush and its build-in backup mechanism.

Categories: Drupal

Email Validator

New Drupal Modules - 9 June 2014 - 5:31am
Description

Integrates Drupal with the Email Address Online Verification API. As it is said in the service's website, the validation process includes the following steps:

Categories: Drupal

Stanford Web Services Blog: pushd, dirs, and popd

Planet Drupal - 9 June 2014 - 4:49am

If you spend a lot of your day at the command line (as I do), you're constantly on the lookout for new tools and tricks to increase your productivity and efficiency. Today we're going to take a look at the pushd suite of commands that exist in most shells (e.g., bash, tcsh and so forth).

Categories: Drupal

Pin Payments (lite)

New Drupal Modules - 9 June 2014 - 4:02am

Neat, nifty and nimble, Pin Payments is the easiest way for Drupal site-owners to sell online and for customers to purchase online.

Categories: Drupal

Alexander Mikhailian: An Ansible playbook for a smallish and very simple Drupal cluster

Planet Drupal - 8 June 2014 - 5:04pm

The cluster runs on apt-based systems. It is designed for high-availability: failure of one server is not critical. However, there is no automatic failover configuration. Instead, manual recovery is possible within minutes.

  • Load balancers run varnish. Its configuration file takse into account the context_breakpoint cookie that's used to implement responsive delivery. The same server also has memcached.
  • Application servers run nginx and a recent php5-fpm through unix sockets. There's also drush. The filesystem is shared through glusterfs.
  • MariaDb is configured in master-slave mode on database servers. They also run Apache Solr.

All servers set up exim to work as smarthost, sending mails through gmail. In practice, gmail limits outgoing emails to a few thousands per day, so it is better to replace it by a dedicated solution such as Mailchimp. There's also newrelic for server monitoring on all servers.

The playbook assumes that all servers have public IPs on eth0 and sit in the private network on eth1.

For the rest, check the code in github.

Categories: Drupal

Harmony Forum Access

New Drupal Modules - 8 June 2014 - 1:21pm

Restrict access to Harmony threads by Forum/Category!

This module creates permissions for CRUD operations for each term (using machine name for terms) which means exportable config.

Categories: Drupal

Automate API

New Drupal Modules - 8 June 2014 - 11:02am
Project Goals

The overall goal of this project is to abstract commonly used marketing automation features into a shared API module. This will enhance maintainability of 3rd party marketing automation modules by reducing redundant code. It will speed up development of new 3rd party services or Drupal-based MA services. This project also attempts to pool together developer resources to contribute to a centralized project.

Categories: Drupal

Drupal 8 and iOS: POST, PATCH and DELETE request with Drupal 8 REST services

Planet Drupal - 7 June 2014 - 9:04pm
POST, PATCH and DELETE request with Drupal 8 REST services

 

Drupal 8 will have REST support out of the box. But at the time of this writing examples for how to use this REST end points are not much available. In this blog I want to show you how we can create, delete and update a node with REST services with Drupal 8.

 

First of all we have to enable REST services and related HAL , SERIALIZATION, HTTP Basic Authentication modules. I would also like to recommend you to use REST UI contributed module to configure REST services.

 

 

 

Now you have to enable REST services for particular entity type like a node, user etc. you can do it by two way:

 

  1. You may use REST UI to do that from configuration menu and Web services section.
  2. You may directly manipulate  rest.settings.yml file.

 

With any of above mentioned way you enable POST, PATCH and DELETE method for certain entity type and also enable ‘basic_auth’ as authentication type.

 

Now give enough permission to administrator so that he can POST, PATCH and DELETE an entity with REST services.

 

You may use REST Client or Postman - REST client or DHC to test you web services.

Now let’s try to POST a node with REST services.

 

 

 

As shown in the image on your site /entity/node ( as at the time of this writing Drupal 8  is still on alpha release so this path may change in stable release)  is  REST endpoint to POST a node. Pass credential details with Authorization header. Set Content-Type to be application/hal+json.

In body part you have to specify value for all mandatory fields for entity type. You have to specify “type” of node with “_links” in JSON body. This “type” will be /rest/type/node/{bundle name}  or in case of user entity type it will be /rest/type/user/user. A successful POST will result in 201 http status code.

 

Now lets try to update a node with PATCH request.

 

 

As you can see in the image URL for node it self works as PATCH end point other headers and body section will be same as POST request. If PATCH request done successfully you will get 204 http status code.

 

At last let’s see how to DELETE a node.

 

Deleting a node is simple. Set request type to DELETE and pass credential information with Authorization header. A successful deletion will result in 204 http status code.

 

By similar way you can manipulate user entity type.

 

You can find more about what other details we can specify in JSON body for POST and PATCH request by GET a node with JSON as Accept type.

 

I am open to discuss this topic. You can mail me at vivekvpandya@gmail.com.

 

 

 

Tags:
Categories: Drupal
Syndicate content


Google+
about seo