Feed aggregator

Kevin Avignon: Shaping your profesional skills structure

Planet Debian - Sun, 26/06/2016 - 02:58
Hey guys, So, professional shaped skills… What’s that. Basically, it’s the form your skills take concerning your expertise in your individual field(s). This form will depend on both depth and broadness. Trying to learn as many things as possible will lead to little depth and a large broadness of skills. The exact opposite leads to … Continue reading Shaping your profesional skills structure →
Categories: Elsewhere

Paul Wise: DebCamp16 day 2

Planet Debian - Sat, 25/06/2016 - 21:49

Review wiki RecentChanges since my bookmark. Usual spam reporting. Mention microG on #debian-mobile. Answer pkg-config question on #debian-mentors. Suggest using UUIDs in response to a debian-arm query. Reported Debian bug #828103 against needrestart. A giant yellow SOS crane between the balcony hacklab and a truly misty city. Locate the 2014 Debian & stuff podcast on archive.org. Poke the SPARC porters in response to a suggestion on debian-www. Mention systemctl daemon-reload wrt buildd service changes. Automate updating some extension lists from check-all-the-things. Reported wishlist Debian bug #828128 against debsources. Engage lizard mode! Wish for better display technology. Nice vegetarian food with nice folks and interesting discussions with interesting locals. Polish and release check-all-the-things. Close bugs I forgot to close in the changelog. Add link to debian-boot on Debootstrap wiki page. Notice first mockup of a theme for Debian stretch. Answer a question about package naming on #debian-mentors. Discuss the future of cross compilation on Debian. Notice a talk about FOSSology & update a wiki page. Mention AsteroidOS and MaruOS on the mobile wiki page. Contemplate how close to the FSDG Debian might be and approaches to improving that.

Categories: Elsewhere

Dimitri John Ledkov: Post-Brexit - The What Now?

Planet Debian - Sat, 25/06/2016 - 21:24
Out of 46,500,001 electorate 17,410,742 voted to leave, which is a mere 37.4% or just over a third. [source]. On my books this is not a clear expression of the UK wishes.

The reaction that the results have caused are devastating. The Scottish First Minister has announced plans for 2nd Scottish Independence referendum [source]. Londoners are filing petitions calling for Independent London [source, source]. The Prime Minister announced his resignation [source]. Things are not stable.
I do not believe that super majority of the electorate are in favor of leaving the EU. I don't even believe that those who voted to leave have considered the break up of the UK as the inevitable outcome of the leave vote. There are numerous videos on the internet about that, impossible to quantify or reliably cite, but for example this [source]
So What Now?
P R O T E S T
I urge everyone to start protesting the outcome of the mistake that happened last Thursday. 4th of July is a good symbolic date to show your discontent with the UK governemnt and a tiny minority who are about to cause the country to fall apart with no other benefits. Please stand up and make yourself heard.
  • General Strikes 4th & 5th of July
There are 64,100,000 people living in the UK according to the World Bank, maybe the government should fear and listen to the unheard third. The current "majority" parliament was only elected by 24% of electorate.

It is time for people to actually take control, we can fix our parliament, we can stop austerity, we can prevent the break up of the UK, and we can stay in the EU. Over to you.

ps. How to elect next PM?

Electing next PM will be done within the Conservative Party, and that's kind of a bummer, given that the desperate state the country currently is in. It is not that hard to predict that Boris Johnson is a front-runner. If you wish to elect a different PM, I urge you to splash out 25 quid and register to be a member of the Conservative Party just for one year =) this way you will get a chance to directly elect the new Leader of the Conservative Party and thus the new Prime Minister. You can backdoor the Conservative election here.
Categories: Elsewhere

DrupalEasy: A Deep Dive into Views in a Unique Fashion (Book Review: Mastering Drupal 8 Views)

Planet Drupal - Sat, 25/06/2016 - 19:52

