Newsfeeds

Entity Unified access

New Drupal Modules - 14 August 2019 - 6:39am

This module is for developers only and unifying hook_entity_access and hook_entity_query.

Categories: Drupal

Active Form

New Drupal Modules - 14 August 2019 - 5:30am
Categories: Drupal

Merge Duplicate Files (MDF)

New Drupal Modules - 14 August 2019 - 3:53am

The Merge Duplicate Files (MDF) module extend filehash module functionally and allow to reuse uploaded files automatically if user upload the existed file. Module compare files by hash and prevent duplicate files, replace it with exists file.

Categories: Drupal

Devportal FAQ

New Drupal Modules - 14 August 2019 - 2:32am
Categories: Drupal

Devportal API Reference

New Drupal Modules - 14 August 2019 - 2:29am
Categories: Drupal

Devportal API Bundle

New Drupal Modules - 14 August 2019 - 2:25am
Categories: Drupal

Built By

New Drupal Modules - 14 August 2019 - 1:45am

Built By provides a simple agency copyright block with a configurable message and link.

For SEO purposes, the link also needs to have 'rel=follow' attribute on the home page, and 'rel=nofollow' on all non-home pages, and the logic and caching for this is included in the module.

The need for this module arose from having to create a reusable solution for many sites.

Categories: Drupal

Dropsolid: Debugging segmentation faults in Drupal

Planet Drupal - 14 August 2019 - 1:15am
14 Aug

Segfaults in Drupal are not a common occurrence - but when they do pop up, they can pose some tricky challenges... Our DevOps Engineer Mattias Michaux sheds some light on how to debug segmentation faults.
 

As a Drupal web developer, it can be frightening to encounter a so-called segmentation fault or segfault. This is a type of failure raised by hardware with memory protection, notifying you that the software has attempted to access a restricted area of memory. This kind of fault is common in languages with low-level memory management, such as C. Coding in a scripting language like PHP usually implies that you will be spared from segfaults, but on rare occasions these kind of errors can still pop up. And if they do, they tend to leave no stack trace or meaningful error clue in the PHP log. This is because segfault errors originate in the layers located below the PHP engine. Let me talk you through a recent consulting project that involved a curious segmentation fault.
 

Segfault case study

Not so long ago, one of our clients started experiencing seemingly random ‘503 service unavailable’ errors, at random times on random pages. That’s plenty of randomness, without much of a clue to start from.
 

The segfaults had started occurring after an update from PHP 5.6 to PHP 7.2 and the switch from mod_php - PHP is executed as a module within the Apache process -  to PHP-FPM. Just to clarify: PHP runs as a standalone service that Apache connects to.
 

We tried to reproduce the errors on a copy of the site and infrastructure of the project. The segfault was only reproducible when we ran a scraping tool on the site. There was no apparent connection between the pages it occurred on, and the error came up with less than 1% of the total requests. Looking at the logs, there seemed to be no direct cause for this error.

 

 

[proxy_fcgi:error] [pid 10272] AH01067: Failed to read FastCGI header [proxy_fcgi:error] [pid 10272] (104)Connection reset by peer: AH01075: Error dispatching request to ****

Example of the unhelpful Apache error message

 

 

The message above only tells us that something went wrong, but it provides no indication as to what the cause might be. Next, the PHP-FPM log indicated a segmentation fault:

WARNING: [pool web] child 3824 exited on signal 11 (SIGSEGV) after 3.353763 seconds from start

 

The syslog entry didn’t turn out to be very helpful either:

kernel: [4734894.041892] traps: php-fpm7.2[3760] general protection ip:555ce4cb6342 sp:7ffccab418c8 error:0 kernel: [4734894.041897] in php-fpm7.2[555ce4a51000+411000]

 

To find out what the root cause might be, we needed to recompile PHP with debugging enabled. This allowed us to produce core dumps, which contain a full backtrace. A backtrace is a summary of how the program got to a particular point. It displays one line per frame for many frames, starting with the frame that is currently being executed. I suggest finding a guide like this one on how to compile your php with debugging enabled.
 

