Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 2 min 11 sec ago

Drupal Association News: Building the Drupal Community in Vietnam: Seeds for Empowerment and Opportunities

Wed, 07/23/2014 - 06:38
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpimg alt=Drupal Vietnam class=left src= /With almost 90 million people, Vietnam has the 13th largest population of any nation in the world. It's home to a young generation that is very active in adopting innovative technologies, and in the last decade, the country has been steadily emerging as an attractive IT outsourcing and staffing location for many Western software companies./p pYet amidst this clear trend, Drupal has emerged very slowly in Vietnam and all of Asia as a leading, enterprise-ready Framework (CMF). However, this is changing as one Drupalista works hard to grow the regional user base./p h2 How it all started/h2 pTom Tran, a German with Hanoian roots, discovered Drupal in 2008. He was overwhelmed by the technological power and flexibility that makes Drupal such a highly competitive platform, and was amazed by the friendliness and vibrancy of the global community. He realized that introducing the framework and the Drupal community to Vietnam would help local people the opportunity to access the following three benefits:/p ulli strongSteady Income:/strong Drupal won’t make you an overnight millionaire, however if you become a Drupal expert and commit to helping clients to achieve their goals, you will never be short of work. Quality Drupal specialists are in huge demand across the world and this demand won’t stop any time soon as Drupal adoption grows./li li strongBetter Lifestyle: /strongYou are free and able to design a work/lifestyle balance on your terms. You can work from home or contribute remotely while traveling, as long as you continue to deliver sustainable value to your client. Many professionals in less developed countries like Vietnam have never imagined this opportunity-- and learning about this lifestyle can be very empowering and inspirational./li li strongCross Cultural Friendships: /strongIn spite of national borders and cultural differences, Tom has established fruitful partnerships between his development team from Vietnam and clients from across the globe. Whether clients are based in California, Berlin, Melbourne or Tokyo, his team has successfully collaborated on many projects and often became good friends beyond just project mates. These relationships can only grow thanks to the open Drupal community spirit and the way it connects peoples from all regions and cultures from around the world./li /ulpTom started by organizing a a href= 7 release party in Hanoi/a in January 2011. Afterwards, he reached out to Drupal enthusiasts in the region and organized informal coffee sessions, which have contributed to the growth of a solid, cohesive community in Vietnam./p h2 Drupal Vietnam College Tour/h2 pWith help from a a href= Cultivation Grant/a, Tom put on workshops every three months at Vietnamese universities and colleges in 2012. By showcasing the big brands and institutions using Drupal, a diverse series of use cases demonstrate that the demand for Drupal is high, and that the Drupal industry is a great place to be. A three hour hands-on session walks students through the basics of sitebuilding with Drupal-- and it's at this point that most students get hooked./p pstrongMarch 2012/strongbr / First ever Drupal Hanoi Conference at VTC Academy, with 120 visitors (a href=;type=1facebook gallery/a)/p pimg alt= src= //p pstrongJune 2012/strongbr / Hello Drupal workshop @ Tech University Danang (a href=;type=3gallery/a)/p pimg alt= src= //p p /p pstrongJuly 2012/strongbr / Drupal Workshop @ FTP-Aptech (a href=;type=1fb gallery/a, a href= aptech news/a)/p pimg alt= src= //p p /p pstrongSeptember 2012/strongbr / Drupal Workshop @ NUCE (a href=, a href=;id=1265Nuce news/a)/p pimg alt= src= //p p /p pstrongNovember 2012/strongbr / Drupal Workshop @ FTP University (a href=;page=1gallery/a)/p pimg alt= src= //p p /p pstrongDecember 2012/strongbr / Drupal Workshop @ Aiti-Aptech (a href=;type=3gallery/a)/p pimg alt= src= //p p /p pstrongDecember 2012/strongbr / Drupal talk amp; sponsorship for 2012 (local images 2x)img alt= src= //p pThe results was an overall increase in members and growing everyday. Stats in 2014:/p ulli 640 Members on a href= li 1300 members on Facebook/Vietnam/li li 550 members on a href= li 80 members on a href= /ulh2 What’s next?/h2 pTom is currently planning to organize the first DrupalCamp in Hanoi / Vietnam in late 2014. Today strongDrupal Vietnam/strong has only roughly 1300 members, (less than LA DUG) but with a growing pool of software engineers graduating each year, this country is set to become a relevant resource of highly skilled developers, provided high quality training is affordable and access to jobs can be facilitated. Things look very bright in Vietnam!/p h2 Supporters/h2 ulli Drupal Association/li li a href= James/a amp; a href= from Acquia/li li a href= Kettunen/a/li li a href= Nadeau/a/li li a href= Wooten/a/li /ulh2 About/h2 pimg alt=Tom Tran class=right src= //p pTom is founder of a href=http://geekpolis.comGeekpolis/a, a software company with a development center based in Hanoi, Vietnam. Geekpolis focuses on high-quality managed Drupal development services for bigger consultancy agencies. Currently the team is comprised of 25 engineers./p h2 To get involved, contact Tom at:/h2 ulli a href= li a href= /ul/div/div/div

Drupal core announcements: Drupal 7.30 release this week to fix regressions in the Drupal 7.29 security release