Gregg Marshall's Mastering Drupal 8 Views is one of the (I can only assume) many Drupal 8-focused books that will be released in the coming months. It is a very good deep dive into many of the hidden corners of the Views module, albeit with an interesting format. Not completely structured like a typical how-to software book, Gregg takes a bit more of a novel approach (pun intended) - he takes the reader on a journey through the Views module through the eyes of Lynn, a small business owner (Lynn's cat and Drupal consultant also have prominent roles). While some readers might find the story-ish elements distracting, they add a certain degree of warmth to the book - something I can only assume a subset of readers will more than appreciate.

The author does a nice job of setting the stage, identifying the intended audience for the book, and speaking directly to them (through the book's characters). There are sections of the book that may cause confusion with this structure, on several occasions I found myself reading long, multi-paragraph sections that I didn't immediately realize that a character was speaking, and not the author. It seems that the use of quotations to indicate when characters were speaking was not consistently applied.

While the technical content of the book is often well-written and clear, there are some places in the book where things seem out-of-order - none more so than the first lesson diving into the Views "settings" page - something that most people new to the subject don't need to consider until they need to modify the (very sane) default values. Another example early in the book has the author creating a new view "display" prior to a full explanation of what Views display are.

There are, however, many areas of great explanation on topics that I don't recall ever seeing in other Drupal-related books. Sections on the new "entity reference" and "REST export" display types stood out in the first few chapters, as well as some of the best explanations (and details) on the "table" format, and field rewrites (more on this in a bit).

There are several lessons that have starting points that aren't necessarily considered "best practice", including one that has the reader cloning the admin/content view as a starting point for a public facing view. In my opinion, the reader would be better served by starting a brand new view using the Views "wizard" interface. As a stickler for best practices, there were several things in the book that made me cringe a bit, including the use of the (outdated?) GMap and Location modules (instead of Geofield-related modules) and (even more so) the use of the admin area's "Install new module" functionality.

I found the discussion and lessons around contextual filters to be extremely effective. The story-ish nature of the book allowed the author to almost naturally introduce a problem that is elegantly solved with contextual filters. Along with relationships, contextual filters are often one of the major stumbling blocks in learning Views, and this book does as good a job as anything else I've read and taking the reader down in the deep, dark recesses of it ("Default value" options included!) The chapter on Views relationships is similarly structured and just as effective.

This is perhaps one of the only Drupal books I've read that purposely sends the reader (in this case, the main character as well) down a dead-end in order to introduce a new topic. I think that many readers will find this comforting, in that it allows the author to introduce a new topic in order to direct the reader to a solution.

As a big fan of display modes, combined with the fact that they are much more visible in Drupal 8, I hoped that the author would utilize them more often in the various lessons (instead of relying on adding fields to most views).

The book really shines in chapters that normally are only a small section in other Drupal resources. There is an entire chapter on field rewrites, and it is wonderful. The author takes Lynn and the reader through various examples, each exposing a new aspect of field rewrites. For anyone who doesn't dare dive into this section of Views field configuration, this chapter alone is worth the price of the book.

The chapter on all the settings in the "Advanced" fieldset is also something that the author covers extremely well. In most Views references, many of these settings are glossed over, but this book provides an almost ("aggregation" isn't covered as deeply as I hoped) complete reference to all the various available settings.

While the vast majority of the examples in the book are well structured, many of them depend on content types and other information architecture that exists on "Lynn's" site. While details of the information architecture are provided in an appendix, it would be very helpful for the author to provide them via GitHub or some other electronic mechanism to readers. Otherwise, it seems like a tedious and error-prone process for readers to recreate the information architecture on their own in order to follow the examples in the book.

The author does a nice job of walking the reader through the use of several Views-related contributed modules as well. For my taste, I think there should have been just a little more explanation about how various contributed modules fit together with Views. As an example, the fact that Views Slideshow provides a new display plugin is glossed over. I think it would serve the readers well to specifically mention that many Views related modules are simply plugins for various parts of the Views infrastructure. This would provide readers with a higher-level view of the Views ecosystem. That's a bit of a nitpick though, as this section is really, really solid.

One of the last chapters in the book covers theming views, and I think it doesn't go into enough details and/or examples. The section on adding CSS classes to various parts of a view is very useful, but the section on overriding template files feels incomplete.

Overall, this is a welcome addition to the Drupal family of books, and one that I can honestly recommend for users that feel like there are aspects of the Views module that are still a mystery to them. The novel-like structure of the book normally doesn't get in the way of the lesson, but for readers who normally doesn't read technical books front-to-back (instead cherry picking only chapters of interest), it might be a bit distracting. While this is properly identified as a Drupal 8 book, much of the content is also valid for Drupal 7, including some of (in my opinion) the strongest chapters.

Categories: Elsewhere

qed42.com: Pan India Code Sprint - Pune Edition

Planet Drupal - Sat, 25/06/2016 - 14:42
Pan India Code Sprint - Pune Edition Body

Drupal India Community have been talking about Pan India code sprint and with effort and cooperation of regional communities we were finally able to organise a combined sprint, we had participation from Mumbai, Jaipur, Delhi and Pune. This is an account of Pune sprint which happened at QED42 Office in Viman Nagar. We had a total attendance of 10 Drupalers out of which 2 were first time sprinters ( Congratulations Dhruvesh and Shreyal on attending your first sprint :) ).

The focus of the sprint was porting modules from D7 to D8 and trying to reach stable releases of some of the modules that were started in previous sprints. One of those modules was auto_entitylabel the issues were triaged prior to the code sprint, so we had less trouble getting around the issues & fixing them up. EOD, we were able to get a basic version of the module, which included integration with tokens.

 

Ajit mentored Dhruvesh on autologout tasks and Dhruvesh contributed a fix to an issue in D8 version of the module & then backported it to Drupal 7 version as well.

 

Sprint also included some code review work around heap_analytics module, which Nitesh  ported to Drupal 8 (https://github.com/nitesh11/heap_analytics). 

 

Overall, it was a productive sprint & we plan to continue the same on Last Saturday of every Month. Keep an eye on auto_entitylabel, jquery_carousel, heap_analytics if you are interested to use them in Drupal 8, couple of sprints and help from community we should be able to release stable versions of these modules :) we specifically need help on testing of these modules and reporting issues. 

PIYUESH KUMAR Sat, 06/25/2016 - 18:12
Categories: Elsewhere

Valuebound: How to reduce your development hours by Creating an Installation Profile or Distribution in Drupal 8!

Planet Drupal - Sat, 25/06/2016 - 08:45

Creating an installation profile in Drupal 8 is quite easy according to my humble opinion. Why? Because of the Configuration Management System in Drupal 8. In Drupal 7 we had lot of amazing contributed Installation profiles like Commerce Kick Start, Open Atrium, aGov, etc. Here we are going to discuss about how to create the installation profile in Drupal 8 and the benefit of using an installation profile in our Drupal Development World. Before that let us find out the answers for the following questions….

  • What is…
Categories: Elsewhere

Valuebound: How to reduce your development hours by Creating an Installation Profile or Distribution in Drupal 8!

Planet Drupal - Sat, 25/06/2016 - 08:45

Creating and installation profile in Drupal 8 is quite easy according to my humble opinion. Why? Because of the Configuration Management System in Drupal 8. In Drupal 7 we had lot of amazing contributed Installation profiles like Commerce Kick Start, Open Atrium, aGov, etc. Here we are going to discuss about how to create the installation profile in Drupal 8 and the benefit of using an installation profile in our Drupal Development World. Before that let us find out the answers for the following questions….

  • What is…
Categories: Elsewhere

Zivtech: 8 Common Website Design Problems

Planet Drupal - Fri, 24/06/2016 - 18:44
Your time is limited. By the time you finish this sentence, someone will visit and abandon your website. Unless you give your visitors a reason to stick around, they're gone. High bounce rate is an indicator of visitors' lack of interest.

It may be absolutely fine for a user to check out one page, especially if it's a press release or another event driven piece of content. But if your goal is to build a relationship with your visitors, one and done won't cut it.
Here are some of the most common problems in website design:
  1. There's no clear path. You want to extend a warm welcome to your visitors. Give them an easy way in and through. Too much competition for attention is a turn off. When you provide too many options, the functional result is no options.
  2. Outdated design. Your site was state of the art in 2009. It's got a header, a couple of sidebars, and a big chunk of information running down the center. Guess what? It looks like it's nearly a decade old. Because it is. Time to refresh with current design thinking. The layout of a page has evolved over the past decade. These days the best sites break up content into smaller, digestible bits.
  3. Overused stock images and icons. If visitors see the same image on multiple sites, it erodes trust. That picture of people sitting around the conference table? They sure get around to a lot of offices!
  4. Too many textures and colors. You are trying to add interest, but you just add clutter. Limit colors and fonts. Maintain a thematic color scheme. For professional sites, try to limit the variety of fonts to three or fewer.
  5. Design for the wrong reasons. Always begin by identifying your target audience and customizing design and content. You may want your site to look "modern" or like another site you've seen, but if you haven't checked in with what your audience needs and wants, you can fail miserably.
  6. Cute that doesn't cut it. When your links have adorable, witty names, the experience gets tired fast. Links that don't make much sense are not user friendly and won't ingratiate you with your visitors. Be practical and basic when naming links. Make it easy for people. Design for multiple visits. A rotating banner is cool the first time, and maybe the second, but at some point it's just a stale eyesore. Monotonous calls to action.
  7. Your site isn't optimized for mobile. You shouldn't need to be reminded of this, but numbers don't lie. Mobile is overtaking desktop. It's increasingly likely that your visitors see your site on a tiny screen. If they have to pinch and stretch to read, they'll find a better source of information. Be sure to test your site on smartphone and tablet.
  8. You play hard to get. If you want customers to find you, make sure your address, phone number and hours of operation are easily accessible on your site. Too often, that information is hidden or completely absent.
Thanks to Zivtech's UX/UI Designer Jen Rovner for co-writing this article.
Categories: Elsewhere

The Sego Blog: Drupal 8, Pantheon & GitKraken: Intro

Planet Drupal - Fri, 24/06/2016 - 18:24
06/24/2016Drupal 8, Pantheon & GitKraken: Intro

For those of you who know me well, you know I do not like to play around with code all that much or even use command line tools if I can avoid it. There are many reasons for this but mostly I am just not that comfortable setting up, maintaining and using these type of tools.  That being said I do like to site build in Drupal….A LOT :). 

