From 0f260a1675be017cbba5fa898e11e4a62820fc0e Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Sat, 25 Nov 2017 17:45:35 +1100 Subject: [PATCH] test caching booking form --- booking.install | 11 +++++++++++ booking.regn_form.inc | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/booking.install b/booking.install index 9b53514..fb42c02 100644 --- a/booking.install +++ b/booking.install @@ -760,6 +760,13 @@ function booking_update_7250() { } */ +/** +* Add custom cache table +*/ +function booking_update_7251() { + $schema['cache_booking'] = drupal_get_schema_unprocessed('system', 'cache'); +} + /** * Implementation of hook_install(). */ @@ -824,6 +831,10 @@ function booking_disable() { * Implementation of hook_schema(). */ function booking_schema() { + + //configure our own cache table + $schema['cache_booking'] = drupal_get_schema_unprocessed('system', 'cache'); + $schema['booking_person'] = array( 'fields' => array( //identifiers diff --git a/booking.regn_form.inc b/booking.regn_form.inc index af10ddf..f9d9e7a 100644 --- a/booking.regn_form.inc +++ b/booking.regn_form.inc @@ -951,6 +951,12 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all ); } + $form['cache'] = '#cache' => array( + 'cid' => 'booking_data', + 'bin' => 'cache_booking', + 'expire' => time() + 360, + ), + if ($inserting == TRUE) { $form['submit'] = array( '#type' => 'submit',