Wed, 07/23/2014 - 06:06
div class=field field-type-datestamp field-field-start7 div class=field-items div class=field-item odd div class=field-label-inline-first Start:nbsp;/div span class=date-display-start2014-07-23 (All day)/spanspan class=date-display-separator - /spanspan class=date-display-end2014-07-25 (All day) America/New_York/span /div /div /div div class=field field-type-text field-field-event-type div class=field-items div class=field-item odd Sprint /div /div /div div class=field field-type-userreference field-field-organizers div class=field-labelOrganizers:nbsp;/div div class=field-items div class=field-item odd a href=/user/14705 title=View user profile.David_Rothstein/a /div /div /div pThe a href= 7.29 security release/a contained a security fix to the File module which caused some regressions in Drupal's file handling, particularly for files or images attached to taxonomy terms./p pI am planning to release Drupal 7.30 this week to fix as many of these regressions as possible and allow more sites to upgrade past Drupal 7.28. The release could come as early as today (Wednesday July 23)./p pHowever, to do this we need more testing and reviews of the proposed patches to make sure they are solid. Please see a href= Regression: Files or images attached to certain core and non-core entities are lost when the entity is edited and saved/a for more details and for the patches to test, and leave a comment on that issue if you have reviewed or tested them./p pThank you!/p

Mediacurrent: Understanding the Role of the Enterprise in Drupal

Wed, 07/23/2014 - 03:53
img typeof=foaf:Image src= width=200 height=152 / pThere is a a href= topic/a I am seeing being discussed a lot more in the open-source software and a href= community. The point of conversation focuses on what the role should be of enterprise organizations?  Especially, those that are or have already adopted Drupal as their web platform of choice./p

Greater Los Angeles Drupal (GLAD): Drupal Migrate using xml 0 to 35