Lately I have been creating and managing Drupal 8 sites with Pantheon and using a Git client called GitKraken to manage my version control workflow and I have to say the experience has been FANTASTIC!

Categories: Elsewhere

Evolving Web: Using Core Base Themes in Drupal 8

Planet Drupal - Fri, 24/06/2016 - 17:07

One of the first questions I get asked when teaching a Drupal theming class is which base theme to use. The answer has always starts with the unsatisfying: "It depends". Now that I'm teaching Drupal 8 theming, we have a couple new base themes in core added to the mix: classy and stable.

You can learn the difference between the two and how to use them in this previous post.

read more
Categories: Elsewhere

Mediacurrent: Friday 5: 5 Problems Large Enterprise Face in Their Digital Transformation

Planet Drupal - Fri, 24/06/2016 - 17:06

Give yourself a pat on the back for making it to the finish line of another busy work week!

Categories: Elsewhere

Lullabot: Replacing the Body Field in Drupal 8

Planet Drupal - Fri, 24/06/2016 - 16:00

The body field has been around since the beginning of Drupal time. Before you could create custom fields in core, and before custom entities were in core, there was a body field. As it exists now, the body field is a bit of a platypus. It's not exactly a text field like any other text field. It's two text fields in one (summary and body), with a lot of specialized behavior to allow you to show or hide it on the node form, and options to either create distinct summary text or deduce a summary by clipping off a certain number of characters from the beginning of the body.

