From 8800a936089d85413fe9e3da001de701eab7130d Mon Sep 17 00:00:00 2001 From: baverhey Date: Sun, 14 Dec 2014 21:26:10 +0100 Subject: [PATCH 1/3] the settings page and nessesairy adjustments --- serial.inc | 2 ++ serial.info | 2 +- serial.install | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/serial.inc b/serial.inc index cb3dec2..c792bf8 100644 --- a/serial.inc +++ b/serial.inc @@ -165,6 +165,8 @@ function _serial_generate_value($bundle, $field_name, $delete = TRUE) { ->execute(); } + // Return the new unique serial value but first devide with the correction factor. + $sid= (int)$sid / variable_get('serial_increment', 1); // Return the new unique serial value. return $sid; } diff --git a/serial.info b/serial.info index 56dfddd..dae6acd 100644 --- a/serial.info +++ b/serial.info @@ -4,7 +4,7 @@ package = Fields core = 7.x dependencies[] = field files[] = serial.module - +configure = admin/settings/serial ; Information added by drupal.org packaging script on 2013-10-15 version = "7.x-1.3" diff --git a/serial.install b/serial.install index 18e72bf..e3fc558 100644 --- a/serial.install +++ b/serial.install @@ -5,6 +5,8 @@ * Install, update and uninstall functions for the Serial module. */ + + /** * Implements hook_uninstall(). */ -- 1.9.1 From b026a9ecdabaf1558245bbb6af5917fd28d4e73a Mon Sep 17 00:00:00 2001 From: baverhey Date: Sun, 14 Dec 2014 21:34:05 +0100 Subject: [PATCH 2/3] forgot the .module file --- serial.module | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/serial.module b/serial.module index 688bb10..dfcf7e0 100644 --- a/serial.module +++ b/serial.module @@ -5,6 +5,97 @@ * The Serial module main file. */ + +//==================// +// Viewable pages // +//==================// + +/** + * Implements hook_help(). + */ +function serial_help($path, $arg) { + switch ($path) { +// Main module help for the serial module + case 'admin/help#serial': + return '

' . t('The serial field relies on the mysql database auto increment value, to provide unique serial fields(asyncronus writing safe)
+ On shared hosting or shared databases the auto_increment_increment is not editable, but lucaly on the settings page it is.
+ The mysql related help page.
+
+ Warning: +