Skip to content

Instantly share code, notes, and snippets.

View andrewcuthill's full-sized avatar

andrewcuthill

  • Sydney, Australia
View GitHub Profile
@johnennewdeeson
johnennewdeeson / gist:26a1f0082aa3f5c4dd47
Last active January 11, 2017 23:10
Drupal move all data from one field to another on the same node programatically.
/**
* Move all data in one field to another.
* In the example below we replace a multi cardinality field (field_old_field)
* with a single cardinality field (field_new_field).
* The data in the first element of the old field becomes the only data in the new field.
*
* @requires entity module
*/
function mymodule_update_7001(&$sandbox) {
if (!isset($sandbox['progress'])) {
@tgmweb
tgmweb / ElasticSearch
Created July 18, 2013 17:16
Example CFC for elasticSearch interface
<cfcomponent output="false" >
<cffunction name="init" access="public" returntype="any" >
<!--- this just sets up the CFC with the elasticSearch URL and port --->
<cfargument name="searchEndPoint" type="string" required="true"/>
<cfargument name="searchPort" type="string" required="true"/>
<cfset variables.searchEndPoint = arguments.searchEndPoint />
<cfset variables.searchPort = arguments.searchPort />
<cfreturn this />
</cffunction>