The oddity of this field can create problems. The summary has no format of its own, it shares a format with the body. So you can't have a simple format for the summary and a more complex one for the body. The link to expose and hide the summary on the edit form is a little non-intuitive, especially since no other field behaves this way, so it's easy to miss the fact that there is a summary field there at all. If you are relying on the truncated text for the summary, there's no easy way to see in the node form what the summary will end up looking like. You have to preview the node to tell.

I wanted to move away from using the legacy body field in favor of separate body and summary fields that behave in a more normal way, where each is a distinct field, with its own format and no unexpected behavior. I like the benefits of having two fields, with the additional granularity that provides. This article describes how I made this switch on one of my legacy sites.

Making the Switch

The first step was to add the new fields to the content types where they will be used. I just did this in the UI by going to admin > structure > types. I created two fields, one called field_description for the full body text and one called field_summary for the summary. My plan was for the summary field to be a truncated, plain text excerpt of the body that I could use in metatags and in AMP metadata, as well as on teasers. I updated the Manage Display and Manage Form Display data on each content type to display my new fields instead of the old body field on the node form and in all my view modes.

Once the new fields were created I wanted to get my old body/summary data copied over to my new fields. To do this I needed an update hook. I used Drupal.org as a guide for creating an update hook in Drupal 8.

The instructions for update hooks recommend not using normal hooks, like $node->save(), inside update hooks, and instead updating the database directly with a SQL query. But that would require understanding all the tables that need to be updated. This is much more complicated in Drupal 8 than it was in Drupal 7. In Drupal 7 each field has exactly two tables, one for the active values of the field and one with revision values. In Drupal 8 there are numerous tables that might be used, depending on whether you are using revisions and/or translations. There could be up to four tables that need to be updated for each individual field that is altered. On top of that, if I had two fields in Drupal 7 that had the same name, they were always stored in the same tables, but in Drupal 8 if I have two fields with the same name they might be in different tables, with each field stored in up to four tables for each type of entity the field exists on.

