This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Debugging Guzzle errors in Drupal

Guzzle is a great HTTP Client, but it can be difficult to figure out how to get access to its error messages. I've put together a blog post explaining how to catch GuzzleException, and retrieve the full response from the remote server, making debugging Guzzle errors much easier:

https://www.morpht.com/blog/debugging-guzzle-http-request-errors-drupal

Drupal facet search exclude filters

Hello

i have a situation with Search Facet and some excluded taxonomies from the filters on Drupal 7. Here is my scenario

  • content is tagged with tags - taxonomies
  • on the user profile, there is "Denied tags" auto-complete,Entity Reference to the tags taxonomies Field
  • the admin can select for each user the tags
  • on the front end there is a view listing of products and a facet search listing those tags

How can i, based on the excluded tags of the logged-in user, remove those tags from Search facet list?

Custom Config Form Caching

Hi All,

I had some serious form caching with a custom form that sets a few of my module's config settings.  Normally the config form would be reserved for an admin/settings page, but with this project I don't want the users to access Drupal's back-end.  Instead, I've rebuilt most of the necessary back-end config forms on the front-end, so they can still make certain config changes.

^^ This lead to some serious caching issues;

Most caching solutions I found centered around using render arrays with markup elements, but nothing for form element render elements.

REST config ressource

Hello,

I needed to retreive the system.site page.front config value from js on front end (progressive decoupling)
I first thought of using  hook_page_attachments_alter() and inject the value in drupalSettings
But then i built a little module which provide any "simple config" through REST resource
I'll paste the rest resource plugin bellow but i have some questions :

How to convert drupal tokens in TWIG ?

{#
/**
 * @file
 * Default theme implementation for message entities.
 *
 * Available variables:
 * - $content: An array of comment items. Use render($content) to print them all, or
 *   print a subset such as render($content['field_example']). Use
 *   hide($content['field_example']) to temporarily suppress the printing of a
 *   given element.
 * - $title: The (sanitized) entity label.
 * - $url: Direct url of the current entity if specified.
 * - $page: Flag for the full page state.

jQuery and drupal.behaviors in Drupal 8 : unable to run a function once

Hi,

I'm currently using some jQuery on my Drupal 8 website, but my function is running on every request and the lists generated by the script are duplicated. I tried to use .once() to avoid this problem, without success.

jQuery code running on every request :

(function($) {

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions