summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Droogmans2012-10-05 07:09:48 (GMT)
committer Peter Droogmans2012-10-05 07:09:48 (GMT)
commit40a8cb4f97d6dad2853abad3165ab34cd308f5e9 (patch)
tree0b7a24a04a7d047c26c27d38c6ac99c611fae1aa
parente4f909cf493acfa4af5ae769f05837f1ff26edf4 (diff)
parent84c6fea4be6317842911ab84c64a54d94d658cb3 (diff)
Merge branch '8.x' into breakpic
-rw-r--r--core/includes/common.inc6
-rw-r--r--core/includes/theme.inc9
-rw-r--r--core/includes/update.inc14
-rw-r--r--core/lib/Drupal/Core/Mail/PhpMail.php2
-rw-r--r--core/lib/Drupal/Core/Queue/QueueInterface.php4
-rw-r--r--core/modules/comment/comment.install51
-rw-r--r--core/modules/dblog/dblog.install20
-rw-r--r--core/modules/field/field.install10
-rw-r--r--core/modules/field/modules/field_sql_storage/field_sql_storage.install2
-rw-r--r--core/modules/node/content_types.inc12
-rw-r--r--core/modules/node/node.admin.inc59
-rw-r--r--core/modules/node/node.install67
-rw-r--r--core/modules/node/node.module92
-rw-r--r--core/modules/node/node.pages.inc46
-rw-r--r--core/modules/overlay/overlay.module22
-rw-r--r--core/modules/statistics/statistics.install18
-rw-r--r--core/modules/system/image.gd.inc59
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php6
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php6
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Uuid/UuidUnitTest.php6
-rw-r--r--core/modules/system/system.api.php119
-rw-r--r--core/modules/tracker/tracker.install21
-rw-r--r--core/modules/user/user.install16
23 files changed, 572 insertions, 95 deletions
diff --git a/core/includes/common.inc b/core/includes/common.inc
index ff2fcb3..bb1b8a4 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -7160,11 +7160,11 @@ function drupal_get_filetransfer_info() {
* Instantiates and statically caches the correct class for a queue.
*
* The following variables can be set by variable_set or $conf overrides:
- * - queue_class_$name: the class to be used for the queue $name.
- * - queue_default_class: the class to use when queue_class_$name is not
+ * - queue_class_$name: The class to be used for the queue $name.
+ * - queue_default_class: The class to use when queue_class_$name is not
* defined. Defaults to Drupal\Core\Queue\System, a reliable backend using
* SQL.
- * - queue_default_reliable_class: the class to use when queue_class_$name is
+ * - queue_default_reliable_class: The class to use when queue_class_$name is
* not defined and the queue_default_class is not reliable. Defaults to
* Drupal\Core\Queue\System.
*
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 16e3b45..5ca3391 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -715,16 +715,19 @@ function list_themes($refresh = FALSE) {
}
/**
- * Find all the base themes for the specified theme.
+ * Finds all the base themes for the specified theme.
*
- * Themes can inherit templates and function implementations from earlier themes.
+ * Themes can inherit templates and function implementations from earlier
+ * themes.
*
* @param $themes
* An array of available themes.
* @param $key
* The name of the theme whose base we are looking for.
* @param $used_keys
- * A recursion parameter preventing endless loops.
+ * (optional) A recursion parameter preventing endless loops. Defaults to
+ * NULL.
+ *
* @return
* Returns an array of all of the theme's ancestors; the first element's value
* will be NULL if an error occurred.
diff --git a/core/includes/update.inc b/core/includes/update.inc
index d8f94b4..5d80188 100644
--- a/core/includes/update.inc
+++ b/core/includes/update.inc
@@ -1125,17 +1125,3 @@ function update_variables_to_config($config_name, array $variable_map) {
// Delete the migrated variables.
db_delete('variable')->condition('name', array_keys($variable_map), 'IN')->execute();
}
-
-/**
- * @defgroup update-api-7.x-to-8.x Update versions of API functions
- * @{
- * Functions similar to normal API function but not firing hooks.
- *
- * During update, it is impossible to judge the consequences of firing a hook
- * as it might hit a module not yet updated. So simplified versions of some
- * core APIs are provided.
- */
-
-/**
- * @} End of "defgroup update-api-7.x-to-8.x".
- */
diff --git a/core/lib/Drupal/Core/Mail/PhpMail.php b/core/lib/Drupal/Core/Mail/PhpMail.php
index 668cc51..f5ec995 100644
--- a/core/lib/Drupal/Core/Mail/PhpMail.php
+++ b/core/lib/Drupal/Core/Mail/PhpMail.php
@@ -13,7 +13,7 @@ namespace Drupal\Core\Mail;
class PhpMail implements MailInterface {
/**
- * Concatenates and wrap the e-mail body for plain-text mails.
+ * Concatenates and wraps the e-mail body for plain-text mails.
*
* @param array $message
* A message array, as described in hook_mail_alter().
diff --git a/core/lib/Drupal/Core/Queue/QueueInterface.php b/core/lib/Drupal/Core/Queue/QueueInterface.php
index 90d4b00..e3e9350 100644
--- a/core/lib/Drupal/Core/Queue/QueueInterface.php
+++ b/core/lib/Drupal/Core/Queue/QueueInterface.php
@@ -15,10 +15,10 @@ namespace Drupal\Core\Queue;
*/
interface QueueInterface {
/**
- * Start working with a queue.
+ * Initializes a new queue object.
*
* @param $name
- * Arbitrary string. The name of the queue to work with.
+ * An arbitrary string. The name of the queue to work with.
*/
public function __construct($name);
diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install
index 0a147b5..6692a95 100644
--- a/core/modules/comment/comment.install
+++ b/core/modules/comment/comment.install
@@ -105,12 +105,14 @@ function comment_schema() {
),
'nid' => array(
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {node}.nid to which this comment is a reply.',
),
'uid' => array(
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {users}.uid who authored the comment. If set to 0, this comment was created by an anonymous user.',
@@ -234,6 +236,7 @@ function comment_schema() {
),
'last_comment_uid' => array(
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The user ID of the latest author to post a comment on this node, from {comment}.uid.',
@@ -317,6 +320,54 @@ function comment_update_8001() {
}
/**
+ * Make *id fields unsigned.
+ */
+function comment_update_8002() {
+ db_drop_index('comment', 'comment_num_new');
+ db_drop_index('comment', 'comment_nid_langcode');
+ db_change_field('comment', 'nid', 'nid',
+ array(
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ 'description' => 'The {node}.nid to which this comment is a reply.',
+ ),
+ array('indexes' => array(
+ 'comment_num_new' => array('nid', 'status', 'created', 'cid', 'thread'),
+ 'comment_nid_langcode' => array('nid', 'langcode'),
+ ))
+ );
+ db_drop_index('comment', 'comment_uid');
+ db_change_field('comment', 'uid', 'uid',
+ array(
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ 'description' => 'The {users}.uid who authored the comment. If set to 0, this comment was created by an anonymous user.',
+ ),
+ array('indexes' => array(
+ 'comment_uid' => array('uid'),
+ ))
+ );
+
+ db_drop_index('node_comment_statistics', 'last_comment_uid');
+ db_change_field('node_comment_statistics', 'last_comment_uid', 'last_comment_uid',
+ array(
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ 'description' => 'The user ID of the latest author to post a comment on this node, from {comment}.uid.',
+ ),
+ array('indexes' => array(
+ 'last_comment_uid' => array('last_comment_uid'),
+ ))
+ );
+}
+
+/**
* @} End of "addtogroup updates-7.x-to-8.x".
* The next series of updates should start at 9000.
*/
diff --git a/core/modules/dblog/dblog.install b/core/modules/dblog/dblog.install
index 919bab3..398171a 100644
--- a/core/modules/dblog/dblog.install
+++ b/core/modules/dblog/dblog.install
@@ -19,6 +19,7 @@ function dblog_schema() {
),
'uid' => array(
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The {users}.uid of the user who triggered the event.',
@@ -107,6 +108,25 @@ function dblog_update_8000() {
}
/**
+ * Make *id fields unsigned.
+ */
+function dblog_update_8001() {
+ db_drop_index('watchdog', 'uid');
+ db_change_field('watchdog', 'uid', 'uid',
+ array(
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ 'description' => 'The {users}.uid of the user who triggered the event.',
+ ),
+ array('indexes' => array(
+ 'uid' => array('uid'),
+ ))
+ );
+}
+
+/**
* @} End of "defgroup updates-7.x-to-8.x"
* The next series of updates should start at 9000.
*/
diff --git a/core/modules/field/field.install b/core/modules/field/field.install
index d665d36..24849e3 100644
--- a/core/modules/field/field.install
+++ b/core/modules/field/field.install
@@ -169,7 +169,7 @@ function field_schema() {
/**
* Creates a field by writing directly to the database.
*
- * @ingroup update-api-7.x-to-8.x
+ * @ingroup update_api
*/
function _update_7000_field_create_field(&$field) {
// Merge in default values.`
@@ -247,7 +247,7 @@ function _update_7000_field_create_field(&$field) {
* @param $field_name
* The field name to delete.
*
- * @ingroup update-api-7.x-to-8.x
+ * @ingroup update_api
*/
function _update_7000_field_delete_field($field_name) {
$table_name = 'field_data_' . $field_name;
@@ -276,7 +276,7 @@ function _update_7000_field_delete_field($field_name) {
*
* BEWARE: This function deletes user data from the field storage tables.
*
- * @ingroup update-api-7.x-to-8.x
+ * @ingroup update_api
*/
function _update_7000_field_delete_instance($field_name, $entity_type, $bundle) {
// Delete field instance configuration data.
@@ -314,7 +314,7 @@ function _update_7000_field_delete_instance($field_name, $entity_type, $bundle)
* @return
* An array of fields matching $conditions, keyed by the property specified
* by the $key parameter.
- * @ingroup update-api-7.x-to-8.x
+ * @ingroup update_api
*/
function _update_7000_field_read_fields(array $conditions = array(), $key = 'id') {
$fields = array();
@@ -346,7 +346,7 @@ function _update_7000_field_read_fields(array $conditions = array(), $key = 'id'
/**
* Writes a field instance directly to the database.
*
- * @ingroup update-api-7.x-to-8.x
+ * @ingroup update_api
*/
function _update_7000_field_create_instance($field, &$instance) {
// Merge in defaults.
diff --git a/core/modules/field/modules/field_sql_storage/field_sql_storage.install b/core/modules/field/modules/field_sql_storage/field_sql_storage.install
index a4e0544..4d4fe57 100644
--- a/core/modules/field/modules/field_sql_storage/field_sql_storage.install
+++ b/core/modules/field/modules/field_sql_storage/field_sql_storage.install
@@ -27,7 +27,7 @@ function field_sql_storage_schema() {
/**
* Writes field data directly to SQL storage.
*
- * @ingroup update-api-7.x-to-8.x
+ * @ingroup update_api
*/
function _update_8000_field_sql_storage_write($entity_type, $bundle, $entity_id, $revision_id, $field_name, $data) {
$table_name = "field_data_{$field_name}";
diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc
index 355a022..7388ee9 100644
--- a/core/modules/node/content_types.inc
+++ b/core/modules/node/content_types.inc
@@ -8,6 +8,9 @@
/**
* Page callback: Displays the content type admin overview page.
*
+ * @return array
+ * An array as expected by drupal_render().
+ *
* @see node_menu()
*/
function node_overview_types() {
@@ -63,6 +66,9 @@ function node_overview_types() {
* - type: An object containing the 'type' (machine name) and 'description' of
* the content type.
*
+ * @return string
+ * An HTML-formatted string of the description for this node type.
+ *
* @ingroup themeable
*/
function theme_node_admin_overview($variables) {
@@ -278,6 +284,12 @@ function node_type_form($form, &$form_state, $type = NULL) {
/**
* Helper function for teaser length choices.
+ *
+ * @param int $length
+ * An integer representing the desired length of the teaser string.
+ *
+ * @return string
+ * A string that reprents the teaser length options.
*/
function _node_characters($length) {
return ($length == 0) ? t('Unlimited') : format_plural($length, '1 character', '@count characters');
diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc
index f77ec7d..2ca2d3e 100644
--- a/core/modules/node/node.admin.inc
+++ b/core/modules/node/node.admin.inc
@@ -10,8 +10,11 @@ use Drupal\Core\Database\Query\SelectInterface;
/**
* Page callback: Form constructor for the permission rebuild confirmation form.
*
- * @see node_menu()
+ * @return array
+ * An array as expected by drupal_render().
+ *
* @see node_configure_rebuild_confirm_submit()
+ * @see node_menu()
*/
function node_configure_rebuild_confirm() {
return confirm_form(array(), t('Are you sure you want to rebuild the permissions on site content?'),
@@ -73,7 +76,7 @@ function node_node_operations() {
* Lists node administration filters that can be applied.
*
* @return
- * Associative array of filters.
+ * An associative array of filters.
*/
function node_filters() {
// Regular filters
@@ -124,7 +127,7 @@ function node_filters() {
/**
* Applies filters for the node administration overview based on session.
*
- * @param $query
+ * @param Drupal\Core\Database\Query\SelectInterface $query
* A SelectQuery to which the filters should be applied.
*/
function node_build_filter_query(SelectInterface $query) {
@@ -145,14 +148,15 @@ function node_build_filter_query(SelectInterface $query) {
}
/**
- * Returns the node administration filters form object to node_admin_content().
+ * Returns the node administration filters form array to node_admin_content().
*
- * @see node_multiple_delete_confirm()
- * @see node_multiple_delete_confirm_submit()
* @see node_admin_nodes()
* @see node_admin_nodes_submit()
* @see node_admin_nodes_validate()
* @see node_filter_form_submit()
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
+ *
* @ingroup forms
*/
function node_filter_form() {
@@ -231,12 +235,12 @@ function node_filter_form() {
* Form submission handler for node_filter_form().
*
* @see node_admin_content()
- * @see node_multiple_delete_confirm()
- * @see node_multiple_delete_confirm_submit()
* @see node_admin_nodes()
* @see node_admin_nodes_submit()
* @see node_admin_nodes_validate()
* @see node_filter_form()
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
*/
function node_filter_form_submit($form, &$form_state) {
$filters = node_filters();
@@ -310,6 +314,9 @@ function node_mass_update($nodes, $updates) {
* @param $updates
* Associative array of updates.
*
+ * @return object
+ * An updated node object.
+ *
* @see node_mass_update()
*/
function _node_mass_update_helper($nid, $updates) {
@@ -325,6 +332,13 @@ function _node_mass_update_helper($nid, $updates) {
/**
* Executes a batch operation for node_mass_update().
+ *
+ * @param array $nodes
+ * An array of node IDs.
+ * @param array $updates
+ * Associative array of updates.
+ * @param array $context
+ * An array of contextual key/values.
*/
function _node_mass_update_batch_process($nodes, $updates, &$context) {
if (!isset($context['sandbox']['progress'])) {
@@ -356,6 +370,14 @@ function _node_mass_update_batch_process($nodes, $updates, &$context) {
/**
* Reports the 'finished' status of batch operation for node_mass_update().
+ *
+ * @param bool $success
+ * A boolean indicating whether the batch mass update operation successfully
+ * concluded.
+ * @param int $results
+ * The number of nodes updated via the batch mode process.
+ * @param array $operations
+ * An array of function calls (not used in this function).
*/
function _node_mass_update_batch_finished($success, $results, $operations) {
if ($success) {
@@ -372,14 +394,14 @@ function _node_mass_update_batch_finished($success, $results, $operations) {
/**
* Page callback: Form constructor for the content administration form.
*
- * @see node_multiple_delete_confirm()
- * @see node_multiple_delete_confirm_submit()
* @see node_admin_nodes()
* @see node_admin_nodes_submit()
* @see node_admin_nodes_validate()
* @see node_filter_form()
* @see node_filter_form_submit()
* @see node_menu()
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
*/
function node_admin_content($form, $form_state) {
if (isset($form_state['values']['operation']) && $form_state['values']['operation'] == 'delete') {
@@ -395,12 +417,13 @@ function node_admin_content($form, $form_state) {
/**
* Returns the admin form object to node_admin_content().
*
- * @see node_multiple_delete_confirm()
- * @see node_multiple_delete_confirm_submit()
* @see node_admin_nodes_submit()
* @see node_admin_nodes_validate()
* @see node_filter_form()
* @see node_filter_form_submit()
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
+ *
* @ingroup forms
*/
function node_admin_nodes() {
@@ -592,12 +615,12 @@ function node_admin_nodes() {
* Checks if any nodes have been selected to perform the chosen
* 'Update option' on.
*
- * @see node_multiple_delete_confirm()
- * @see node_multiple_delete_confirm_submit()
* @see node_admin_nodes()
* @see node_admin_nodes_submit()
* @see node_filter_form()
* @see node_filter_form_submit()
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
*/
function node_admin_nodes_validate($form, &$form_state) {
// Error if there are no items to select.
@@ -611,12 +634,12 @@ function node_admin_nodes_validate($form, &$form_state) {
*
* Executes the chosen 'Update option' on the selected nodes.
*
- * @see node_multiple_delete_confirm()
- * @see node_multiple_delete_confirm_submit()
* @see node_admin_nodes()
* @see node_admin_nodes_validate()
* @see node_filter_form()
* @see node_filter_form_submit()
+ * @see node_multiple_delete_confirm()
+ * @see node_multiple_delete_confirm_submit()
*/
function node_admin_nodes_submit($form, &$form_state) {
$operations = module_invoke_all('node_operations');
@@ -645,12 +668,12 @@ function node_admin_nodes_submit($form, &$form_state) {
/**
* Multiple node deletion confirmation form for node_admin_content().
*
- * @see node_multiple_delete_confirm_submit()
* @see node_admin_nodes()
* @see node_admin_nodes_submit()
* @see node_admin_nodes_validate()
* @see node_filter_form()
* @see node_filter_form_submit()
+ * @see node_multiple_delete_confirm_submit()
*/
function node_multiple_delete_confirm($form, &$form_state, $nodes) {
$form['nodes'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
@@ -678,12 +701,12 @@ function node_multiple_delete_confirm($form, &$form_state, $nodes) {
/**
* Form submission handler for node_multiple_delete_confirm().
*
- * @see node_multiple_delete_confirm()
* @see node_admin_nodes()
* @see node_admin_nodes_submit()
* @see node_admin_nodes_validate()
* @see node_filter_form()
* @see node_filter_form_submit()
+ * @see node_multiple_delete_confirm()
*/
function node_multiple_delete_confirm_submit($form, &$form_state) {
if ($form_state['values']['confirm']) {
diff --git a/core/modules/node/node.install b/core/modules/node/node.install
index 5727129..ac777f3 100644
--- a/core/modules/node/node.install
+++ b/core/modules/node/node.install
@@ -57,6 +57,7 @@ function node_schema() {
'uid' => array(
'description' => 'The {users}.uid that owns this node; initially, this is the user that created it.',
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
@@ -215,6 +216,7 @@ function node_schema() {
'uid' => array(
'description' => 'The {users}.uid that created this version.',
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
@@ -410,12 +412,14 @@ function node_schema() {
'uid' => array(
'description' => 'The {users}.uid that read the {node} nid.',
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'nid' => array(
'description' => 'The {node}.nid that was read.',
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
@@ -454,6 +458,9 @@ function node_install() {
/**
* Implements hook_uninstall().
+ *
+ * @see node_ranking()
+ * @see _node_rankings()
*/
function node_uninstall() {
// Delete node type variables.
@@ -473,7 +480,6 @@ function node_uninstall() {
}
// Delete node search ranking variables.
- // @see node_ranking(), _node_rankings()
variable_del('node_rank_relevance');
variable_del('node_rank_sticky');
variable_del('node_rank_promote');
@@ -490,7 +496,7 @@ function node_uninstall() {
/**
* Fetches node types directly from the database.
*
- * @ingroup update-api-7.x-to-8.x
+ * @ingroup update_api
*/
function _update_7000_node_get_types() {
$node_types = db_query('SELECT * FROM {node_type}')->fetchAllAssoc('type', PDO::FETCH_OBJ);
@@ -601,6 +607,63 @@ function node_update_8004() {
}
/**
+ * Make *id fields unsigned.
+ */
+function node_update_8005() {
+ db_drop_index('node', 'uid');
+ db_change_field('node', 'uid', 'uid',
+ array(
+ 'description' => 'The {users}.uid that owns this node; initially, this is the user that created it.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ array('indexes' => array(
+ 'uid' => array('uid'),
+ ))
+ );
+
+ db_drop_index('node_revision', 'uid');
+ db_change_field('node_revision', 'uid', 'uid',
+ array(
+ 'description' => 'The {users}.uid that created this version.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ array('indexes' => array(
+ 'uid' => array('uid'),
+ ))
+ );
+
+ db_drop_primary_key('history');
+ db_drop_index('history', 'nid');
+ db_change_field('history', 'uid', 'uid',
+ array(
+ 'description' => 'The {users}.uid that read the {node} nid.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ )
+ );
+ db_change_field('history', 'nid', 'nid',
+ array(
+ 'description' => 'The {node}.nid that was read.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ array('primary key' => array('uid', 'nid'), 'indexes' => array(
+ 'nid' => array('nid'),
+ ))
+ );
+}
+
+/**
* @} End of "addtogroup updates-7.x-to-8.x"
* The next series of updates should start at 9000.
*/
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 175bf47..2dd1b57 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -287,6 +287,9 @@ function node_field_display_node_alter(&$display, $context) {
*
* @param Drupal\node\Node $node
* A node entity.
+ *
+ * @return array
+ * An array with 'path' as the key and Node ID as its value.
*/
function node_uri(Node $node) {
return array(
@@ -360,6 +363,13 @@ function node_tag_new(Node $node) {
/**
* Retrieves the timestamp for the current user's last view of a specified node.
+ *
+ * @param int $nid
+ * A node ID.
+ *
+ * @return int
+ * If a node has been previously viewed by the user, the timestamp in seconds
+ * of when the last view occurred; otherwise, zero.
*/
function node_last_viewed($nid) {
global $user;
@@ -411,6 +421,7 @@ function node_mark($nid, $timestamp) {
* @return
* An array of node types, as objects, keyed by the type.
*
+ * @see _node_types_build()
* @see node_type_load()
*/
function node_type_get_types() {
@@ -445,6 +456,8 @@ function node_type_get_base($type) {
*
* @return
* An array of node type labels, keyed by the node type name.
+ *
+ * @see _node_types_build()
*/
function node_type_get_names() {
return _node_types_build()->names;
@@ -784,7 +797,8 @@ function node_type_update_nodes($old_type, $type) {
* until node_types_rebuild() is called.
*
* @param $rebuild
- * TRUE to rebuild node types. Equivalent to calling node_types_rebuild().
+ * (optional) TRUE to rebuild node types. Equivalent to calling
+ * node_types_rebuild(). Defaults to FALSE.
*
* @return
* An object with two properties:
@@ -897,6 +911,8 @@ function node_type_cache_reset() {
*
* @return
* A node type object, with missing values in $info set to their defaults.
+ *
+ * @see hook_node_ifo()
*/
function node_type_set_defaults($info = array()) {
$info = (array) $info;
@@ -999,7 +1015,8 @@ function node_hook($type, $hook) {
* @param $hook
* A string containing the name of the hook.
* @param $a2, $a3, $a4
- * Arguments to pass on to the hook, after the $node argument.
+ * (optional) Arguments to pass on to the hook, after the $node argument. All
+ * default to NULL.
*
* @return
* The returned value of the invoked hook.
@@ -1020,7 +1037,8 @@ function node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
* @param array $nids
* (optional) An array of entity IDs. If omitted, all entities are loaded.
* @param bool $reset
- * (optional) Whether to reset the internal node_load() cache.
+ * (optional) Whether to reset the internal node_load() cache. Defaults to
+ * FALSE.
*
* @return array
* An array of node entities indexed by nid.
@@ -1038,7 +1056,8 @@ function node_load_multiple(array $nids = NULL, $reset = FALSE) {
* @param int $nid
* The node ID.
* @param bool $reset
- * (optional) Whether to reset the node_load_multiple() cache.
+ * (optional) Whether to reset the node_load_multiple() cache. Defaults to
+ * FALSE.
*
* @return Drupal\node\Node|false
* A fully-populated node entity, or FALSE if the node is not found.
@@ -1062,6 +1081,12 @@ function node_revision_load($vid = NULL) {
/**
* Prepares a node for saving by populating the author and creation date.
+ *
+ * @param object $node
+ * A node object.
+ *
+ * @return object
+ * An updated node object.
*/
function node_submit($node) {
global $user;
@@ -1129,7 +1154,7 @@ function node_delete_multiple($nids) {
* The revision ID to delete.
*
* @return
- * TRUE if the revision deletion was successful.
+ * TRUE if the revision deletion was successful; otherwise, FALSE.
*/
function node_revision_delete($revision_id) {
if ($revision = node_revision_load($revision_id)) {
@@ -1295,7 +1320,7 @@ function node_build_content(Node $node, $view_mode = 'full', $langcode = NULL) {
* A node entity.
* @param $message
* (optional) A flag which sets a page title relevant to the revision being
- * viewed.
+ * viewed. Default is FALSE.
*
* @return
* A $page element suitable for use by drupal_render().
@@ -1764,10 +1789,11 @@ function theme_node_search_admin($variables) {
* @param object $account
* (optional) A user object representing the user for whom the operation is
* to be performed. Determines access for a user other than the current user.
+ * Defaults to NULL.
* @param $langcode
* (optional) Language code for the variant of the node. Different language
* variants might have different permissions associated. If NULL, the
- * original langcode of the node is used.
+ * original langcode of the node is used. Defaults to NULL.
*
* @return
* TRUE if the operation may be performed, FALSE otherwise.
@@ -2050,6 +2076,9 @@ function node_menu_local_tasks_alter(&$data, $router_item, $root_path) {
* @param $type
* The node type object.
*
+ * @return string
+ * An unsanitized string that is the title of the node type edit form.
+ *
* @see node_menu()
*/
function node_type_page_title($type) {
@@ -2062,6 +2091,9 @@ function node_type_page_title($type) {
* @param Drupal\node\Node $node
* The node entity.
*
+ * @return
+ * An unsanitized string that is the title of the node.
+ *
* @see node_menu()
*/
function node_page_title(Node $node) {
@@ -2086,6 +2118,9 @@ function node_last_changed($nid) {
*
* @param Drupal\node\Node $node
* The node entity.
+ *
+ * @return
+ * An associative array keyed by node revision number.
*/
function node_revision_list(Node $node) {
$revisions = array();
@@ -2440,6 +2475,9 @@ function node_block_list_alter(&$blocks) {
* @link http://cyber.law.harvard.edu/rss/rss.html RSS 2.0 Specification. @endlink
* The link should be an absolute URL.
*
+ * @return Symfony\Component\HttpFoundation\Response
+ * A response object.
+ *
* @see node_menu()
*/
function node_feed($nids = FALSE, $channel = array()) {
@@ -2545,6 +2583,9 @@ function node_view_multiple($nodes, $view_mode = 'teaser', $weight = 0, $langcod
/**
* Page callback: Generates a listing of promoted nodes.
*
+ * @return array
+ * An array in the format expected by drupal_render().
+ *
* @see node_menu()
*/
function node_page_default() {
@@ -2601,6 +2642,9 @@ function node_page_default() {
* @param Drupal\node\Node $node
* The node entity.
*
+ * @return
+ * A page array suitable for use by drupal_render().
+ *
* @see node_menu()
*/
function node_page_view(Node $node) {
@@ -2908,10 +2952,11 @@ function node_form_system_themes_admin_form_submit($form, &$form_state) {
* @param $account
* (optional) A user object representing the user for whom the operation is to
* be performed. Determines access for a user other than the current user.
+ * Defaults to NULL.
* @param $langcode
* (optional) Language code for the variant of the node. Different language
* variants might have different permissions associated. If NULL, the
- * original langcode of the node is used.
+ * original langcode of the node is used. Defaults to NULL.
*
* @return
* TRUE if the operation may be performed, FALSE otherwise.
@@ -3123,7 +3168,7 @@ function node_permissions_get_configured_types() {
* The operation that the user is trying to perform.
* @param $account
* (optional) The user object for the user performing the operation. If
- * omitted, the current user is used.
+ * omitted, the current user is used. Defaults to NULL.
*
* @return
* An associative array in which the keys are realms, and the values are
@@ -3157,7 +3202,7 @@ function node_access_grants($op, $account = NULL) {
*
* @param $account
* (optional) The user object for the user whose access is being checked. If
- * omitted, the current user is used.
+ * omitted, the current user is used. Defaults to NULL.
*
* @return
* TRUE if 'view' access to all nodes is granted, FALSE otherwise.
@@ -3242,6 +3287,9 @@ function node_query_entity_field_access_alter(AlterableInterface $query) {
* Either 'node' or 'entity' depending on what sort of query it is. See
* node_query_node_access_alter() and node_query_entity_field_access_alter()
* for more.
+ *
+ * @see node_query_node_access_alter()
+ * @see node_query_entity_field_access_alter()
*/
function _node_query_node_access_alter($query, $type) {
global $user;
@@ -3420,11 +3468,12 @@ function node_access_acquire_grants(Node $node, $delete = TRUE) {
* is a module-defined id to define grant privileges. each grant_* field
* is a boolean value.
* @param $realm
- * (optional) If provided, read/write grants for that realm only.
+ * (optional) If provided, read/write grants for that realm only. Defaults to
+ * NULL.
* @param $delete
* (optional) If false, does not delete records. This is only for optimization
* purposes, and assumes the caller has already performed a mass delete of
- * some form.
+ * some form. Defaults to TRUE.
*/
function _node_access_write_grants(Node $node, $grants, $realm = NULL, $delete = TRUE) {
if ($delete) {
@@ -3499,7 +3548,8 @@ function node_access_needs_rebuild($rebuild = NULL) {
* has a large number of nodes). hook_update_N() and any form submit handler
* are safe contexts to use the 'batch mode'. Less decidable cases (such as
* calls from hook_user(), hook_taxonomy(), etc.) might consider using the
- * non-batch mode.
+ * non-batch mode. Defaults to FALSE.
+ *
* @see node_access_needs_rebuild()
*/
function node_access_rebuild($batch_mode = FALSE) {
@@ -3559,6 +3609,9 @@ function node_access_rebuild($batch_mode = FALSE) {
* This is a multistep operation : we go through all nodes by packs of 20.
* The batch processing engine interrupts processing and sends progress
* feedback after 1 second execution time.
+ *
+ * @param array $context
+ * An array of contextual key/value information for rebuild batch process.
*/
function _node_access_rebuild_batch_operation(&$context) {
if (empty($context['sandbox'])) {
@@ -3590,6 +3643,13 @@ function _node_access_rebuild_batch_operation(&$context) {
/**
* Post-processing for node_access_rebuild_batch.
+ *
+ * @param bool $success
+ * A boolean indicating whether the re-build process has completed.
+ * @param array $results
+ * An array of results information.
+ * @param array $operations
+ * An array of function calls (not used in this function).
*/
function _node_access_rebuild_batch_finished($success, $results, $operations) {
if ($success) {
@@ -3913,6 +3973,12 @@ function node_assign_owner_action_submit($form, $form_state) {
/**
* Generates settings form for node_unpublish_by_keyword_action().
+ *
+ * @param array $context
+ * Array of additional information about what triggered this action.
+ *
+ * @return array
+ * A form array.
*/
function node_unpublish_by_keyword_action_form($context) {
$form['keywords'] = array(
diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc
index 12437e1..1780fb9 100644
--- a/core/modules/node/node.pages.inc
+++ b/core/modules/node/node.pages.inc
@@ -14,6 +14,12 @@ use Drupal\node\Node;
/**
* Page callback: Presents the node editing form.
*
+ * @param object $node
+ * A node object.
+ *
+ * @return array
+ * A form array as expected by drupal_render().
+ *
* @see node_menu()
*/
function node_page_edit($node) {
@@ -26,6 +32,11 @@ function node_page_edit($node) {
*
* Redirects to node/add/[type] if only one content type is available.
*
+ * @return array
+ * A render array for a list of the node types that can be added; however, if
+ * there is only one node type defined for the site, the function redirects
+ * to the node add page for that one node type and does not return at all.
+ *
* @see node_menu()
*/
function node_add_page() {
@@ -51,7 +62,11 @@ function node_add_page() {
* An associative array containing:
* - content: An array of content types.
*
+ * @return string
+ * An HTML-formatted string.
+ *
* @see node_add_page()
+ *
* @ingroup themeable
*/
function theme_node_add_list($variables) {
@@ -79,8 +94,8 @@ function theme_node_add_list($variables) {
* @param $node_type
* The node type object for the submitted node.
*
- * @return
- * Returns a node submission form.
+ * @return array
+ * A node submission form.
*
* @see node_menu()
*/
@@ -107,7 +122,7 @@ function node_add($node_type) {
* The node to preview.
*
* @return
- * Themed node preview.
+ * An HTML-formatted string of a node preview.
*
* @see node_form_build_preview()
*/
@@ -155,6 +170,7 @@ function node_preview(Node $node) {
* - node: The node entity which is being previewed.
*
* @see NodeFormController::preview()
+ *
* @ingroup themeable
*/
function theme_node_preview($variables) {
@@ -187,6 +203,12 @@ function theme_node_preview($variables) {
/**
* Page callback: Form constructor for node deletion confirmation form.
*
+ * @param object $node
+ * A node object.
+ *
+ * @return array
+ * A form array.
+ *
* @see node_menu()
*/
function node_delete_confirm($form, &$form_state, $node) {
@@ -218,6 +240,12 @@ function node_delete_confirm_submit($form, &$form_state) {
/**
* Page callback: Generates an overview table of older revisions of a node.
*
+ * @param object $node
+ * A node object.
+ *
+ * @return array
+ * An array as expected by drupal_render().
+ *
* @see node_menu()
*/
function node_revision_overview($node) {
@@ -276,6 +304,12 @@ function node_revision_overview($node) {
*
* This form prevents against CSRF attacks.
*
+ * @param int $node_revision
+ * The node revision ID.
+ *
+ * @return array
+ * An array as expected by drupal_render().
+ *
* @see node_menu()
* @see node_revision_revert_confirm_submit()
*/
@@ -311,6 +345,12 @@ function node_revision_revert_confirm_submit($form, &$form_state) {
*
* This form prevents against CSRF attacks.
*
+ * @param $node_revision
+ * The node revision ID.
+ *
+ * @return
+ * An array as expected by drupal_render().
+ *
* @see node_menu()
* @see node_revision_delete_confirm_submit()
*/
diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module
index e2cdc4c..6d78e43 100644
--- a/core/modules/overlay/overlay.module
+++ b/core/modules/overlay/overlay.module
@@ -311,7 +311,11 @@ function overlay_page_alter(&$page) {
}
/**
- * Access callback; determines access to dismiss the overlay accessibility message.
+ * Access callback: Determines access to dismiss the accessibility message.
+ *
+ * @return
+ * TRUE if the user has permission to dismiss the accessibility message or if
+ * the user is anonymous. FALSE if otherwise.
*
* @see overlay_user_dismiss_message()
* @see overlay_menu()
@@ -331,7 +335,10 @@ function overlay_user_dismiss_message_access() {
}
/**
- * Menu callback: Dismisses the overlay accessibility message for this user.
+ * Page callback: Dismisses the overlay accessibility message for this user.
+ *
+ * @return
+ * A render array for a page containing a list of content.
*
* @see overlay_user_dismiss_message_access()
* @see overlay_menu()
@@ -554,7 +561,7 @@ function overlay_preprocess_page(&$variables) {
}
/**
- * Callback to request that the overlay display an empty page.
+ * Stores and returns whether an empty page override is needed.
*
* This is used to prevent a page request which closes the overlay (for
* example, a form submission) from being fully re-rendered before the overlay
@@ -731,12 +738,13 @@ function overlay_overlay_child_initialize() {
}
/**
- * Callback to request that the overlay close as soon as the page is displayed.
+ * Requests that the overlay overlay closes when the page is displayed.
*
* @param $redirect
* (optional) The path that should open in the parent window after the
* overlay closes. If not set, no redirect will be performed on the parent
* window.
+ *
* @param $redirect_options
* (optional) An associative array of options to use when generating the
* redirect URL.
@@ -966,7 +974,7 @@ function overlay_store_rendered_content($id = NULL, $content = NULL) {
}
/**
- * Request that the parent window refresh a particular page region.
+ * Requests that the parent window refreshes a particular page region.
*
* @param $region
* The name of the page region to refresh. The parent window will trigger a
@@ -981,7 +989,7 @@ function overlay_request_refresh($region) {
}
/**
- * Request that the entire parent window be reloaded when the overlay closes.
+ * Requests that the entire parent window is reloaded when the overlay closes.
*
* @see overlay_trigger_refresh()
*/
@@ -990,7 +998,7 @@ function overlay_request_page_refresh() {
}
/**
- * Check if the parent window needs to be refreshed on this page load.
+ * Checks if the parent window needs to be refreshed on this page load.
*
* If the previous page load requested that any page regions be refreshed, or
* if it requested that the entire page be refreshed when the overlay closes,
diff --git a/core/modules/statistics/statistics.install b/core/modules/statistics/statistics.install
index 97c5518..c0d0a6f 100644
--- a/core/modules/statistics/statistics.install
+++ b/core/modules/statistics/statistics.install
@@ -88,6 +88,7 @@ function statistics_schema() {
'nid' => array(
'description' => 'The {node}.nid for these statistics.',
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
@@ -136,3 +137,20 @@ function statistics_update_8000() {
'statistics_block_top_last_num' => 'block.popular.top_recent_limit',
));
}
+
+/**
+ * Make *id fields unsigned.
+ */
+function statistics_update_8001() {
+ db_drop_primary_key('node_counter');
+ db_change_field('node_counter', 'nid', 'nid',
+ array(
+ 'description' => 'The {node}.nid for these statistics.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ array('primary key' => array('nid'))
+ );
+}
diff --git a/core/modules/system/image.gd.inc b/core/modules/system/image.gd.inc
index f6f12ae..7f3ac5e 100644
--- a/core/modules/system/image.gd.inc
+++ b/core/modules/system/image.gd.inc
@@ -11,7 +11,19 @@
*/
/**
- * Retrieve settings for the GD2 toolkit.
+ * Image toolkit callback: Returns GD-specific image toolkit settings.
+ *
+ * This function verifies that the GD PHP extension is installed. If it is not,
+ * a form error message is set, informing the user about the missing extension.
+ *
+ * The form elements returned by this function are integrated into the form
+ * built by system_image_toolkit_settings().
+ *
+ * @return
+ * An array of Form API elements to be added to the form.
+ *
+ * @see hook_image_toolkits()
+ * @see system_image_toolkit_settings()
*/
function image_gd_settings() {
if (image_gd_check_settings()) {
@@ -38,10 +50,14 @@ function image_gd_settings() {
}
/**
- * Verify GD2 settings (that the right version is actually installed).
+ * Verifies GD2 settings (that the right version is actually installed).
*
* @return
- * A boolean indicating if the GD toolkit is available on this machine.
+ * A Boolean indicating whether the correct version of the GD toolkit is
+ * available on this machine.
+ *
+ * @see image_gd_settings()
+ * @see system_image_toolkits()
*/
function image_gd_check_settings() {
if ($check = get_extension_funcs('gd')) {
@@ -54,7 +70,7 @@ function image_gd_check_settings() {
}
/**
- * Scale an image to the specified size using GD.
+ * Image toolkit callback: Scales an image to the specified size using GD.
*
* @param $image
* An image object. The $image->resource, $image->info['width'], and
@@ -63,9 +79,11 @@ function image_gd_check_settings() {
* The new width of the resized image, in pixels.
* @param $height
* The new height of the resized image, in pixels.
+ *
* @return
* TRUE or FALSE, based on success.
*
+ * @see hook_image_toolkits()
* @see image_resize()
*/
function image_gd_resize(stdClass $image, $width, $height) {
@@ -84,7 +102,7 @@ function image_gd_resize(stdClass $image, $width, $height) {
}
/**
- * Rotate an image the given number of degrees.
+ * Image toolkit callback: Rotates an image a specified number of degrees.
*
* @param $image
* An image object. The $image->resource, $image->info['width'], and
@@ -92,11 +110,12 @@ function image_gd_resize(stdClass $image, $width, $height) {
* @param $degrees
* The number of (clockwise) degrees to rotate the image.
* @param $background
- * An hexadecimal integer specifying the background color to use for the
- * uncovered area of the image after the rotation. E.g. 0x000000 for black,
- * 0xff00ff for magenta, and 0xffffff for white. For images that support
- * transparency, this will default to transparent. Otherwise it will
+ * (optional) A hexadecimal integer specifying the background color to use
+ * for the uncovered area of the image after the rotation. E.g. 0x000000 for
+ * black, 0xff00ff for magenta, and 0xffffff for white. For images that
+ * support transparency, this will default to transparent. Otherwise it will
* be white.
+ *
* @return
* TRUE or FALSE, based on success.
*
@@ -154,7 +173,7 @@ function image_gd_rotate(stdClass $image, $degrees, $background = NULL) {
}
/**
- * Crop an image using the GD toolkit.
+ * Image toolkit callback: Crops an image using the GD toolkit.
*
* @param $image
* An image object. The $image->resource, $image->info['width'], and
@@ -167,9 +186,11 @@ function image_gd_rotate(stdClass $image, $degrees, $background = NULL) {
* The width of the cropped area, in pixels.
* @param $height
* The height of the cropped area, in pixels.
+ *
* @return
* TRUE or FALSE, based on success.
*
+ * @see hook_image_toolkits()
* @see image_crop()
*/
function image_gd_crop(stdClass $image, $x, $y, $width, $height) {
@@ -188,15 +209,17 @@ function image_gd_crop(stdClass $image, $x, $y, $width, $height) {
}
/**
- * Convert an image resource to grayscale.
+ * Image toolkit callback: Converts an image to grayscale using the GD toolkit.
*
* Note that transparent GIFs loose transparency when desaturated.
*
* @param $image
* An image object. The $image->resource value will be modified by this call.
+ *
* @return
* TRUE or FALSE, based on success.
*
+ * @see hook_image_toolkits()
* @see image_desaturate()
*/
function image_gd_desaturate(stdClass $image) {
@@ -210,13 +233,15 @@ function image_gd_desaturate(stdClass $image) {
}
/**
- * GD helper function to create an image resource from a file.
+ * Image toolkit callback: Creates a GD image resource from a file.
*
* @param $image
* An image object. The $image->resource value will populated by this call.
+ *
* @return
* TRUE or FALSE, based on success.
*
+ * @see hook_image_toolkits()
* @see image_load()
*/
function image_gd_load(stdClass $image) {
@@ -238,15 +263,17 @@ function image_gd_load(stdClass $image) {
}
/**
- * GD helper to write an image resource to a destination file.
+ * Image toolkit callback: Writes an image resource to a destination file.
*
* @param $image
* An image object.
* @param $destination
* A string file URI or path where the image should be saved.
+ *
* @return
* TRUE or FALSE, based on success.
*
+ * @see hook_image_toolkits()
* @see image_save()
*/
function image_gd_save(stdClass $image, $destination) {
@@ -287,7 +314,7 @@ function image_gd_save(stdClass $image, $destination) {
}
/**
- * Create a truecolor image preserving transparency from a provided image.
+ * Creates a truecolor image preserving transparency from a provided image.
*
* @param $image
* An image object.
@@ -295,6 +322,7 @@ function image_gd_save(stdClass $image, $destination) {
* The new width of the new image, in pixels.
* @param $height
* The new height of the new image, in pixels.
+ *
* @return
* A GD image handle.
*/
@@ -331,9 +359,11 @@ function image_gd_create_tmp(stdClass $image, $width, $height) {
/**
* Get details about an image.
+ * Image toolkit callback: Retrieves details about an image.
*
* @param $image
* An image object.
+ *
* @return
* FALSE, if the file could not be found or is not an image. Otherwise, a
* keyed array containing information about the image:
@@ -342,6 +372,7 @@ function image_gd_create_tmp(stdClass $image, $width, $height) {
* - "extension": Commonly used file extension for the image.
* - "mime_type": MIME type ('image/jpeg', 'image/gif', 'image/png').
*
+ * @see hook_image_toolkits()
* @see image_get_info()
*/
function image_gd_get_info(stdClass $image) {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
index 88dab0d..c53d225 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/DependencyTest.php
@@ -8,7 +8,7 @@
namespace Drupal\system\Tests\Module;
/**
- * Test module dependency functionality.
+ * Tests module dependency functionality.
*/
class DependencyTest extends ModuleTestBase {
public static function getInfo() {
@@ -20,7 +20,7 @@ class DependencyTest extends ModuleTestBase {
}
/**
- * Attempt to enable translation module without language enabled.
+ * Attempts to enable translation module without language enabled.
*/
function testEnableWithoutDependency() {
// Attempt to enable content translation without language enabled.
@@ -44,7 +44,7 @@ class DependencyTest extends ModuleTestBase {
}
/**
- * Attempt to enable a module with a missing dependency.
+ * Attempts to enable a module with a missing dependency.
*/
function testMissingModules() {
// Test that the system_dependencies_test module is marked
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php
index cbd26b3..f691e7a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php
@@ -8,7 +8,7 @@
namespace Drupal\system\Tests\Module;
/**
- * Test module enabling/disabling functionality.
+ * Tests functionality for enabling and disabling modules.
*/
class EnableDisableTest extends ModuleTestBase {
public static function getInfo() {
@@ -20,7 +20,7 @@ class EnableDisableTest extends ModuleTestBase {
}
/**
- * Test that all core modules can be enabled, disabled and uninstalled.
+ * Tests that all core modules can be enabled, disabled and uninstalled.
*/
function testEnableDisable() {
// Try to enable, disable and uninstall all core modules, unless they are
@@ -168,7 +168,7 @@ class EnableDisableTest extends ModuleTestBase {
/**
* Disables and uninstalls a module and asserts that it was done correctly.
*
- * @param $module
+ * @param string $module
* The name of the module to disable and uninstall.
*/
function assertSuccessfulDisableAndUninstall($module) {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Uuid/UuidUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Uuid/UuidUnitTest.php
index 94a110b..fb5792b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Uuid/UuidUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Uuid/UuidUnitTest.php
@@ -37,7 +37,7 @@ class UuidUnitTest extends UnitTestBase {
}
/**
- * Test generating a UUID.
+ * Tests generating a UUID.
*/
public function testGenerateUuid() {
$uuid = $this->uuid->generate();
@@ -45,7 +45,7 @@ class UuidUnitTest extends UnitTestBase {
}
/**
- * Test that generated UUIDs are unique.
+ * Tests that generated UUIDs are unique.
*/
public function testUuidIsUnique() {
$uuid1 = $this->uuid->generate();
@@ -54,7 +54,7 @@ class UuidUnitTest extends UnitTestBase {
}
/**
- * Test UUID validation.
+ * Tests UUID validation.
*/
function testUuidValidation() {
// These valid UUIDs.
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index f17dcf9..ad6006e 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -2826,6 +2826,13 @@ function hook_install() {
* In order to call a function from your mymodule.module or an include file,
* you need to explicitly load that file first.
*
+ * During database updates the schema of any module could be out of date. For
+ * this reason, caution is needed when using any API function within an update
+ * function - particularly CRUD functions, functions that depend on the schema
+ * (for example by using drupal_write_record()), and any functions that invoke
+ * hooks. See @link update_api Update versions of API functions @endlink for
+ * details.
+ *
* If your update task is potentially time-consuming, you'll need to implement a
* multipass update to avoid PHP timeouts. Multipass updates use the $sandbox
* parameter provided by the batch API (normally, $context['sandbox']) to store
@@ -2851,6 +2858,7 @@ function hook_install() {
*
* @see batch
* @see schemaapi
+ * @see update_api
* @see hook_update_last_removed()
* @see update_get_update_list()
*/
@@ -3956,3 +3964,114 @@ function hook_filetransfer_info_alter(&$filetransfer_info) {
/**
* @} End of "addtogroup hooks".
*/
+
+/**
+ * @defgroup update_api Update versions of API functions
+ * @{
+ * Functions that are similar to normal API functions, but do not invoke hooks.
+ *
+ * These simplified versions of core API functions are provided for use by
+ * update functions (hook_update_N() implementations).
+ *
+ * During database updates the schema of any module could be out of date. For
+ * this reason, caution is needed when using any API function within an update
+ * function - particularly CRUD functions, functions that depend on the schema
+ * (for example by using drupal_write_record()), and any functions that invoke
+ * hooks.
+ *
+ * Instead, a simplified utility function should be used. If a utility version
+ * of the API function you require does not already exist, then you should
+ * create a new function. The new utility function should be named
+ * _update_N_mymodule_my_function(). N is the schema version the function acts
+ * on (the schema version is the number N from the hook_update_N()
+ * implementation where this schema was introduced, or a number following the
+ * same numbering scheme), and mymodule_my_function is the name of the original
+ * API function including the module's name.
+ *
+ * Examples:
+ * - _update_7000_mymodule_save(): This function performs a save operation
+ * without invoking any hooks using the 7.x schema.
+ * - _update_8000_mymodule_save(): This function performs the same save
+ * operation using the 8.x schema.
+ *
+ * The utility function should not invoke any hooks, and should perform database
+ * operations using functions from the
+ * @link database Database abstraction layer, @endlink
+ * like db_insert(), db_update(), db_delete(), db_query(), and so on.
+ *
+ * If a change to the schema necessitates a change to the utility function, a
+ * new function should be created with a name based on the version of the schema
+ * it acts on. See _update_8000_bar_get_types() and _update_8001_bar_get_types()
+ * in the code examples that follow.
+ *
+ * For example, foo.install could contain:
+ * @code
+ * function foo_update_dependencies() {
+ * // foo_update_8010() needs to run after bar_update_8000().
+ * $dependencies['foo'][8010] = array(
+ * 'bar' => 8000,
+ * );
+ *
+ * // foo_update_8036() needs to run after bar_update_8001().
+ * $dependencies['foo'][8036] = array(
+ * 'bar' => 8001,
+ * );
+ *
+ * return $dependencies;
+ * }
+ *
+ * function foo_update_8000() {
+ * // No updates have been run on the {bar_types} table yet, so this needs
+ * // to work with the 7.x schema.
+ * foreach (_update_7000_bar_get_types() as $type) {
+ * // Rename a variable.
+ * }
+ * }
+ *
+ * function foo_update_8010() {
+ * // Since foo_update_8010() is going to run after bar_update_8000(), it
+ * // needs to operate on the new schema, not the old one.
+ * foreach (_update_8000_bar_get_types() as $type) {
+ * // Rename a different variable.
+ * }
+ * }
+ *
+ * function foo_update_8036() {
+ * // This update will run after bar_update_8001().
+ * foreach (_update_8001_bar_get_types() as $type) {
+ * }
+ * }
+ * @endcode
+ *
+ * And bar.install could contain:
+ * @code
+ * function bar_update_8000() {
+ * // Type and bundle are confusing, so we renamed the table.
+ * db_rename_table('bar_types', 'bar_bundles');
+ * }
+ *
+ * function bar_update_8001() {
+ * // Database table names should be singular when possible.
+ * db_rename_table('bar_bundles', 'bar_bundle');
+ * }
+ *
+ * function _update_7000_bar_get_types() {
+ * db_query('SELECT * FROM {bar_types}')->fetchAll();
+ * }
+ *
+ * function _update_8000_bar_get_types() {
+ * db_query('SELECT * FROM {bar_bundles'})->fetchAll();
+ * }
+ *
+ * function _update_8001_bar_get_types() {
+ * db_query('SELECT * FROM {bar_bundle}')->fetchAll();
+ * }
+ * @endcode
+ *
+ * @see hook_update_N()
+ * @see hook_update_dependencies()
+ */
+
+/**
+ * @} End of "defgroup update_api".
+ */
diff --git a/core/modules/tracker/tracker.install b/core/modules/tracker/tracker.install
index 64dd8c4..569f488 100644
--- a/core/modules/tracker/tracker.install
+++ b/core/modules/tracker/tracker.install
@@ -79,6 +79,7 @@ function tracker_schema() {
'uid' => array(
'description' => 'The {users}.uid of the node author or commenter.',
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
@@ -132,6 +133,26 @@ function tracker_update_8000() {
}
/**
+ * Make *id fields unsigned.
+ */
+function tracker_update_8001() {
+ db_drop_primary_key('tracker_user');
+ db_drop_index('tracker_user', 'tracker');
+ db_change_field('tracker_user', 'uid', 'uid',
+ array(
+ 'description' => 'The {users}.uid of the node author or commenter.',
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ ),
+ array('primary key' => array('nid', 'uid'), 'indexes' => array(
+ 'tracker' => array('uid', 'published', 'changed'),
+ ))
+ );
+}
+
+/**
* @} End of "defgroup updates-7.x-to-8.x".
* The next series of updates should start at 9000.
*/
diff --git a/core/modules/user/user.install b/core/modules/user/user.install
index 9d7a4af..422dcfb 100644
--- a/core/modules/user/user.install
+++ b/core/modules/user/user.install
@@ -20,6 +20,7 @@ function user_schema() {
),
'uid' => array(
'type' => 'int',
+ 'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => "User's {users}.uid.",
@@ -568,5 +569,20 @@ function user_update_8007() {
}
/**
+ * Make *id fields unsigned.
+ */
+function user_update_8008() {
+ db_change_field('authmap', 'uid', 'uid',
+ array(
+ 'type' => 'int',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ 'default' => 0,
+ 'description' => "User's {users}.uid.",
+ )
+ );
+}
+
+/**
* @} End of "addtogroup updates-7.x-to-8.x".
*/