How to use the provided API

Sending messages

Retrieve the implementation of the message broker interface and send a message to a specific destination:

$broker = message_broker_get();

$message_body = json_encode(array('data' => 'anyData'));
$broker->sendMessage($message_body, 'yourDestination');

Remarks: Note that you are responsible for serializing and unserializing your message data when sending and receiving. We recommend to use json_encode and json_decode. But you can also use the built in serialize function and its pendant if you know for sure that every client is using PHP.

The destination variable refers to the exchange name in AMQP terminology.

You specify a routing key by passing a third array parameter that is able to hold more (implementation dependent) flags for a specific message:

$broker->sendMessage($message_body, 'yourDestination', array(
  'routing_key' => 'my.routing.key', 
  'content_type' => 'application/json');

Receiving messages

FAQ - Message Broker Integration module

- why do we need the json file?
- exception when trying to send message - queue/exchange definitions were changed -> purge amqp queues
- ..

Drupal 7.16 released

Update: Drupal 7.17 is now available.

Drupal 7.16, a maintenance release which contains fixes for security vulnerabilities, is now available for download. See the Drupal 7.16 release notes for further information.

Upgrading your existing Drupal 7 sites is strongly recommended. There are no new features or non-security-related bug fixes in this release. For more information about the Drupal 7.x release series, consult the Drupal 7.0 release announcement.

Order form with search function


I have been trying to search for a module that fits my need, but I haven't found one special module doing what I want.
I have a website for my university parliament and we are planning on selling university clothing. What I want to do, is to make an order form where people can type in their names, phone numbers, select their class, and their order, and then send them an e-mail with an order confirmation. Payment should not be an option with this module, as that will be handled externally, and filled in the database by a moderator as soon as the payment have been fulfilled.
It should also be possible to search for a particular order when the students come to pick it up, and mark that order as completed.

Webform is a the closest module I have found for this, but the problem is that I haven't found a way of being able to process all the raw data that I get in, as well as being able to search for an e-mail address/phone number or so on to find that particular order and see what kind of clothes/size that particular student have ordered. It should also be able to sort orders by for example size (for example only by sweater S, sweater M, sweater L, sweater XL and so on), or by class (1st year group A, 1st year group B and so on).
By using webform I managed to make the order form and get the raw data, to something like this:

How to call a simple javascript file from a custom drupal module

Hi, contemptable newbie here trying to figure out how to integrate javascript with php. I've included

drupal_add_js(drupal_get_path('module', 'mymodule').'/test.js');

At the top of my custom ".module" file, and I've clearly included test.js in the same module folder. test.js is simply:

Uploaded files with names ending in numbers (+ .extension) are renamed

I'm battling with a weird behaviour on a new site running Drupal 7.15.
Some files uploaded through the WYSIWYG editor get renamed *after the first server request*.

Most recent case, a few hours ago:

1) upload the FED_20061004.pdf file, no problem;

2) link it to a node and save;

3) test the page: pdf file downloads just fine;

4) a few hours later I spot a 404 error for the same file: check for it in /documents (default upload folder) and the file name is now just FED.pdf


Subscribe with RSS Subscribe to RSS - Drupal 7.x