diff options
-rw-r--r-- | CHANGELOG.txt | 4 | ||||
-rw-r--r-- | includes/bootstrap.inc | 2 | ||||
-rw-r--r-- | includes/common.inc | 45 | ||||
-rw-r--r-- | includes/database/database.inc | 4 | ||||
-rw-r--r-- | includes/database/schema.inc | 4 | ||||
-rw-r--r-- | includes/entity.inc | 2 | ||||
-rw-r--r-- | includes/xmlrpcs.inc | 4 | ||||
-rw-r--r-- | modules/field/field.crud.inc | 4 | ||||
-rw-r--r-- | modules/field/field.module | 7 | ||||
-rw-r--r-- | modules/field_ui/field_ui.api.php | 3 | ||||
-rw-r--r-- | modules/help/help.api.php | 63 | ||||
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 75 | ||||
-rw-r--r-- | modules/system/system.admin.inc | 6 | ||||
-rw-r--r-- | modules/system/system.api.php | 86 | ||||
-rw-r--r-- | modules/user/user.pages.inc | 7 | ||||
-rw-r--r-- | robots.txt | 4 |
16 files changed, 175 insertions, 145 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f25e25353..8ad68b43e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,7 @@ + +Drupal 7.30, xxxx-xx-xx (development version) +----------------------- + Drupal 7.29, 2014-07-16 ---------------------- - Fixed security issues (multiple vulnerabilities). See SA-CORE-2014-003. diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index d8120cba3..e1b447cfd 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -8,7 +8,7 @@ /** * The current system version. */ -define('VERSION', '7.29'); +define('VERSION', '7.30-dev'); /** * Core API compatibility. diff --git a/includes/common.inc b/includes/common.inc index e1a1673d7..477ecc0e2 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -544,37 +544,32 @@ function drupal_get_destination() { } /** - * Parses a system URL string into an associative array suitable for url(). + * Parses a URL string into its path, query, and fragment components. * - * This function should only be used for URLs that have been generated by the - * system, such as via url(). It should not be used for URLs that come from - * external sources, or URLs that link to external resources. + * This function splits both internal paths like @code node?b=c#d @endcode and + * external URLs like @code https://example.com/a?b=c#d @endcode into their + * component parts. See + * @link http://tools.ietf.org/html/rfc3986#section-3 RFC 3986 @endlink for an + * explanation of what the component parts are. * - * The returned array contains a 'path' that may be passed separately to url(). - * For example: - * @code - * $options = drupal_parse_url($_GET['destination']); - * $my_url = url($options['path'], $options); - * $my_link = l('Example link', $options['path'], $options); - * @endcode + * Note that, unlike the RFC, when passed an external URL, this function + * groups the scheme, authority, and path together into the path component. * - * This is required, because url() does not support relative URLs containing a - * query string or fragment in its $path argument. Instead, any query string - * needs to be parsed into an associative query parameter array in - * $options['query'] and the fragment into $options['fragment']. - * - * @param $url - * The URL string to parse, f.e. $_GET['destination']. + * @param string $url + * The internal path or external URL string to parse. * - * @return - * An associative array containing the keys: - * - 'path': The path of the URL. If the given $url is external, this includes - * the scheme and host. - * - 'query': An array of query parameters of $url, if existent. - * - 'fragment': The fragment of $url, if existent. + * @return array + * An associative array containing: + * - path: The path component of $url. If $url is an external URL, this + * includes the scheme, authority, and path. + * - query: An array of query parameters from $url, if they exist. + * - fragment: The fragment component from $url, if it exists. * - * @see url() * @see drupal_goto() + * @see l() + * @see url() + * @see http://tools.ietf.org/html/rfc3986 + * * @ingroup php_wrappers */ function drupal_parse_url($url) { diff --git a/includes/database/database.inc b/includes/database/database.inc index ad78ac0b6..f78098bc0 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -2832,7 +2832,7 @@ function db_drop_table($table) { * will be set to the value of the key in all rows. This is most useful for * creating NOT NULL columns with no default value in existing tables. * @param $keys_new - * Optional keys and indexes specification to be created on the table along + * (optional) Keys and indexes specification to be created on the table along * with adding the field. The format is the same as a table specification, but * without the 'fields' element. If you are adding a type 'serial' field, you * MUST specify at least one key or index including it in this array. See @@ -3012,7 +3012,7 @@ function db_drop_index($table, $name) { * @param $spec * The field specification for the new field. * @param $keys_new - * Optional keys and indexes specification to be created on the table along + * (optional) Keys and indexes specification to be created on the table along * with changing the field. The format is the same as a table specification * but without the 'fields' element. */ diff --git a/includes/database/schema.inc b/includes/database/schema.inc index d3943b29b..68843a49c 100644 --- a/includes/database/schema.inc +++ b/includes/database/schema.inc @@ -416,7 +416,7 @@ abstract class DatabaseSchema implements QueryPlaceholderInterface { * This is most useful for creating NOT NULL columns with no default * value in existing tables. * @param $keys_new - * Optional keys and indexes specification to be created on the + * (optional) Keys and indexes specification to be created on the * table along with adding the field. The format is the same as a * table specification but without the 'fields' element. If you are * adding a type 'serial' field, you MUST specify at least one key @@ -630,7 +630,7 @@ abstract class DatabaseSchema implements QueryPlaceholderInterface { * @param $spec * The field specification for the new field. * @param $keys_new - * Optional keys and indexes specification to be created on the + * (optional) Keys and indexes specification to be created on the * table along with changing the field. The format is the same as a * table specification but without the 'fields' element. * diff --git a/includes/entity.inc b/includes/entity.inc index dc43e730a..203ed87f9 100644 --- a/includes/entity.inc +++ b/includes/entity.inc @@ -46,7 +46,7 @@ interface DrupalEntityControllerInterface { class DrupalDefaultEntityController implements DrupalEntityControllerInterface { /** - * Static cache of entities. + * Static cache of entities, keyed by entity ID. * * @var array */ diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc index 118f652d2..8655c05b0 100644 --- a/includes/xmlrpcs.inc +++ b/includes/xmlrpcs.inc @@ -9,7 +9,9 @@ * Invokes XML-RPC methods on this server. * * @param array $callbacks - * Array of external XML-RPC method names with the callbacks they map to. + * Either an associative array of external XML-RPC method names as keys with + * the callbacks they map to as values, or a more complex structure + * describing XML-RPC callbacks as returned from hook_xmlrpc(). */ function xmlrpc_server($callbacks) { $xmlrpc_server = new stdClass(); diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc index 83863d6eb..e4486d03f 100644 --- a/modules/field/field.crud.inc +++ b/modules/field/field.crud.inc @@ -540,9 +540,9 @@ function field_create_instance($instance) { * // Fetch an instance info array. * $instance_info = field_info_instance($entity_type, $field_name, $bundle_name); * // Change a single property in the instance definition. - * $instance_info['definition']['required'] = TRUE; + * $instance_info['required'] = TRUE; * // Write the changed definition back. - * field_update_instance($instance_info['definition']); + * field_update_instance($instance_info); * @endcode * * @throws FieldException diff --git a/modules/field/field.module b/modules/field/field.module index 52faf3548..132238ecd 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -961,6 +961,13 @@ function field_has_data($field) { /** * Determine whether the user has access to a given field. * + * This function does not determine whether access is granted to the entity + * itself, only the specific field. Callers are responsible for ensuring that + * entity access is also respected. For example, when checking field access for + * nodes, check node_access() before checking field_access(), and when checking + * field access for entities using the Entity API contributed module, + * check entity_access() before checking field_access(). + * * @param $op * The operation to be performed. Possible values: * - 'edit' diff --git a/modules/field_ui/field_ui.api.php b/modules/field_ui/field_ui.api.php index 05d9f053f..9b80077c7 100644 --- a/modules/field_ui/field_ui.api.php +++ b/modules/field_ui/field_ui.api.php @@ -134,6 +134,9 @@ function hook_field_widget_settings_form($field, $instance) { /** * Specify the form elements for a formatter's settings. * + * This hook is only invoked if hook_field_formatter_settings_summary() + * returns a non-empty value. + * * @param $field * The field structure being configured. * @param $instance diff --git a/modules/help/help.api.php b/modules/help/help.api.php deleted file mode 100644 index f7d9c08b6..000000000 --- a/modules/help/help.api.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -/** - * @file - * Hooks provided by the Help module. - */ - -/** - * @addtogroup hooks - * @{ - */ - -/** - * Provide online user help. - * - * By implementing hook_help(), a module can make documentation available to - * the user for the module as a whole, or for specific paths. Help for - * developers should usually be provided via function header comments in the - * code, or in special API example files. - * - * For a detailed usage example, see page_example.module. - * - * @param $path - * The router menu path, as defined in hook_menu(), for the help that is - * being requested; e.g., 'admin/people' or 'user/register'. If the router - * path includes a wildcard, then this will appear in $path as %, even if it - * is a named %autoloader wildcard in the hook_menu() implementation; for - * example, node pages would have $path equal to 'node/%' or 'node/%/view'. - * To provide a help page for a whole module with a listing on admin/help, - * your hook implementation should match a path with a special descriptor - * after a "#" sign: - * 'admin/help#modulename' - * The main module help text, displayed on the admin/help/modulename - * page and linked to from the admin/help page. - * @param $arg - * An array that corresponds to the return value of the arg() function, for - * modules that want to provide help that is specific to certain values - * of wildcards in $path. For example, you could provide help for the path - * 'user/1' by looking for the path 'user/%' and $arg[1] == '1'. This given - * array should always be used rather than directly invoking arg(), because - * your hook implementation may be called for other purposes besides building - * the current page's help. Note that depending on which module is invoking - * hook_help, $arg may contain only empty strings. Regardless, $arg[0] to - * $arg[11] will always be set. - * - * @return - * A localized string containing the help text. - */ -function hook_help($path, $arg) { - switch ($path) { - // Main module help for the block module - case 'admin/help#block': - return '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/structure/block'))) . '</p>'; - - // Help for another path in the block module - case 'admin/structure/block': - return '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page.') . '</p>'; - } -} - -/** - * @} End of "addtogroup hooks". - */ diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 414a3778d..8022bf325 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -2624,8 +2624,6 @@ class DrupalWebTestCase extends DrupalTestCase { * * @param $label * Text between the anchor tags. - * @param $index - * Link position counting from zero. * @param $message * Message to display. * @param $group @@ -3189,7 +3187,7 @@ class DrupalWebTestCase extends DrupalTestCase { * @param $callback * The name of the theme function to invoke; e.g. 'links' for theme_links(). * @param $variables - * An array of variables to pass to the theme function. + * (optional) An array of variables to pass to the theme function. * @param $expected * The expected themed output string. * @param $message @@ -3225,7 +3223,9 @@ class DrupalWebTestCase extends DrupalTestCase { * @param $xpath * XPath used to find the field. * @param $value - * (optional) Value of the field to assert. + * (optional) Value of the field to assert. You may pass in NULL (default) + * to skip checking the actual value, while still checking that the field + * exists. * @param $message * (optional) Message to display. * @param $group @@ -3293,12 +3293,14 @@ class DrupalWebTestCase extends DrupalTestCase { } /** - * Asserts that a field does not exist in the current page by the given XPath. + * Asserts that a field doesn't exist or its value doesn't match, by XPath. * * @param $xpath * XPath used to find the field. * @param $value - * (optional) Value of the field to assert. + * (optional) Value for the field, to assert that the field's value on the + * page doesn't match it. You may pass in NULL to skip checking the + * value, while still checking that the field doesn't exist. * @param $message * (optional) Message to display. * @param $group @@ -3331,7 +3333,9 @@ class DrupalWebTestCase extends DrupalTestCase { * @param $name * Name of field to assert. * @param $value - * Value of the field to assert. + * (optional) Value of the field to assert. You may pass in NULL (default) + * to skip checking the actual value, while still checking that the field + * exists. * @param $message * Message to display. * @param $group @@ -3362,9 +3366,12 @@ class DrupalWebTestCase extends DrupalTestCase { * @param $name * Name of field to assert. * @param $value - * Value of the field to assert. + * (optional) Value for the field, to assert that the field's value on the + * page doesn't match it. You may pass in NULL to skip checking the + * value, while still checking that the field doesn't exist. However, the + * default value ('') asserts that the field value is not an empty string. * @param $message - * Message to display. + * (optional) Message to display. * @param $group * The group this message belongs to. * @return @@ -3375,14 +3382,17 @@ class DrupalWebTestCase extends DrupalTestCase { } /** - * Asserts that a field exists in the current page with the given id and value. + * Asserts that a field exists in the current page with the given ID and value. * * @param $id - * Id of field to assert. + * ID of field to assert. * @param $value - * Value of the field to assert. + * (optional) Value for the field to assert. You may pass in NULL to skip + * checking the value, while still checking that the field exists. + * However, the default value ('') asserts that the field value is an empty + * string. * @param $message - * Message to display. + * (optional) Message to display. * @param $group * The group this message belongs to. * @return @@ -3393,14 +3403,17 @@ class DrupalWebTestCase extends DrupalTestCase { } /** - * Asserts that a field does not exist with the given id and value. + * Asserts that a field does not exist with the given ID and value. * * @param $id - * Id of field to assert. + * ID of field to assert. * @param $value - * Value of the field to assert. + * (optional) Value for the field, to assert that the field's value on the + * page doesn't match it. You may pass in NULL to skip checking the value, + * while still checking that the field doesn't exist. However, the default + * value ('') asserts that the field value is not an empty string. * @param $message - * Message to display. + * (optional) Message to display. * @param $group * The group this message belongs to. * @return @@ -3414,9 +3427,9 @@ class DrupalWebTestCase extends DrupalTestCase { * Asserts that a checkbox field in the current page is checked. * * @param $id - * Id of field to assert. + * ID of field to assert. * @param $message - * Message to display. + * (optional) Message to display. * @return * TRUE on pass, FALSE on fail. */ @@ -3429,9 +3442,9 @@ class DrupalWebTestCase extends DrupalTestCase { * Asserts that a checkbox field in the current page is not checked. * * @param $id - * Id of field to assert. + * ID of field to assert. * @param $message - * Message to display. + * (optional) Message to display. * @return * TRUE on pass, FALSE on fail. */ @@ -3444,11 +3457,11 @@ class DrupalWebTestCase extends DrupalTestCase { * Asserts that a select option in the current page is checked. * * @param $id - * Id of select field to assert. + * ID of select field to assert. * @param $option * Option to assert. * @param $message - * Message to display. + * (optional) Message to display. * @return * TRUE on pass, FALSE on fail. * @@ -3463,11 +3476,11 @@ class DrupalWebTestCase extends DrupalTestCase { * Asserts that a select option in the current page is not checked. * * @param $id - * Id of select field to assert. + * ID of select field to assert. * @param $option * Option to assert. * @param $message - * Message to display. + * (optional) Message to display. * @return * TRUE on pass, FALSE on fail. */ @@ -3477,12 +3490,12 @@ class DrupalWebTestCase extends DrupalTestCase { } /** - * Asserts that a field exists with the given name or id. + * Asserts that a field exists with the given name or ID. * * @param $field - * Name or id of field to assert. + * Name or ID of field to assert. * @param $message - * Message to display. + * (optional) Message to display. * @param $group * The group this message belongs to. * @return @@ -3493,12 +3506,12 @@ class DrupalWebTestCase extends DrupalTestCase { } /** - * Asserts that a field does not exist with the given name or id. + * Asserts that a field does not exist with the given name or ID. * * @param $field - * Name or id of field to assert. + * Name or ID of field to assert. * @param $message - * Message to display. + * (optional) Message to display. * @param $group * The group this message belongs to. * @return diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index c1e81f0bb..b6f67890d 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -950,7 +950,11 @@ function system_sort_modules_by_info_name($a, $b) { } /** - * Array sorting callback; sorts modules or themes by their name. + * Sorts themes by their names, with the default theme listed first. + * + * Callback for uasort() within system_themes_page(). + * + * @see system_sort_modules_by_info_name(). */ function system_sort_themes($a, $b) { if ($a->is_default) { diff --git a/modules/system/system.api.php b/modules/system/system.api.php index fbcb17348..22175b130 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -2110,6 +2110,61 @@ function hook_permission() { } /** + * Provide online user help. + * + * By implementing hook_help(), a module can make documentation available to + * the user for the module as a whole, or for specific paths. Help for + * developers should usually be provided via function header comments in the + * code, or in special API example files. + * + * The page-specific help information provided by this hook appears as a system + * help block on that page. The module overview help information is displayed + * by the Help module. It can be accessed from the page at admin/help or from + * the Modules page. + * + * For detailed usage examples of: + * - Module overview help, see node_help(). Module overview help should follow + * @link https://drupal.org/node/632280 the standard help template. @endlink + * - Page-specific help with simple paths, see dashboard_help(). + * - Page-specific help using wildcards in path and $arg, see node_help() + * and block_help(). + * + * @param $path + * The router menu path, as defined in hook_menu(), for the help that is + * being requested; e.g., 'admin/people' or 'user/register'. If the router + * path includes a wildcard, then this will appear in $path as %, even if it + * is a named %autoloader wildcard in the hook_menu() implementation; for + * example, node pages would have $path equal to 'node/%' or 'node/%/view'. + * For the help page for the module as a whole, $path will have the value + * 'admin/help#module_name', where 'module_name" is the machine name of your + * module. + * @param $arg + * An array that corresponds to the return value of the arg() function, for + * modules that want to provide help that is specific to certain values + * of wildcards in $path. For example, you could provide help for the path + * 'user/1' by looking for the path 'user/%' and $arg[1] == '1'. This given + * array should always be used rather than directly invoking arg(), because + * your hook implementation may be called for other purposes besides building + * the current page's help. Note that depending on which module is invoking + * hook_help, $arg may contain only empty strings. Regardless, $arg[0] to + * $arg[11] will always be set. + * + * @return + * A localized string containing the help text. + */ +function hook_help($path, $arg) { + switch ($path) { + // Main module help for the block module + case 'admin/help#block': + return '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/structure/block'))) . '</p>'; + + // Help for another path in the block module + case 'admin/structure/block': + return '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page.') . '</p>'; + } +} + +/** * Register a module (or theme's) theme implementations. * * The implementations declared by this hook have two purposes: either they @@ -3371,24 +3426,31 @@ function hook_install() { * 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 - * information between successive calls, and the $sandbox['#finished'] value - * to provide feedback regarding completion level. - * - * See the batch operations page for more information on how to use the - * @link http://drupal.org/node/180528 Batch API. @endlink - * - * @param $sandbox + * The $sandbox parameter should be used when a multipass update is needed, in + * circumstances where running the whole update at once could cause PHP to + * timeout. Each pass is run in a way that avoids PHP timeouts, provided each + * pass remains under the timeout limit. To signify that an update requires + * at least one more pass, set $sandbox['#finished'] to a number less than 1 + * (you need to do this each pass). The value of $sandbox['#finished'] will be + * unset between passes but all other data in $sandbox will be preserved. The + * system will stop iterating this update when $sandbox['#finished'] is left + * unset or set to a number higher than 1. It is recommended that + * $sandbox['#finished'] is initially set to 0, and then updated each pass to a + * number between 0 and 1 that represents the overall % completed for this + * update, finishing with 1. + * + * See the @link batch Batch operations topic @endlink for more information on + * how to use the Batch API. + * + * @param array $sandbox * Stores information for multipass updates. See above for more information. * - * @throws DrupalUpdateException, PDOException + * @throws DrupalUpdateException|PDOException * In case of error, update hooks should throw an instance of DrupalUpdateException * with a meaningful message for the user. If a database query fails for whatever * reason, it will throw a PDOException. * - * @return + * @return string|null * Optionally, update hooks may return a translated string that will be * displayed to the user after the update has completed. If no message is * returned, no message will be presented to the user. diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index 7d40663e7..8ec2348d6 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -183,8 +183,11 @@ function user_logout() { /** * Process variables for user-profile.tpl.php. * - * The $variables array contains the following arguments: - * - $account + * @param array $variables + * An associative array containing: + * - elements: An associative array containing the user information and any + * fields attached to the user. Properties used: + * - #account: The user account of the profile being viewed. * * @see user-profile.tpl.php */ diff --git a/robots.txt b/robots.txt index 7de843560..6f20eaf37 100644 --- a/robots.txt +++ b/robots.txt @@ -11,10 +11,10 @@ # Ignored: http://example.com/site/robots.txt # # For more information about the robots.txt standard, see: -# http://www.robotstxt.org/wc/robots.html +# http://www.robotstxt.org/robotstxt.html # # For syntax checking, see: -# http://www.sxw.org.uk/computing/robots/check.html +# http://www.frobee.com/robots-txt-check User-agent: * Crawl-delay: 10 |