Tue, 07/22/2014 - 20:55
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpUsing Drupal Migrate is a great way to move you content into Drupal. Unfortunately the documentation for xml import can be obscure. This comes about when those that developed the module try to communicate how they did what they did to someone that did not do the work. Things that seem obvious to them are not to someone else./p pI have spent some time recently importing content using xml. In no way am I an expert that is speeding down the fast lane, something more in the cruising around town at a comfortable 35 mph./p pTo use Drupal Migrate you need to define your own class. A class is php code that is used in Object Oriented Programming that defines your data and defines how you can manipulate your data. Most of the actual migration work is done with the classes provide by the migrate module, you simply have to define the details of your migration./p pConstructor - The constructor modifies the migration modules classes to define your specific data. I was able to follow the SourceList method, this provides one xml (file or feed) that contains the ID number for all the content you want to import, and a second (file or feed) that contains the content. The wine example migrate has this but understanding what it really wants is more difficult to understand./p pBelow is my class file explained:br / =====================br / lt;?php/p p/**br / * @filebr / * Vision Article / *//p p/**br / * Vision Article migration / */br / class VisionArticleMigration extends XMLMigration {br / public function __construct() {br / parent::__construct();br / $this-gt;description = t('XML feed of Ektron Articles.');/p h3---------------br / So far pretty easy. You need to name your class, extend from the proper migration. and give it an extension. /h3p-----------------br //pp // There isn't a consistent way to automatically identify appropriatebr / // fields from an XML feed, so we pass an explicit list of source / $fields = array(br / 'id' =gt; t('ID'),br / 'lang_type' =gt; t('Language'),br / 'type' =gt; t('Type'),br / 'image' =gt; t('Image'),br / 'authors' =gt; t('Authors'),br / 'article_category' =gt; t('Article Category'),br / 'article_series_title' =gt; t('Article Series Title'),br / 'article_part_no' =gt; t('Article Series Part Number'),br / 'article_title' =gt; t('Article Title'),br / 'article_date' =gt; t('Article Date'),br / 'article_display_date' =gt; t('Article Display Date'),br / 'article_dropheader' =gt; t('Article Dropheader'),br / 'article_body' =gt; t('Article Body'),br / 'article_author_name' =gt; t('Article Author Name'),br / 'article_author_url' =gt; t('Article Author Email Address'),br / 'article_authors' =gt; t('Article Additional Authors'),br / 'article_postscript' =gt; t('Article Postscript'),br / 'article_link_text' =gt; t('Article Link text'),br / 'article_link' =gt; t('Article Link'),br / 'article_image' =gt; t('Article Image'),br / 'article_image_folder' =gt; t('Article Image Folder'),br / 'article_image_alt' =gt; t('Article Image Alt'),br / 'article_image_title' =gt; t('Article Image Title'),br / 'article_image_caption' =gt; t('Article Image Caption'),br / 'article_image_credit' =gt; t('Article Image Credit'),br / 'article_sidebar_element' =gt; t('Article Side Bar Content'),br / 'article_sidebar_element_margin' =gt; t('Article Margin between Sidebar Content'),br / 'article_archived_html_content' =gt; t('Article HTML Content from old system'),br / 'article_video_id' =gt; t('Article ID of Associated Video Article'),br / 'metadata_title' =gt; t('Metadata Title'),br / 'metadata_description' =gt; t('Metadata Description'),br / 'metadata_keywords' =gt; t('Metadata Keywords'),br / 'metadata_google_sitemap_priority' =gt; t('Metadata Google Sitemap Priority'),br / 'metadata_google_sitemap_change_frequency' =gt; t('Metadata Google Sitemap Change Freequency'),br / 'metadata_collection_number' =gt; t('Metadata Collection Number'),br / 'title' =gt; t('Title'),br / 'teaser' =gt; t('Teaser'),br / 'alias' =gt; t('Alias from old system'),br / 'taxonomy' =gt; t('Taxonomy'),br / 'created_date' =gt; t('Date Created')br / );/p h3 -------------------br / So what doe this mean?br / You will need a field name below. It has nothing to do with your xml file, you will need a field for each thing you want to import. Such as article_image_alt is the alt text for the image. Later you will define the xpath to load this variable. This will start to come together below, just remember each unique piece of information needs a variable. /h3p---------------------br //pp // The source ID here is the one retrieved from the XML listing URL, andbr / // used to identify the specific item's / $this-gt;map = new MigrateSQLMap($this-gt;machineName,br / array(br / 'ID' =gt; array(br / 'type' =gt; 'int',br / 'unsigned' =gt; TRUE,br / 'not null' =gt; TRUE,br / 'description' =gt; 'Source ID',br / )br / ),br / MigrateDestinationNode::getKeySchema()br / );/p h3 ---------------------br / This has to do with setting up the migration table in the database. This has to do with the input database, the Source ID is the field in the input file that has the pointer to the data record. My source file looks like: /h3p567br / 1054/p pSo we need a table with a field for the id which an integer./p p-----------------------br //pp // Source list / $list_url = 'a href=';br / // Each ID retrieved from the list URL will be plugged into :id in thebr / // item URL to fetch the specific / // @todo: Add langtype for importing translated / $item_url = 'a href=';/p p // We use the MigrateSourceList class for any source where we obtain thebr / // list of IDs to process separately from the data for each item. Thebr / // listing and item are represented by separate classes, so for example webr / // could replace the XML listing with a file directory listing, or the XMLbr / // item with a JSON / $this-gt;source = new MigrateSourceList(new MigrateListXML($list_url),br / new MigrateItemXML($item_url), $fields);/p p $this-gt;destination = new MigrateDestinationNode('vision_article');/p h3 ----------------- /h3pNow we are setting up the magic. We setup a list url that contains the ID's of all the content to import, then another one that uses this ID to fetch the details for this ID. Then you tell Migrate to use the MigrateListXML to find the items to import with MigrateItemXML. Then finally in the MigrateDestinationNode to tell Migrate which content type to use. This means we need a separate migration class for each content type to import. I have been creating each class in it's own inc file and adding this to the files section in the info file./p p-----------------br //pp // TIP: Note that for XML sources, in addition to the source field passed tobr / // addFieldMapping (the name under which it will be saved in the data rowbr / // passed through the migration process) we specify the Xpath used to retrievebr / // the value from the / $this-gt;addFieldMapping('created', 'created_date')br / -gt;xpath('/content/CreateDate');/p h3 ------------------br / Now we map the source field with the destination field. Created is the field name in the content type (vision_article), created_date is from our fields section above. Remember I said we needed a definiation for each part of the content we want to import. The xpath then points to the data in the xml feed. So this says take the content of the /contnet/CreateDate in the xml file and load this into the source variable created_date, then store this in the created field in a new vision_article content item. I say this in this way because if you do like me and cut and paste and forget to change the source varable, the source varable will contain the bottom data from xpath. /h3p------------------br //pp $this-gt;addFieldMapping('field_category', 'article_category')br / -gt;defaultValue(1)br / -gt;xpath('/content/html/root/article/Category');/p h3 ------------------- /h3pYou can set a default value in case the xml does not contain any data/p p----------br //pp $this-gt;addFieldMapping('field_series_title', 'article_series_title')br / -gt;xpath('/content/html/root/article/ArticleSeriesTitle');br / $this-gt;addFieldMapping('field_part_number', 'article_part_no')br / -gt;xpath('/content/html/root/article/ArticlePartNo');br / $this-gt;addFieldMapping('field_h1_title', 'article_title')br / -gt;arguments(array('format' =gt; 'filtered_html'))br / -gt;xpath('/content/html/root/article/Title');br / $this-gt;addFieldMapping('field_display_date', 'article_display_date')br / -gt;xpath('/content/html/root/article/DisplayDate');br / $this-gt;addFieldMapping('field_drophead', 'article_dropheader')br / -gt;arguments(array('format' =gt; 'filtered_html'))br / -gt;xpath('/content/Taxonomy');/p h3 ------------- /h3pAnother field argument, the default content type is plain text, so if your content contains HTML you need to set the correct format here./p p---------------br //pp $this-gt;addFieldMapping('body', 'article_body')br / -gt;arguments(array('format' =gt; 'filtered_html'))br / -gt;xpath('/content/html/root/article/Body');br / $this-gt;addFieldMapping('body:summary', 'teaser')br / -gt;arguments(array('format' =gt; 'filtered_html'))br / -gt;xpath('/content/Teaser');/p h3 ----------- /h3pNote you can set the teaser as a part of the body. One of the drush migrate commands make is easy to discover the additional parts of your content field, drush mfd (Migrate Field Destinations). This will display all the destination fields and their options./p p------------br //pp $this-gt;addFieldMapping('field_author', 'article_author_email')br / -gt;xpath('/content/html/root/article/AuthorURL');br / $this-gt;addFieldMapping('field_author:title', 'article_author_name')br / -gt;xpath('/content/html/root/article/AuthorName');br / $this-gt;addFieldMapping('field_ext_reference_title', 'article_postscript')br / -gt;arguments(array('format' =gt; 'filtered_html'))br / -gt;xpath('/content/html/root/article/Postscript');/p p---------br / see explanation belowbr / --------br / $this-gt;addFieldMapping('field_article_image:file_replace')br / -gt;defaultValue(MigrateFile::FILE_EXISTS_REUSE); //FILE_EXISTS_REUSE is in the MigrateFile classbr / $this-gt;addFieldMapping('field_article_images', 'article_image')br / -gt;xpath('/content/html/root/article/Image/File/img/file_name');br / $this-gt;addFieldMapping('field_article_images:source_dir', 'article_image_folder')br / -gt;xpath('/content/html/root/article/Image/File/img/file_path');br / $this-gt;addFieldMapping('field_article_images:alt', 'article_image_alt')br / -gt;xpath('/content/html/root/article/Image/File/img/@alt');br / $this-gt;addFieldMapping('field_article_images:title', 'article_image_title')br / -gt;xpath('/content/html/root/article/Image/File/img/@alt');/p h3 -------------- /h3pThis section gets tricky. You are importing an Image or other file. The default migration for a file is MigrateFileUrl. You can migrate all your files ahead of time or as I am doing do it inline. The main components for this is the main field, which is the file name, and the source_dir for the path to this image. Drual 7 has a database table for the files is uses with the url to the file. MigrateFile then uploads this file to the public folder and creates an entry into the files_,amaged table to indicate the url. What I did was copy all the images to a public location on S3 storage so I did not want Migrate to create a new file but use the existing file. Thus the file_replace setting to the constant MigrateFile::FILE_EXISTS_REUSE. This tells migrate to use the existing file and make an entry in the file_managed table for this file./p pLater in the PrepareRow method I will show how we separate this and add it to the xml./p p------------br //pp $this-gt;addFieldMapping('field_archive', 'article_archived_html_content')br / -gt;xpath('/content/archive_html');br / $this-gt;addFieldMapping('field_ektron_id', 'id')br / -gt;xpath('/content/ID');br / $this-gt;addFieldMapping('field_ektron_alias', 'alias')br / -gt;xpath('/content/html/Alias');br / $this-gt;addFieldMapping('field_sidebar', 'article_sidebar_element')br / -gt;arguments(array('format' =gt; 'filtered_html'))br / -gt;xpath('/content/html/root/article/SidebarElement/SidebarElementInformation');br / $this-gt;addFieldMapping('field_slider_image:file_replace')br / -gt;defaultValue(MigrateFile::FILE_EXISTS_REUSE); //FILE_EXISTS_REUSE is in the MigrateFile classbr / $this-gt;addFieldMapping('field_slider_image', 'image')br / -gt;xpath('/content/Image/file_name');br / $this-gt;addFieldMapping('field_slider_image:source_dir', 'image_folder')br / -gt;xpath('/content/Image/file_path');br / $this-gt;addFieldMapping('field_slider_image:alt', 'image_alt')br / -gt;xpath('/content/Title');br / $this-gt;addFieldMapping('field_slider_image:title', 'image_title')br / -gt;xpath('/content/Title');br / $this-gt;addFieldMapping('title', 'title')br / -gt;xpath('/content/Title');br / $this-gt;addFieldMapping('title_field', 'title')br / -gt;xpath('/content/Title');/p p // Declare unmapped source / $unmapped_sources = array(br / 'article_author_url',br / 'article_authors',br / 'article_sidebar_element_margin',br / 'article_video_id',br / 'metadata_title',br / 'metadata_description',br / 'metadata_keywords',br / 'metadata_google_sitemap_priority',br / 'metadata_google_sitemap_change_frequency',br / 'metadata_collection_number',/p p );/p h3 ------------- /h3pIf you are not using a source field, best practices state that you declare it in the unmapped sources/p p------------br //pp $this-gt;addUnmigratedSources($unmapped_sources);/p p // Declare unmapped destination / $unmapped_destinations = array(br / 'revision_uid',br / 'changed',br / 'status',br / 'promote',br / 'sticky',br / 'revision',br / 'log',br / 'language',br / 'tnid',br / 'is_new',br / 'body:language',br / );/p h3 ---------------------- /h3pIf you are not using a destination field best practices state that you declare in the unmaped destinations array. Note if you later use this field you need to remove it from the unused array./p p---------------------br //pp $this-gt;addUnmigratedDestinations($unmapped_destinations);/p p if (module_exists('path')) {br / $this-gt;addFieldMapping('path')br / -gt;issueGroup(t('DNM'));br / if (module_exists('pathauto')) {br / $this-gt;addFieldMapping('pathauto')br / -gt;issueGroup(t('DNM'));br / }br / }br / if (module_exists('statistics')) {br / $this-gt;addUnmigratedDestinations(array('totalcount', 'daycount', 'timestamp'));br / }br / }/p p------------/p pThe rest of the constructor is from the example. Did not cause me a problem so did not worry about it./p p------------br / /**br / * {@inheritdoc}br / *//p h3 --------------- /h3pNow we can add our own magic. We can effect the data from the content item before it is saved in to the content item. /p p-----------------br //pp public function prepareRow($row) {br / if (parent::prepareRow($row) === FALSE) {br / return FALSE;br / }br / $ctype = (string)$row-gt;xml-gt;Type;br / //set variable for return codebr / $ret = FALSE;br / //dpm($row);/p h3 ------------ /h3pYou will see these scattered through the prepareRow function. These are the devel command to print to the screen for debuging. They should be commented out but you can see the process I went through to debug my particular prepareRow. Also note this is a great use of the Migrate UI, these print statment only help you in the web interface, if you use Drush you will not see these diagnostic prints./p p---------------br //pp if ($ctype == '12'){/p h3 --------------- /h3pThis is specific to my migrate. The following code is only applicable to a content type of 12. The other content types have a different data structure. If prepareRow returns False the row will be skipped./p p------------------br //pp // Map the article_postscript source field to the new destination / //if((string)$row-gt;xml-gt;root-gt;article-gt;Title == ''){br / // $row-gt;xml-gt;root-gt;article-gt;Title = $row-gt;xml-gt;root-gt;Title;br / //}br / $postscript = $row-gt;xml-gt;html-gt;root-gt;article-gt;Postscript-gt;asXML();br / $postscript = str_replace('','',$postscript);br / $postscript = str_replace('','',$postscript);br / $row-gt;xml-gt;html-gt;root-gt;article-gt;Postscript = $postscript;/p h3 ------------------- /h3pAgain this is something unique to my migrate. The content structure is contained in xml so the HTML is recognized by SimpleXML as xml. So the asXML() function returns a string containing the xml of the node. Now I can save this string to the node and it becomes a string node and is back to straight html. So I need to do this for all the nodes that contain html. Most of the time you will be able to pass the html string as a node and will not have to do this transform./p p-------------------br //pp //converts html nodes to string so they will / $body = $row-gt;xml-gt;html-gt;root-gt;article-gt;Body-gt;asXML();br / $body = str_replace('','',$body);br / $body = str_replace('','',$body);br / $row-gt;xml-gt;html-gt;root-gt;article-gt;Body = $body;br / $title = $row-gt;xml-gt;html-gt;root-gt;article-gt;Title-gt;asXML();br / $title = str_replace('','',$title);br / $title = str_replace('','',$title);br / $row-gt;xml-gt;html-gt;root-gt;article-gt;Title = $title;br / $drophead = $row-gt;xml-gt;html-gt;root-gt;article-gt;Dropheader-gt;asXML();br / $drophead = str_replace('','',$drophead);br / $drophead = str_replace('','',$drophead);br / //If Dropheader is emptybr / $drophead = str_replace('','',$drophead);br / $row-gt;xml-gt;html-gt;root-gt;article-gt;Dropheader = $drophead;br / //Array to allow conversion of Category text to ISbr / $cat_tax = array(br / 'Science and Environment' =gt; 1,br / 'History' =gt; 2,br / 'Social Issues' =gt; 3,br / 'Family and Relationships' =gt; 4,br / 'Life and Health' =gt; 5,br / 'Religion and Spirituality' =gt; 6,br / 'Biography' =gt; 7,br / 'Ethics and Morality'=gt; 8,br / 'Society and Culture' =gt; 9,br / 'Current Events and Politics' =gt; 10,br / 'Philosophy and Ideas' =gt; 11,br / 'Personal Development' =gt; 12,br / 'Reviews' =gt; 13,br / 'From the Publisher' =gt; 14,br / 'Interviews' =gt; 17,br / );br / //Convert additional taxonomies to tagsbr / //$tax_id_in = (string)$row-gt;xml-gt;Taxonomy;br / //$tax_id_array = explode(',',$tax_id_in);br / //$tax_in_array = array();br / //foreach($tax_id_array as $tax){br / // If(is_null($cat_tax[tax]))br / // $tax_in_array[] = $cat_tax[$tax];br / //}br / //$new_tax = implode(',',$tax_in_array);br / //dpm($new_tax);br / //dpm($row);br / //$row-gt;xml-gt;Taxomomy = $new_tax;br / // Change category text to IDbr / $category = (string)$row-gt;xml-gt;html-gt;root-gt;article-gt;Category;br / //Specify unknown category if we do not recognize the categorybr / //This allows the migrate and allow us to fix / $tax_cat = $cat_tax[trim($category)];br / //dpm($category);br / if(is_null($tax_cat)) {$tax_cat = 18;}br / //dpm($tax_cat);br / $row-gt;xml-gt;html-gt;root-gt;article-gt;Category = $tax_cat;/p h3 ------------- /h3pThe category field in the source is a text field. The categories are a entity reference to a taxonomy field, which requires an id rather than text. I manually setup the categories ahead of time so I created an array that has the text as the key and the is as the content. Then you can use this to quickly look up the id for the text in he category field. Then we can replace the text in Category with the id. This works, another way to do this is migrate the categories first then use this migration to translate this for you. This is a feature built into migrate. The explanation of this will come later./p p----------------br //pp //modify the image file / //dpm((string)$row-gt;xml-gt;ID);br / if((string)$row-gt;xml-gt;html-gt;root-gt;article-gt;Image-gt;File-gt;asXML() != ''){br / //dpm((string)$row-gt;xml-gt;html-gt;root-gt;article-gt;Image-gt;File-gt;asXML());br / $src = (string)$row-gt;xml-gt;html-gt;root-gt;article-gt;Image-gt;File-gt;img-gt;attributes()-gt;src;br / $src_new = str_replace('/visionmedia/uploadedImages/','a href=',$src);br / $row-gt;xml-gt;html-gt;root-gt;article-gt;Image-gt;File-gt;img-gt;attributes()-gt;src = $src_new;br / $file_name = basename($src_new);br / $file_path = rtrim(str_replace($file_name,'', $src_new), '/');;br / $row-gt;xml-gt;html-gt;root-gt;article-gt;Image-gt;File-gt;img-gt;addChild('file_name',$file_name);br / $row-gt;xml-gt;html-gt;root-gt;article-gt;Image-gt;File-gt;img-gt;addChild('file_path',$file_path);br / }/p h3 -------------- /h3pThere is alot of stuff here. Remember for the MigrateFile you need to present the file name and source directory. The Image/File node contains an img tag. So we need to get the scr attribute and extract the file name and source directory. So why the if? Migrate will import a null node as null, but this is php code running on the row. If you try to get the src attribute on a null node it will throw an error. So the if statement checks to see if the File node is empty (only contains /File) and skips this tranformation, Migrate will simply import a null or empty field./p pThe src is the relative path to the website, so the first thing we do is change this to full url to the s3 content storage. The path is basically the same except in the uploadedimages the i in the database is uppercase. This was a Windows server so it did not make a difference but the s3 url is case sensitive. We then use base name to extract the file name and use this to remove the file from the path for the file path and create a new child in the xml row to store these. I did not point this out but this is the xpath use in the field mapping above./p p--------------br //pp $email = (string)$row-gt;xml-gt;html-gt;root-gt;article-gt;AuthorURL;br / if (!empty($email)){br / $email = 'mailto:'.$email;br / $row-gt;xml-gt;html-gt;root-gt;article-gt;AuthorURL = $email;br / }/p h3 ------------- /h3pThe author url is the email to the author of the article. We turn this into a mailto link so that it will generate a link to send the author an email./p p---------------br //pp $archive_html = (string)$row-gt;xml-gt;html-gt;asXML();br / $row-gt;xml-gt;addChild('archive_html',$archive_html);br / $sidebar_element = (string)$row-gt;xml-gt;html-gt;root-gt;article-gt;SidebarElement-gt;SidebarElementInformation-gt;asXML();br / $row-gt;xml-gt;html-gt;root-gt;article-gt;SidebarElement-gt;SidebarElementInformation = $sidebar_element;br / $slider_src = (string)$row-gt;xml-gt;Image;br / $slider_src_new = str_replace('/visionmedia/uploadedImages/','a href=',$slider_src);br / $row-gt;xml-gt;Image = $slider_src_new;br / $slider_file_name = basename($slider_src_new);br / $slider_file_path = rtrim(str_replace($slider_file_name,'', $slider_src_new), '/');;br / $row-gt;xml-gt;Image-gt;addChild('file_name',$slider_file_name);br / $row-gt;xml-gt;Image-gt;addChild('file_path',$slider_file_path);br / //dpm($row);/p p---------------/p pThe rest is repitition of the above techniques. Note that we return TRUE if we want to process the row and false if we do not want to process the row./p p-----------------br //pp$ret=TRUE;br / //dpm($src);br / }br / //Need to add processing for other Article Content types especially 0 (HTML content)br / //dpm($row);br / return $ret;br / }/p p}/p h3 ---------- /h3pThis is the class I use for one of the imports. I told you that I would show the use of another migrate in the field mappings. Below is a snippet of code from the issues migration. The issue contains entity reference to vision_articles that were imported from above./p p-------------br //pp $this-gt;addFieldMapping('field_articles', 'article_id')br / -gt;sourceMigration('VisionArticle')br / -gt;xpath('/item/articles/article/ID'); /p h3 -------------- /h3pSo this says use the VisionArticle (I will show you were to find this next), it knows to look up the source ID and relate it to the DestinationID and store this in the field_articles field./p p---------------/p pMigrate has been around for a while. Initially they said that the class would automaticall be registed and you could manually register them if needed. Then they changed to say that they will not manually register and you should register your classes. So you should have as part of your migration module the following that will register your classes. Note the name of the array element is the name used above./p p----------------br //ppfunction vision_migrate_migrate_api() {br / $api = array(br / 'api' =gt; 2,br / // Give the group a human readable / 'groups' =gt; array(br / 'vision' =gt; array(br / 'title' =gt; t('Vision'),br / ),br / ),br / 'migrations' =gt; array(br / 'VisionArticle' =gt; array('class_name' =gt; 'VisionArticleMigration'),br / 'VisionIssue' =gt; array('class_name' =gt; 'VisionIssueMigration'),br / 'VisionVideoArticle' =gt; array('class_name' =gt; 'VisionVideoArticleMigration'),br / 'VisionFrontpage' =gt; array('class_name' =gt; 'VisionFrontpageMigration'),br / ),br / );/p p return $api;br / } /p h3 ---------------- /h3pI hope this makes things a little easier to understand. You will need some basic module building skills, knowing the file names and things like that, but this should help you through the more obscure parts of creating your migration class./p /div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/tags/planet-drupal typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=Planet Drupal/a/div/div/div

Drupal Association News: Why we moved to a CDN

Tue, 07/22/2014 - 19:54
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpAs of a little after 19:00 UTC on 2 July 2014, is now delivering as many sites as possible via our a href= CDN./p h2 a href= a CDN/a?/h2 pWe are primarily concerned with the network level security that a CDN will provide pThe CDN enables us to restrict access to our origin servers and disallow directly connecting to origin web nodes (which is currently possible). The two big advantages are:/p olli Accelerate cacheable content (static assets, static pages, etc)./li li Allow us to easily manage network access and have a very large network in front of ours to absorb some levels of attacks./li /olpHere are some examples of how the CDN helps ulli We were having issues with a .js file on The network was having routing issues to Europe and people were complaining about stalling on page loads. There was basically nothing we could do but wait for the route to get better. This should never be a problem again with EdgeCast's global network./li li We constantly have reports of because blacklisted because it serves a ton of traffic coming in and out of a small number of IP addresses. This should also not happen again because the traffic is distributed through EdgeCast's network./li li A few months ago we were under consistent attack from a group of IPs that was sub-HTTP and was saturating the origin network's bandwidth. We now have EdgeCast's large network in front of us that can 'take the beating'./li /ulh2 pBy enabling EdgeCast's raw logs, rsync, and caching features, we were able to offload roughly 25 Mbps of traffic from our origin servers to EdgeCast. This change resulted in a drastic drop in origin network traffic, which freed up resources for The use of rsync and the raw log features of EdgeCast enabled us to continue using our current project usage statistics tools. We do this by syncing the access logs from EdgeCast to’s utility server that processes project usage statistics./p h2 img alt=CDN caching results screenshot src= style=width: 494px; height: 192px; //h2 h2 pMinutes after switching to use the CDN, there were multiple reports of faster page load times from Europe and North America./p pA quick check from France / / Pre-CDN results: first page load=4.387s. repeat view=2.155sbr / Post-CDN results: first page load=3.779s, repeat view=1.285s/p h2 Why was the rename required?/h2 pOur CDN uses a combination of a href= IP addresses/a and DNS trickery. Each region (Asia, North America, Europe, etc.) has an Anycast IP address associated with it. For example might resolve to in North America, and in Japan./p pSince,, etc. are Anycast IPs, generally their routes are as short as possible, and the IP will route to whatever POP is closest. This improves network performance globally./p h2 Why can't be a CNAME?/h2 pThe DNS trickery above works by using a CNAME DNS record. must be an A record because the root domain cannot be a CNAME. MX records and any other records are a href= allowed by the RFC on CNAME records/a. To work around this DNS limitation, URLs are now redirected to p /p p /p pstrongRelated issues/strongbr /a href= /a href= /div/div/div

Stanford Web Services Blog: Cherry Picking - Small Git lesson

Tue, 07/22/2014 - 18:56
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedp class=summarySmall commits allow for big wins./p p class=summarySomething that I have been using a lot lately is GIT's cherry pick command. I find the command very usefull and it saves me bunches of time. Here is a quick lesson on what it does and an example use case./p h3spanWhat is GIT cherry-pick? a href= rel=nofollowman page/a/span/h3 pspanGit cherry pick allows you to merge a single commit from one branch into another.  To use the cherry pick command follow these steps:/span/p/div/div/div

2bits: Improve Your Drupal Site Performance While Reducing Your Hosting Costs

Tue, 07/22/2014 - 17:00
We were recently apporached by a non-profit site that runs on Drupal. Major Complains Their major complaint was that the quot;content on the site does not show upquot;. The other main complain is that the site is very slow. Diagnosis First ... In order to troubleshoot the disappearing content, we created a copy of the site in our lab, and proceeded to test it, to see if we can replicate the issues. pa href= target=_blankread more/a/p

Drupalize.Me: Drupal 8 Has All the Hotness, but So Can Drupal 7

Tue, 07/22/2014 - 15:30
div class=field field-name-body field-type-text-with-summary field-label-hidden text-content text-secondarydiv class=field-itemsdiv class=field-item evenpDrupal 8 is moving along at a steady pace, but not as quickly as we all had hoped. One great advantage this has is it gives developers time to backport lots of the features Drupal 8 has in core as modules for Drupal 7. My inspiration and blatant rip-off for this blog came from the presentation fellow Lullabot Dave Reid did at Drupalcon Austin about how to Future-Proof Your Drupal 7 Site. Dave’s presentation was more about what you can do to make your Drupal 7 “ready” where this article is more about showing off Drupal 8 “hotness” that we can use in production today./p /div/div/div

Drupal Easy: DrupalEasy Podcast 135: Deltron 3030 (Ronan Dowling, Backup and Migrate 3.0)

Tue, 07/22/2014 - 15:09
div class=field field-type-link field-field-embed a href= rel=enclosureDownload Podcast 135/a /div pRonan Dowling (a href=, lead developer at a href=http://www.gortonstudios.comGorton Studios/a joins Ted and Mike to talk about all the new features in a href= and Migrate 3.0/a including file and code backup and a improved plugin architecture. We also get up-to-speed with Drupal 8 development, review some Drupal-y statistics, make our picks of the week, and ask Ronan 5-ish questions./p pa href= target=_blankread more/a/pdiv class=feedflare a href= src= border=0/img/a a href= src= border=0/img/a /divimg src= height=1 width=1/

Acquia: Enforcing Drupal Coding Standards During the Software Versioning Process

Tue, 07/22/2014 - 14:18
div class=field field-name-body field-type-text-with-summary field-label-hidden div class=field-items div property=content:encoded class=field-item evenpemCross-posted with permission from a href= target=_blankGenuine Interactive/abr //embr /emLes is a web applications engineer at Genuine Interactive. He is a frequent Drupal community contributor. Genuine’s PHP team works on projects in a range of industries from CPG, B2B, financial services, and more./em/p/div /div /div span property=dc:title content=Enforcing Drupal Coding Standards During the Software Versioning Process class=rdf-meta/span

Blair Wadman: Create your first Drupal admin interface

Tue, 07/22/2014 - 12:34
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpOne of the key features of a Drupal module is an admin interface. An admin interface enables you to make a module's settings configurable by a site editor or administrator so they can change them on the fly./p/div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/drupal/module-development typeof=skos:Concept property=rdfs:label skos:prefLabelDrupal Module Development/a/divdiv class=field-item odd rel=dc:subjecta href=/drupal/planet typeof=skos:Concept property=rdfs:label skos:prefLabelPlanet Drupal/a/div/div/div

PreviousNext: Using Drupal 8 Condition Plugins API

Tue, 07/22/2014 - 08:03
div class=field field-name-field-summary field-type-text-long field-label-hiddendiv class=field-itemsdiv class=field-item even pAlthough Drupal 8 has had a Conditions Plugin API for a several months, it wasn't until during DrupalCon Austin sprint we managed to get blocks to use the Conditions Plugin API for block visibility./p pThe great thing about Condition Plugins, is they are re-usable chunks of code, and many contrib projects will be able to take advantage of them (Page Manager, Panels, Rules anyone?)/p pIn this post, I show how you can create an example Page Message module that uses a RequestPath condition plugin to show a message on a configured page./p /div/div/divspan property=dc:title content=Using Drupal 8 Condition Plugins API class=rdf-meta/span

DrupalCon Amsterdam: Come to the Devops Track at DrupalCon Amsterdam

Tue, 07/22/2014 - 08:00
div class=field field--name-body field--type-text-with-summary field--label-hiddendiv class=field__itemsdiv class=field__item evenpSo you've finished building a beautiful Drupal website. That means your work is done, right?/p pNot even close! Building the site is only the beginning: every website needs to be deployed, hosted, monitored, maintained, upgraded, security patched, scaled, and more— and if you start thinking about those things only after finishing your site, you’re bound to run into trouble./p pFortunately, DrupalCon Amsterdam is here to help! a href=;field_track_value=DevOpsamp;field_drupal_version_value=Allamp;combine=We’ll be running a #devops track/a that will bring devs and ops closer together. We’ll be discussing ways to achieve easier deployments, as well as how to ensure better stability, scalability and security for your big, beautiful Drupal website./p pWe've got a bunch of awesome speakers with experience in all of the above topics, as well as: /p limanaging large sites, /li lidoing continuous delivery of applications,/li liautomated testing to improve quality/li p... and many more topics that you should think about when building that beautiful website that can't afford to go down./p pThe DrupalCon Amsterdam DevOps track will feature a broad range of talks covering the various technologies used in devops— and we expect it will be a nice counterpart to the traditional Drupal-centric tracks. These DevOps sessions will give you a perfect opportunity to peek into new technologies and talk with the best people working on those solutions./p pWhether you are putting together a small internal application or a large, popular, internet-facing site, your job does not end at the last commit. So join us in learning how to release stronger and better software faster. We’re all in this together, so let’s share the love and learn from each other!/p /div/div/div

Drupal Watchdog: Outed in Austin

Tue, 07/22/2014 - 03:26
div class=field field--body field-type-text-with-summary field-label-hidden field--rss pToday, my cover was blown./p pIf you came across this photo on your Facebook account or Twitter feed and you’ve been wondering – or furiously texting friends who were in Austin last month – “Is that really...?” or “Was he...” and “Did you meet him?”/p pa href= src=/sites/default/files/twitter-medium1.png class=img-thumbnail alt=Twitter image 1 //a/p pThe answer is:/p pNo. Howard Stern did not attend DrupalCon as a Drupal Watchdog secret agent. (Although we did hear a rumor that he was in Austin at the time, taping an episode of America’s Got Talent, and that he just might put in a surprise appearance at the Convention Center.)/p pa href= src=/sites/default/files/twitter-small2.png class=img-thumbnail right-border alt=Twitter image 2 //aIn fact, I can say with some certainty – having been a guest on his show – that Howard wouldn’t know Drupal from poopal./p pTruly, that was I in the photo: Ronnie Ray, your fearless Watchdog blogster./p pSo now you know. But kindly keep this information on the QT. /p pAlthough if you or your company want a Howardish presence at DrupalCon Amsterdam, feel free to send checks, cash, a NYC-Amsterdam round-trip airline ticket (and Howard only flies first class, alas) to R. Brawer, c/o this magazine./p /div div class=field field--images field-type-image field-label-above field--rss div class=field-labelImages:nbsp;/div div class=field-items img typeof=foaf:Image class=img-responsive src=/sites/default/files/twitter-small2.png width=300 height=225 alt= / img typeof=foaf:Image class=img-responsive src=/sites/default/files/twitter-medium1.png width=628 height=400 alt= / /div/div

FiveRDesign: Drupal HowTo: Turn Off The Read More In Commerce Product Displays

Tue, 07/22/2014 - 02:00
A post describing how to overcome the obscureness of how to turn off the read more option on the body field of Drupal Commerce product displays.

PreviousNext: Easy improvements for Drupal content editors using contrib

Tue, 07/22/2014 - 01:00
div class=field field-name-field-summary field-type-text-long field-label-hiddendiv class=field-itemsdiv class=field-item even pGet started with some quick and easy ways to improve the content editor experience, using contributed modules./p /div/div/divspan property=dc:title content=Easy improvements for Drupal content editors using contrib class=rdf-meta/span

Forum One: Getting Started With Drupal 8 Code

Mon, 07/21/2014 - 22:18
pWant to get started with Drupal 8 coding, but not sure where to begin?/p pFear not! That#8217;s exactly how I felt before I jumped down the rabbit hole by attending my a title=Forum One Enters the Sprints! href= Drupal 8 code sprint/a, organized by the Forum One team earlier this month. Others there seemed to be in the same place I was in – which is to say that what we anticipated to be a quick installation actually turned into a lot of time spent that I#8217;d have rather spent contributing!/p pTo spare the next person from this experience I have created a friendly slideshow to guide you through the setup and installation process of getting Drupal 8 up-and-running locally./p pEnjoy! And if you have any suggestions for enhancements, please leave them in the comments below img src= alt=:) class=wp-smiley / /p piframe style=border: 1px solid #CCC; border-width: 1px 1px 0; margin-bottom: 5px; max-width: 100%; src=// width=597 height=486 frameborder=0 marginwidth=0 marginheight=0 scrolling=no allowfullscreen=allowfullscreen /iframe/p

Drupal Commerce: Converting Your Existing Development Environment to a Makefile

Mon, 07/21/2014 - 21:28
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedimg src= build window: Building as a vanilla project, you are missing out! /pOne of the most exciting features of is it’s ability to use Drush makefiles to rapidly prototype sites. By default, new projects can start with a makefile that will automatically add Commerce Kickstart or vanilla Drupal. Then, using the makefile, you can add new modules, themes, and libraries, by simply adding a few lines to the makefile and commiting. When you push the changes to your platform, the entire site will be rebuilt. Plus, whenever you’re in “makefile mode” any extra files that are in the root of the respository get pushed into sites/all/default. So if you have any custom modules, you can just stick them in codemodules//code and they’ll end up in codesites/all/default/modules/code. This can make your code bases not only small, but far more manageable. You can convert a site that isn’t a makefile into a makefile. And in this post, that’s exactly what we’re going to do. /p /div/div/div

Mediacurrent: 10 Reasons Enterprise Marketers Choose Drupal

Mon, 07/21/2014 - 17:43
img typeof=foaf:Image src= width=200 height=152 alt=Reasons Marketers Love Drupal title=Reasons Marketers Love Drupal / pAs marketers, you understand the importance of having a system that promotes ease and efficiency when it comes to implementing marketing processes. You want to create content once and use it over and over in different ways to create contextual user experiences. /p pDrupal provides you with a variety of powerful, integrated tools to not only help you understand who you visitors are and what they want to accomplish, but to also dig deeper into their interactions, engagements and habits with your site. /p pHere are just a few reasons why enterprise marketers adopt Drupal. br / /p