Herzlich Willkommen.

Snippet: HTTP Authentication mit PHP trotz CGI/SuExec

27.03.2015 - 17:33

Eine Herausforderung des heutigen Tages lag darin, auf einer PHP-Website eine HTTP-Authentifizierung via PHP umzusetzen, obwohl PHP auf der Seite als CGI läuft.

Wie wir wissen, ist das ein Problem da die nötigen Variablen nicht belegt werden:

  1. $_SERVER['PHP_AUTH_USER']
  2. $_SERVER['PHP_AUTH_PW']

sind stets leer!

Zum Glück konnte ich einen Workaround finden:


Drupal Multisite as folder not working? Use a symlink pointing to .

27.03.2015 - 15:53

Your Drupal Multisite as subfolder does not work? (http://www.mydomain.com/mymultisitealias)

If you already have a correct sites.php in the "sites" folder ("sites/sites.php") then the solution may be to create a symlink in the drupal home directory.

In the example above that means your sites.php looks like this:

  1. $sites['mydomain.com'] = 'default';


Phonegap / Drupalgap / jQuery Mobile: Use "pageinit pageshow" events together to ensure functionality

27.03.2015 - 14:16

Today I have an important note for you that cost me a lot of time and debugging my Drupalgap / Phonegap App using jQuery Mobile.


Drupal 7 FAPI's #states: Take care of Internet Explorer (IE)!!! (Conditional fields not working in IE)

26.03.2015 - 15:21

Today I ran into a very very mad bug: ‎Conditional Fields‎ did not correctly work in IE, as discussed in this issue:
https://www.drupal.org/node/1373656

But as I later found out and posted here this problem is based on the FAPI #states API!


Drupal subscriptions.module: Exclude (current) user from notifications about own changes via HOOK

19.03.2015 - 19:08

With the following little HOOK snippet you can exclude users from receiving notifications about own changes in the ‎Subscriptions‎:

  1. /**
  2.  * Implements HOOK_subscriptions_queue_alter.
  3.  */
  4. function MYMODULE_subscriptions_queue_alter(&$event){
  5.   global $user;
  6.   if(!empty($user)){
  7.     // Prevent users from receiving notifications about own changes.


Drupal 7 set JavaScript / jQuery trigger on autocomplete field option

19.03.2015 - 15:02

With this little snippet you can easily set a trigger on autocomplete field options (suggestions) click:

  1. $(document).on('click', 'div.reference-autocomplete', function(e) {
  2.   // Do what you need to do Wink
  3. });

It's not that easy because the selection click does not trigger any change event on the parent input.


Drupal 7 Commerce: Dynamically calculate line item price based on rules and individual product configuration

18.03.2015 - 17:53

We've got some experience on individual product calculators based on Drupal Commerce. Today I'd like to share a bit of that with you: Individual line item price calculation based on rules.

We're for example using these methods in custom calculations for product.


Linktipp: Drupal Commerce Line Item Wrappers API overview

17.03.2015 - 23:06

A nice overview of Drupal 7 Commerce Line Item Wrapper API functions Smile


Drupal 7 Commerce: #ajax / AJAX not working in commerce_cart_add_to_cart form? dc_cart_ajax.module may be the reason

16.03.2015 - 17:41

If you're reading this blog entry I guess you're having problems with adding AJAX in your commerce_cart_add_to_cart_form.
So this blog post is a reminder for myself if I should ever again run into this problem.

What I wanted to do, was adding some AJAX functionality to the add to cart form (A product add to cart form in the shop) using HOOK_form_commerce_cart_add_to_cart_form_alter.


Solution to: Call to undefined function node_form_validate on ajax form submit

27.02.2015 - 11:43

If you're running into the JavaScript alert error message on creating an AJAXified node form:

Call to undefined function node_form_validate() ...

... the reason might be that the $form_states array contains wrong information which files to load on form build.


Inhalt abgleichen