After compiling PHP, we copied the php.ini and pool config from the original PHP version to the freshly compiled one. Next, we altered the config, so now the PHP-FPM pool used a separate name and socket path, and we changed that socket in the vhost. After starting the new PHP-FPM instance and running the crawler to reproduce the issue, we quickly saw the same 503 errors showing up, but this time with a core dump. We started comparing the dumps and tried to find a pattern. Fortunately, most cases pointed to the same thing: the unserialize() function of large objects. This made us look for specific PHP bugs that involved unserializing or memory allocation. We found an interesting one - in fact, someone had encountered almost the same issue before.
 

We decided to try the same approach by disabling garbage collection in the settings file:

ini_set('zend.enable_gc', 0);

 

We reran the scraper for multiple hours and no issues occurred. There are other documented cases where PHP’s garbage collection interferes with Drupal’s processing of huge amounts of data and objects.  Because disabling the garbage collection globally could have negative effects on the resource consumption of the live site, we also looked for a way to only disable garbage collection partially. This is indeed possible by patching  includes/cache.inc so _cache_get_object doesn’t run gc while fetching data.
 

This puzzling problem took several hours and two people to solve, but in the end we managed to diagnose correctly and we implemented a solid solution. An interesting case that led us to explore unusual parts of Drupal - and possibly something to bear in mind next time your Drupal environment produces a similar type of error.
 

gdb /opt/php/7.2/sbin/php-fpm /tmp/coredump-php-fpm.28651 -ex "source /opt/php-src/php7.2-build/php-7.2.17/.gdbinit" -ex "zbacktrace" --batch | grep "\[0x" [0x7f2c2b4220e0] unserialize("O:4:"view":49:{s:8:"db_table";s:10:"views_view";s:10:"base_table";s:18:"commerce_line_item";s:10:"base_field";s:3:"nid";s:4:"name";s:25:"commerce_reports_products";s:3:"vid";s:0:"";s:11:"description";s:0:"";s:3:"tag";s:16:"commerce_reports";s:10:"human_nam...") [internal function] [0x7f2c2b421f40] DrupalDatabaseCache->prepareItem(object[0x7f2c2b421f90]) /home/project/www/includes/cache.inc:520 [0x7f2c2b421d80] DrupalDatabaseCache->getMultiple(reference) /home/project/www/includes/cache.inc:433 [0x7f2c2b421cf0] cache_get_multiple(reference, "cache_views") /home/project/www/includes/cache.inc:113 [0x7f2c2b421a70] _ctools_export_get_defaults_from_cache("views_view", array(24)[0x7f2c2b421ad0]) /home/project/www/sites/all/modules/contrib/ctools/includes/export.inc:746 [0x7f2c2b421390] _ctools_export_get_defaults("views_view", array(24)[0x7f2c2b4213f0]) /home/project/www/sites/all/modules/contrib/ctools/includes/export.inc:649 [0x7f2c2b4211a0] _ctools_export_get_some_defaults("views_view", array(24)[0x7f2c2b421200], array(1)[0x7f2c2b421210]) /home/project/www/sites/all/modules/contrib/ctools/includes/export.inc:783 [0x7f2c2b420210] ctools_export_load_object("views_view", "names", array(1)[0x7f2c2b420280]) /home/project/www/sites/all/modules/contrib/ctools/includes/export.inc:493 [0x7f2c2b420080] ctools_export_crud_load("views_view", "search_results") /home/project/www/sites/all/modules/contrib/ctools/includes/export.inc:81 [0x7f2c2b41ff50] views_get_view("search_results") /home/project/www/sites/all/modules/contrib/views/views.module:1683 [0x7f2c2b41fb50] views_block_view("-exp-search_results-page") /home/project/www/sites/all/modules/contrib/views/views.module:772 [0x7f2c2b41fa60] module_invoke("views", "block_view", array(1)[0x7f2c2b41fad0]) /home/project/www/includes/module.inc:934 [0x7f2c2b41f410] _block_render_blocks(array(0)[0x7f2c2b41f460]) /home/project/www/modules/block/block.module:911 [0x7f2c2b41f2d0] block_list("branding") /home/project/www/modules/block/block.module:690 [0x7f2c2b41f200] block_get_blocks_by_region("branding") /home/project/www/modules/block/block.module:319 [0x7f2c2b41eee0] block_page_build(reference) /home/project/www/modules/block/block.module:270 [0x7f2c2b41ecf0] drupal_render_page(reference) /home/project/www/includes/common.inc:5914 [0x7f2c2b41e570] drupal_deliver_html_page(array(1)[0x7f2c2b41e5c0]) /home/project/www/includes/common.inc:2761 [0x7f2c2b41e3d0] drupal_deliver_page(array(1)[0x7f2c2b41e420], "") /home/project/www/includes/common.inc:2634 [0x7f2c2b41e100] menu_execute_active_handler() /home/project/www/includes/menu.inc:542 [0x7f2c2b41e030] (main) /home/project/www/index.php:21

 

dropsolid8
Categories: Drupal

Steam's 'Follower' counts - hidden in plain sight. - by Simon Carless

Gamasutra.com Blogs - 13 August 2019 - 11:02pm
In the interests of focusing on one particular part of game discoverability, I’d like to concentrate this piece on one particular hidden gem of a statistic - Steam’s follower count.
Categories: Game Theory & Design

Web Wash: Use Taxonomy Terms as Webform Options in Drupal 8

Planet Drupal - 13 August 2019 - 6:30pm

Webform has a pretty robust system for managing lists of options. When you create a select box, you can define its options just for that element, or use a predefined list. If you go to Structure, Webforms, Configurations and click on Options, you can see all the predefined options and you can create your own.

If you want to learn how to create your own predefined options check out our tutorial; How to Use Webform Predefined Options in Drupal 8.

One thing to be aware of is that all of these options are stored as config files, which makes perfect sense, it is configuration.

But what if you want editors to manage the options?

Depending on how you deploy Drupal sites if you change an option only on the production site, your change will be overridden the next time you deploy to production because you import all new configuration changes.

To work around this, you could look at using Webform Config Ignore.

Another way of managing options is by using the Taxonomy system. An editor would simply manage all the terms from the Taxonomy page and nothing will be stored in config files.

In this tutorial, you’ll learn how to create a select element which uses a taxonomy vocabulary instead of the standard options.

Categories: Drupal

Managing the evolving state of Destiny 2: 'the game cannot grow infinitely forever'

Social/Online Games - Gamasutra - 13 August 2019 - 2:05pm

Destiny 2 game director Luke Smith shares a candid discussion of balance changes, encounter design, and the game's relationship with microtransactions. ...

Categories: Game Theory & Design

Multi-platform games from Xbox-owned studios must 'make sense for the franchise'

Social/Online Games - Gamasutra - 13 August 2019 - 12:52pm

Xbox Game Studios head Matt Booty won't rule out multi-platform first-party launches, but says the decision needs to make sense for that specific franchise. ...

Categories: Game Theory & Design

Hook 42: Exploring Contenta CMS

Planet Drupal - 13 August 2019 - 12:03pm
Exploring Contenta CMS Lindsey Gemmill Tue, 08/13/2019 - 19:03
Categories: Drupal

TEN7 Blog's Drupal Posts: Case Study: Our Family Wizard

Planet Drupal - 13 August 2019 - 10:30am
Website Redesign: A Professional Face for a Market Leader

When parents divorce or separate, the child often becomes the unwilling intermediary for communication. Our Family Wizard (OFW) is a mobile application for co-parenting exes that facilitates and tracks communication, helps coordinate child duties and stores important information.

Categories: Drupal

Drupal blog: Increasing Drupal speaker diversity

Planet Drupal - 13 August 2019 - 10:23am

This blog has been re-posted and edited with permission from Dries Buytaert's blog.

At Drupalcon Seattle, I spoke about some of the challenges Open Source communities like Drupal often have with increasing contributor diversity. We want our contributor base to look like everyone in the world who uses Drupal's technology on the internet, and unfortunately, that is not quite the reality today.

One way to step up is to help more people from underrepresented groups speak at Drupal conferences and workshops. Seeing and hearing from a more diverse group of people can inspire new contributors from all races, ethnicities, gender identities, geographies, religious groups, and more.

To help with this effort, the Drupal Diversity and Inclusion group is hosting a speaker diversity training workshop on September 21 and 28 with Jill Binder, whose expertise has also driven major speaker diversity improvements within the WordPress community.

I'd encourage you to either sign up for this session yourself or send the information to someone in a marginalized group who has knowledge to share, but may be hesitant to speak up. Helping someone see that their expertise is valuable is the kind of support we need in order to drive meaningful change.

Categories: Drupal

Hook 42: Getting Started With Developer Environments

Planet Drupal - 13 August 2019 - 9:51am
Getting Started With Developer Environments Lindsey Gemmill Tue, 08/13/2019 - 16:51
Categories: Drupal

(Mostly) Everything You Need To Know About Building WeChat Mini Games - by Luke Stapley

Gamasutra.com Blogs - 13 August 2019 - 8:07am
Many mobile/HTML5 game developers today are looking for new platforms and audiences to release their game onto. With China being one of the biggest, it's no wonder WeChat mini games are becoming a hot topic. Learn almost everything you need here.
Categories: Game Theory & Design

Acro Media: Using Drupal for Headless Ecommerce Customer Experiences

Planet Drupal - 13 August 2019 - 7:45am

Back in April, BigCommerce, in partnership with Acro Media, announced the release of the BigCommerce for Drupal module. This module effectively bridges the gap between the BigCommerce SaaS ecommerce platform and the Drupal open source content management system. It allows Drupal to be used as the frontend customer experience engine for a headless BigCommerce ecommerce store.

For BigCommerce, this integration provides a new and exciting way to utilize their platform for creating innovative, content-rich commerce experiences that were not possible via BigCommerce alone.

For Drupal, this integration extends the options its users and site-builders have for adding ecommerce functionality into a Drupal site. The flexibility of Drupal combined with the stability and ease-of-use of BigCommerce opens up new possibilities for Drupal that didn’t previously exist.

Since the announcement, BigCommerce and Acro Media have continued to educate and promote this exciting new headless commerce option. A new post on the BigCommerce blog published last week title Leverage Headless Commerce To Transform Your User Experience with Drupal Ecommerce (link below) is a recent addition to this information campaign. The BigCommerce teams are experts in what they do and Acro Media is an expert in open source integrations and Drupal. They asked if we could provide an introduction for their readers to really explain what Drupal is and where it fits in to the headless commerce mix. This, of course, was an opportunity not to be missed and so our teams buckled down together once again to provide readers with the best information possible.

So without further explanation, click the link below to learn how you can leverage headless commerce to transform your user experience with Drupal.

Additional resources:
Categories: Drupal

Game Music and Psychological Attachment: How Game Composers Can Enhance Virtual Presence (Pt. 2) - by Winifred Phillips

Gamasutra.com Blogs - 13 August 2019 - 7:37am
The 2nd of a 4-part series. Video game composer Winifred Phillips shares ideas from her GDC 2019 talk, How Music Enhances Virtual Presence. Part 2: Game Music and Psychological Attachment. Included are practical examples and video demonstrations.
Categories: Game Theory & Design

Let the Punishment Fit the Twine: Ancient Greek Punishments as Hypertexts - by Pippin Barr

Gamasutra.com Blogs - 13 August 2019 - 7:34am
Reflections on translating five myths of punishment into Twine stories, with a focus on the physicality of interaction in hypertexts.
Categories: Game Theory & Design

Pages

Subscribe to As If Productions aggregator