To avoid any chance of missing or misunderstanding which tables to update, I went ahead and used the $node->save() method in the update hook to ensure every table gets the right changes. That method is time-consuming and could easily time out for mass updates, so it was critical to run the updates in small batches. I then tested it to be sure the batches were small enough not to create a problem when the update ran.

The update hook ended up looking like this:

<?php /** * Update new summary and description fields from body values. */ function custom_update_8001(&$sandbox) { // The content types to update. $bundles = ['article', 'news', 'book']; // The new field for the summary. Must already exist on these content types. $summary_field = 'field_summary'; // The new field for the body. Must already exist on these content types. $body_field = 'field_description'; // The number of nodes to update at once. $range = 5; if (!isset($sandbox['progress'])) { // This must be the first run. Initialize the sandbox. $sandbox['progress'] = 0; $sandbox['current_pk'] = 0; $sandbox['max'] = Database::getConnection()->query("SELECT COUNT(nid) FROM {node} WHERE type IN (:bundles[])", array(':bundles[]' => $bundles))->fetchField(); } // Update in chunks of $range. $storage = Drupal::entityManager()->getStorage('node'); $records = Database::getConnection()->select('node', 'n') ->fields('n', array('nid')) ->condition('type', $bundles, 'IN') ->condition('nid', $sandbox['current_pk'], '>') ->range(0, $range) ->orderBy('nid', 'ASC') ->execute(); foreach ($records as $record) { $node = $storage->load($record->nid); // Get the body values if there is now a body field. if (isset($node->body)) { $body = $node->get('body')->value; $summary = $node->get('body')->summary; $format = $node->get('body')->format; // Copy the values to the new fields, being careful not to wipe out other values that might be there. if (empty($node->{$summary_field}->getValue()) && !empty($summary)) { $node->{$summary_field}->setValue(['value' => $summary, 'format' => $format]); } if (empty($node->{$body_field}->getValue()) && !empty($body)) { $node->{$body_field}->setValue(['value' => $body, 'format' => $format]); } if ($updated) { // Clear the body values. $node->body->setValue([]); } } // Force a node save even if there are no changes to force the pre_save hook to be executed. $node->save(); $sandbox['progress']++; $sandbox['current_pk'] = $record->nid; } $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); return t('All content of the types: @bundles were updated with the new description and summary fields.', array('@bundles' => implode(', ', $bundles))); } ?> Creating the Summary

That update would copy the existing body data to the new fields, but many of the new summary fields would be empty. As distinct fields, they won't automatically pick up content from the body field, and will just not display at all. The update needs something more to get the summary fields populated. What I wanted was to end up with something that would work similarly to the old body field. If the summary is empty I want to populate it with a value derived from the body field. But when doing that I also want to truncate it to a reasonable length for a summary, and in my case I also wanted to be sure that I ended up with plain text, not markup, in that field.

I created a helper function in a custom module that would take text, like that which might be in the body field, and alter it appropriately to create the summaries I want. I have a lot of nodes with html data tables, and I needed to remove those tables before truncating the content to create a summary. My body fields also have a number of filters that need to do their replacements before I try creating a summary. I ended up with the following processing, which I put in a custom.module file:

<?php use Drupal\Component\Render\PlainTextOutput; /** * Clean up and trim text or markup to create a plain text summary of $limit size. * * @param string $value * The text to use to create the summary. * @param string $limit * The maximum characters for the summary, zero means unlimited. * @param string $input_format * The format to use on filtered text to restore filter values before creating a summary. * @param string $output_format * The format to use for the resulting summary. * @param boolean $add_elipsis * Whether or not to add an elipsis to the summary. */ function custom_parse_summary($value, $limit = 150, $input_format = 'plain_text', $output_format = 'plain_text', $add_elipsis = TRUE) { // Allow filters to replace values so we have all the original markup. $value = check_markup($value, $input_format); // Completely strip tables out of summaries, they won't truncate well. // Stripping markup, done next, would leave the table contents, which may create odd results, so remove the tables entirely. $value = preg_replace('/(.*?)<\/table>/si', '', $value); // Strip out all markup. $value = PlainTextOutput::renderFromHtml(htmlspecialchars_decode($value)); // Strip out carriage returns and extra spaces to pack as much info as possible into the allotted space. $value = str_replace("\n", "", $value); $value = preg_replace('/\s+/', ' ', $value); $value = trim($value); // Trim the text to the $limit length. if (!empty($limit)) { $value = text_summary($value, $output_format, $limit); } // Add elipsis. if ($add_elipsis && !empty($value)) { $value .= '...'; } return $value; } ?> Adding a Presave Hook

I could have used this helper function in my update hook to populate my summary fields, but I realized that I actually want automatic population of the summaries to be the default behavior. I don't want to have to copy, paste, and truncate content from the body to populate the summary field every time I edit a node, I'd like to just leave the summary field blank if I want a truncated version of the body in that field, and have it updated automatically when I save it.

To do that I used the pre_save hook. The pre_save hook will update the summary field whenever I save the node, and it will also update the summary field when the above update hook does $node->save(), making sure that my legacy summaries also get this treatment.

My pre_save hook, in the same custom.module file used above, ended up looking like the following:

<?php use Drupal\Core\Entity\EntityInterface; /** * Implements hook_entity_presave(). * * Make sure summary and image are populated. */ function custom_entity_presave(EntityInterface $entity) { $entity_type = 'node'; $bundles = ['article', 'news', 'book']; // The new field for the summary. Must already exist on these content types. $summary_field = 'field_summary'; // The new field for the body. Must already exist on these content types. $body_field = 'field_description'; // The maximum length of any summary, set to zero for no limit. $summary_length = 300; // Everything is an entity in Drupal 8, and this hook is executed on all of them! // Make sure this only operates on nodes of a particular type. if ($entity->getEntityTypeId() != $entity_type || !in_array($entity->bundle(), $bundles)) { return; } // If we have a summary, run it through custom_parse_summary() to clean it up. $format = $entity->get($summary_field)->format; $summary = $entity->get($summary_field)->value; if (!empty($summary)) { $summary = custom_parse_summary($summary, $summary_length, $format, 'plain_text'); $entity->{$summary_field}->setValue(['value' => $summary, 'format' => 'plain_text']); } // The summary might be empty or could have been emptied by the cleanup in the previous step. If so, we need to pull it from description. $format = $entity->get($body_field)->format; $description = $entity->get($body_field)->value; if (empty($summary) && !empty($description)) { $summary = custom_parse_summary($description, $summary_length, $format, 'plain_text'); $entity->{$summary_field}->setValue(['value' => $summary, 'format' => 'plain_text']); } } ?>

With this final bit of code I’m ready to actually run my update. Now whenever a node is saved, including when I run the update to move all my legacy body data to the new fields, empty summary fields will automatically be populated with a plain text, trimmed, excerpt from the full text.

Going forward, when I edit a node, I can either type in a custom summary, or leave the summary field empty if I want to automatically extract its value from the body. The next time I edit the node the summary will already be populated from the previous save. I can leave that value, or alter it manually, and it won't be overridden by the pre_save process on the next save. Or I can wipe the field out if I want it populated automatically again when the node is re-saved.

Javascript or Presave?

Instead of a pre_save hook I could have used javascript to automatically update the summary field in the node form as the node is being edited. I would only want that behavior if I'm not adding a custom summary, so the javascript would have to be smart enough to leave the summary field alone if I already have text in it or if I start typing in it, while still picking up every change I make in the description field if I don’t. And it would be difficult to use javascript to do filter replacements on the description text or have it strip html as I'm updating the body. Thinking through all the implications of trying to make a javascript solution work, I preferred the idea of doing this as a pre_save hook.

If I was using javascript to update my summaries, the javascript changes wouldn't be triggered by my update hook, and the update hook code above would have to be altered to do the summary clean up as well.

Ta-dah

And that's it. I ran the update hook and then the final step was to remove my now-empty body field from the content types that I switched, which I did using the UI on the Content Types management page.

My site now has all its nodes updated to use my new fields, and summaries are getting updated automatically when I save nodes. And as a bonus this was a good exercise in seeing how to manipulate nodes and how to write update and pre_save hooks in Drupal 8.

Categories: Elsewhere

Joey Hess: twenty years of free software -- part 5 pristine-tar

Planet Debian - Fri, 24/06/2016 - 15:38

I've written retrospectively about pristine-tar before, when I stopped maintaining it. So, I'll quote part of that here:

[...] a little bit about the reason I wrote pristine-tar in the first place. There were two reasons: 1. I was once in a talk where someone mentioned that Ubuntu had/was developing something that involved regenerating orig tarballs from version control. I asked the obvious question: How could that possibly be done technically? The (slightly hung over) presenter did not have a satesfactory response, so my curiosity was piqued to find a way to do it. (I later heard that Ubuntu has been using pristine-tar..) 2. Sometimes code can be subversive. It can change people's perspective on a topic, nudging discourse in a different direction. It can even point out absurdities in the way things are done. I may or may not have accomplished the subversive part of my goals with pristine-tar. Code can also escape its original intention. Many current uses of pristine-tar fall into that category. So it seems likely that some people will want it to continue to work even if it's met the two goals above already.

For me, the best part of building pristine-tar was finding an answer to the question "How could that possibly be done technically?" It was also pretty cool to be able to use every tarball in Debian as the test suite for pristine-tar.

I'm afraid I kind of left Debian in the lurch when I stopped maintaining pristine-tar.

"Debian has probably hundreds, if not thousands of git repositories using pristine-tar. We all rely now on an unmaintained, orphaned, and buggy piece of software." -- Norbert Preining

So I was relieved when it finally got a new maintainer just recently.

Still, I don't expect I'll ever use pristine-tar again. It's the only software I've built in the past ten years that I can say that about.

Next: ?twenty years of free software -- part 6 moreutils

Categories: Elsewhere

Kevin Avignon: Tech questions 10-17: FP questions

Planet Debian - Fri, 24/06/2016 - 14:07
Hey guys, Today’s post is to make you understand that even is oriented-object programming (OOP) feels now finally natural and exquisite, they are better ways to design and implement your solutions to make them better and of course, safer. My goal today is to make you want to adopt a functional mindset when creating software … Continue reading Tech questions 10-17: FP questions →
Categories: Elsewhere

OSTraining: Installing Drupal-VM on Windows

Planet Drupal - Fri, 24/06/2016 - 12:52

An OSTraining member asked how to use the Drupal VM environment on Windows.

In this tutorial, we will install D8 in a few simple steps.

Categories: Elsewhere

jfhovinne opened pull request ec-europa/platform-dev#695

Devel - Fri, 24/06/2016 - 12:09
Jun 24, 2016 jfhovinne opened pull request ec-europa/platform-dev#695 NEXTEUROPA-11861: remove old patch and use new one from d.o instead. 1 commit with 6 additions and 23 deletions
Categories: Networks

Frederic Marand: What to do when your Drupal site has been hacked

Planet Drupal - Fri, 24/06/2016 - 10:36

These are the slides of the presentation I gave yesterday at DrupalDevDays Milan.

Life after the hack from OSInet, for Drupal Project

read more

Categories: Elsewhere

Norbert Preining: Rest in peace UK

Planet Debian - Fri, 24/06/2016 - 06:22

I am mourning for the UK. I feel so much pain and pity for all my good friends over there. Stupidity has won again. Good bye UK, your long reign has found its end. The rest is silence.

RIP.

(Graphic from The Guardian – EU referendum results in full)

Categories: Elsewhere

Norbert Preining: Debian/TeX Live 2016.20160623-1

Planet Debian - Fri, 24/06/2016 - 04:33

About one month has passed since we did release TeX Live 2016, and more than a month since the last Debian packages, so it is high time to ship out a new checkout of upstream. Nothing spectacular new here, just lots and lots of updates since the freeze.

I am dedicating this release to those intelligent beings who voted against the stupid Brexit and for remaining in the EC! – I am still optimist!

New packages

aucklandthesis, autobreak, cquthesis, getargs, hustthesis, ietfbibs, linop, markdown, olsak-misc, optidef, sanitize-umlaut, umbclegislation, wordcount, xcntperchap.

Updated packages

academicons, achemso, acmart, acro, animate, apa6, arabluatex, archaeologie, babel-hungarian, beamertheme-epyt, beebe, biblatex-abnt, biblatex-anonymous, biblatex-bookinother, biblatex-caspervector, biblatex-chicago, biblatex-manuscripts-philology, biblatex-morenames, biblatex-opcit-booktitle, biblatex-philosophy, biblatex-realauthor, biblatex-source-division, biblatex-subseries, bidi, bookcover, bxjscls, caption, chemformula, chemmacros, circuitikz, cloze, cochineal, context, csplain, cstex, datetime2, denisbdoc, dvipdfmx-def, epstopdf, erewhon, exsol, fbb, fibeamer, fithesis, fontawesome, fontspec, fonts-tlwg, geschichtsfrkl, getmap, glossaries, glossaries-extra, graphics, graphics-cfg, gregoriotex, gzt, he-she, hook-pre-commit-pkg, hyperref, ifluatex, keyvaltable, koma-script, l3build, latex, latex-bin, limap, lollipop, lshort-chinese, luaotfload, luatex85, luatex-def, luatexja, lua-visual-debug, marginnote, mcf2graph, media9, minted, mptopdf, msu-thesis, musixtex, navigator, nwejm, oberdiek, patchcmd, pdfcomment, pdftex-def, pdfx, pkuthss, platex, pstricks, ptex, ptex2pdf, ptex-base, ptex-ng, reledmac, repere, scheme-xml, sduthesis, showlabels, tableaux, tcolorbox, tex4ht, texinfo, texlive-scripts, tex-overview, textpos, tools, translations, tudscr, unicode-data, uplatex, uptex, xassoccnt, xcharter, xetex, xindy, yathesis, ycbook.

Enjoy.

Categories: Elsewhere

Pages

Subscribe to jfhovinne aggregator