[Pkg-drupal-commits] r2257 - in /branches/upstream/current-7: ./ includes/ includes/database/ includes/database/mysql/ includes/database/pgsql/ includes/database/sqlite/ includes/filetransfer/ misc/ modules/aggregator/ modules/aggregator/tests/ modules/block/ modules/block/tests/ modules/block/tests/themes/ modules/block/tests/themes/block_test_theme/ modules/blog/ modules/book/ modules/color/ modules/comment/ modules/contact/ modules/contextual/ modules/dashboard/ modules/dblog/ modules/field/ modules/field/modules/field_sql_storage/ modules/field/modules/list/ modules/field/modules/list/tests/ modules/field/modules/number/ modules/field/modules/options/ modules/field/modules/text/ modules/field/tests/ modules/field_ui/ modules/file/ modules/file/tests/ modules/filter/ modules/forum/ modules/help/ modules/image/ modules/image/tests/ modules/locale/ modules/locale/tests/ modules/menu/ modules/node/ modules/node/tests/ modules/openid/ modules/openid/tests/ modules/overlay/ modules/path/ modules/php/ modules/poll/ modules/profile/ modules/rdf/ modules/rdf/tests/ modules/search/ modules/search/tests/ modules/shortcut/ modules/simpletest/ modules/simpletest/tests/ modules/simpletest/tests/drupal_system_listing_compatible_test/ modules/simpletest/tests/drupal_system_listing_incompatible_test/ modules/simpletest/tests/themes/ modules/simpletest/tests/themes/test_theme/ modules/simpletest/tests/upgrade/ modules/statistics/ modules/syslog/ modules/system/ modules/taxonomy/ modules/toolbar/ modules/tracker/ modules/translation/ modules/translation/tests/ modules/trigger/ modules/trigger/tests/ modules/update/ modules/update/tests/ modules/update/tests/themes/ modules/update/tests/themes/update_test_basetheme/ modules/update/tests/themes/update_test_subtheme/ modules/user/ modules/user/tests/ profiles/minimal/ profiles/standard/ profiles/testing/ profiles/testing/modules/drupal_system_listing_compatible_test/ profiles/testing/modules/drupal_system_listing_incompatible_test/ scripts/ sites/default/ themes/bartik/ themes/bartik/css/ themes/garland/ themes/seven/ themes/stark/ themes/tests/

luigi at users.alioth.debian.org luigi at users.alioth.debian.org
Sun Feb 5 17:53:09 UTC 2012


Author: luigi
Date: Sun Feb  5 17:53:08 2012
New Revision: 2257

URL: http://svn.debian.org/wsvn/pkg-drupal/?sc=1&rev=2257
Log:
[svn-upgrade] new version drupal7 (7.12)

Added:
    branches/upstream/current-7/includes/json-encode.inc
    branches/upstream/current-7/modules/block/tests/themes/
    branches/upstream/current-7/modules/block/tests/themes/block_test_theme/
    branches/upstream/current-7/modules/block/tests/themes/block_test_theme/block_test_theme.info
    branches/upstream/current-7/modules/block/tests/themes/block_test_theme/page.tpl.php
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.module
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.module
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.module
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.module
    branches/upstream/current-7/modules/simpletest/tests/theme_test.template_test.tpl.php
    branches/upstream/current-7/modules/simpletest/tests/themes/
    branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/
    branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/template.php
    branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/test_theme.info
    branches/upstream/current-7/modules/simpletest/tests/update_script_test.info
    branches/upstream/current-7/modules/simpletest/tests/update_script_test.install
    branches/upstream/current-7/modules/simpletest/tests/update_script_test.module
    branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php
    branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.bare.minimal.database.php.gz   (with props)
    branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.bare.standard_all.database.php.gz   (with props)
    branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.filled.minimal.database.php.gz   (with props)
    branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.filled.standard_all.database.php.gz   (with props)
    branches/upstream/current-7/modules/update/tests/themes/
    branches/upstream/current-7/modules/update/tests/themes/update_test_basetheme/
    branches/upstream/current-7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
    branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/
    branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
    branches/upstream/current-7/scripts/dump-database-d7.sh
    branches/upstream/current-7/scripts/generate-d7-content.sh
    branches/upstream/current-7/scripts/test.script
Removed:
    branches/upstream/current-7/themes/tests/
Modified:
    branches/upstream/current-7/CHANGELOG.txt
    branches/upstream/current-7/INSTALL.mysql.txt
    branches/upstream/current-7/MAINTAINERS.txt
    branches/upstream/current-7/UPGRADE.txt
    branches/upstream/current-7/includes/actions.inc
    branches/upstream/current-7/includes/ajax.inc
    branches/upstream/current-7/includes/archiver.inc
    branches/upstream/current-7/includes/authorize.inc
    branches/upstream/current-7/includes/batch.inc
    branches/upstream/current-7/includes/batch.queue.inc
    branches/upstream/current-7/includes/bootstrap.inc
    branches/upstream/current-7/includes/cache-install.inc
    branches/upstream/current-7/includes/cache.inc
    branches/upstream/current-7/includes/common.inc
    branches/upstream/current-7/includes/database/database.inc
    branches/upstream/current-7/includes/database/mysql/database.inc
    branches/upstream/current-7/includes/database/pgsql/database.inc
    branches/upstream/current-7/includes/database/query.inc
    branches/upstream/current-7/includes/database/select.inc
    branches/upstream/current-7/includes/database/sqlite/database.inc
    branches/upstream/current-7/includes/file.inc
    branches/upstream/current-7/includes/filetransfer/filetransfer.inc
    branches/upstream/current-7/includes/form.inc
    branches/upstream/current-7/includes/graph.inc
    branches/upstream/current-7/includes/image.inc
    branches/upstream/current-7/includes/install.core.inc
    branches/upstream/current-7/includes/install.inc
    branches/upstream/current-7/includes/iso.inc
    branches/upstream/current-7/includes/locale.inc
    branches/upstream/current-7/includes/mail.inc
    branches/upstream/current-7/includes/menu.inc
    branches/upstream/current-7/includes/module.inc
    branches/upstream/current-7/includes/password.inc
    branches/upstream/current-7/includes/path.inc
    branches/upstream/current-7/includes/registry.inc
    branches/upstream/current-7/includes/stream_wrappers.inc
    branches/upstream/current-7/includes/theme.inc
    branches/upstream/current-7/includes/token.inc
    branches/upstream/current-7/includes/update.inc
    branches/upstream/current-7/includes/updater.inc
    branches/upstream/current-7/includes/utility.inc
    branches/upstream/current-7/includes/xmlrpc.inc
    branches/upstream/current-7/includes/xmlrpcs.inc
    branches/upstream/current-7/misc/ajax.js
    branches/upstream/current-7/misc/authorize.js
    branches/upstream/current-7/misc/autocomplete.js
    branches/upstream/current-7/misc/drupal.js
    branches/upstream/current-7/modules/aggregator/aggregator-feed-source.tpl.php
    branches/upstream/current-7/modules/aggregator/aggregator-item.tpl.php
    branches/upstream/current-7/modules/aggregator/aggregator-summary-item.tpl.php
    branches/upstream/current-7/modules/aggregator/aggregator-summary-items.tpl.php
    branches/upstream/current-7/modules/aggregator/aggregator-wrapper.tpl.php
    branches/upstream/current-7/modules/aggregator/aggregator.admin.inc
    branches/upstream/current-7/modules/aggregator/aggregator.api.php
    branches/upstream/current-7/modules/aggregator/aggregator.info
    branches/upstream/current-7/modules/aggregator/aggregator.module
    branches/upstream/current-7/modules/aggregator/aggregator.pages.inc
    branches/upstream/current-7/modules/aggregator/aggregator.parser.inc
    branches/upstream/current-7/modules/aggregator/aggregator.processor.inc
    branches/upstream/current-7/modules/aggregator/aggregator.test
    branches/upstream/current-7/modules/aggregator/tests/aggregator_test.info
    branches/upstream/current-7/modules/block/block-admin-display-form.tpl.php
    branches/upstream/current-7/modules/block/block.admin.inc
    branches/upstream/current-7/modules/block/block.info
    branches/upstream/current-7/modules/block/block.module
    branches/upstream/current-7/modules/block/block.test
    branches/upstream/current-7/modules/block/block.tpl.php
    branches/upstream/current-7/modules/block/tests/block_test.info
    branches/upstream/current-7/modules/block/tests/block_test.module
    branches/upstream/current-7/modules/blog/blog.info
    branches/upstream/current-7/modules/book/book.info
    branches/upstream/current-7/modules/color/color-rtl.css
    branches/upstream/current-7/modules/color/color.css
    branches/upstream/current-7/modules/color/color.info
    branches/upstream/current-7/modules/color/color.js
    branches/upstream/current-7/modules/color/color.module
    branches/upstream/current-7/modules/color/color.test
    branches/upstream/current-7/modules/color/preview.js
    branches/upstream/current-7/modules/comment/comment.info
    branches/upstream/current-7/modules/comment/comment.install
    branches/upstream/current-7/modules/comment/comment.module
    branches/upstream/current-7/modules/comment/comment.test
    branches/upstream/current-7/modules/contact/contact.admin.inc
    branches/upstream/current-7/modules/contact/contact.info
    branches/upstream/current-7/modules/contact/contact.module
    branches/upstream/current-7/modules/contact/contact.pages.inc
    branches/upstream/current-7/modules/contact/contact.test
    branches/upstream/current-7/modules/contextual/contextual-rtl.css
    branches/upstream/current-7/modules/contextual/contextual.css
    branches/upstream/current-7/modules/contextual/contextual.info
    branches/upstream/current-7/modules/contextual/contextual.js
    branches/upstream/current-7/modules/contextual/contextual.module
    branches/upstream/current-7/modules/dashboard/dashboard.info
    branches/upstream/current-7/modules/dblog/dblog.info
    branches/upstream/current-7/modules/field/field.api.php
    branches/upstream/current-7/modules/field/field.attach.inc
    branches/upstream/current-7/modules/field/field.crud.inc
    branches/upstream/current-7/modules/field/field.info
    branches/upstream/current-7/modules/field/field.info.inc
    branches/upstream/current-7/modules/field/field.multilingual.inc
    branches/upstream/current-7/modules/field/modules/field_sql_storage/field_sql_storage.info
    branches/upstream/current-7/modules/field/modules/list/list.info
    branches/upstream/current-7/modules/field/modules/list/tests/list_test.info
    branches/upstream/current-7/modules/field/modules/number/number.info
    branches/upstream/current-7/modules/field/modules/options/options.info
    branches/upstream/current-7/modules/field/modules/text/text.info
    branches/upstream/current-7/modules/field/tests/field.test
    branches/upstream/current-7/modules/field/tests/field_test.entity.inc
    branches/upstream/current-7/modules/field/tests/field_test.field.inc
    branches/upstream/current-7/modules/field/tests/field_test.info
    branches/upstream/current-7/modules/field/tests/field_test.module
    branches/upstream/current-7/modules/field_ui/field_ui-rtl.css
    branches/upstream/current-7/modules/field_ui/field_ui.admin.inc
    branches/upstream/current-7/modules/field_ui/field_ui.api.php
    branches/upstream/current-7/modules/field_ui/field_ui.css
    branches/upstream/current-7/modules/field_ui/field_ui.info
    branches/upstream/current-7/modules/field_ui/field_ui.js
    branches/upstream/current-7/modules/field_ui/field_ui.module
    branches/upstream/current-7/modules/field_ui/field_ui.test
    branches/upstream/current-7/modules/file/file.api.php
    branches/upstream/current-7/modules/file/file.css
    branches/upstream/current-7/modules/file/file.field.inc
    branches/upstream/current-7/modules/file/file.info
    branches/upstream/current-7/modules/file/file.module
    branches/upstream/current-7/modules/file/tests/file.test
    branches/upstream/current-7/modules/file/tests/file_module_test.info
    branches/upstream/current-7/modules/file/tests/file_module_test.module
    branches/upstream/current-7/modules/filter/filter.info
    branches/upstream/current-7/modules/forum/forum.info
    branches/upstream/current-7/modules/forum/forum.module
    branches/upstream/current-7/modules/help/help.admin.inc
    branches/upstream/current-7/modules/help/help.api.php
    branches/upstream/current-7/modules/help/help.info
    branches/upstream/current-7/modules/help/help.test
    branches/upstream/current-7/modules/image/image.effects.inc
    branches/upstream/current-7/modules/image/image.field.inc
    branches/upstream/current-7/modules/image/image.info
    branches/upstream/current-7/modules/image/image.install
    branches/upstream/current-7/modules/image/image.test
    branches/upstream/current-7/modules/image/tests/image_module_test.info
    branches/upstream/current-7/modules/locale/locale.info
    branches/upstream/current-7/modules/locale/locale.module
    branches/upstream/current-7/modules/locale/locale.test
    branches/upstream/current-7/modules/locale/tests/locale_test.info
    branches/upstream/current-7/modules/locale/tests/locale_test.js
    branches/upstream/current-7/modules/menu/menu.admin.inc
    branches/upstream/current-7/modules/menu/menu.admin.js
    branches/upstream/current-7/modules/menu/menu.info
    branches/upstream/current-7/modules/menu/menu.install
    branches/upstream/current-7/modules/menu/menu.js
    branches/upstream/current-7/modules/menu/menu.module
    branches/upstream/current-7/modules/menu/menu.test
    branches/upstream/current-7/modules/node/node.api.php
    branches/upstream/current-7/modules/node/node.info
    branches/upstream/current-7/modules/node/node.module
    branches/upstream/current-7/modules/node/node.test
    branches/upstream/current-7/modules/node/tests/node_access_test.info
    branches/upstream/current-7/modules/node/tests/node_access_test.module
    branches/upstream/current-7/modules/node/tests/node_test.info
    branches/upstream/current-7/modules/node/tests/node_test_exception.info
    branches/upstream/current-7/modules/openid/openid.info
    branches/upstream/current-7/modules/openid/tests/openid_test.info
    branches/upstream/current-7/modules/overlay/overlay-child-rtl.css
    branches/upstream/current-7/modules/overlay/overlay-parent.js
    branches/upstream/current-7/modules/overlay/overlay.info
    branches/upstream/current-7/modules/overlay/overlay.module
    branches/upstream/current-7/modules/path/path.info
    branches/upstream/current-7/modules/php/php.info
    branches/upstream/current-7/modules/php/php.module
    branches/upstream/current-7/modules/php/php.test
    branches/upstream/current-7/modules/poll/poll.info
    branches/upstream/current-7/modules/poll/poll.module
    branches/upstream/current-7/modules/poll/poll.test
    branches/upstream/current-7/modules/profile/profile.info
    branches/upstream/current-7/modules/profile/profile.module
    branches/upstream/current-7/modules/profile/profile.test
    branches/upstream/current-7/modules/rdf/rdf.info
    branches/upstream/current-7/modules/rdf/rdf.module
    branches/upstream/current-7/modules/rdf/tests/rdf_test.info
    branches/upstream/current-7/modules/search/search.api.php
    branches/upstream/current-7/modules/search/search.extender.inc
    branches/upstream/current-7/modules/search/search.info
    branches/upstream/current-7/modules/search/search.module
    branches/upstream/current-7/modules/search/search.test
    branches/upstream/current-7/modules/search/tests/search_embedded_form.info
    branches/upstream/current-7/modules/search/tests/search_extra_type.info
    branches/upstream/current-7/modules/shortcut/shortcut.admin.js
    branches/upstream/current-7/modules/shortcut/shortcut.info
    branches/upstream/current-7/modules/simpletest/drupal_web_test_case.php
    branches/upstream/current-7/modules/simpletest/simpletest.info
    branches/upstream/current-7/modules/simpletest/simpletest.module
    branches/upstream/current-7/modules/simpletest/simpletest.pages.inc
    branches/upstream/current-7/modules/simpletest/simpletest.test
    branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.info
    branches/upstream/current-7/modules/simpletest/tests/ajax.test
    branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.info
    branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.module
    branches/upstream/current-7/modules/simpletest/tests/ajax_test.info
    branches/upstream/current-7/modules/simpletest/tests/batch_test.info
    branches/upstream/current-7/modules/simpletest/tests/bootstrap.test
    branches/upstream/current-7/modules/simpletest/tests/common.test
    branches/upstream/current-7/modules/simpletest/tests/common_test.info
    branches/upstream/current-7/modules/simpletest/tests/common_test.module
    branches/upstream/current-7/modules/simpletest/tests/common_test_cron_helper.info
    branches/upstream/current-7/modules/simpletest/tests/database_test.info
    branches/upstream/current-7/modules/simpletest/tests/database_test.test
    branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
    branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
    branches/upstream/current-7/modules/simpletest/tests/entity_cache_test.info
    branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.info
    branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.module
    branches/upstream/current-7/modules/simpletest/tests/entity_crud_hook_test.info
    branches/upstream/current-7/modules/simpletest/tests/entity_query.test
    branches/upstream/current-7/modules/simpletest/tests/error_test.info
    branches/upstream/current-7/modules/simpletest/tests/file.test
    branches/upstream/current-7/modules/simpletest/tests/file_test.info
    branches/upstream/current-7/modules/simpletest/tests/file_test.module
    branches/upstream/current-7/modules/simpletest/tests/filter_test.info
    branches/upstream/current-7/modules/simpletest/tests/form.test
    branches/upstream/current-7/modules/simpletest/tests/form_test.info
    branches/upstream/current-7/modules/simpletest/tests/form_test.module
    branches/upstream/current-7/modules/simpletest/tests/image_test.info
    branches/upstream/current-7/modules/simpletest/tests/mail.test
    branches/upstream/current-7/modules/simpletest/tests/menu_test.info
    branches/upstream/current-7/modules/simpletest/tests/module_test.info
    branches/upstream/current-7/modules/simpletest/tests/path.test
    branches/upstream/current-7/modules/simpletest/tests/requirements1_test.info
    branches/upstream/current-7/modules/simpletest/tests/requirements2_test.info
    branches/upstream/current-7/modules/simpletest/tests/session_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_dependencies_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_test.module
    branches/upstream/current-7/modules/simpletest/tests/taxonomy_test.info
    branches/upstream/current-7/modules/simpletest/tests/theme.test
    branches/upstream/current-7/modules/simpletest/tests/theme_test.info
    branches/upstream/current-7/modules/simpletest/tests/theme_test.module
    branches/upstream/current-7/modules/simpletest/tests/unicode.test
    branches/upstream/current-7/modules/simpletest/tests/update_test_1.info
    branches/upstream/current-7/modules/simpletest/tests/update_test_2.info
    branches/upstream/current-7/modules/simpletest/tests/update_test_3.info
    branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.node.test
    branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.test
    branches/upstream/current-7/modules/simpletest/tests/url_alter_test.info
    branches/upstream/current-7/modules/simpletest/tests/url_alter_test.module
    branches/upstream/current-7/modules/simpletest/tests/xmlrpc_test.info
    branches/upstream/current-7/modules/statistics/statistics.info
    branches/upstream/current-7/modules/statistics/statistics.module
    branches/upstream/current-7/modules/statistics/statistics.test
    branches/upstream/current-7/modules/syslog/syslog.info
    branches/upstream/current-7/modules/syslog/syslog.module
    branches/upstream/current-7/modules/system/system.admin.inc
    branches/upstream/current-7/modules/system/system.api.php
    branches/upstream/current-7/modules/system/system.base.css
    branches/upstream/current-7/modules/system/system.info
    branches/upstream/current-7/modules/system/system.install
    branches/upstream/current-7/modules/system/system.mail.inc
    branches/upstream/current-7/modules/system/system.module
    branches/upstream/current-7/modules/system/system.queue.inc
    branches/upstream/current-7/modules/system/system.test
    branches/upstream/current-7/modules/taxonomy/taxonomy.info
    branches/upstream/current-7/modules/taxonomy/taxonomy.module
    branches/upstream/current-7/modules/taxonomy/taxonomy.pages.inc
    branches/upstream/current-7/modules/taxonomy/taxonomy.test
    branches/upstream/current-7/modules/toolbar/toolbar.info
    branches/upstream/current-7/modules/toolbar/toolbar.module
    branches/upstream/current-7/modules/tracker/tracker.info
    branches/upstream/current-7/modules/tracker/tracker.test
    branches/upstream/current-7/modules/translation/tests/translation_test.info
    branches/upstream/current-7/modules/translation/translation.info
    branches/upstream/current-7/modules/trigger/tests/trigger_test.info
    branches/upstream/current-7/modules/trigger/trigger.info
    branches/upstream/current-7/modules/update/tests/aaa_update_test.info
    branches/upstream/current-7/modules/update/tests/bbb_update_test.info
    branches/upstream/current-7/modules/update/tests/ccc_update_test.info
    branches/upstream/current-7/modules/update/tests/update_test.info
    branches/upstream/current-7/modules/update/tests/update_test.module
    branches/upstream/current-7/modules/update/update.info
    branches/upstream/current-7/modules/update/update.manager.inc
    branches/upstream/current-7/modules/update/update.module
    branches/upstream/current-7/modules/user/tests/user_form_test.info
    branches/upstream/current-7/modules/user/user.info
    branches/upstream/current-7/modules/user/user.install
    branches/upstream/current-7/modules/user/user.js
    branches/upstream/current-7/modules/user/user.module
    branches/upstream/current-7/profiles/minimal/minimal.info
    branches/upstream/current-7/profiles/standard/standard.info
    branches/upstream/current-7/profiles/standard/standard.install
    branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
    branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
    branches/upstream/current-7/profiles/testing/testing.info
    branches/upstream/current-7/scripts/run-tests.sh
    branches/upstream/current-7/sites/default/default.settings.php
    branches/upstream/current-7/themes/bartik/bartik.info
    branches/upstream/current-7/themes/bartik/css/style-rtl.css
    branches/upstream/current-7/themes/garland/garland.info
    branches/upstream/current-7/themes/seven/maintenance-page.tpl.php
    branches/upstream/current-7/themes/seven/page.tpl.php
    branches/upstream/current-7/themes/seven/seven.info
    branches/upstream/current-7/themes/seven/style.css
    branches/upstream/current-7/themes/stark/stark.info
    branches/upstream/current-7/update.php

Modified: branches/upstream/current-7/CHANGELOG.txt
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/CHANGELOG.txt?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/CHANGELOG.txt (original)
+++ branches/upstream/current-7/CHANGELOG.txt Sun Feb  5 17:53:08 2012
@@ -1,3 +1,40 @@
+
+Drupal 7.13 xxxx-xx-xx (development version)
+----------------------
+
+Drupal 7.12, 2012-02-01
+----------------------
+- Fixed bug preventing custom menus from receiving an active trail.
+- Fixed hook_field_delete() no longer invoked during field_purge_data().
+- Fixed bug causing entity info cache to not be cleared with the rest of caches.
+- Fixed file_unmanaged_copy() fails with Drupal 7.7+ and safe_mode() or
+  open_basedir().
+- Fixed Nested transactions throw exceptions when they got out of scope.
+- Fixed bugs with the Return-Path when sending mail on both Windows and
+  non-Windows systems.
+- Fixed bug with DrupalCacheArray property visibility preventing others from
+  extending it (API change: http://drupal.org/node/1422264).
+- Fixed bug with handling of non-ASCII characters in file names (API change:
+  http://drupal.org/node/1424840).
+- Reconciled field maximum length with database column size in image and
+  aggregator modules.
+- Fixes to various core JavaScript files to allow for minification and
+  aggregation.
+- Fixed Prevent tests from deleting main installation's tables when
+  parent::setUp() is not called.
+- Fixed several Poll module bugs.
+- Fixed several Shortcut module bugs.
+- Added new hook_system_theme_info() to provide ability for contributed modules
+  to test theme functionality.
+- Added ability to cancel mail sending from hook_mail_alter().
+- Added support for configurable PDO connection options, enabling master-master
+  database replication.
+- Numerous improvements to tests and test runner to pave the way for faster test
+  runs.
+- Expanded test coverage.
+- Numerous API documentation improvements.
+- Numerous performance improvements, including token replacement and render
+  cache.
 
 Drupal 7.11, 2012-02-01
 ----------------------

Modified: branches/upstream/current-7/INSTALL.mysql.txt
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/INSTALL.mysql.txt?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/INSTALL.mysql.txt (original)
+++ branches/upstream/current-7/INSTALL.mysql.txt Sun Feb  5 17:53:08 2012
@@ -18,7 +18,7 @@
   mysql -u username -p
 
 Again, you will be asked for the 'username' database password. At the MySQL
-prompt, enter following command:
+prompt, enter the following command:
 
   GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER
   ON databasename.*

Modified: branches/upstream/current-7/MAINTAINERS.txt
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/MAINTAINERS.txt?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/MAINTAINERS.txt (original)
+++ branches/upstream/current-7/MAINTAINERS.txt Sun Feb  5 17:53:08 2012
@@ -1,22 +1,25 @@
 
-Drupal core is maintained by the community.  To participate, go to
-
-  http://drupal.org/contribute
-
-The people listed here have agreed to do more quality assurance work for
-particular areas of Drupal.  All of them are subject to change.
-
+Drupal core is built and maintained by the Drupal project community. Everyone is
+encouraged to submit issues and changes (patches) to improve Drupal, and to
+contribute in other ways -- see http://drupal.org/contribute to find out how.
 
 Branch maintainers
 ------------------
 
-Drupal 7
+The Drupal Core branch maintainers oversee the development of Drupal as a whole.
+The branch maintainers for Drupal 7 are:
+
 - Dries Buytaert 'dries' <http://drupal.org/user/1>
 - Angela Byron 'webchick' <http://drupal.org/user/24967>
 
 
 Component maintainers
 ---------------------
+
+The Drupal Core component maintainers oversee the development of Drupal
+subsystems. See http://drupal.org/contribute/core-maintainers for more
+information on their responsibilities, and to find out how to become a component
+maintainer. Current component maintainers for Drupal 7:
 
 Ajax system
 - Alex Bronstein 'effulgentsia' <http://drupal.org/user/78040>
@@ -130,7 +133,6 @@
 - Brandon Bowersox 'brandonojc' <http://drupal.org/user/186415> 
 
 Documentation
-- Ariane Khachatourians 'arianek' <http://drupal.org/user/158886>
 - Jennifer Hodgdon 'jhodgdon' <http://drupal.org/user/155601>
 
 Security
@@ -254,6 +256,7 @@
 - ?
 
 Taxonomy module
+- Jess Myrbo 'xjm' <http://drupal.org/user/65776>
 - Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
 - Benjamin Doherty 'bangpound' <http://drupal.org/user/100456>
 

Modified: branches/upstream/current-7/UPGRADE.txt
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/UPGRADE.txt?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/UPGRADE.txt (original)
+++ branches/upstream/current-7/UPGRADE.txt Sun Feb  5 17:53:08 2012
@@ -141,15 +141,19 @@
    download Drupal 6.x and follow the instructions in its UPGRADE.txt. This
    document only applies for upgrades from 6.x to 7.x.
 
-3. Log in as user ID 1 (the site maintenance user).
-
-4. Go to Administer > Site configuration > Site maintenance. Select
+3. In addition to updating to the latest available version of Drupal 7.x core,
+   you must also upgrade all of your contributed modules for Drupal to their
+   latest Drupal 6.x versions.
+
+4. Log in as user ID 1 (the site maintenance user).
+
+5. Go to Administer > Site configuration > Site maintenance. Select
    "Off-line" and save the configuration.
 
-5. Go to Administer > Site building > Themes. Enable "Garland" and select it as
+6. Go to Administer > Site building > Themes. Enable "Garland" and select it as
    the default theme.
 
-6. Go to Administer > Site building > Modules. Disable all modules that are not
+7. Go to Administer > Site building > Modules. Disable all modules that are not
    listed under "Core - required" or "Core - optional". It is possible that some
    modules cannot be disabled, because others depend on them. Repeat this step
    until all non-core modules are disabled.
@@ -158,21 +162,21 @@
    no longer need their data, then you can uninstall them under the Uninstall
    tab after disabling them.
 
-7. On the command line or in your FTP client, remove the file
+8. On the command line or in your FTP client, remove the file
 
      sites/default/default.settings.php
 
-8. Remove all old core files and directories, except for the 'sites' directory
+9. Remove all old core files and directories, except for the 'sites' directory
    and any custom files you added elsewhere.
 
    If you made modifications to files like .htaccess or robots.txt, you will
    need to re-apply them from your backup, after the new files are in place.
 
-9. If you uninstalled any modules, remove them from the sites/all/modules and
+10. If you uninstalled any modules, remove them from the sites/all/modules and
    other sites/*/modules directories. Leave other modules in place, even though
    they are incompatible with Drupal 7.x.
 
-10. Download the latest Drupal 7.x release from http://drupal.org to a
+11. Download the latest Drupal 7.x release from http://drupal.org to a
    directory outside of your web root. Extract the archive and copy the files
    into your Drupal directory.
 
@@ -191,14 +195,14 @@
    from http://drupal.org using your web browser, extract it, and then use an
    FTP client to upload the files to your web root.
 
-11. Re-apply any modifications to files such as .htaccess or robots.txt.
-
-12. Make your settings.php file writeable, so that the update process can
+12. Re-apply any modifications to files such as .htaccess or robots.txt.
+
+13. Make your settings.php file writeable, so that the update process can
    convert it to the format of Drupal 7.x. settings.php is usually located in
 
      sites/default/settings.php
 
-13. Run update.php by visiting http://www.example.com/update.php (replace
+14. Run update.php by visiting http://www.example.com/update.php (replace
    www.example.com with your domain name). This will update the core database
    tables.
 
@@ -214,17 +218,17 @@
 
    - Once the upgrade is done, $update_free_access must be reverted to FALSE.
 
-14. Backup your database after the core upgrade has run.
-
-15. Replace and update your non-core modules and themes, following the
+15. Backup your database after the core upgrade has run.
+
+16. Replace and update your non-core modules and themes, following the
    procedures at http://drupal.org/node/948216
 
-16. Go to Administration > Reports > Status report. Verify that everything is
+17. Go to Administration > Reports > Status report. Verify that everything is
    working as expected.
 
-17. Ensure that $update_free_access is FALSE in settings.php.
-
-18. Go to Administration > Configuration > Development > Maintenance mode.
+18. Ensure that $update_free_access is FALSE in settings.php.
+
+19. Go to Administration > Configuration > Development > Maintenance mode.
    Disable the "Put site into maintenance mode" checkbox and save the
    configuration.
 

Modified: branches/upstream/current-7/includes/actions.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/actions.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/actions.inc (original)
+++ branches/upstream/current-7/includes/actions.inc Sun Feb  5 17:53:08 2012
@@ -22,7 +22,7 @@
  * - $a1, $a2: Optional additional information, which can be passed into
  *   actions_do() and will be passed along to the action function.
  *
- * @} End of "defgroup actions".
+ * @}
  */
 
 /**
@@ -48,6 +48,7 @@
  *   Passed along to the callback.
  * @param $a2
  *   Passed along to the callback.
+ *
  * @return
  *   An associative array containing the results of the functions that
  *   perform the actions, keyed on action ID.
@@ -149,6 +150,7 @@
  *
  * @param $reset
  *   Reset the action info static cache.
+ *
  * @return
  *   An associative array keyed on action function name, with the same format
  *   as the return value of hook_action_info(), containing all
@@ -176,9 +178,9 @@
  * function and the actions returned by actions_list() are partially
  * synchronized. Non-configurable actions from hook_action_info()
  * implementations are put into the database when actions_synchronize() is
- * called, which happens when admin/config/system/actions is visited. Configurable
- * actions are not added to the database until they are configured in the
- * user interface, in which case a database row is created for each
+ * called, which happens when admin/config/system/actions is visited.
+ * Configurable actions are not added to the database until they are configured
+ * in the user interface, in which case a database row is created for each
  * configuration of each action.
  *
  * @return
@@ -205,6 +207,7 @@
  *   An associative array with function names or action IDs as keys
  *   and associative arrays with keys 'label', 'type', etc. as values.
  *   This is usually the output of actions_list() or actions_get_all_actions().
+ *
  * @return
  *   An associative array whose keys are hashes of the input array keys, and
  *   whose corresponding values are associative arrays with components
@@ -223,7 +226,7 @@
 }
 
 /**
- * Given a hash of an action array key, returns the key (function or ID).
+ * Returns an action array key (function or ID), given its hash.
  *
  * Faster than actions_actions_map() when you only need the function name or ID.
  *
@@ -231,6 +234,7 @@
  *   Hash of a function name or action ID array key. The array key
  *   is a key into the return value of actions_list() (array key is the action
  *   function name) or actions_get_all_actions() (array key is the action ID).
+ *
  * @return
  *   The corresponding array key, or FALSE if no match is found.
  */
@@ -332,6 +336,7 @@
  *   to Jim'.
  * @param $aid
  *   The ID of this action. If omitted, a new action is created.
+ *
  * @return
  *   The ID of the action.
  */
@@ -361,6 +366,7 @@
  *
  * @param $aid
  *   The ID of the action to retrieve.
+ *
  * @return
  *   The appropriate action row from the database as an object.
  */
@@ -380,4 +386,3 @@
     ->execute();
   module_invoke_all('actions_delete', $aid);
 }
-

Modified: branches/upstream/current-7/includes/ajax.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/ajax.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/ajax.inc (original)
+++ branches/upstream/current-7/includes/ajax.inc Sun Feb  5 17:53:08 2012
@@ -24,7 +24,8 @@
  * ajax_form_callback() and a defined #ajax['callback'] function.
  * However, you may optionally specify a different path to request or a
  * different callback function to invoke, which can return updated HTML or can
- * also return a richer set of @link ajax_commands Ajax framework commands @endlink.
+ * also return a richer set of
+ * @link ajax_commands Ajax framework commands @endlink.
  *
  * Standard form handling is as follows:
  *   - A form element has a #ajax property that includes #ajax['callback'] and
@@ -101,7 +102,7 @@
  * In the above example, the 'changethis' element is Ajax-enabled. The default
  * #ajax['event'] is 'change', so when the 'changethis' element changes,
  * an Ajax call is made. The form is submitted and reprocessed, and then the
- * callback is called.  In this case, the form has been automatically
+ * callback is called. In this case, the form has been automatically
  * built changing $form['replace_textfield']['#description'], so the callback
  * just returns that part of the form.
  *
@@ -188,11 +189,11 @@
  * be converted to a JSON object and returned to the client, which will then
  * iterate over the array and process it like a macro language.
  *
- * Each command item is an associative array which will be converted to a command
- * object on the JavaScript side. $command_item['command'] is the type of
- * command, e.g. 'alert' or 'replace', and will correspond to a method in the
- * Drupal.ajax[command] space. The command array may contain any other data
- * that the command needs to process, e.g. 'method', 'selector', 'settings', etc.
+ * Each command item is an associative array which will be converted to a
+ * command object on the JavaScript side. $command_item['command'] is the type
+ * of command, e.g. 'alert' or 'replace', and will correspond to a method in the
+ * Drupal.ajax[command] space. The command array may contain any other data that
+ * the command needs to process, e.g. 'method', 'selector', 'settings', etc.
  *
  * Commands are usually created with a couple of helper functions, so they
  * look like this:
@@ -222,7 +223,7 @@
  */
 
 /**
- * Render a commands array into JSON.
+ * Renders a commands array into JSON.
  *
  * @param $commands
  *   A list of macro commands generated by the use of ajax_command_*()
@@ -262,19 +263,13 @@
     }
   }
 
-  // Settings are handled separately, later in this function, so that changes to
-  // the ajaxPageState setting that occur during drupal_get_css() and
-  // drupal_get_js() get included, and because the jQuery.extend() code produced
-  // by drupal_get_js() for adding settings isn't appropriate during an Ajax
-  // response, because it does not pass TRUE for the "deep" parameter, and
-  // therefore, can clobber existing settings on the page.
+  // Render the HTML to load these files, and add AJAX commands to insert this
+  // HTML in the page. We pass TRUE as the $skip_alter argument to prevent the
+  // data from being altered again, as we already altered it above. Settings are
+  // handled separately, afterwards.
   if (isset($items['js']['settings'])) {
     unset($items['js']['settings']);
   }
-
-  // Render the HTML to load these files, and add Ajax commands to insert this
-  // HTML in the page. We pass TRUE as the $skip_alter argument to prevent the
-  // data from being altered again, as we already altered it above.
   $styles = drupal_get_css($items['css'], TRUE);
   $scripts_footer = drupal_get_js('footer', $items['js'], TRUE);
   $scripts_header = drupal_get_js('header', $items['js'], TRUE);
@@ -293,11 +288,10 @@
     $commands = array_merge($extra_commands, $commands);
   }
 
+  // Now add a command to merge changes and additions to Drupal.settings.
   $scripts = drupal_add_js();
   if (!empty($scripts['settings'])) {
     $settings = $scripts['settings'];
-    // Automatically extract any settings added via drupal_add_js() and make
-    // them the first command.
     array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $settings['data']), TRUE));
   }
 
@@ -308,7 +302,7 @@
 }
 
 /**
- * Get a form submitted via #ajax during an Ajax callback.
+ * Gets a form submitted via #ajax during an Ajax callback.
  *
  * This will load a form from the form cache used during Ajax operations. It
  * pulls the form info from $_POST.
@@ -368,6 +362,8 @@
  * #ajax['path']. If processing is required that cannot be accomplished with
  * a callback, re-implement this function and set #ajax['path'] to the
  * enhanced function.
+ *
+ * @see system_menu()
  */
 function ajax_form_callback() {
   list($form, $form_state) = ajax_get_form();
@@ -403,6 +399,9 @@
  * of the page. Therefore, system_menu() sets the 'theme callback' for
  * 'system/ajax' to this function, and it is recommended that modules
  * implementing other generic Ajax paths do the same.
+ *
+ * @see system_menu()
+ * @see file_menu()
  */
 function ajax_base_page_theme() {
   if (!empty($_POST['ajax_page_state']['theme']) && !empty($_POST['ajax_page_state']['theme_token'])) {
@@ -421,7 +420,7 @@
 }
 
 /**
- * Package and send the result of a page callback to the browser as an Ajax response.
+ * Packages and sends the result of a page callback as an Ajax response.
  *
  * This function is the equivalent of drupal_deliver_html_page(), but for Ajax
  * requests. Like that function, it:
@@ -554,7 +553,7 @@
 }
 
 /**
- * Perform end-of-Ajax-request tasks.
+ * Performs end-of-Ajax-request tasks.
  *
  * This function is the equivalent of drupal_page_footer(), but for Ajax
  * requests.
@@ -577,7 +576,7 @@
 }
 
 /**
- * Form element process callback to handle #ajax.
+ * Form element processing handler for the #ajax form property.
  *
  * @param $element
  *   An associative array containing the properties of the element.
@@ -596,7 +595,7 @@
 }
 
 /**
- * Add Ajax information about an element to the page to communicate with JavaScript.
+ * Adds Ajax information about an element to communicate with JavaScript.
  *
  * If #ajax['path'] is set on an element, this additional JavaScript is added
  * to the page header to attach the Ajax behaviors. See ajax.js for more
@@ -1210,4 +1209,3 @@
     'selector' => $selector,
   );
 }
-

Modified: branches/upstream/current-7/includes/archiver.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/archiver.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/archiver.inc (original)
+++ branches/upstream/current-7/includes/archiver.inc Sun Feb  5 17:53:08 2012
@@ -6,61 +6,63 @@
  */
 
 /**
- * Common interface for all Archiver classes.
+ * Defines the common interface for all Archiver classes.
  */
 interface ArchiverInterface {
 
   /**
-   * Constructor for a new archiver instance.
+   * Constructs a new archiver instance.
    *
    * @param $file_path
-   *   The full system path of the archive to manipulate.  Only local files
-   *   are supported.  If the file does not yet exist, it will be created if
+   *   The full system path of the archive to manipulate. Only local files
+   *   are supported. If the file does not yet exist, it will be created if
    *   appropriate.
    */
   public function __construct($file_path);
 
   /**
-   * Add the specified file or directory to the archive.
+   * Adds the specified file or directory to the archive.
    *
    * @param $file_path
    *   The full system path of the file or directory to add. Only local files
    *   and directories are supported.
+   *
    * @return ArchiverInterface
    *   The called object.
    */
   public function add($file_path);
 
   /**
-   * Remove the specified file from the archive.
+   * Removes the specified file from the archive.
    *
    * @param $path
    *   The file name relative to the root of the archive to remove.
+   *
    * @return ArchiverInterface
    *   The called object.
    */
   public function remove($path);
 
   /**
-   * Extract multiple files in the archive to the specified path.
+   * Extracts multiple files in the archive to the specified path.
    *
    * @param $path
    *   A full system path of the directory to which to extract files.
    * @param $files
    *   Optionally specify a list of files to be extracted. Files are
    *   relative to the root of the archive. If not specified, all files
-   *   in the archive will be extracted
+   *   in the archive will be extracted.
+   *
    * @return ArchiverInterface
    *   The called object.
    */
-  public function extract($path, Array $files = array());
+  public function extract($path, array $files = array());
 
   /**
-   * List all files in the archive.
+   * Lists all files in the archive.
    *
    * @return
    *   An array of file names relative to the root of the archive.
    */
   public function listContents();
 }
-

Modified: branches/upstream/current-7/includes/authorize.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/authorize.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/authorize.inc (original)
+++ branches/upstream/current-7/includes/authorize.inc Sun Feb  5 17:53:08 2012
@@ -6,7 +6,13 @@
  */
 
 /**
- * Build the form for choosing a FileTransfer type and supplying credentials.
+ * Form constructor for the file transfer authorization form.
+ *
+ * Allows the user to choose a FileTransfer type and supply credentials.
+ *
+ * @see authorize_filetransfer_form_validate()
+ * @see authorize_filetransfer_form_submit()
+ * @ingroup forms
  */
 function authorize_filetransfer_form($form, &$form_state) {
   global $base_url, $is_https;
@@ -127,10 +133,11 @@
 }
 
 /**
- * Generate the Form API array for the settings for a given connection backend.
+ * Generates the Form API array for a given connection backend's settings.
  *
  * @param $backend
  *   The name of the backend (e.g. 'ftp', 'ssh', etc).
+ *
  * @return
  *   Form API array of connection settings for the given backend.
  *
@@ -151,7 +158,7 @@
 }
 
 /**
- * Recursively fill in the default settings on a file transfer connection form.
+ * Sets the default settings on a file transfer connection form recursively.
  *
  * The default settings for the file transfer connection forms are saved in
  * the database. The settings are stored as a nested array in the case of a
@@ -165,8 +172,6 @@
  *   The key for our current form element, if any.
  * @param array $defaults
  *   The default settings for the file transfer backend we're operating on.
- * @return
- *   Nothing, this function just sets $element['#default_value'] if needed.
  */
 function _authorize_filetransfer_connection_settings_set_defaults(&$element, $key, array $defaults) {
   // If we're operating on a form element which isn't a fieldset, and we have
@@ -186,9 +191,10 @@
 }
 
 /**
- * Validate callback for the filetransfer authorization form.
+ * Form validation handler for authorize_filetransfer_form().
  *
  * @see authorize_filetransfer_form()
+ * @see authorize_filetransfer_submit()
  */
 function authorize_filetransfer_form_validate($form, &$form_state) {
   // Only validate the form if we have collected all of the user input and are
@@ -218,9 +224,10 @@
 }
 
 /**
- * Submit callback when a file transfer is being authorized.
+ * Form submission handler for authorize_filetransfer_form().
  *
  * @see authorize_filetransfer_form()
+ * @see authorize_filetransfer_validate()
  */
 function authorize_filetransfer_form_submit($form, &$form_state) {
   global $base_url;
@@ -280,7 +287,7 @@
 }
 
 /**
- * Run the operation specified in $_SESSION['authorize_operation']
+ * Runs the operation specified in $_SESSION['authorize_operation'].
  *
  * @param $filetransfer
  *   The FileTransfer object to use for running the operation.
@@ -298,12 +305,13 @@
 }
 
 /**
- * Get a FileTransfer class for a specific transfer method and settings.
+ * Gets a FileTransfer class for a specific transfer method and settings.
  *
  * @param $backend
  *   The FileTransfer backend to get the class for.
  * @param $settings
  *   Array of settings for the FileTransfer.
+ *
  * @return
  *   An instantiated FileTransfer object for the requested method and settings,
  *   or FALSE if there was an error finding or instantiating it.

Modified: branches/upstream/current-7/includes/batch.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/batch.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/batch.inc (original)
+++ branches/upstream/current-7/includes/batch.inc Sun Feb  5 17:53:08 2012
@@ -1,5 +1,4 @@
 <?php
-
 
 /**
  * @file
@@ -21,6 +20,7 @@
  * @param $id
  *   The ID of the batch to load. When a progressive batch is being processed,
  *   the relevant ID is found in $_REQUEST['id'].
+ *
  * @return
  *   An array representing the batch, or FALSE if no batch was found.
  */
@@ -36,7 +36,7 @@
 }
 
 /**
- * State-based dispatcher for the batch processing page.
+ * Renders the batch processing page based on the current state of the batch.
  *
  * @see _batch_shutdown()
  */
@@ -94,7 +94,7 @@
 }
 
 /**
- * Initialize the batch processing.
+ * Initializes the batch processing.
  *
  * JavaScript-enabled clients are identified by the 'has_js' cookie set in
  * drupal.js. If no JavaScript-enabled page has been visited during the current
@@ -110,7 +110,7 @@
 }
 
 /**
- * Output a batch processing page with JavaScript support.
+ * Outputs a batch processing page with JavaScript support.
  *
  * This initializes the batch and error messages. Note that in JavaScript-based
  * processing, the batch processing page is displayed only once and updated via
@@ -144,7 +144,7 @@
 }
 
 /**
- * Do one execution pass in JavaScript-mode and return progress to the browser.
+ * Does one execution pass with JavaScript and returns progress to the browser.
  *
  * @see _batch_progress_page_js()
  * @see _batch_process()
@@ -164,7 +164,7 @@
 }
 
 /**
- * Output a batch processing page without JavaScript support.
+ * Outputs a batch processing page without JavaScript support.
  *
  * @see _batch_process()
  */
@@ -228,7 +228,7 @@
 }
 
 /**
- * Process sets in a batch.
+ * Processes sets in a batch.
  *
  * If the batch was marked for progressive execution (default), this executes as
  * many operations in batch sets until an execution time of 1 second has been
@@ -370,7 +370,7 @@
 }
 
 /**
- * Helper function for _batch_process(): returns the formatted percentage.
+ * Formats the percent completion for a batch set.
  *
  * @param $total
  *   The total number of operations.
@@ -379,11 +379,14 @@
  *   rather than an integer in the case of a multi-step operation that is not
  *   yet complete; in that case, the fractional part of $current represents the
  *   fraction of the operation that has been completed.
+ *
  * @return
  *   The properly formatted percentage, as a string. We output percentages
  *   using the correct number of decimal places so that we never print "100%"
  *   until we are finished, but we also never print more decimal places than
  *   are meaningful.
+ *
+ * @see _batch_process()
  */
 function _batch_api_percentage($total, $current) {
   if (!$total || $total == $current) {
@@ -410,7 +413,7 @@
 }
 
 /**
- * Return the batch set being currently processed.
+ * Returns the batch set being currently processed.
  */
 function &_batch_current_set() {
   $batch = &batch_get();
@@ -418,7 +421,7 @@
 }
 
 /**
- * Retrieve the next set in a batch.
+ * Retrieves the next set in a batch.
  *
  * If there is a subsequent set in this batch, assign it as the new set to
  * process and execute its form submit handler (if defined), which may add
@@ -442,7 +445,7 @@
 }
 
 /**
- * End the batch processing.
+ * Ends the batch processing.
  *
  * Call the 'finished' callback of each batch set to allow custom handling of
  * the results and resolve page redirection.
@@ -521,7 +524,10 @@
 }
 
 /**
- * Shutdown function; store the current batch data for the next request.
+ * Shutdown function: Stores the current batch data for the next request.
+ *
+ * @see _batch_page()
+ * @see drupal_register_shutdown_function()
  */
 function _batch_shutdown() {
   if ($batch = batch_get()) {
@@ -531,4 +537,3 @@
       ->execute();
   }
 }
-

Modified: branches/upstream/current-7/includes/batch.queue.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/batch.queue.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/batch.queue.inc (original)
+++ branches/upstream/current-7/includes/batch.queue.inc Sun Feb  5 17:53:08 2012
@@ -1,24 +1,30 @@
 <?php
-
 
 /**
  * @file
  * Queue handlers used by the Batch API.
  *
- * Those implementations:
- * - ensure FIFO ordering,
- * - let an item be repeatedly claimed until it is actually deleted (no notion
- *   of lease time or 'expire' date), to allow multipass operations.
+ * These implementations:
+ * - Ensure FIFO ordering.
+ * - Allow an item to be repeatedly claimed until it is actually deleted (no
+ *   notion of lease time or 'expire' date), to allow multipass operations.
  */
 
 /**
- * Batch queue implementation.
+ * Defines a batch queue.
  *
  * Stale items from failed batches are cleaned from the {queue} table on cron
  * using the 'created' date.
  */
 class BatchQueue extends SystemQueue {
 
+  /**
+   * Overrides SystemQueue::claimItem().
+   *
+   * Unlike SystemQueue::claimItem(), this method provides a default lease
+   * time of 0 (no expiration) instead of 30. This allows the item to be
+   * claimed repeatedly until it is deleted.
+   */
   public function claimItem($lease_time = 0) {
     $item = db_query_range('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', 0, 1, array(':name' => $this->name))->fetchObject();
     if ($item) {
@@ -29,9 +35,9 @@
   }
 
   /**
-   * Retrieve all remaining items in the queue.
+   * Retrieves all remaining items in the queue.
    *
-   * This is specific to Batch API and is not part of the DrupalQueueInterface,
+   * This is specific to Batch API and is not part of the DrupalQueueInterface.
    */
   public function getAllItems() {
     $result = array();
@@ -44,10 +50,17 @@
 }
 
 /**
- * Batch queue implementation used for non-progressive batches.
+ * Defines a batch queue for non-progressive batches.
  */
 class BatchMemoryQueue extends MemoryQueue {
 
+  /**
+   * Overrides MemoryQueue::claimItem().
+   *
+   * Unlike MemoryQueue::claimItem(), this method provides a default lease
+   * time of 0 (no expiration) instead of 30. This allows the item to be
+   * claimed repeatedly until it is deleted.
+   */
   public function claimItem($lease_time = 0) {
     if (!empty($this->queue)) {
       reset($this->queue);
@@ -57,9 +70,9 @@
   }
 
   /**
-   * Retrieve all remaining items in the queue.
+   * Retrieves all remaining items in the queue.
    *
-   * This is specific to Batch API and is not part of the DrupalQueueInterface,
+   * This is specific to Batch API and is not part of the DrupalQueueInterface.
    */
   public function getAllItems() {
     $result = array();

Modified: branches/upstream/current-7/includes/bootstrap.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/bootstrap.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/bootstrap.inc (original)
+++ branches/upstream/current-7/includes/bootstrap.inc Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.11');
+define('VERSION', '7.12');
 
 /**
  * Core API compatibility.
@@ -43,9 +43,9 @@
  * Logging severity levels as defined in RFC 3164.
  *
  * The WATCHDOG_* constant definitions correspond to the logging severity levels
- * defined in RFC 3164, section 4.1.1.  PHP supplies predefined LOG_* constants
+ * defined in RFC 3164, section 4.1.1. PHP supplies predefined LOG_* constants
  * for use in the syslog() function, but their values on Windows builds do not
- * correspond to RFC 3164.  The associated PHP bug report was closed with the
+ * correspond to RFC 3164. The associated PHP bug report was closed with the
  * comment, "And it's also not a bug, as Windows just have less log levels,"
  * and "So the behavior you're seeing is perfectly normal."
  *
@@ -137,8 +137,7 @@
 define('DRUPAL_BOOTSTRAP_LANGUAGE', 6);
 
 /**
- * Final bootstrap phase: Drupal is fully loaded; validate and fix
- * input data.
+ * Final bootstrap phase: Drupal is fully loaded; validate and fix input data.
  */
 define('DRUPAL_BOOTSTRAP_FULL', 7);
 
@@ -153,8 +152,9 @@
 define('DRUPAL_AUTHENTICATED_RID', 2);
 
 /**
- * The number of bytes in a kilobyte. For more information, visit
- * http://en.wikipedia.org/wiki/Kilobyte.
+ * The number of bytes in a kilobyte.
+ *
+ * For more information, visit http://en.wikipedia.org/wiki/Kilobyte.
  */
 define('DRUPAL_KILOBYTE', 1024);
 
@@ -191,10 +191,14 @@
 define('LANGUAGE_RTL', 1);
 
 /**
- * For convenience, define a short form of the request time global.
- *
- * REQUEST_TIME is a float with microseconds since PHP 5.4.0, but float
- * timestamps confuses most of the PHP functions (including date_create()).
+ * Time of the current request in seconds elapsed since the Unix Epoch.
+ *
+ * This differs from $_SERVER['REQUEST_TIME'], which is stored as a float
+ * since PHP 5.4.0. Float timestamps confuse most PHP functions
+ * (including date_create()).
+ *
+ * @see http://php.net/manual/reserved.variables.server.php
+ * @see http://php.net/manual/function.time.php
  */
 define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']);
 
@@ -285,12 +289,12 @@
   /**
    * A cid to pass to cache_set() and cache_get().
    */
-  private $cid;
+  protected $cid;
 
   /**
    * A bin to pass to cache_set() and cache_get().
    */
-  private $bin;
+  protected $bin;
 
   /**
    * An array of keys to add to the cache at the end of the request.
@@ -303,7 +307,7 @@
   protected $storage = array();
 
   /**
-   * Constructor.
+   * Constructs a DrupalCacheArray object.
    *
    * @param $cid
    *   The cid for the array being cached.
@@ -319,10 +323,16 @@
     }
   }
 
+  /**
+   * Implements ArrayAccess::offsetExists().
+   */
   public function offsetExists($offset) {
     return $this->offsetGet($offset) !== NULL;
   }
 
+  /**
+   * Implements ArrayAccess::offsetGet().
+   */
   public function offsetGet($offset) {
     if (isset($this->storage[$offset]) || array_key_exists($offset, $this->storage)) {
       return $this->storage[$offset];
@@ -332,10 +342,16 @@
     }
   }
 
+  /**
+   * Implements ArrayAccess::offsetSet().
+   */
   public function offsetSet($offset, $value) {
     $this->storage[$offset] = $value;
   }
 
+  /**
+   * Implements ArrayAccess::offsetUnset().
+   */
   public function offsetUnset($offset) {
     unset($this->storage[$offset]);
   }
@@ -375,32 +391,31 @@
   abstract protected function resolveCacheMiss($offset);
 
   /**
-   * Immediately write a value to the persistent cache.
+   * Writes a value to the persistent cache immediately.
    *
-   * @param $cid
-   *   The cache ID.
-   * @param $bin
-   *   The cache bin.
    * @param $data
    *   The data to write to the persistent cache.
    * @param $lock
    *   Whether to acquire a lock before writing to cache.
    */
-  protected function set($cid, $data, $bin, $lock = TRUE) {
+  protected function set($data, $lock = TRUE) {
     // Lock cache writes to help avoid stampedes.
     // To implement locking for cache misses, override __construct().
-    $lock_name = $cid . ':' . $bin;
+    $lock_name = $this->cid . ':' . $this->bin;
     if (!$lock || lock_acquire($lock_name)) {
-      if ($cached = cache_get($cid, $bin)) {
+      if ($cached = cache_get($this->cid, $this->bin)) {
         $data = $cached->data + $data;
       }
-      cache_set($cid, $data, $bin);
+      cache_set($this->cid, $data, $this->bin);
       if ($lock) {
         lock_release($lock_name);
       }
     }
   }
 
+  /**
+   * Destructs the DrupalCacheArray object.
+   */
   public function __destruct() {
     $data = array();
     foreach ($this->keysToPersist as $offset => $persist) {
@@ -409,14 +424,16 @@
       }
     }
     if (!empty($data)) {
-      $this->set($this->cid, $data, $this->bin);
-    }
-  }
-}
-
-/**
- * Start the timer with the specified name. If you start and stop the same
- * timer multiple times, the measured intervals will be accumulated.
+      $this->set($data);
+    }
+  }
+}
+
+/**
+ * Starts the timer with the specified name.
+ *
+ * If you start and stop the same timer multiple times, the measured intervals
+ * will be accumulated.
  *
  * @param $name
  *   The name of the timer.
@@ -429,7 +446,7 @@
 }
 
 /**
- * Read the current timer value without stopping the timer.
+ * Reads the current timer value without stopping the timer.
  *
  * @param $name
  *   The name of the timer.
@@ -453,7 +470,7 @@
 }
 
 /**
- * Stop the timer with the specified name.
+ * Stops the timer with the specified name.
  *
  * @param $name
  *   The name of the timer.
@@ -578,7 +595,7 @@
 }
 
 /**
- * Set appropriate server variables needed for command line scripts to work.
+ * Sets appropriate server variables needed for command line scripts to work.
  *
  * This function can be called by command line scripts before bootstrapping
  * Drupal, to ensure that the page loads with the desired server parameters.
@@ -640,7 +657,7 @@
 }
 
 /**
- * Initialize PHP environment.
+ * Initializes the PHP environment.
  */
 function drupal_environment_initialize() {
   if (!isset($_SERVER['HTTP_REFERER'])) {
@@ -699,7 +716,7 @@
 }
 
 /**
- * Validate that a hostname (for example $_SERVER['HTTP_HOST']) is safe.
+ * Validates that a hostname (for example $_SERVER['HTTP_HOST']) is safe.
  *
  * @return
  *  TRUE if only containing valid characters, or FALSE otherwise.
@@ -709,8 +726,7 @@
 }
 
 /**
- * Loads the configuration and sets the base URL, cookie domain, and
- * session name correctly.
+ * Sets the base URL, cookie domain, and session name from configuration.
  */
 function drupal_settings_initialize() {
   global $base_url, $base_path, $base_root;
@@ -796,9 +812,10 @@
 }
 
 /**
- * Returns and optionally sets the filename for a system item (module,
- * theme, etc.). The filename, whether provided, cached, or retrieved
- * from the database, is only returned if the file exists.
+ * Returns and optionally sets the filename for a system resource.
+ *
+ * The filename, whether provided, cached, or retrieved from the database, is
+ * only returned if the file exists.
  *
  * This function plays a key role in allowing Drupal's resources (modules
  * and themes) to be located in different places depending on a site's
@@ -828,6 +845,11 @@
   // drupal_static().
   static $files = array(), $dirs = array();
 
+  // Profiles are a special case: they have a fixed location and naming.
+  if ($type == 'profile') {
+    $profile_filename = "profiles/$name/$name.profile";
+    $files[$type][$name] = file_exists($profile_filename) ? $profile_filename : FALSE;
+  }
   if (!isset($files[$type])) {
     $files[$type] = array();
   }
@@ -895,11 +917,11 @@
 }
 
 /**
- * Load the persistent variable table.
+ * Loads the persistent variable table.
  *
  * The variable table is composed of values that have been saved in the table
- * with variable_set() as well as those explicitly specified in the configuration
- * file.
+ * with variable_set() as well as those explicitly specified in the
+ * configuration file.
  */
 function variable_initialize($conf = array()) {
   // NOTE: caching the variables improves performance by 20% when serving
@@ -1006,7 +1028,7 @@
 }
 
 /**
- * Retrieve the current page from the cache.
+ * Retrieves the current page from the cache.
  *
  * Note: we do not serve cached pages to authenticated users, or to anonymous
  * users when $_SESSION is non-empty. $_SESSION may contain status messages
@@ -1038,7 +1060,7 @@
 }
 
 /**
- * Determine the cacheability of the current page.
+ * Determines the cacheability of the current page.
  *
  * @param $allow_caching
  *   Set to FALSE if you want to prevent this page to get cached.
@@ -1057,7 +1079,7 @@
 }
 
 /**
- * Invoke a bootstrap hook in all bootstrap modules that implement it.
+ * Invokes a bootstrap hook in all bootstrap modules that implement it.
  *
  * @param $hook
  *   The name of the bootstrap hook to invoke.
@@ -1079,8 +1101,9 @@
 }
 
 /**
- * Includes a file with the provided type and name. This prevents
- * including a theme, engine, module, etc., more than once.
+ * Includes a file with the provided type and name.
+ *
+ * This prevents including a theme, engine, module, etc., more than once.
  *
  * @param $type
  *   The type of item to load (i.e. theme, theme_engine, module).
@@ -1112,7 +1135,7 @@
 }
 
 /**
- * Set an HTTP response header for the current page.
+ * Sets an HTTP response header for the current page.
  *
  * Note: When sending a Content-Type header, always include a 'charset' type,
  * too. This is necessary to avoid security bugs (e.g. UTF-7 XSS).
@@ -1148,11 +1171,12 @@
 }
 
 /**
- * Get the HTTP response headers for the current page.
+ * Gets the HTTP response headers for the current page.
  *
  * @param $name
  *   An HTTP header name. If omitted, all headers are returned as name/value
  *   pairs. If an array value is FALSE, the header has been unset.
+ *
  * @return
  *   A string containing the header value, or FALSE if the header has been set,
  *   or NULL if the header has not been set.
@@ -1169,6 +1193,8 @@
 }
 
 /**
+ * Sets the preferred name for the HTTP header.
+ *
  * Header names are case-insensitive, but for maximum compatibility they should
  * follow "common form" (see RFC 2617, section 4.2).
  */
@@ -1182,9 +1208,10 @@
 }
 
 /**
- * Send the HTTP response headers previously set using drupal_add_http_header().
- * Add default headers, unless they have been replaced or unset using
- * drupal_add_http_header().
+ * Sends the HTTP response headers that were previously set, adding defaults.
+ *
+ * Headers are set in drupal_add_http_header(). Default headers are not set
+ * if they have been replaced or unset using drupal_add_http_header().
  *
  * @param $default_headers
  *   An array of headers as name/value pairs.
@@ -1219,7 +1246,7 @@
 }
 
 /**
- * Set HTTP headers in preparation for a page response.
+ * Sets HTTP headers in preparation for a page response.
  *
  * Authenticated users are always given a 'no-cache' header, and will fetch a
  * fresh page on every request. This prevents authenticated users from seeing
@@ -1262,7 +1289,7 @@
 }
 
 /**
- * Set HTTP headers in preparation for a cached page response.
+ * Sets HTTP headers in preparation for a cached page response.
  *
  * The headers allow as much as possible in proxies and browsers without any
  * particular knowledge about the pages. Modules can override these headers
@@ -1365,7 +1392,7 @@
 }
 
 /**
- * Define the critical hooks that force modules to always be loaded.
+ * Defines the critical hooks that force modules to always be loaded.
  */
 function bootstrap_hooks() {
   return array('boot', 'exit', 'watchdog', 'language_init');
@@ -1418,10 +1445,10 @@
  * $text = t("@name's blog", array('@name' => format_username($account)));
  * @endcode
  * Basically, you can put variables like @name into your string, and t() will
- * substitute their sanitized values at translation time (see $args below or
- * the Localization API pages referenced above for details). Translators can
- * then rearrange the string as necessary for the language (e.g., in Spanish,
- * it might be "blog de @name").
+ * substitute their sanitized values at translation time. (See the
+ * Localization API pages referenced above and the documentation of
+ * format_string() for details.) Translators can then rearrange the string as
+ * necessary for the language (e.g., in Spanish, it might be "blog de @name").
  *
  * During the Drupal installation phase, some resources used by t() wil not be
  * available to code that needs localization. See st() and get_t() for
@@ -1430,8 +1457,9 @@
  * @param $string
  *   A string containing the English string to translate.
  * @param $args
- *   An associative array of replacements to make after translation.
- *   See format_string().
+ *   An associative array of replacements to make after translation. Based
+ *   on the first character of the key, the value is escaped and/or themed.
+ *   See format_string() for details.
  * @param $options
  *   An associative array of additional options, with the following elements:
  *   - 'langcode' (defaults to the current language): The language code to
@@ -1444,6 +1472,7 @@
  *
  * @see st()
  * @see get_t()
+ * @see format_string()
  * @ingroup sanitization
  */
 function t($string, array $args = array(), array $options = array()) {
@@ -1482,7 +1511,7 @@
 }
 
 /**
- * Replace placeholders with sanitized values in a string.
+ * Replaces placeholders with sanitized values in a string.
  *
  * @param $string
  *   A string containing placeholders.
@@ -1524,7 +1553,7 @@
 }
 
 /**
- * Encode special characters in a plain-text string for display as HTML.
+ * Encodes special characters in a plain-text string for display as HTML.
  *
  * Also validates strings as UTF-8 to prevent cross site scripting attacks on
  * Internet Explorer 6.
@@ -1563,6 +1592,7 @@
  *
  * @param $text
  *   The text to check.
+ *
  * @return
  *   TRUE if the text is valid UTF-8, FALSE if not.
  */
@@ -1604,7 +1634,7 @@
 }
 
 /**
- * Log an exception.
+ * Logs an exception.
  *
  * This is a wrapper function for watchdog() which automatically decodes an
  * exception.
@@ -1645,7 +1675,7 @@
 }
 
 /**
- * Log a system message.
+ * Logs a system message.
  *
  * @param $type
  *   The category to which this message belongs. Can be any string, but the
@@ -1705,7 +1735,7 @@
 }
 
 /**
- * Set a message which reflects the status of the performed operation.
+ * Sets a message which reflects the status of the performed operation.
  *
  * If the function is called with no arguments, this function returns all set
  * messages without clearing them.
@@ -1741,12 +1771,13 @@
 }
 
 /**
- * Return all messages that have been set.
+ * Returns all messages that have been set.
  *
  * @param $type
  *   (optional) Only return messages of this type.
  * @param $clear_queue
  *   (optional) Set to FALSE if you do not want to clear the messages queue
+ *
  * @return
  *   An associative array, the key is the message type, the value an array
  *   of messages. If the $type parameter is passed, you get only that type,
@@ -1774,7 +1805,9 @@
 }
 
 /**
- * Get the title of the current page, for display on the page and in the title bar.
+ * Gets the title of the current page.
+ *
+ * The title is displayed on the page and in the title bar.
  *
  * @return
  *   The current page's title.
@@ -1791,7 +1824,9 @@
 }
 
 /**
- * Set the title of the current page, for display on the page and in the title bar.
+ * Sets the title of the current page.
+ *
+ * The title is displayed on the page and in the title bar.
  *
  * @param $title
  *   Optional string value to assign to the page title; or if set to NULL
@@ -1816,7 +1851,7 @@
 }
 
 /**
- * Check to see if an IP address has been blocked.
+ * Checks to see if an IP address has been blocked.
  *
  * Blocked IP addresses are stored in the database by default. However for
  * performance reasons we allow an override in settings.php. This allows us
@@ -1825,6 +1860,7 @@
  *
  * @param $ip
  *   IP address to check.
+ *
  * @return bool
  *   TRUE if access is denied, FALSE if access is allowed.
  */
@@ -1850,7 +1886,7 @@
 }
 
 /**
- * Handle denied users.
+ * Handles denied users.
  *
  * @param $ip
  *   IP address to check. Prints a message and exits if access is denied.
@@ -1869,7 +1905,8 @@
  *
  * This function is better than simply calling mt_rand() or any other built-in
  * PHP function because it can return a long string of bytes (compared to < 4
- * bytes normally from mt_rand()) and uses the best available pseudo-random source.
+ * bytes normally from mt_rand()) and uses the best available pseudo-random
+ * source.
  *
  * @param $count
  *   The number of characters (bytes) to return in the string.
@@ -1916,7 +1953,7 @@
 }
 
 /**
- * Calculate a base-64 encoded, URL-safe sha-256 hmac.
+ * Calculates a base-64 encoded, URL-safe sha-256 hmac.
  *
  * @param $data
  *   String to be validated with the hmac.
@@ -1934,7 +1971,7 @@
 }
 
 /**
- * Calculate a base-64 encoded, URL-safe sha-256 hash.
+ * Calculates a base-64 encoded, URL-safe sha-256 hash.
  *
  * @param $data
  *   String to be hashed.
@@ -1977,7 +2014,8 @@
  * @see drupal_array_merge_deep_array()
  */
 function drupal_array_merge_deep() {
-  return drupal_array_merge_deep_array(func_get_args());
+  $args = func_get_args();
+  return drupal_array_merge_deep_array($args);
 }
 
 /**
@@ -2038,20 +2076,22 @@
 }
 
 /**
- * A string describing a phase of Drupal to load. Each phase adds to the
- * previous one, so invoking a later phase automatically runs the earlier
- * phases too. The most important usage is that if you want to access the
- * Drupal database from a script without loading anything else, you can
- * include bootstrap.inc, and call drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE).
+ * Ensures Drupal is bootstrapped to the specified phase.
+ *
+ * The bootstrap phase is an integer constant identifying a phase of Drupal
+ * to load. Each phase adds to the previous one, so invoking a later phase
+ * automatically runs the earlier phases as well. To access the Drupal
+ * database from a script without loading anything else, include bootstrap.inc
+ * and call drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE).
  *
  * @param $phase
  *   A constant. Allowed values are the DRUPAL_BOOTSTRAP_* constants.
  * @param $new_phase
  *   A boolean, set to FALSE if calling drupal_bootstrap from inside a
  *   function called from drupal_bootstrap (recursion).
+ *
  * @return
  *   The most recently completed phase.
- *
  */
 function drupal_bootstrap($phase = NULL, $new_phase = TRUE) {
   // Not drupal_static(), because does not depend on any run-time information.
@@ -2130,7 +2170,7 @@
 }
 
 /**
- * Return the time zone of the current user.
+ * Returns the time zone of the current user.
  */
 function drupal_get_user_timezone() {
   global $user;
@@ -2145,7 +2185,7 @@
 }
 
 /**
- * Custom PHP error handler.
+ * Provides custom PHP error handling.
  *
  * @param $error_level
  *   The level of the error raised.
@@ -2156,7 +2196,8 @@
  * @param $line
  *   The line number the error was raised at.
  * @param $context
- *   An array that points to the active symbol table at the point the error occurred.
+ *   An array that points to the active symbol table at the point the error
+ *   occurred.
  */
 function _drupal_error_handler($error_level, $message, $filename, $line, $context) {
   require_once DRUPAL_ROOT . '/includes/errors.inc';
@@ -2164,7 +2205,7 @@
 }
 
 /**
- * Custom PHP exception handler.
+ * Provides custom PHP exception handling.
  *
  * Uncaught exceptions are those not enclosed in a try/catch block. They are
  * always fatal: the execution of the script will stop as soon as the exception
@@ -2192,7 +2233,7 @@
 }
 
 /**
- * Bootstrap configuration: Setup script environment and load settings.php.
+ * Sets up the script environment and loads settings.php.
  */
 function _drupal_bootstrap_configuration() {
   // Set the Drupal custom error handler.
@@ -2207,7 +2248,7 @@
 }
 
 /**
- * Bootstrap page cache: Try to serve a page from cache.
+ * Attempts to serve a page from the cache.
  */
 function _drupal_bootstrap_page_cache() {
   global $user;
@@ -2263,7 +2304,7 @@
 }
 
 /**
- * Bootstrap database: Initialize database system and register autoload functions.
+ * Initializes the database system and registers autoload functions.
  */
 function _drupal_bootstrap_database() {
   // Redirect the user to the installation script if Drupal has not been
@@ -2315,7 +2356,7 @@
 }
 
 /**
- * Bootstrap variables: Load system variables and all enabled bootstrap modules.
+ * Loads system variables and all enabled bootstrap modules.
  */
 function _drupal_bootstrap_variables() {
   global $conf;
@@ -2332,7 +2373,7 @@
 }
 
 /**
- * Bootstrap page header: Invoke hook_boot(), initialize locking system, and send default HTTP headers.
+ * Invokes hook_boot(), initializes locking system, and sends HTTP headers.
  */
 function _drupal_bootstrap_page_header() {
   bootstrap_invoke_all('boot');
@@ -2355,8 +2396,7 @@
 }
 
 /**
- * Checks the current User-Agent string to see if this is an internal request
- * from SimpleTest. If so, returns the test prefix for this test.
+ * Returns the test prefix if this is an internal request from SimpleTest.
  *
  * @return
  *   Either the simpletest prefix (the string "simpletest" followed by any
@@ -2392,7 +2432,7 @@
 }
 
 /**
- * Generate a user agent string with a HMAC and timestamp for simpletest.
+ * Generates a user agent string with a HMAC and timestamp for simpletest.
  */
 function drupal_generate_test_ua($prefix) {
   global $drupal_hash_salt;
@@ -2452,7 +2492,7 @@
 }
 
 /**
- * Return TRUE if a Drupal installation is currently being attempted.
+ * Returns TRUE if a Drupal installation is currently being attempted.
  */
 function drupal_installation_attempted() {
   return defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install';
@@ -2495,10 +2535,9 @@
 }
 
 /**
- * Initialize all the defined language types.
+ * Initializes all the defined language types.
  */
 function drupal_language_initialize() {
-  global $language;
   $types = language_types();
 
   // Ensure the language is correctly returned, even without multilanguage
@@ -2518,13 +2557,10 @@
     // environments.
     bootstrap_invoke_all('language_init');
   }
-
-  // Send appropriate HTTP-Header for browsers and search engines.
-  header('Content-Language: ' . $language->language);
-}
-
-/**
- * The built-in language types.
+}
+
+/**
+ * Returns a list of the built-in language types.
  *
  * @return
  *   An array of key-values pairs where the key is the language type and the
@@ -2539,7 +2575,7 @@
 }
 
 /**
- * Return true if there is more than one language enabled.
+ * Returns TRUE if there is more than one language enabled.
  */
 function drupal_multilingual() {
   // The "language_count" variable stores the number of enabled languages to
@@ -2549,7 +2585,7 @@
 }
 
 /**
- * Return an array of the available language types.
+ * Returns an array of the available language types.
  */
 function language_types() {
   return array_keys(variable_get('language_types', drupal_language_types()));
@@ -2606,7 +2642,7 @@
 }
 
 /**
- * Default language used on the site
+ * Returns the default language used on the site
  *
  * @param $property
  *   Optional property of the language object to return
@@ -2676,16 +2712,16 @@
 }
 
 /**
- * Return a component of the current Drupal path.
+ * Returns a component of the current Drupal path.
  *
  * When viewing a page at the path "admin/structure/types", for example, arg(0)
  * returns "admin", arg(1) returns "structure", and arg(2) returns "types".
  *
- * Avoid use of this function where possible, as resulting code is hard to read.
- * In menu callback functions, attempt to use named arguments. See the explanation
- * in menu.inc for how to construct callbacks that take arguments. When attempting
- * to use this function to load an element from the current path, e.g. loading the
- * node on a node page, please use menu_get_object() instead.
+ * Avoid use of this function where possible, as resulting code is hard to
+ * read. In menu callback functions, attempt to use named arguments. See the
+ * explanation in menu.inc for how to construct callbacks that take arguments.
+ * When attempting to use this function to load an element from the current
+ * path, e.g. loading the node on a node page, use menu_get_object() instead.
  *
  * @param $index
  *   The index of the component, where each component is separated by a '/'
@@ -2725,6 +2761,8 @@
 }
 
 /**
+ * Returns the IP address of the client machine.
+ *
  * If Drupal is behind a reverse proxy, we use the X-Forwarded-For header
  * instead of $_SERVER['REMOTE_ADDR'], which would be the IP address of
  * the proxy server, and not the client's. The actual header name can be
@@ -2774,7 +2812,7 @@
  */
 
 /**
- * Get the schema definition of a table, or the whole database schema.
+ * Gets the schema definition of a table, or the whole database schema.
  *
  * The returned schema will include any modifications made by any
  * module that implements hook_schema_alter().
@@ -2810,11 +2848,17 @@
  */
 class SchemaCache extends DrupalCacheArray {
 
+  /**
+   * Constructs a SchemaCache object.
+   */
   public function __construct() {
     // Cache by request method.
     parent::__construct('schema:runtime:' . ($_SERVER['REQUEST_METHOD'] == 'GET'), 'cache');
   }
 
+  /**
+   * Overrides DrupalCacheArray::resolveCacheMiss().
+   */
   protected function resolveCacheMiss($offset) {
     $complete_schema = drupal_get_complete_schema();
     $value = isset($complete_schema[$offset]) ? $complete_schema[$offset] :  NULL;
@@ -2825,7 +2869,7 @@
 }
 
 /**
- * Get the whole database schema.
+ * Gets the whole database schema.
  *
  * The returned schema will include any modifications made by any
  * module that implements hook_schema_alter().
@@ -2895,13 +2939,14 @@
  */
 
 /**
- * Confirm that an interface is available.
+ * Confirms that an interface is available.
  *
  * This function is rarely called directly. Instead, it is registered as an
  * spl_autoload()  handler, and PHP calls it for us when necessary.
  *
  * @param $interface
  *   The name of the interface to check or load.
+ *
  * @return
  *   TRUE if the interface is currently available, FALSE otherwise.
  */
@@ -2910,13 +2955,14 @@
 }
 
 /**
- * Confirm that a class is available.
+ * Confirms that a class is available.
  *
  * This function is rarely called directly. Instead, it is registered as an
  * spl_autoload()  handler, and PHP calls it for us when necessary.
  *
  * @param $class
  *   The name of the class to check or load.
+ *
  * @return
  *   TRUE if the class is currently available, FALSE otherwise.
  */
@@ -2925,7 +2971,7 @@
 }
 
 /**
- * Helper to check for a resource in the registry.
+ * Checks for a resource in the registry.
  *
  * @param $type
  *   The type of resource we are looking up, or one of the constants
@@ -2934,6 +2980,7 @@
  * @param $name
  *   The name of the resource, or NULL if either of the REGISTRY_* constants
  *   is passed in.
+ *
  * @return
  *   TRUE if the resource was found, FALSE if not.
  *   NULL if either of the REGISTRY_* constants is passed in as $type.
@@ -3005,7 +3052,7 @@
 }
 
 /**
- * Rescan all enabled modules and rebuild the registry.
+ * Rescans all enabled modules and rebuilds the registry.
  *
  * Rescans all code in modules or includes directories, storing the location of
  * each interface or class in the database.
@@ -3016,7 +3063,7 @@
 }
 
 /**
- * Update the registry based on the latest files listed in the database.
+ * Updates the registry based on the latest files listed in the database.
  *
  * This function should be used when system_rebuild_module_data() does not need
  * to be called, because it is already known that the list of files in the
@@ -3034,7 +3081,7 @@
  */
 
 /**
- * Central static variable storage.
+ * Provides central static variable storage.
  *
  * All functions requiring a static variable to persist or cache data within
  * a single page request are encouraged to use this function unless it is
@@ -3185,7 +3232,7 @@
 }
 
 /**
- * Reset one or all centrally stored static variable(s).
+ * Resets one or all centrally stored static variable(s).
  *
  * @param $name
  *   Name of the static variable to reset. Omit to reset all variables.
@@ -3195,7 +3242,7 @@
 }
 
 /**
- * Detect whether the current script is running in a command-line environment.
+ * Detects whether the current script is running in a command-line environment.
  */
 function drupal_is_cli() {
   return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)));
@@ -3203,7 +3250,8 @@
 
 /**
  * Formats text for emphasized display in a placeholder inside a sentence.
- * Used automatically by t().
+ *
+ * Used automatically by format_string().
  *
  * @param $text
  *   The text to format (plain-text).
@@ -3216,7 +3264,7 @@
 }
 
 /**
- * Register a function for execution on shutdown.
+ * Registers a function for execution on shutdown.
  *
  * Wrapper for register_shutdown_function() that catches thrown exceptions to
  * avoid "Exception thrown without a stack frame in Unknown".
@@ -3251,7 +3299,7 @@
 }
 
 /**
- * Internal function used to execute registered shutdown functions.
+ * Executes registered shutdown functions.
  */
 function _drupal_shutdown_function() {
   $callbacks = &drupal_register_shutdown_function();

Modified: branches/upstream/current-7/includes/cache-install.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/cache-install.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/cache-install.inc (original)
+++ branches/upstream/current-7/includes/cache-install.inc Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
  */
 
 /**
- * A stub cache implementation to be used during the installation process.
+ * Defines a stub cache implementation to be used during installation.
  *
  * The stub implementation is needed when database access is not yet available.
  * Because Drupal's caching system never requires that cached data be present,
@@ -15,17 +15,30 @@
  * normal operations would have a negative impact on performance.
  */
 class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterface {
+
+  /**
+   * Overrides DrupalDatabaseCache::get().
+   */
   function get($cid) {
     return FALSE;
   }
 
+  /**
+   * Overrides DrupalDatabaseCache::getMultiple().
+   */
   function getMultiple(&$cids) {
     return array();
   }
 
+  /**
+   * Overrides DrupalDatabaseCache::set().
+   */
   function set($cid, $data, $expire = CACHE_PERMANENT) {
   }
 
+  /**
+   * Overrides DrupalDatabaseCache::clear().
+   */
   function clear($cid = NULL, $wildcard = FALSE) {
     // If there is a database cache, attempt to clear it whenever possible. The
     // reason for doing this is that the database cache can accumulate data
@@ -52,6 +65,9 @@
     }
   }
 
+  /**
+   * Overrides DrupalDatabaseCache::isEmpty().
+   */
   function isEmpty() {
     return TRUE;
   }

Modified: branches/upstream/current-7/includes/cache.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/cache.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/cache.inc (original)
+++ branches/upstream/current-7/includes/cache.inc Sun Feb  5 17:53:08 2012
@@ -1,18 +1,23 @@
 <?php
 
 /**
- * Get the cache object for a cache bin.
+ * @file
+ * Functions and interfaces for cache handling.
+ */
+
+/**
+ * Gets the cache object for a cache bin.
  *
  * By default, this returns an instance of the DrupalDatabaseCache class.
  * Classes implementing DrupalCacheInterface can register themselves both as a
  * default implementation and for specific bins.
- *
- * @see DrupalCacheInterface
  *
  * @param $bin
  *   The cache bin for which the cache object should be returned.
  * @return DrupalCacheInterface
  *   The cache object associated with the specified bin.
+ *
+ * @see DrupalCacheInterface
  */
 function _cache_get_object($bin) {
   // We do not use drupal_static() here because we do not want to change the
@@ -29,7 +34,7 @@
 }
 
 /**
- * Return data from the persistent cache
+ * Returns data from the persistent cache.
  *
  * Data may be stored as either plain text or as serialized data. cache_get
  * will automatically return unserialized objects and arrays.
@@ -44,19 +49,22 @@
  *
  * @return
  *   The cache or FALSE on failure.
+ *
+ * @see cache_set()
  */
 function cache_get($cid, $bin = 'cache') {
   return _cache_get_object($bin)->get($cid);
 }
 
 /**
- * Return data from the persistent cache when given an array of cache IDs.
+ * Returns data from the persistent cache when given an array of cache IDs.
  *
  * @param $cids
  *   An array of cache IDs for the data to retrieve. This is passed by
  *   reference, and will have the IDs successfully returned from cache removed.
  * @param $bin
  *   The cache bin where the data is stored.
+ *
  * @return
  *   An array of the items successfully returned from cache indexed by cid.
  */
@@ -65,7 +73,7 @@
 }
 
 /**
- * Store data in the persistent cache.
+ * Stores data in the persistent cache.
  *
  * The persistent cache is split up into several cache bins. In the default
  * cache implementation, each cache bin corresponds to a database table by the
@@ -132,13 +140,15 @@
  *     general cache wipe.
  *   - A Unix timestamp: Indicates that the item should be kept at least until
  *     the given time, after which it behaves like CACHE_TEMPORARY.
+ *
+ * @see cache_get()
  */
 function cache_set($cid, $data, $bin = 'cache', $expire = CACHE_PERMANENT) {
   return _cache_get_object($bin)->set($cid, $data, $expire);
 }
 
 /**
- * Expire data from the cache.
+ * Expires data from the cache.
  *
  * If called without arguments, expirable entries will be cleared from the
  * cache_page and cache_block bins.
@@ -146,15 +156,12 @@
  * @param $cid
  *   If set, the cache ID to delete. Otherwise, all cache entries that can
  *   expire are deleted.
- *
  * @param $bin
- *   If set, the bin $bin to delete from. Mandatory
- *   argument if $cid is set.
- *
+ *   If set, the cache bin to delete from. Mandatory argument if $cid is set.
  * @param $wildcard
- *   If $wildcard is TRUE, cache IDs starting with $cid are deleted in
- *   addition to the exact cache ID specified by $cid.  If $wildcard is
- *   TRUE and $cid is '*' then the entire bin $bin is emptied.
+ *   If TRUE, cache IDs starting with $cid are deleted in addition to the
+ *   exact cache ID specified by $cid. If $wildcard is TRUE and $cid is '*',
+ *   the entire cache bin is emptied.
  */
 function cache_clear_all($cid = NULL, $bin = NULL, $wildcard = FALSE) {
   if (!isset($cid) && !isset($bin)) {
@@ -170,13 +177,14 @@
 }
 
 /**
- * Check if a cache bin is empty.
+ * Checks if a cache bin is empty.
  *
  * A cache bin is considered empty if it does not contain any valid data for any
  * cache ID.
  *
  * @param $bin
  *   The cache bin to check.
+ *
  * @return
  *   TRUE if the cache bin specified is empty.
  */
@@ -185,7 +193,7 @@
 }
 
 /**
- * Interface for cache implementations.
+ * Defines an interface for cache implementations.
  *
  * All cache implementations have to implement this interface.
  * DrupalDatabaseCache provides the default implementation, which can be
@@ -223,7 +231,7 @@
  */
 interface DrupalCacheInterface {
   /**
-   * Constructor.
+   * Constructs a new cache interface.
    *
    * @param $bin
    *   The cache bin for which the object is created.
@@ -231,31 +239,34 @@
   function __construct($bin);
 
   /**
-   * Return data from the persistent cache. Data may be stored as either plain
-   * text or as serialized data. cache_get will automatically return
-   * unserialized objects and arrays.
+   * Returns data from the persistent cache.
+   *
+   * Data may be stored as either plain text or as serialized data. cache_get()
+   * will automatically return unserialized objects and arrays.
    *
    * @param $cid
    *   The cache ID of the data to retrieve.
+   *
    * @return
    *   The cache or FALSE on failure.
    */
   function get($cid);
 
   /**
-   * Return data from the persistent cache when given an array of cache IDs.
+   * Returns data from the persistent cache when given an array of cache IDs.
    *
    * @param $cids
    *   An array of cache IDs for the data to retrieve. This is passed by
    *   reference, and will have the IDs successfully returned from cache
    *   removed.
+   *
    * @return
    *   An array of the items successfully returned from cache indexed by cid.
    */
    function getMultiple(&$cids);
 
   /**
-   * Store data in the persistent cache.
+   * Stores data in the persistent cache.
    *
    * @param $cid
    *   The cache ID of the data to store.
@@ -276,8 +287,10 @@
 
 
   /**
-   * Expire data from the cache. If called without arguments, expirable
-   * entries will be cleared from the cache_page and cache_block bins.
+   * Expires data from the cache.
+   *
+   * If called without arguments, expirable entries will be cleared from the
+   * cache_page and cache_block bins.
    *
    * @param $cid
    *   If set, the cache ID to delete. Otherwise, all cache entries that can
@@ -290,7 +303,7 @@
   function clear($cid = NULL, $wildcard = FALSE);
 
   /**
-   * Check if a cache bin is empty.
+   * Checks if a cache bin is empty.
    *
    * A cache bin is considered empty if it does not contain any valid data for
    * any cache ID.
@@ -302,7 +315,7 @@
 }
 
 /**
- * Default cache implementation.
+ * Defines a default cache implementation.
  *
  * This is Drupal's default cache implementation. It uses the database to store
  * cached data. Each cache bin corresponds to a database table by the same name.
@@ -310,16 +323,25 @@
 class DrupalDatabaseCache implements DrupalCacheInterface {
   protected $bin;
 
+  /**
+   * Constructs a new DrupalDatabaseCache object.
+   */
   function __construct($bin) {
     $this->bin = $bin;
   }
 
+  /**
+   * Implements DrupalCacheInterface::get().
+   */
   function get($cid) {
     $cids = array($cid);
     $cache = $this->getMultiple($cids);
     return reset($cache);
   }
 
+  /**
+   * Implements DrupalCacheInterface::getMultiple().
+   */
   function getMultiple(&$cids) {
     try {
       // Garbage collection necessary when enforcing a minimum cache lifetime.
@@ -373,13 +395,14 @@
   }
 
   /**
-   * Prepare a cached item.
+   * Prepares a cached item.
    *
    * Checks that items are either permanent or did not expire, and unserializes
    * data as appropriate.
    *
    * @param $cache
    *   An item loaded from cache_get() or cache_get_multiple().
+   *
    * @return
    *   The item with data unserialized as appropriate or FALSE if there is no
    *   valid item to load.
@@ -408,6 +431,9 @@
     return $cache;
   }
 
+  /**
+   * Implements DrupalCacheInterface::set().
+   */
   function set($cid, $data, $expire = CACHE_PERMANENT) {
     $fields = array(
       'serialized' => 0,
@@ -434,6 +460,9 @@
     }
   }
 
+  /**
+   * Implements DrupalCacheInterface::clear().
+   */
   function clear($cid = NULL, $wildcard = FALSE) {
     global $user;
 
@@ -496,6 +525,9 @@
     }
   }
 
+  /**
+   * Implements DrupalCacheInterface::isEmpty().
+   */
   function isEmpty() {
     $this->garbageCollection();
     $query = db_select($this->bin);

Modified: branches/upstream/current-7/includes/common.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/common.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/common.inc (original)
+++ branches/upstream/current-7/includes/common.inc Sun Feb  5 17:53:08 2012
@@ -70,8 +70,7 @@
 define('CSS_THEME', 100);
 
 /**
- * The default group for JavaScript libraries, settings or jQuery plugins added
- * to the page.
+ * The default group for JavaScript and jQuery libraries added to the page.
  */
 define('JS_LIBRARY', -100);
 
@@ -86,8 +85,9 @@
 define('JS_THEME', 100);
 
 /**
- * Error code indicating that the request made by drupal_http_request() exceeded
- * the specified timeout.
+ * Error code indicating that the request exceeded the specified timeout.
+ *
+ * @see drupal_http_request()
  */
 define('HTTP_REQUEST_TIMEOUT', -1);
 
@@ -110,31 +110,36 @@
  */
 
 /**
- * The block should not get cached. This setting should be used:
- * - for simple blocks (notably those that do not perform any db query),
- * where querying the db cache would be more expensive than directly generating
- * the content.
- * - for blocks that change too frequently.
+ * The block should not get cached.
+ *
+ * This setting should be used:
+ * - For simple blocks (notably those that do not perform any db query), where
+ *   querying the db cache would be more expensive than directly generating the
+ *   content.
+ * - For blocks that change too frequently.
  */
 define('DRUPAL_NO_CACHE', -1);
 
 /**
- * The block is handling its own caching in its hook_block_view(). From the
- * perspective of the block cache system, this is equivalent to DRUPAL_NO_CACHE.
- * Useful when time based expiration is needed or a site uses a node access
- * which invalidates standard block cache.
+ * The block is handling its own caching in its hook_block_view().
+ *
+ * From the perspective of the block cache system, this is equivalent to
+ * DRUPAL_NO_CACHE. Useful when time based expiration is needed or a site uses
+ * a node access which invalidates standard block cache.
  */
 define('DRUPAL_CACHE_CUSTOM', -2);
 
 /**
- * The block or element can change depending on the roles the user viewing the
- * page belongs to. This is the default setting for blocks, used when the block
- * does not specify anything.
+ * The block or element can change depending on the user's roles.
+ *
+ * This is the default setting for blocks, used when the block does not specify
+ * anything.
  */
 define('DRUPAL_CACHE_PER_ROLE', 0x0001);
 
 /**
- * The block or element can change depending on the user viewing the page.
+ * The block or element can change depending on the user.
+ *
  * This setting can be resource-consuming for sites with large number of users,
  * and thus should only be used when DRUPAL_CACHE_PER_ROLE is not sufficient.
  */
@@ -146,12 +151,12 @@
 define('DRUPAL_CACHE_PER_PAGE', 0x0004);
 
 /**
- * The block or element is the same for every user on every page where it is visible.
+ * The block or element is the same for every user and page that it is visible.
  */
 define('DRUPAL_CACHE_GLOBAL', 0x0008);
 
 /**
- * Add content to a specified region.
+ * Adds content to a specified region.
  *
  * @param $region
  *   Page region the content is added to.
@@ -168,7 +173,7 @@
 }
 
 /**
- * Get assigned content for a given region.
+ * Gets assigned content for a given region.
  *
  * @param $region
  *   A specified region to fetch content for. If NULL, all regions will be
@@ -194,13 +199,13 @@
 }
 
 /**
- * Get the name of the currently active install profile.
+ * Gets the name of the currently active install profile.
  *
  * When this function is called during Drupal's initial installation process,
  * the name of the profile that's about to be installed is stored in the global
  * installation state. At all other times, the standard Drupal systems variable
- * table contains the name of the current profile, and we can call variable_get()
- * to determine what one is active.
+ * table contains the name of the current profile, and we can call
+ * variable_get() to determine what one is active.
  *
  * @return $profile
  *   The name of the install profile.
@@ -220,7 +225,7 @@
 
 
 /**
- * Set the breadcrumb trail for the current page.
+ * Sets the breadcrumb trail for the current page.
  *
  * @param $breadcrumb
  *   Array of links, starting with "home" and proceeding up to but not including
@@ -236,7 +241,7 @@
 }
 
 /**
- * Get the breadcrumb trail for the current page.
+ * Gets the breadcrumb trail for the current page.
  */
 function drupal_get_breadcrumb() {
   $breadcrumb = drupal_set_breadcrumb();
@@ -265,7 +270,7 @@
 }
 
 /**
- * Add output to the head tag of the HTML page.
+ * Adds output to the HEAD tag of the HTML page.
  *
  * This function can be called as long the headers aren't sent. Pass no
  * arguments (or NULL for both) to retrieve the currently stored elements.
@@ -333,7 +338,7 @@
 }
 
 /**
- * Retrieve output to be displayed in the HEAD tag of the HTML page.
+ * Retrieves output to be displayed in the HEAD tag of the HTML page.
  */
 function drupal_get_html_head() {
   $elements = drupal_add_html_head();
@@ -342,7 +347,7 @@
 }
 
 /**
- * Add a feed URL for the current page.
+ * Adds a feed URL for the current page.
  *
  * This function can be called as long the HTML header hasn't been sent.
  *
@@ -370,7 +375,7 @@
 }
 
 /**
- * Get the feed URLs for the current page.
+ * Gets the feed URLs for the current page.
  *
  * @param $delimiter
  *   A delimiter to split feeds by.
@@ -387,7 +392,7 @@
  */
 
 /**
- * Process a URL query parameter array to remove unwanted elements.
+ * Processes a URL query parameter array to remove unwanted elements.
  *
  * @param $query
  *   (optional) An array to be processed. Defaults to $_GET.
@@ -432,7 +437,7 @@
 }
 
 /**
- * Split an URL-encoded query string into an array.
+ * Splits a URL-encoded query string into an array.
  *
  * @param $query
  *   The query string to split.
@@ -452,7 +457,7 @@
 }
 
 /**
- * Parse an array into a valid, rawurlencoded query string.
+ * Parses an array into a valid, rawurlencoded query string.
  *
  * This differs from http_build_query() as we need to rawurlencode() (instead of
  * urlencode()) all query parameters.
@@ -493,7 +498,7 @@
 }
 
 /**
- * Prepare a 'destination' URL query parameter for use in combination with drupal_goto().
+ * Prepares a 'destination' URL query parameter for use with drupal_goto().
  *
  * Used to direct the user back to the referring page after completing a form.
  * By default the current URL is returned. If a destination exists in the
@@ -524,7 +529,7 @@
 }
 
 /**
- * Wrapper around parse_url() to parse a system URL string into an associative array, suitable for url().
+ * Parses a system URL string into an associative array suitable for url().
  *
  * This function should only be used for URLs that have been generated by the
  * system, resp. url(). It should not be used for URLs that come from external
@@ -621,7 +626,7 @@
 }
 
 /**
- * Send the user to a different Drupal page.
+ * Sends the user to a different Drupal page.
  *
  * This issues an on-site HTTP redirect. The function makes sure the redirected
  * URL is formatted correctly.
@@ -686,7 +691,7 @@
 }
 
 /**
- * Deliver a "site is under maintenance" message to the browser.
+ * Delivers a "site is under maintenance" message to the browser.
  *
  * Page callback functions wanting to report a "site offline" message should
  * return MENU_SITE_OFFLINE instead of calling drupal_site_offline(). However,
@@ -698,7 +703,7 @@
 }
 
 /**
- * Deliver a "page not found" error to the browser.
+ * Delivers a "page not found" error to the browser.
  *
  * Page callback functions wanting to report a "page not found" message should
  * return MENU_NOT_FOUND instead of calling drupal_not_found(). However,
@@ -710,19 +715,20 @@
 }
 
 /**
- * Deliver a "access denied" error to the browser.
+ * Delivers an "access denied" error to the browser.
  *
  * Page callback functions wanting to report an "access denied" message should
  * return MENU_ACCESS_DENIED instead of calling drupal_access_denied(). However,
  * functions that are invoked in contexts where that return value might not
- * bubble up to menu_execute_active_handler() should call drupal_access_denied().
+ * bubble up to menu_execute_active_handler() should call
+ * drupal_access_denied().
  */
 function drupal_access_denied() {
   drupal_deliver_page(MENU_ACCESS_DENIED);
 }
 
 /**
- * Perform an HTTP request.
+ * Performs an HTTP request.
  *
  * This is a flexible and powerful HTTP client implementation. Correctly
  * handles GET, POST, PUT or any other HTTP requests. Handles redirects.
@@ -832,7 +838,7 @@
     // Mark that this request failed. This will trigger a check of the web
     // server's ability to make outgoing HTTP requests the next time that
     // requirements checking is performed.
-    // See system_requirements()
+    // See system_requirements().
     variable_set('drupal_http_request_fails', TRUE);
 
     return $result;
@@ -1023,6 +1029,14 @@
  * @} End of "HTTP handling".
  */
 
+/**
+ * Strips slashes from a string or array of strings.
+ *
+ * Callback for array_walk() within fix_gpx_magic().
+ *
+ * @param $item
+ *   An individual string or array of strings from superglobals.
+ */
 function _fix_gpc_magic(&$item) {
   if (is_array($item)) {
     array_walk($item, '_fix_gpc_magic');
@@ -1033,11 +1047,19 @@
 }
 
 /**
- * Helper function to strip slashes from $_FILES skipping over the tmp_name keys
- * since PHP generates single backslashes for file paths on Windows systems.
- *
- * tmp_name does not have backslashes added see
- * http://php.net/manual/en/features.file-upload.php#42280
+ * Strips slashes from $_FILES items.
+ *
+ * Callback for array_walk() within fix_gpc_magic().
+ *
+ * The tmp_name key is skipped keys since PHP generates single backslashes for
+ * file paths on Windows systems.
+ *
+ * @param $item
+ *   An item from $_FILES.
+ * @param $key
+ *   The key for the item within $_FILES.
+ *
+ * @see http://php.net/manual/en/features.file-upload.php#42280
  */
 function _fix_gpc_magic_files(&$item, $key) {
   if ($key != 'tmp_name') {
@@ -1051,7 +1073,10 @@
 }
 
 /**
- * Fix double-escaping problems caused by "magic quotes" in some PHP installations.
+ * Fixes double-escaping caused by "magic quotes" in some PHP installations.
+ *
+ * @see _fix_gpc_magic()
+ * @see _fix_gpc_magic_files()
  */
 function fix_gpc_magic() {
   static $fixed = FALSE;
@@ -1072,12 +1097,13 @@
  */
 
 /**
- * Verify the syntax of the given e-mail address.
+ * Verifies the syntax of the given e-mail address.
  *
  * Empty e-mail addresses are allowed. See RFC 2822 for details.
  *
  * @param $mail
  *   A string containing an e-mail address.
+ *
  * @return
  *   TRUE if the address is in a valid format.
  */
@@ -1086,7 +1112,7 @@
 }
 
 /**
- * Verify the syntax of the given URL.
+ * Verifies the syntax of the given URL.
  *
  * This function should only be used on actual URLs. It should not be used for
  * Drupal menu paths, which can contain arbitrary characters.
@@ -1095,6 +1121,7 @@
  *   The URL to verify.
  * @param $absolute
  *   Whether the URL is absolute (beginning with a scheme such as "http:").
+ *
  * @return
  *   TRUE if the URL is in a valid format.
  */
@@ -1127,7 +1154,7 @@
  */
 
 /**
- * Register an event for the current visitor to the flood control mechanism.
+ * Registers an event for the current visitor to the flood control mechanism.
  *
  * @param $name
  *   The name of an event.
@@ -1154,7 +1181,7 @@
 }
 
 /**
- * Make the flood control mechanism forget about an event for the current visitor.
+ * Makes the flood control mechanism forget an event for the current visitor.
  *
  * @param $name
  *   The name of an event.
@@ -1172,7 +1199,7 @@
 }
 
 /**
- * Checks whether user is allowed to proceed with the specified event.
+ * Checks whether a user is allowed to proceed with the specified event.
  *
  * Events can have thresholds saying that each user can only do that event
  * a certain number of times in a time window. This function verifies that the
@@ -1266,7 +1293,7 @@
 }
 
 /**
- * Strips dangerous protocols (e.g. 'javascript:') from a URI and encodes it for output to an HTML attribute value.
+ * Strips dangerous protocols from a URI and encodes it for output to HTML.
  *
  * @param $uri
  *   A plain-text URI that might contain dangerous protocols.
@@ -1286,7 +1313,7 @@
 }
 
 /**
- * Very permissive XSS/HTML filter for admin-only use.
+ * Applies a very permissive XSS/HTML filter for admin-only use.
  *
  * Use only for fields where it is impractical to use the
  * whole filter system, but where some (mainly inline) mark-up
@@ -1300,7 +1327,7 @@
 }
 
 /**
- * Filters an HTML string to prevent cross-site-scripting (XSS) vulnerabilities.
+ * Filters HTML to prevent cross-site-scripting (XSS) vulnerabilities.
  *
  * Based on kses by Ulf Harnhammar, see http://sourceforge.net/projects/kses.
  * For examples of various XSS attacks, see: http://ha.ckers.org/xss.html.
@@ -1331,21 +1358,21 @@
   if (!drupal_validate_utf8($string)) {
     return '';
   }
-  // Store the text format
+  // Store the text format.
   _filter_xss_split($allowed_tags, TRUE);
-  // Remove NULL characters (ignored by some browsers)
+  // Remove NULL characters (ignored by some browsers).
   $string = str_replace(chr(0), '', $string);
-  // Remove Netscape 4 JS entities
+  // Remove Netscape 4 JS entities.
   $string = preg_replace('%&\s*\{[^}]*(\}\s*;?|$)%', '', $string);
 
-  // Defuse all HTML entities
+  // Defuse all HTML entities.
   $string = str_replace('&', '&', $string);
-  // Change back only well-formed entities in our whitelist
-  // Decimal numeric entities
+  // Change back only well-formed entities in our whitelist:
+  // Decimal numeric entities.
   $string = preg_replace('/&#([0-9]+;)/', '&#\1', $string);
-  // Hexadecimal numeric entities
+  // Hexadecimal numeric entities.
   $string = preg_replace('/&#[Xx]0*((?:[0-9A-Fa-f]{2})+;)/', '&#x\1', $string);
-  // Named entities
+  // Named entities.
   $string = preg_replace('/&([A-Za-z][A-Za-z0-9]*;)/', '&\1', $string);
 
   return preg_replace_callback('%
@@ -1369,6 +1396,7 @@
  *   If $store is FALSE then the array has one element, the HTML tag to process.
  * @param $store
  *   Whether to store $m.
+ *
  * @return
  *   If the element isn't allowed, an empty string. Otherwise, the cleaned up
  *   version of the HTML element.
@@ -1384,16 +1412,16 @@
   $string = $m[1];
 
   if (substr($string, 0, 1) != '<') {
-    // We matched a lone ">" character
+    // We matched a lone ">" character.
     return '>';
   }
   elseif (strlen($string) == 1) {
-    // We matched a lone "<" character
+    // We matched a lone "<" character.
     return '<';
   }
 
   if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?|(<!--.*?-->)$%', $string, $matches)) {
-    // Seriously malformed
+    // Seriously malformed.
     return '';
   }
 
@@ -1407,7 +1435,7 @@
   }
 
   if (!isset($allowed_html[strtolower($elem)])) {
-    // Disallowed HTML element
+    // Disallowed HTML element.
     return '';
   }
 
@@ -1423,7 +1451,7 @@
   $attrlist = preg_replace('%(\s?)/\s*$%', '\1', $attrlist, -1, $count);
   $xhtml_slash = $count ? ' /' : '';
 
-  // Clean up attributes
+  // Clean up attributes.
   $attr2 = implode(' ', _filter_xss_attributes($attrlist));
   $attr2 = preg_replace('/[<>]/', '', $attr2);
   $attr2 = strlen($attr2) ? ' ' . $attr2 : '';
@@ -1448,7 +1476,7 @@
 
     switch ($mode) {
       case 0:
-        // Attribute name, href for instance
+        // Attribute name, href for instance.
         if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) {
           $attrname = strtolower($match[1]);
           $skip = ($attrname == 'style' || substr($attrname, 0, 2) == 'on');
@@ -1458,7 +1486,7 @@
         break;
 
       case 1:
-        // Equals sign or valueless ("selected")
+        // Equals sign or valueless ("selected").
         if (preg_match('/^\s*=\s*/', $attr)) {
           $working = 1; $mode = 2;
           $attr = preg_replace('/^\s*=\s*/', '', $attr);
@@ -1475,7 +1503,7 @@
         break;
 
       case 2:
-        // Attribute value, a URL after href= for instance
+        // Attribute value, a URL after href= for instance.
         if (preg_match('/^"([^"]*)"(\s+|$)/', $attr, $match)) {
           $thisval = filter_xss_bad_protocol($match[1]);
 
@@ -1512,7 +1540,7 @@
     }
 
     if ($working == 0) {
-      // not well formed, remove and try again
+      // Not well formed; remove and try again.
       $attr = preg_replace('/
         ^
         (
@@ -1536,15 +1564,16 @@
 }
 
 /**
- * Processes an HTML attribute value and ensures it does not contain an URL with a disallowed protocol (e.g. javascript:).
+ * Processes an HTML attribute value and strips dangerous protocols from URLs.
  *
  * @param $string
  *   The string with the attribute value.
  * @param $decode
- *   (Deprecated) Whether to decode entities in the $string. Set to FALSE if the
+ *   (deprecated) Whether to decode entities in the $string. Set to FALSE if the
  *   $string is in plain text, TRUE otherwise. Defaults to TRUE. This parameter
  *   is deprecated and will be removed in Drupal 8. To process a plain-text URI,
  *   call drupal_strip_dangerous_protocols() or check_url() instead.
+ *
  * @return
  *   Cleaned up and HTML-escaped version of $string.
  */
@@ -1598,7 +1627,7 @@
 }
 
 /**
- * Format a single RSS item.
+ * Formats a single RSS item.
  *
  * Arbitrary elements may be added using the $args associative array.
  */
@@ -1614,7 +1643,7 @@
 }
 
 /**
- * Format XML elements.
+ * Formats XML elements.
  *
  * @param $array
  *   An array where each item represents an element and is either a:
@@ -1653,7 +1682,7 @@
 }
 
 /**
- * Format a string containing a count of items.
+ * Formats a string containing a count of items.
  *
  * This function ensures that the string is pluralized correctly. Since t() is
  * called by this function, make sure not to pass already-localized strings to
@@ -1675,31 +1704,27 @@
  * @param $count
  *   The item count to display.
  * @param $singular
- *   The string for the singular case. Please make sure it is clear this is
- *   singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
- *   Do not use @count in the singular string.
+ *   The string for the singular case. Make sure it is clear this is singular,
+ *   to ease translation (e.g. use "1 new comment" instead of "1 new"). Do not
+ *   use @count in the singular string.
  * @param $plural
- *   The string for the plural case. Please make sure it is clear this is plural,
- *   to ease translation. Use @count in place of the item count, as in "@count
- *   new comments".
+ *   The string for the plural case. Make sure it is clear this is plural, to
+ *   ease translation. Use @count in place of the item count, as in
+ *   "@count new comments".
  * @param $args
- *   An associative array of replacements to make after translation. Incidences
+ *   An associative array of replacements to make after translation. Instances
  *   of any key in this array are replaced with the corresponding value.
- *   Based on the first character of the key, the value is escaped and/or themed:
- *    - !variable: inserted as is
- *    - @variable: escape plain text to HTML (check_plain)
- *    - %variable: escape text and theme as a placeholder for user-submitted
- *      content (check_plain + drupal_placeholder)
- *   Note that you do not need to include @count in this array.
- *   This replacement is done automatically for the plural case.
+ *   Based on the first character of the key, the value is escaped and/or
+ *   themed. See format_string(). Note that you do not need to include @count
+ *   in this array; this replacement is done automatically for the plural case.
  * @param $options
- *   An associative array of additional options, with the following keys:
- *     - 'langcode' (default to the current language) The language code to
- *       translate to a language other than what is used to display the page.
- *     - 'context' (default to the empty context) The context the source string
- *       belongs to.
+ *   An associative array of additional options. See t() for allowed keys.
+ *
  * @return
  *   A translated string.
+ *
+ * @see t()
+ * @see format_string()
  */
 function format_plural($count, $singular, $plural, array $args = array(), array $options = array()) {
   $args['@count'] = $count;
@@ -1728,11 +1753,12 @@
 }
 
 /**
- * Parse a given byte count.
+ * Parses a given byte count.
  *
  * @param $size
  *   A size expressed as a number of bytes with optional SI or IEC binary unit
  *   prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8 bytes, 9mbytes).
+ *
  * @return
  *   An integer representation of the size in bytes.
  */
@@ -1749,13 +1775,14 @@
 }
 
 /**
- * Generate a string representation for the given byte count.
+ * Generates a string representation for the given byte count.
  *
  * @param $size
  *   A size in bytes.
  * @param $langcode
  *   Optional language code to translate to a language other than what is used
  *   to display the page.
+ *
  * @return
  *   A translated string representation of the size.
  */
@@ -1788,19 +1815,20 @@
 }
 
 /**
- * Format a time interval with the requested granularity.
- *
- * @param $timestamp
+ * Formats a time interval with the requested granularity.
+ *
+ * @param $interval
  *   The length of the interval in seconds.
  * @param $granularity
  *   How many different units to display in the string.
  * @param $langcode
  *   Optional language code to translate to a language other than
  *   what is used to display the page.
+ *
  * @return
  *   A translated string representation of the interval.
  */
-function format_interval($timestamp, $granularity = 2, $langcode = NULL) {
+function format_interval($interval, $granularity = 2, $langcode = NULL) {
   $units = array(
     '1 year|@count years' => 31536000,
     '1 month|@count months' => 2592000,
@@ -1813,9 +1841,9 @@
   $output = '';
   foreach ($units as $key => $value) {
     $key = explode('|', $key);
-    if ($timestamp >= $value) {
-      $output .= ($output ? ' ' : '') . format_plural(floor($timestamp / $value), $key[0], $key[1], array(), array('langcode' => $langcode));
-      $timestamp %= $value;
+    if ($interval >= $value) {
+      $output .= ($output ? ' ' : '') . format_plural(floor($interval / $value), $key[0], $key[1], array(), array('langcode' => $langcode));
+      $interval %= $value;
       $granularity--;
     }
 
@@ -1928,10 +1956,11 @@
 /**
  * Returns an ISO8601 formatted date based on the given date.
  *
- * Can be used as a callback for RDF mappings.
+ * Callback for use within hook_rdf_mapping() implementations.
  *
  * @param $date
  *   A UNIX timestamp.
+ *
  * @return string
  *   An ISO8601 formatted date.
  */
@@ -1942,7 +1971,9 @@
 }
 
 /**
- * Callback function for preg_replace_callback().
+ * Translates a formatted date string.
+ *
+ * Callback for preg_replace_callback() within format_date().
  */
 function _format_date_callback(array $matches = NULL, $new_langcode = NULL) {
   // We cache translations to avoid redundant and rather costly calls to t().
@@ -2057,8 +2088,8 @@
  *     Drupal on a web server that cannot be configured to automatically find
  *     index.php, then hook_url_outbound_alter() can be implemented to force
  *     this value to 'index.php'.
- *   - 'entity_type': The entity type of the object that called url(). Only set if
- *     url() is invoked by entity_uri().
+ *   - 'entity_type': The entity type of the object that called url(). Only
+ *     set if url() is invoked by entity_uri().
  *   - 'entity': The entity object (such as a node) for which the URL is being
  *     generated. Only set if url() is invoked by entity_uri().
  *
@@ -2183,7 +2214,7 @@
 }
 
 /**
- * Return TRUE if a path is external to Drupal (e.g. http://example.com).
+ * Returns TRUE if a path is external to Drupal (e.g. http://example.com).
  *
  * If a path cannot be assessed by Drupal's menu handler, then we must
  * treat it as potentially insecure.
@@ -2191,6 +2222,7 @@
  * @param $path
  *   The internal path or external URL being linked to, such as "node/34" or
  *   "http://example.com/foo".
+ *
  * @return
  *   Boolean TRUE or FALSE, where TRUE indicates an external path.
  */
@@ -2203,7 +2235,7 @@
 }
 
 /**
- * Format an attribute string for a HTTP header.
+ * Formats an attribute string for an HTTP header.
  *
  * @param $attributes
  *   An associative array of attributes such as 'rel'.
@@ -2225,7 +2257,7 @@
 }
 
 /**
- * Converts an associative array to an attribute string for use in XML/HTML tags.
+ * Converts an associative array to an XML/HTML tag attribute string.
  *
  * Each array key and its value will be formatted into an attribute string.
  * If a value is itself an array, then its elements are concatenated to a single
@@ -2338,7 +2370,7 @@
     // rendering.
     if (variable_get('theme_link', TRUE)) {
       drupal_theme_initialize();
-      $registry = theme_get_registry();
+      $registry = theme_get_registry(FALSE);
       // We don't want to duplicate functionality that's in theme(), so any
       // hint of a module or theme doing anything at all special with the 'link'
       // theme hook should simply result in theme() being called. This includes
@@ -2446,7 +2478,7 @@
 }
 
 /**
- * Package and send the result of a page callback to the browser as HTML.
+ * Packages and sends the result of a page callback to the browser as HTML.
  *
  * @param $page_callback_result
  *   The result of a page callback. Can be one of:
@@ -2465,6 +2497,10 @@
   if (isset($page_callback_result) && is_null(drupal_get_http_header('Content-Type'))) {
     drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
   }
+
+  // Send appropriate HTTP-Header for browsers and search engines.
+  global $language;
+  drupal_add_http_header('Content-Language', $language->language);
 
   // Menu status constants are integers; page content is a string or array.
   if (is_int($page_callback_result)) {
@@ -2551,7 +2587,7 @@
 }
 
 /**
- * Perform end-of-request tasks.
+ * Performs end-of-request tasks.
  *
  * This function sets the page cache if appropriate, and allows modules to
  * react to the closing of the page by calling hook_exit().
@@ -2578,7 +2614,7 @@
 }
 
 /**
- * Perform end-of-request tasks.
+ * Performs end-of-request tasks.
  *
  * In some cases page requests need to end without calling drupal_page_footer().
  * In these cases, call drupal_exit() instead. There should rarely be a reason
@@ -2600,7 +2636,7 @@
 }
 
 /**
- * Form an associative array from a linear array.
+ * Forms an associative array from a linear array.
  *
  * This function walks through the provided array and constructs an associative
  * array out of it. The keys of the resulting array will be the values of the
@@ -2676,10 +2712,10 @@
 }
 
 /**
- * Return the base URL path (i.e., directory) of the Drupal installation.
- *
- * base_path() prefixes and suffixes a "/" onto the returned path if the path is
- * not empty. At the very least, this will return "/".
+ * Returns the base URL path (i.e., directory) of the Drupal installation.
+ *
+ * base_path() adds a "/" to the beginning and end of the returned path if the
+ * path is not empty. At the very least, this will return "/".
  *
  * Examples:
  * - http://example.com returns "/" because the path is empty.
@@ -2690,12 +2726,12 @@
 }
 
 /**
- * Add a LINK tag with a distinct 'rel' attribute to the page's HEAD.
- *
- * This function can be called as long the HTML header hasn't been sent,
- * which on normal pages is up through the preprocess step of theme('html').
- * Adding a link will overwrite a prior link with the exact same 'rel' and
- * 'href' attributes.
+ * Adds a LINK tag with a distinct 'rel' attribute to the page's HEAD.
+ *
+ * This function can be called as long the HTML header hasn't been sent, which
+ * on normal pages is up through the preprocess step of theme('html'). Adding
+ * a link will overwrite a prior link with the exact same 'rel' and 'href'
+ * attributes.
  *
  * @param $attributes
  *   Associative array of element attributes including 'href' and 'rel'.
@@ -2759,8 +2795,8 @@
  *     See drupal_get_css() where the overrides are performed. Also, if the
  *     direction of the current language is right-to-left (Hebrew, Arabic,
  *     etc.), the function will also look for an RTL CSS file and append it to
- *     the list. The name of this file should have an '-rtl.css' suffix.  For
- *     example a CSS file called 'mymodule-name.css' will have a
+ *     the list. The name of this file should have an '-rtl.css' suffix. For
+ *     example, a CSS file called 'mymodule-name.css' will have a
  *     'mymodule-name-rtl.css' file added to the list, if exists in the same
  *     directory. This CSS file should contain overrides for properties which
  *     should be reversed or otherwise different in a right-to-left display.
@@ -2892,7 +2928,7 @@
 }
 
 /**
- * Returns a themed representation of all stylesheets that should be attached to the page.
+ * Returns a themed representation of all stylesheets to attach to the page.
  *
  * It loads the CSS in order, with 'module' first, then 'theme' afterwards.
  * This ensures proper cascading of styles so themes can easily override
@@ -2938,7 +2974,7 @@
   foreach ($css as $key => $item) {
     if ($item['type'] == 'file') {
       // If defined, force a unique basename for this file.
-      $basename = isset($item['basename']) ? $item['basename'] : basename($item['data']);
+      $basename = isset($item['basename']) ? $item['basename'] : drupal_basename($item['data']);
       if (isset($previous_item[$basename])) {
         // Remove the previous item that shared the same base name.
         unset($css[$previous_item[$basename]]);
@@ -2962,11 +2998,24 @@
 }
 
 /**
- * Function used by uasort to sort the array structures returned by drupal_add_css() and drupal_add_js().
+ * Sorts CSS and JavaScript resources.
+ *
+ * Callback for uasort() within:
+ * - drupal_get_css()
+ * - drupal_get_js()
  *
  * This sort order helps optimize front-end performance while providing modules
  * and themes with the necessary control for ordering the CSS and JavaScript
  * appearing on a page.
+ *
+ * @param $a
+ *   First item for comparison. The compared items should be associative arrays
+ *   of member items from drupal_add_css() or drupal_add_js().
+ * @param $b
+ *   Second item for comparison.
+ *
+ * @see drupal_add_css()
+ * @see drupal_add_js()
  */
 function drupal_sort_css_js($a, $b) {
   // First order by group, so that, for example, all items in the CSS_SYSTEM
@@ -3033,6 +3082,7 @@
  *   'items' key, which is the subset of items from $css that are in the group.
  *
  * @see drupal_pre_render_styles()
+ * @see system_element_info()
  */
 function drupal_group_css($css) {
   $groups = array();
@@ -3115,6 +3165,7 @@
  *
  * @see drupal_group_css()
  * @see drupal_pre_render_styles()
+ * @see system_element_info()
  */
 function drupal_aggregate_css(&$css_groups) {
   $preprocess_css = (variable_get('preprocess_css', FALSE) && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update'));
@@ -3376,8 +3427,8 @@
  * in $css while the value is the cache file name. The cache file is generated
  * in two cases. First, if there is no file name value for the key, which will
  * happen if a new file name has been added to $css or after the lookup
- * variable is emptied to force a rebuild of the cache.  Second, the cache
- * file is generated if it is missing on disk. Old cache files are not deleted
+ * variable is emptied to force a rebuild of the cache. Second, the cache file
+ * is generated if it is missing on disk. Old cache files are not deleted
  * immediately when the lookup variable is emptied, but are deleted after a set
  * period by drupal_delete_file_if_stale(). This ensures that files referenced
  * by a cached page will still be available.
@@ -3455,9 +3506,7 @@
 }
 
 /**
- * Helper function for drupal_build_css_cache().
- *
- * This function will prefix all paths within a CSS file.
+ * Prefixes all paths within a CSS file for drupal_build_css_cache().
  */
 function _drupal_build_css_path($matches, $base = NULL) {
   $_base = &drupal_static(__FUNCTION__);
@@ -3528,13 +3577,14 @@
 }
 
 /**
- * Process the contents of a stylesheet for aggregation.
+ * Processes the contents of a stylesheet for aggregation.
  *
  * @param $contents
  *   The contents of the stylesheet.
  * @param $optimize
  *   (optional) Boolean whether CSS contents should be minified. Defaults to
  *   FALSE.
+ *
  * @return
  *   Contents of the stylesheet including the imported stylesheets.
  */
@@ -3630,7 +3680,7 @@
 }
 
 /**
- * Prepare a string for use as a valid CSS identifier (element, class or ID name).
+ * Prepares a string for use as a CSS identifier (element, class, or ID name).
  *
  * http://www.w3.org/TR/CSS21/syndata.html#characters shows the syntax for valid
  * CSS identifiers (including element names, classes, and IDs in selectors.)
@@ -3639,6 +3689,7 @@
  *   The identifier to clean.
  * @param $filter
  *   An array of string replacements to use on the identifier.
+ *
  * @return
  *   The cleaned identifier.
  */
@@ -3660,13 +3711,14 @@
 }
 
 /**
- * Prepare a string for use as a valid class name.
+ * Prepares a string for use as a valid class name.
  *
  * Do not pass one string containing multiple classes as they will be
  * incorrectly concatenated with dashes, i.e. "one two" will become "one-two".
  *
  * @param $class
  *   The class name to clean.
+ *
  * @return
  *   The cleaned class name.
  */
@@ -3675,7 +3727,7 @@
 }
 
 /**
- * Prepare a string for use as a valid HTML ID and guarantee uniqueness.
+ * Prepares a string for use as a valid HTML ID and guarantees uniqueness.
  *
  * This function ensures that each passed HTML ID value only exists once on the
  * page. By tracking the already returned ids, this function enables forms,
@@ -3806,7 +3858,7 @@
  *   to tell the user that a new message arrived, by opening a pop up, alert
  *   box, etc.). This should only be used for JavaScript that cannot be executed
  *   from a file. When adding inline code, make sure that you are not relying on
- *   $() being the jQuery function.  Wrap your code in
+ *   $() being the jQuery function. Wrap your code in
  *   @code (function ($) {... })(jQuery); @endcode
  *   or use jQuery() instead of $().
  * - Add external JavaScript ('external'): Allows the inclusion of external
@@ -3926,7 +3978,7 @@
  *       happened later in the page request gets added to the page after one for
  *       which drupal_add_js() happened earlier in the page request.
  *   - defer: If set to TRUE, the defer attribute is set on the <script>
- *     tag.  Defaults to FALSE.
+ *     tag. Defaults to FALSE.
  *   - cache: If set to FALSE, the JavaScript file is loaded anew on every page
  *     call; in other words, it is not cached. Used only when 'type' references
  *     a JavaScript file. Defaults to TRUE.
@@ -4023,6 +4075,7 @@
  *
  * @param $data
  *   (optional) The default data parameter for the JavaScript item array.
+ *
  * @see drupal_get_js()
  * @see drupal_add_js()
  */
@@ -4066,8 +4119,10 @@
  *   (optional) If set to TRUE, this function skips calling drupal_alter() on
  *   $javascript, useful when the calling function passes a $javascript array
  *   that has already been altered.
+ *
  * @return
  *   All JavaScript code segments and includes for the scope as HTML tags.
+ *
  * @see drupal_add_js()
  * @see locale_js_alter()
  * @see drupal_js_defaults()
@@ -4239,7 +4294,7 @@
  * );
  * @endcode
  *
- * 'js', 'css', and 'library' are types that get special handling.  For any
+ * 'js', 'css', and 'library' are types that get special handling. For any
  * other kind of attached data, the array key must be the full name of the
  * callback function and each value an array of arguments. For example:
  * @code
@@ -4590,16 +4645,16 @@
 }
 
 /**
- * Assist in adding the tableDrag JavaScript behavior to a themed table.
+ * Assists in adding the tableDrag JavaScript behavior to a themed table.
  *
  * Draggable tables should be used wherever an outline or list of sortable items
  * needs to be arranged by an end-user. Draggable tables are very flexible and
  * can manipulate the value of form elements placed within individual columns.
  *
- * To set up a table to use drag and drop in place of weight select-lists or
- * in place of a form that contains parent relationships, the form must be
- * themed into a table. The table must have an id attribute set. If using
- * theme_table(), the id may be set as such:
+ * To set up a table to use drag and drop in place of weight select-lists or in
+ * place of a form that contains parent relationships, the form must be themed
+ * into a table. The table must have an ID attribute set. If using
+ * theme_table(), the ID may be set as follows:
  * @code
  * $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'my-module-table')));
  * return $output;
@@ -4614,8 +4669,8 @@
  * $form['my_elements'][$delta]['weight']['#attributes']['class'] = array('my-elements-weight');
  * @endcode
  *
- * Each row of the table must also have a class of "draggable" in order to enable the
- * drag handles:
+ * Each row of the table must also have a class of "draggable" in order to
+ * enable the drag handles:
  * @code
  * $row = array(...);
  * $rows[] = array(
@@ -4635,8 +4690,8 @@
  * @endcode
  *
  * In a more complex case where there are several groups in one column (such as
- * the block regions on the admin/structure/block page), a separate subgroup class
- * must also be added to differentiate the groups.
+ * the block regions on the admin/structure/block page), a separate subgroup
+ * class must also be added to differentiate the groups.
  * @code
  * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = array('my-elements-weight', 'my-elements-weight-' . $region);
  * @endcode
@@ -4653,14 +4708,14 @@
  *
  * In a situation where tree relationships are present, adding multiple
  * subgroups is not necessary, because the table will contain indentations that
- * provide enough information about the sibling and parent relationships.
- * See theme_menu_overview_form() for an example creating a table containing
- * parent relationships.
- *
- * Please note that this function should be called from the theme layer, such as
- * in a .tpl.php file, theme_ function, or in a template_preprocess function,
- * not in a form declaration. Though the same JavaScript could be added to the
- * page using drupal_add_js() directly, this function helps keep template files
+ * provide enough information about the sibling and parent relationships. See
+ * theme_menu_overview_form() for an example creating a table containing parent
+ * relationships.
+ *
+ * Note that this function should be called from the theme layer, such as in a
+ * .tpl.php file, theme_ function, or in a template_preprocess function, not in
+ * a form declaration. Though the same JavaScript could be added to the page
+ * using drupal_add_js() directly, this function helps keep template files
  * clean and readable. It also prevents tabledrag.js from being added twice
  * accidentally.
  *
@@ -4733,8 +4788,8 @@
  * $files while the value is the cache file name. The cache file is generated
  * in two cases. First, if there is no file name value for the key, which will
  * happen if a new file name has been added to $files or after the lookup
- * variable is emptied to force a rebuild of the cache.  Second, the cache
- * file is generated if it is missing on disk. Old cache files are not deleted
+ * variable is emptied to force a rebuild of the cache. Second, the cache file
+ * is generated if it is missing on disk. Old cache files are not deleted
  * immediately when the lookup variable is emptied, but are deleted after a set
  * period by drupal_delete_file_if_stale(). This ensures that files referenced
  * by a cached page will still be available.
@@ -4800,14 +4855,29 @@
 /**
  * Converts a PHP variable into its JavaScript equivalent.
  *
- * We use HTML-safe strings, i.e. with <, > and & escaped.
+ * We use HTML-safe strings, with several characters escaped.
  *
  * @see drupal_json_decode()
+ * @see drupal_json_encode_helper()
  * @ingroup php_wrappers
  */
 function drupal_json_encode($var) {
-  // json_encode() does not escape <, > and &, so we do it with str_replace().
-  return str_replace(array('<', '>', '&'), array('\u003c', '\u003e', '\u0026'), json_encode($var));
+  // The PHP version cannot change within a request.
+  static $php530;
+
+  if (!isset($php530)) {
+    $php530 = version_compare(PHP_VERSION, '5.3.0', '>=');
+  }
+
+  if ($php530) {
+    // Encode <, >, ', &, and " using the json_encode() options parameter.
+    return json_encode($var, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT);
+  }
+
+  // json_encode() escapes <, >, ', &, and " using its options parameter, but
+  // does not support this parameter prior to PHP 5.3.0.  Use a helper instead.
+  include_once DRUPAL_ROOT . '/includes/json-encode.inc';
+  return drupal_json_encode_helper($var);
 }
 
 /**
@@ -4821,7 +4891,7 @@
 }
 
 /**
- * Return data in JSON format.
+ * Returns data in JSON format.
  *
  * This function should be used for JavaScript callback functions returning
  * data in JSON format. It sets the header for JavaScript output.
@@ -4839,7 +4909,7 @@
 }
 
 /**
- * Get a salt useful for hardening against SQL injection.
+ * Gets a salt useful for hardening against SQL injection.
  *
  * @return
  *   A salt based on information in settings.php, not in the database.
@@ -4852,7 +4922,7 @@
 }
 
 /**
- * Ensure the private key variable used to generate tokens is set.
+ * Ensures the private key variable used to generate tokens is set.
  *
  * @return
  *   The private key.
@@ -4866,7 +4936,7 @@
 }
 
 /**
- * Generate a token based on $value, the current user session and private key.
+ * Generates a token based on $value, the user session, and the private key.
  *
  * @param $value
  *   An additional value to base the token on.
@@ -4876,7 +4946,7 @@
 }
 
 /**
- * Validate a token based on $value, the current user session and private key.
+ * Validates a token based on $value, the user session, and the private key.
  *
  * @param $token
  *   The token to be validated.
@@ -4884,6 +4954,7 @@
  *   An additional value to base the token on.
  * @param $skip_anonymous
  *   Set to true to skip token validation for anonymous users.
+ *
  * @return
  *   True for a valid token, false for an invalid token. When $skip_anonymous
  *   is true, the return value will always be true for anonymous users.
@@ -4952,7 +5023,7 @@
 }
 
 /**
- * Store the current page in the cache.
+ * Stores the current page in the cache.
  *
  * If page_compression is enabled, a gzipped version of the page is stored in
  * the cache to avoid compressing the output on each request. The cache entry
@@ -5004,10 +5075,10 @@
 /**
  * Executes a cron run when called.
  *
- * Do not call this function from test, use $this->cronRun() instead.
- *
- * @return
- *   Returns TRUE if ran successfully
+ * Do not call this function from a test. Use $this->cronRun() instead.
+ *
+ * @return
+ *   TRUE if cron ran successfully.
  */
 function drupal_cron_run() {
   // Allow execution to continue even if the request gets canceled.
@@ -5040,7 +5111,7 @@
     foreach ($queues as $queue_name => $info) {
       DrupalQueue::get($queue_name)->createQueue();
     }
-    // Register shutdown callback
+    // Register shutdown callback.
     drupal_register_shutdown_function('drupal_cron_cleanup');
 
     // Iterate through the modules calling their cron handlers (if any):
@@ -5054,7 +5125,7 @@
       }
     }
 
-    // Record cron time
+    // Record cron time.
     variable_set('cron_last', REQUEST_TIME);
     watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);
 
@@ -5082,14 +5153,17 @@
 }
 
 /**
- * Shutdown function for cron cleanup.
+ * Shutdown function: Performs cron cleanup.
+ *
+ * @see drupal_cron_run()
+ * @see drupal_register_shutdown_function()
  */
 function drupal_cron_cleanup() {
   // See if the semaphore is still locked.
   if (variable_get('cron_semaphore', FALSE)) {
     watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), WATCHDOG_WARNING);
 
-    // Release cron semaphore
+    // Release cron semaphore.
     variable_del('cron_semaphore');
   }
 }
@@ -5158,14 +5232,14 @@
     $searchdir[] = "profiles/$profile/$directory";
   }
 
-  // Always search sites/all/* as well as the global directories
+  // Always search sites/all/* as well as the global directories.
   $searchdir[] = 'sites/all/' . $directory;
 
   if (file_exists("$config/$directory")) {
     $searchdir[] = "$config/$directory";
   }
 
-  // Get current list of items
+  // Get current list of items.
   if (!function_exists('file_scan_directory')) {
     require_once DRUPAL_ROOT . '/includes/file.inc';
   }
@@ -5201,7 +5275,7 @@
 }
 
 /**
- * Set the main page content value for later use.
+ * Sets the main page content value for later use.
  *
  * Given the nature of the Drupal page handling, this will be called once with
  * a string or array. We store that and return it later as the block is being
@@ -5209,6 +5283,7 @@
  *
  * @param $content
  *   A string or renderable array representing the body of the page.
+ *
  * @return
  *   If called without $content, a renderable array representing the body of
  *   the page.
@@ -5459,13 +5534,13 @@
  * Note that if also a #theme is defined for the element, then the result of
  * the theme callback will override #children.
  *
- * @see drupal_render()
- *
  * @param $elements
  *   A structured array using the #markup key.
  *
  * @return
  *   The passed-in elements, but #markup appended to #children.
+ *
+ * @see drupal_render()
  */
 function drupal_pre_render_markup($elements) {
   $elements['#children'] = $elements['#markup'];
@@ -5478,8 +5553,10 @@
  * @param $page
  *   A string or array representing the content of a page. The array consists of
  *   the following keys:
- *   - #type: Value is always 'page'. This pushes the theming through page.tpl.php (required).
- *   - #show_messages: Suppress drupal_get_message() items. Used by Batch API (optional).
+ *   - #type: Value is always 'page'. This pushes the theming through
+ *     page.tpl.php (required).
+ *   - #show_messages: Suppress drupal_get_message() items. Used by Batch
+ *     API (optional).
  *
  * @see hook_page_alter()
  * @see element_info()
@@ -5556,20 +5633,20 @@
  * drupal_render() can optionally cache the rendered output of elements to
  * improve performance. To use drupal_render() caching, set the element's #cache
  * property to an associative array with one or several of the following keys:
- *    - 'keys': An array of one or more keys that identify the element. If 'keys'
- *       is set, the cache ID is created automatically from these keys. See
- *       drupal_render_cid_create().
- *    - 'granularity' (optional): Define the cache granularity using binary
- *       combinations of the cache granularity constants, e.g. DRUPAL_CACHE_PER_USER
- *       to cache for each user separately or
- *       DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE to cache separately for each
- *       page and role. If not specified the element is cached globally for each
- *       theme and language.
- *    - 'cid': Specify the cache ID directly. Either 'keys' or 'cid' is required.
- *       If 'cid' is set, 'keys' and 'granularity' are ignored. Use only if you
- *       have special requirements.
- *    - 'expire': Set to one of the cache lifetime constants.
- *    - 'bin': Specify a cache bin to cache the element in. Defaults to 'cache'.
+ * - 'keys': An array of one or more keys that identify the element. If 'keys'
+ *   is set, the cache ID is created automatically from these keys. See
+ *   drupal_render_cid_create().
+ * - 'granularity' (optional): Define the cache granularity using binary
+ *   combinations of the cache granularity constants, e.g.
+ *   DRUPAL_CACHE_PER_USER to cache for each user separately or
+ *   DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE to cache separately for each
+ *   page and role. If not specified the element is cached globally for each
+ *   theme and language.
+ * - 'cid': Specify the cache ID directly. Either 'keys' or 'cid' is required.
+ *   If 'cid' is set, 'keys' and 'granularity' are ignored. Use only if you
+ *   have special requirements.
+ * - 'expire': Set to one of the cache lifetime constants.
+ * - 'bin': Specify a cache bin to cache the element in. Defaults to 'cache'.
  *
  * This function is usually called from within another function, like
  * drupal_get_form() or a theme function. Elements are sorted internally
@@ -5586,6 +5663,7 @@
  *
  * @param $elements
  *   The structured array describing the data to be rendered.
+ *
  * @return
  *   The rendered HTML.
  */
@@ -5601,8 +5679,11 @@
   }
 
   // Try to fetch the element's markup from cache and return.
-  if (isset($elements['#cache']) && $cached_output = drupal_render_cache_get($elements)) {
-    return $cached_output;
+  if (isset($elements['#cache'])) {
+    $cached_output = drupal_render_cache_get($elements);
+    if ($cached_output !== FALSE) {
+      return $cached_output;
+    }
   }
 
   // If #markup is set, ensure #type is set. This allows to specify just #markup
@@ -5699,7 +5780,7 @@
 }
 
 /**
- * Render children of an element and concatenate them.
+ * Renders children of an element and concatenates them.
  *
  * This renders all children of an element using drupal_render() and then
  * joins them together into a single string.
@@ -5724,7 +5805,7 @@
 }
 
 /**
- * Render an element.
+ * Renders an element.
  *
  * This function renders an element using drupal_render(). The top level
  * element is shown with show() before rendering, so it will always be rendered
@@ -5753,7 +5834,7 @@
 }
 
 /**
- * Hide an element from later rendering.
+ * Hides an element from later rendering.
  *
  * The first time render() or drupal_render() is called on an element tree,
  * as each element in the tree is rendered, it is marked with a #printed flag
@@ -5779,7 +5860,7 @@
 }
 
 /**
- * Show a hidden element for later rendering.
+ * Shows a hidden element for later rendering.
  *
  * You can also use render($element), which shows the element while rendering
  * it.
@@ -5808,16 +5889,17 @@
 }
 
 /**
- * Get the rendered output of a renderable element from cache.
+ * Gets the rendered output of a renderable element from the cache.
+ *
+ * @param $elements
+ *   A renderable array.
+ *
+ * @return
+ *   A markup string containing the rendered content of the element, or FALSE
+ *   if no cached copy of the element is available.
  *
  * @see drupal_render()
  * @see drupal_render_cache_set()
- *
- * @param $elements
- *   A renderable array.
- * @return
- *   A markup string containing the rendered content of the element, or FALSE
- *   if no cached copy of the element is available.
  */
 function drupal_render_cache_get($elements) {
   if (!in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD')) || !$cid = drupal_render_cid_create($elements)) {
@@ -5838,17 +5920,17 @@
 }
 
 /**
- * Cache the rendered output of a renderable element.
- *
- * This is called by drupal_render() if the #cache property is set on an element.
- *
- * @see drupal_render()
- * @see drupal_render_cache_get()
+ * Caches the rendered output of a renderable element.
+ *
+ * This is called by drupal_render() if the #cache property is set on an
+ * element.
  *
  * @param $markup
  *   The rendered output string of $elements.
  * @param $elements
  *   A renderable array.
+ *
+ * @see drupal_render_cache_get()
  */
 function drupal_render_cache_set(&$markup, $elements) {
   // Create the cache ID for the element.
@@ -5874,7 +5956,7 @@
 }
 
 /**
- * Collect #attached for an element and all child elements into a single array.
+ * Collects #attached for an element and its children into a single array.
  *
  * When caching elements, it is necessary to collect all libraries, JavaScript
  * and CSS into a single array, from both the element itself and all child
@@ -5917,9 +5999,10 @@
 }
 
 /**
- * Prepare an element for caching based on a query. This smart caching strategy
- * saves Drupal from querying and rendering to HTML when the underlying query is
- * unchanged.
+ * Prepares an element for caching based on a query.
+ *
+ * This smart caching strategy saves Drupal from querying and rendering to HTML
+ * when the underlying query is unchanged.
  *
  * Expensive queries should use the query builder to create the query and then
  * call this function. Executing the query and formatting results should happen
@@ -5957,12 +6040,15 @@
 }
 
 /**
- * Helper function for building cache ids.
+ * Returns cache ID parts for building a cache ID.
  *
  * @param $granularity
- *   One or more cache granularity constants, e.g. DRUPAL_CACHE_PER_USER to cache
- *   for each user separately or DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE to
- *   cache separately for each page and role.
+ *   One or more cache granularity constants. For example, to cache separately
+ *   for each user, use DRUPAL_CACHE_PER_USER. To cache separately for each
+ *   page and role, use the expression:
+ *   @code
+ *   DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE
+ *   @endcode
  *
  * @return
  *   An array of cache ID parts, always containing the active theme. If the
@@ -6001,7 +6087,7 @@
 }
 
 /**
- * Create the cache ID for a renderable element.
+ * Creates the cache ID for a renderable element.
  *
  * This creates the cache ID string, either by returning the #cache['cid']
  * property if present or by building the cache ID out of the #cache['keys']
@@ -6048,7 +6134,7 @@
 }
 
 /**
- * Retrieve the default properties for the defined element type.
+ * Retrieves the default properties for the defined element type.
  *
  * @param $type
  *   An element type as defined by hook_element_info().
@@ -6074,7 +6160,7 @@
 }
 
 /**
- * Retrieve a single property for the defined element type.
+ * Retrieves a single property for the defined element type.
  *
  * @param $type
  *   An element type as defined by hook_element_info().
@@ -6114,21 +6200,21 @@
 }
 
 /**
- * Check if the key is a property.
+ * Checks if the key is a property.
  */
 function element_property($key) {
   return $key[0] == '#';
 }
 
 /**
- * Get properties of a structured array element. Properties begin with '#'.
+ * Gets properties of a structured array element (keys beginning with '#').
  */
 function element_properties($element) {
   return array_filter(array_keys((array) $element), 'element_property');
 }
 
 /**
- * Check if the key is a child.
+ * Checks if the key is a child.
  */
 function element_child($key) {
   return !isset($key[0]) || $key[0] != '#';
@@ -6144,6 +6230,7 @@
  *   The element array whose children are to be identified.
  * @param $sort
  *   Boolean to indicate whether the children should be sorted by weight.
+ *
  * @return
  *   The array keys of the element's children.
  */
@@ -6183,6 +6270,7 @@
  *
  * @param $elements
  *   The parent element.
+ *
  * @return
  *   The array keys of the element's visible children.
  */
@@ -6377,7 +6465,7 @@
 }
 
 /**
- * Determines whether a nested array with variable depth contains all of the requested keys.
+ * Determines whether a nested array contains the requested keys.
  *
  * This helper function should be used when the depth of the array element to be
  * checked may vary (that is, the number of parent keys is variable). See
@@ -6413,11 +6501,11 @@
 }
 
 /**
- * Provide theme registration for themes across .inc files.
+ * Provides theme registration for themes across .inc files.
  */
 function drupal_common_theme() {
   return array(
-    // theme.inc
+    // From theme.inc.
     'html' => array(
       'render element' => 'page',
       'template' => 'html',
@@ -6493,7 +6581,7 @@
     'html_tag' => array(
       'render element' => 'element',
     ),
-    // from theme.maintenance.inc
+    // From theme.maintenance.inc.
     'maintenance_page' => array(
       'variables' => array('content' => NULL, 'show_messages' => TRUE),
       'template' => 'maintenance-page',
@@ -6513,7 +6601,7 @@
     'authorize_report' => array(
       'variables' => array('messages' => array()),
     ),
-    // from pager.inc
+    // From pager.inc.
     'pager' => array(
       'variables' => array('tags' => array(), 'element' => 0, 'parameters' => array(), 'quantity' => 9),
     ),
@@ -6532,7 +6620,7 @@
     'pager_link' => array(
       'variables' => array('text' => NULL, 'page_new' => NULL, 'element' => NULL, 'parameters' => array(), 'attributes' => array()),
     ),
-    // from menu.inc
+    // From menu.inc.
     'menu_link' => array(
       'render element' => 'element',
     ),
@@ -6548,7 +6636,7 @@
     'menu_local_tasks' => array(
       'variables' => array('primary' => array(), 'secondary' => array()),
     ),
-    // from form.inc
+    // From form.inc.
     'select' => array(
       'render element' => 'element',
     ),
@@ -6624,7 +6712,7 @@
  */
 
 /**
- * Creates all tables in a module's hook_schema() implementation.
+ * Creates all tables defined in a module's hook_schema().
  *
  * Note: This function does not pass the module's schema through
  * hook_schema_alter(). The module's tables will be created exactly as the
@@ -6643,7 +6731,7 @@
 }
 
 /**
- * Remove all tables that a module defines in its hook_schema().
+ * Removes all tables defined in a module's hook_schema().
  *
  * Note: This function does not pass the module's schema through
  * hook_schema_alter(). The module's tables will be created exactly as the
@@ -6651,6 +6739,7 @@
  *
  * @param $module
  *   The module for which the tables will be removed.
+ *
  * @return
  *   An array of arrays with the following key/value pairs:
  *    - success: a boolean indicating whether the query succeeded.
@@ -6706,7 +6795,7 @@
 }
 
 /**
- * Fill in required default values for table definitions returned by hook_schema().
+ * Fills in required default values for table definitions from hook_schema().
  *
  * @param $schema
  *   The schema definition array as it was returned by the module's
@@ -6737,7 +6826,9 @@
 }
 
 /**
- * Retrieve a list of fields from a table schema. The list is suitable for use in a SQL query.
+ * Retrieves a list of fields from a table schema.
+ *
+ * The returned list is suitable for use in an SQL query.
  *
  * @param $table
  *   The name of the table from which to retrieve fields.
@@ -6745,7 +6836,7 @@
  *   An optional prefix to to all fields.
  *
  * @return An array of fields.
- **/
+ */
 function drupal_schema_fields_sql($table, $prefix = NULL) {
   $schema = drupal_get_schema($table);
   $fields = array_keys($schema['fields']);
@@ -6973,7 +7064,7 @@
 }
 
 /**
- * Parse data in Drupal's .info format.
+ * Parses data in Drupal's .info format.
  *
  * Data should be in an .ini-like format to specify values. White-space
  * generally doesn't matter, except inside values:
@@ -7003,6 +7094,7 @@
  *
  * @param $data
  *   A string to parse.
+ *
  * @return
  *   The info array.
  *
@@ -7026,19 +7118,19 @@
     )\s*$                           # Stop at the next end of a line, ignoring trailing whitespace
     @msx', $data, $matches, PREG_SET_ORDER)) {
     foreach ($matches as $match) {
-      // Fetch the key and value string
+      // Fetch the key and value string.
       $i = 0;
       foreach (array('key', 'value1', 'value2', 'value3') as $var) {
         $$var = isset($match[++$i]) ? $match[$i] : '';
       }
       $value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3;
 
-      // Parse array syntax
+      // Parse array syntax.
       $keys = preg_split('/\]?\[/', rtrim($key, ']'));
       $last = array_pop($keys);
       $parent = &$info;
 
-      // Create nested arrays
+      // Create nested arrays.
       foreach ($keys as $key) {
         if ($key == '') {
           $key = count($parent);
@@ -7054,7 +7146,7 @@
         $value = $constants[$value];
       }
 
-      // Insert actual value
+      // Insert actual value.
       if ($last == '') {
         $last = count($parent);
       }
@@ -7066,11 +7158,12 @@
 }
 
 /**
- * Severity levels, as defined in RFC 3164: http://www.ietf.org/rfc/rfc3164.txt.
+ * Returns a list of severity levels, as defined in RFC 3164.
  *
  * @return
  *   Array of the possible severity levels for log messages.
  *
+ * @see http://www.ietf.org/rfc/rfc3164.txt
  * @see watchdog()
  * @ingroup logging_severity_levels
  */
@@ -7089,7 +7182,7 @@
 
 
 /**
- * Explode a string of given tags into an array.
+ * Explodes a string of tags into an array.
  *
  * @see drupal_implode_tags()
  */
@@ -7115,7 +7208,7 @@
 }
 
 /**
- * Implode an array of tags into a string.
+ * Implodes an array of tags into a string.
  *
  * @see drupal_explode_tags()
  */
@@ -7133,7 +7226,7 @@
 }
 
 /**
- * Flush all cached data on the site.
+ * Flushes all cached data on the site.
  *
  * Empties cache tables, rebuilds the menu cache and theme registries, and
  * invokes a hook so that other modules' cache data can be cleared as well.
@@ -7151,6 +7244,7 @@
   system_rebuild_theme_data();
   drupal_theme_rebuild();
 
+  entity_info_cache_clear();
   node_types_rebuild();
   // node_menu() defines menu items based on node types so it needs to come
   // after node types are rebuilt.
@@ -7174,10 +7268,10 @@
 }
 
 /**
- * Helper function to change query-strings on css/js files.
- *
- * Changes the character added to all css/js files as dummy query-string, so
- * that all browsers are forced to reload fresh files.
+ * Changes the dummy query string added to all CSS and JavaScript files.
+ *
+ * Changing the dummy query string appended to CSS and JavaScript files forces
+ * all browsers to reload fresh files.
  */
 function _drupal_flush_css_js() {
   // The timestamp is converted to base 36 in order to make it more compact.
@@ -7185,7 +7279,7 @@
 }
 
 /**
- * Debug function used for outputting debug information.
+ * Outputs debug information.
  *
  * The debug information is passed on to trigger_error() after being converted
  * to a string using _drupal_debug_message().
@@ -7210,10 +7304,11 @@
 }
 
 /**
- * Parse a dependency for comparison by drupal_check_incompatibility().
+ * Parses a dependency for comparison by drupal_check_incompatibility().
  *
  * @param $dependency
  *   A dependency string, for example 'foo (>=7.x-4.5-beta5, 3.x)'.
+ *
  * @return
  *   An associative array with three keys:
  *   - 'name' includes the name of the thing to depend on (e.g. 'foo').
@@ -7267,12 +7362,13 @@
 }
 
 /**
- * Check whether a version is compatible with a given dependency.
+ * Checks whether a version is compatible with a given dependency.
  *
  * @param $v
  *   The parsed dependency structure from drupal_parse_dependency().
  * @param $current_version
  *   The version to check against (like 4.2).
+ *
  * @return
  *   NULL if compatible, otherwise the original dependency version string that
  *   caused the incompatibility.
@@ -7777,11 +7873,12 @@
 }
 
 /**
- * Create the appropriate archiver for the specified file.
+ * Creates the appropriate archiver for the specified file.
  *
  * @param $file
- *   The full path of the archive file.  Note that stream wrapper
- *   paths are supported, but not remote ones.
+ *   The full path of the archive file. Note that stream wrapper paths are
+ *   supported, but not remote ones.
+ *
  * @return
  *   A newly created instance of the archiver class appropriate
  *   for the specified file, already bound to that file.
@@ -7810,14 +7907,14 @@
 }
 
 /**
- * Drupal Updater registry.
+ * Assembles the Drupal Updater registry.
  *
  * An Updater is a class that knows how to update various parts of the Drupal
  * file system, for example to update modules that have newer releases, or to
  * install a new theme.
  *
  * @return
- *   Returns the Drupal Updater class registry.
+ *   The Drupal Updater class registry.
  *
  * @see hook_updater_info()
  * @see hook_updater_info_alter()
@@ -7833,10 +7930,10 @@
 }
 
 /**
- * Drupal FileTransfer registry.
- *
- * @return
- *   Returns the Drupal FileTransfer class registry.
+ * Assembles the Drupal FileTransfer registry.
+ *
+ * @return
+ *   The Drupal FileTransfer class registry.
  *
  * @see FileTransfer
  * @see hook_filetransfer_info()

Modified: branches/upstream/current-7/includes/database/database.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/database.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/database.inc (original)
+++ branches/upstream/current-7/includes/database/database.inc Sun Feb  5 17:53:08 2012
@@ -1016,9 +1016,9 @@
       throw new DatabaseTransactionNoActiveException();
     }
     // A previous rollback to an earlier savepoint may mean that the savepoint
-    // in question has already been rolled back.
-    if (!in_array($savepoint_name, $this->transactionLayers)) {
-      return;
+    // in question has already been accidentally committed.
+    if (!isset($this->transactionLayers[$savepoint_name])) {
+      throw new DatabaseTransactionNoActiveException();
     }
 
     // We need to find the point we're rolling back to, all other savepoints
@@ -1096,8 +1096,12 @@
     if (!$this->supportsTransactions()) {
       return;
     }
+    // The transaction has already been committed earlier. There is nothing we
+    // need to do. If this transaction was part of an earlier out-of-order
+    // rollback, an exception would already have been thrown by
+    // Database::rollback().
     if (!isset($this->transactionLayers[$name])) {
-      throw new DatabaseTransactionNoActiveException();
+      return;
     }
 
     // Mark this layer as committable.

Modified: branches/upstream/current-7/includes/database/mysql/database.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/mysql/database.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/mysql/database.inc (original)
+++ branches/upstream/current-7/includes/database/mysql/database.inc Sun Feb  5 17:53:08 2012
@@ -37,14 +37,20 @@
       $dsn = 'mysql:host=' . $connection_options['host'] . ';port=' . (empty($connection_options['port']) ? 3306 : $connection_options['port']);
     }
     $dsn .= ';dbname=' . $connection_options['database'];
-    parent::__construct($dsn, $connection_options['username'], $connection_options['password'], array(
+    // Allow PDO options to be overridden.
+    $connection_options += array(
+      'pdo' => array(),
+    );
+    $connection_options['pdo'] += array(
       // So we don't have to mess around with cursors and unbuffered queries by default.
       PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE,
       // Because MySQL's prepared statements skip the query cache, because it's dumb.
       PDO::ATTR_EMULATE_PREPARES => TRUE,
       // Force column names to lower case.
       PDO::ATTR_CASE => PDO::CASE_LOWER,
-    ));
+    );
+
+    parent::__construct($dsn, $connection_options['username'], $connection_options['password'], $connection_options['pdo']);
 
     // Force MySQL to use the UTF-8 character set. Also set the collation, if a
     // certain one has been set; otherwise, MySQL defaults to 'utf8_general_ci'
@@ -56,14 +62,22 @@
       $this->exec('SET NAMES utf8');
     }
 
-    // Force MySQL's behavior to conform more closely to SQL standards.
-    // This allows Drupal to run almost seamlessly on many different
-    // kinds of database systems. These settings force MySQL to behave
-    // the same as postgresql, or sqlite in regards to syntax interpretation
-    // and invalid data handling. See http://drupal.org/node/344575 for
-    // further discussion. Also, as MySQL 5.5 changed the meaning of
-    // TRADITIONAL we need to spell out the modes one by one.
-    $this->exec("SET sql_mode='ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER'");
+    // Set MySQL init_commands if not already defined.  Default Drupal's MySQL
+    // behavior to conform more closely to SQL standards.  This allows Drupal
+    // to run almost seamlessly on many different kinds of database systems.
+    // These settings force MySQL to behave the same as postgresql, or sqlite
+    // in regards to syntax interpretation and invalid data handling.  See
+    // http://drupal.org/node/344575 for further discussion. Also, as MySQL 5.5
+    // changed the meaning of TRADITIONAL we need to spell out the modes one by
+    // one.
+    $connection_options += array(
+      'init_commands' => array(),
+    );
+    $connection_options['init_commands'] += array(
+      'sql_mode' => "SET sql_mode = 'ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER'",
+    );
+    // Set connection options.
+    $this->exec(implode('; ', $connection_options['init_commands']));
   }
 
   public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
@@ -169,8 +183,11 @@
           // succeed for MySQL error code 1305 ("SAVEPOINT does not exist").
           if ($e->errorInfo[1] == '1305') {
             // If one SAVEPOINT was released automatically, then all were.
-            // Therefore, we keep just the topmost transaction.
-            $this->transactionLayers = array('drupal_transaction' => 'drupal_transaction');
+            // Therefore, clean the transaction stack.
+            $this->transactionLayers = array();
+            // We also have to explain to PDO that the transaction stack has
+            // been cleaned-up.
+            PDO::commit();
           }
           else {
             throw $e;

Modified: branches/upstream/current-7/includes/database/pgsql/database.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/pgsql/database.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/pgsql/database.inc (original)
+++ branches/upstream/current-7/includes/database/pgsql/database.inc Sun Feb  5 17:53:08 2012
@@ -47,7 +47,12 @@
     $this->connectionOptions = $connection_options;
 
     $dsn = 'pgsql:host=' . $connection_options['host'] . ' dbname=' . $connection_options['database'] . ' port=' . $connection_options['port'];
-    parent::__construct($dsn, $connection_options['username'], $connection_options['password'], array(
+
+    // Allow PDO options to be overridden.
+    $connection_options += array(
+      'pdo' => array(),
+    );
+    $connection_options['pdo'] += array(
       // Prepared statements are most effective for performance when queries
       // are recycled (used several times). However, if they are not re-used,
       // prepared statements become ineffecient. Since most of Drupal's
@@ -59,10 +64,16 @@
       PDO::ATTR_STRINGIFY_FETCHES => TRUE,
       // Force column names to lower case.
       PDO::ATTR_CASE => PDO::CASE_LOWER,
-    ));
+    );
+    parent::__construct($dsn, $connection_options['username'], $connection_options['password'], $connection_options['pdo']);
 
     // Force PostgreSQL to use the UTF-8 character set by default.
     $this->exec("SET NAMES 'UTF8'");
+
+    // Execute PostgreSQL init_commands.
+    if (isset($connection_options['init_commands'])) {
+      $this->exec(implode('; ', $connection_options['init_commands']));
+    }
   }
 
   public function query($query, array $args = array(), $options = array()) {

Modified: branches/upstream/current-7/includes/database/query.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/query.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/query.inc (original)
+++ branches/upstream/current-7/includes/database/query.inc Sun Feb  5 17:53:08 2012
@@ -21,6 +21,9 @@
    * This method can take a variable number of parameters. If called with two
    * parameters, they are taken as $field and $value with $operator having a
    * value of IN if $value is an array and = otherwise.
+   *
+   * Do not use this method to test for NULL values. Instead, use
+   * QueryConditionInterface::isNull() or QueryConditionInterface::isNotNull().
    *
    * @param $field
    *   The name of the field to check. If you would like to add a more complex
@@ -36,6 +39,9 @@
    *
    * @return QueryConditionInterface
    *   The called object.
+   *
+   * @see QueryConditionInterface::isNull()
+   * @see QueryConditionInterface::isNotNull()
    */
   public function condition($field, $value = NULL, $operator = NULL);
 

Modified: branches/upstream/current-7/includes/database/select.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/select.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/select.inc (original)
+++ branches/upstream/current-7/includes/database/select.inc Sun Feb  5 17:53:08 2012
@@ -590,11 +590,13 @@
   }
 
   public function hasAllTags() {
-    return call_user_func_array(array($this->query, 'hasAllTags'), func_get_args());
+    $args = func_get_args();
+    return call_user_func_array(array($this->query, 'hasAllTags'), $args);
   }
 
   public function hasAnyTag() {
-    return call_user_func_array(array($this->query, 'hasAnyTags'), func_get_args());
+    $args = func_get_args();
+    return call_user_func_array(array($this->query, 'hasAnyTags'), $args);
   }
 
   public function addMetaData($key, $object) {
@@ -637,16 +639,16 @@
   /* Implementations of QueryConditionInterface for the HAVING clause. */
 
   public function havingCondition($field, $value = NULL, $operator = '=') {
-    $this->query->condition($field, $value, $operator, $num_args);
+    $this->query->havingCondition($field, $value, $operator);
     return $this;
   }
 
   public function &havingConditions() {
-    return $this->having->conditions();
+    return $this->query->havingConditions();
   }
 
   public function havingArguments() {
-    return $this->having->arguments();
+    return $this->query->havingArguments();
   }
 
   public function having($snippet, $args = array()) {
@@ -790,31 +792,7 @@
   }
 
   public function countQuery() {
-    // Create our new query object that we will mutate into a count query.
-    $count = clone($this);
-
-    // Zero-out existing fields and expressions.
-    $fields =& $count->getFields();
-    $fields = array();
-    $expressions =& $count->getExpressions();
-    $expressions = array();
-
-    // Also remove 'all_fields' statements, which are expanded into tablename.*
-    // when the query is executed.
-    $tables = &$count->getTables();
-    foreach ($tables as $alias => &$table) {
-      unset($table['all_fields']);
-    }
-
-    // Ordering a count query is a waste of cycles, and breaks on some
-    // databases anyway.
-    $orders = &$count->getOrderBy();
-    $orders = array();
-
-    // COUNT() is an expression, so we add that back in.
-    $count->addExpression('COUNT(*)');
-
-    return $count;
+    return $this->query->countQuery();
   }
 
   function isNull($field) {
@@ -836,7 +814,7 @@
     $this->query->notExists($select);
     return $this;
   }
-  
+
   public function __toString() {
     return (string) $this->query;
   }
@@ -1005,11 +983,13 @@
   }
 
   public function hasAllTags() {
-    return !(boolean)array_diff(func_get_args(), array_keys($this->alterTags));
+    $args = func_get_args();
+    return !(boolean)array_diff($args, array_keys($this->alterTags));
   }
 
   public function hasAnyTag() {
-    return (boolean)array_intersect(func_get_args(), array_keys($this->alterTags));
+    $args = func_get_args();
+    return (boolean)array_intersect($args, array_keys($this->alterTags));
   }
 
   public function addMetaData($key, $object) {
@@ -1088,7 +1068,7 @@
     $this->where->notExists($select);
     return $this;
   }
-  
+
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder) {
     $this->where->compile($connection, $queryPlaceholder);
     $this->having->compile($connection, $queryPlaceholder);
@@ -1172,17 +1152,17 @@
     $this->having->isNotNull($field);
     return $this;
   }
-  
+
   public function havingExists(SelectQueryInterface $select) {
     $this->having->exists($select);
     return $this;
   }
-  
+
   public function havingNotExists(SelectQueryInterface $select) {
     $this->having->notExists($select);
     return $this;
   }
-  
+
   public function forUpdate($set = TRUE) {
     if (isset($set)) {
       $this->forUpdate = $set;
@@ -1451,17 +1431,20 @@
     $count = clone($this);
 
     $group_by = $count->getGroupBy();
-
-    if (!$count->distinct) {
+    $having = $count->havingConditions();
+
+    if (!$count->distinct && !isset($having[0])) {
       // When not executing a distinct query, we can zero-out existing fields
-      // and expressions that are not used by a GROUP BY.  Fields listed in
-      // the GROUP BY clause need to be present in the query.
+      // and expressions that are not used by a GROUP BY or HAVING. Fields
+      // listed in a GROUP BY or HAVING clause need to be present in the
+      // query.
       $fields =& $count->getFields();
       foreach (array_keys($fields) as $field) {
         if (empty($group_by[$field])) {
           unset($fields[$field]);
         }
       }
+
       $expressions =& $count->getExpressions();
       foreach (array_keys($expressions) as $field) {
         if (empty($group_by[$field])) {

Modified: branches/upstream/current-7/includes/database/sqlite/database.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/sqlite/database.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/sqlite/database.inc (original)
+++ branches/upstream/current-7/includes/database/sqlite/database.inc Sun Feb  5 17:53:08 2012
@@ -59,16 +59,21 @@
     $this->statementClass = NULL;
 
     // This driver defaults to transaction support, except if explicitly passed FALSE.
-    $this->transactionSupport = !isset($connection_options['transactions']) || $connection_options['transactions'] !== FALSE;
+    $this->transactionSupport = $this->transactionalDDLSupport = !isset($connection_options['transactions']) || $connection_options['transactions'] !== FALSE;
 
     $this->connectionOptions = $connection_options;
 
-    parent::__construct('sqlite:' . $connection_options['database'], '', '', array(
+    // Allow PDO options to be overridden.
+    $connection_options += array(
+      'pdo' => array(),
+    );
+    $connection_options['pdo'] += array(
       // Force column names to lower case.
       PDO::ATTR_CASE => PDO::CASE_LOWER,
       // Convert numeric values to strings when fetching.
       PDO::ATTR_STRINGIFY_FETCHES => TRUE,
-    ));
+    );
+    parent::__construct('sqlite:' . $connection_options['database'], '', '', $connection_options['pdo']);
 
     // Attach one database for each registered prefix.
     $prefixes = $this->prefixes;
@@ -103,6 +108,11 @@
     $this->sqliteCreateFunction('substring', array($this, 'sqlFunctionSubstring'), 3);
     $this->sqliteCreateFunction('substring_index', array($this, 'sqlFunctionSubstringIndex'), 3);
     $this->sqliteCreateFunction('rand', array($this, 'sqlFunctionRand'));
+
+    // Execute sqlite init_commands.
+    if (isset($connection_options['init_commands'])) {
+      $this->exec(implode('; ', $connection_options['init_commands']));
+    }
   }
 
   /**

Modified: branches/upstream/current-7/includes/file.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/file.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/file.inc (original)
+++ branches/upstream/current-7/includes/file.inc Sun Feb  5 17:53:08 2012
@@ -770,7 +770,7 @@
     $file = clone $source;
     $file->fid = NULL;
     $file->uri = $uri;
-    $file->filename = basename($uri);
+    $file->filename = drupal_basename($uri);
     // If we are replacing an existing file re-use its database record.
     if ($replace == FILE_EXISTS_REPLACE) {
       $existing_files = file_load_multiple(array(), array('uri' => $uri));
@@ -783,7 +783,7 @@
     // If we are renaming around an existing file (rather than a directory),
     // use its basename for the filename.
     elseif ($replace == FILE_EXISTS_RENAME && is_file($destination)) {
-      $file->filename = basename($destination);
+      $file->filename = drupal_basename($destination);
     }
 
     $file = file_save($file);
@@ -828,6 +828,10 @@
  *   is reported.
  * - If file already exists in $destination either the call will error out,
  *   replace the file or rename the file based on the $replace parameter.
+ * - Provides a fallback using realpaths if the move fails using stream
+ *   wrappers. This can occur because PHP's copy() function does not properly
+ *   support streams if safe_mode or open_basedir are enabled. See
+ *   https://bugs.php.net/bug.php?id=60456
  *
  * @param $source
  *   A string specifying the filepath or URI of the source file.
@@ -867,14 +871,14 @@
 
   // Build a destination URI if necessary.
   if (!isset($destination)) {
-    $destination = file_build_uri(basename($source));
+    $destination = file_build_uri(drupal_basename($source));
   }
 
 
   // Prepare the destination directory.
   if (file_prepare_directory($destination)) {
     // The destination is already a directory, so append the source basename.
-    $destination = file_stream_wrapper_uri_normalize($destination . '/' . basename($source));
+    $destination = file_stream_wrapper_uri_normalize($destination . '/' . drupal_basename($source));
   }
   else {
     // Perhaps $destination is a dir/file?
@@ -907,8 +911,12 @@
   file_ensure_htaccess();
   // Perform the copy operation.
   if (!@copy($source, $destination)) {
-    watchdog('file', 'The specified file %file could not be copied to %destination.', array('%file' => $source, '%destination' => $destination), WATCHDOG_ERROR);
-    return FALSE;
+    // If the copy failed and realpaths exist, retry the operation using them
+    // instead.
+    if ($real_source === FALSE || $real_destination === FALSE || !@copy($real_source, $real_destination)) {
+      watchdog('file', 'The specified file %file could not be copied to %destination.', array('%file' => $source, '%destination' => $destination), WATCHDOG_ERROR);
+      return FALSE;
+    }
   }
 
   // Set the permissions on the new file.
@@ -950,7 +958,7 @@
         break;
 
       case FILE_EXISTS_RENAME:
-        $basename = basename($destination);
+        $basename = drupal_basename($destination);
         $directory = drupal_dirname($destination);
         $destination = file_create_filename($basename, $directory);
         break;
@@ -1025,7 +1033,7 @@
     // If we are renaming around an existing file (rather than a directory),
     // use its basename for the filename.
     elseif ($replace == FILE_EXISTS_RENAME && is_file($destination)) {
-      $file->filename = basename($destination);
+      $file->filename = drupal_basename($destination);
     }
 
     $file = file_save($file);
@@ -1138,7 +1146,7 @@
 }
 
 /**
- * Undo the effect of upload_munge_filename().
+ * Undo the effect of file_munge_filename().
  *
  * @param $filename
  *   String with the filename to be unmunged.
@@ -1443,7 +1451,7 @@
   $file = new stdClass();
   $file->uid      = $user->uid;
   $file->status   = 0;
-  $file->filename = trim(basename($_FILES['files']['name'][$source]), '.');
+  $file->filename = trim(drupal_basename($_FILES['files']['name'][$source]), '.');
   $file->uri      = $_FILES['files']['tmp_name'][$source];
   $file->filemime = file_get_mimetype($file->filename);
   $file->filesize = $_FILES['files']['size'][$source];
@@ -1841,7 +1849,7 @@
     $file = new stdClass();
     $file->fid = NULL;
     $file->uri = $uri;
-    $file->filename = basename($uri);
+    $file->filename = drupal_basename($uri);
     $file->filemime = file_get_mimetype($file->uri);
     $file->uid      = $user->uid;
     $file->status   = FILE_STATUS_PERMANENT;
@@ -1857,7 +1865,7 @@
     // If we are renaming around an existing file (rather than a directory),
     // use its basename for the filename.
     elseif ($replace == FILE_EXISTS_RENAME && is_file($destination)) {
-      $file->filename = basename($destination);
+      $file->filename = drupal_basename($destination);
     }
 
     return file_save($file);
@@ -2267,6 +2275,35 @@
 }
 
 /**
+ * Gets the filename from a given path.
+ *
+ * PHP's basename() does not properly support streams or filenames beginning
+ * with a non-US-ASCII character.
+ *
+ * @see http://bugs.php.net/bug.php?id=37738
+ * @see basename()
+ *
+ * @ingroup php_wrappers
+ */
+function drupal_basename($uri, $suffix = NULL) {
+  $separators = '/';
+  if (DIRECTORY_SEPARATOR != '/') {
+    // For Windows OS add special separator.
+    $separators .= DIRECTORY_SEPARATOR;
+  }
+  // Remove right-most slashes when $uri points to directory.
+  $uri = rtrim($uri, $separators);
+  // Returns the trailing part of the $uri starting after one of the directory
+  // separators.
+  $filename = preg_match('@[^' . preg_quote($separators, '@') . ']+$@', $uri, $matches) ? $matches[0] : '';
+  // Cuts off a suffix from the filename.
+  if ($suffix) {
+    $filename = preg_replace('@' . preg_quote($suffix, '@') . '$@', '', $filename);
+  }
+  return $filename;
+}
+
+/**
  * Creates a directory using Drupal's default mode.
  *
  * PHP's mkdir() does not respect Drupal's default permissions mode. If a mode
@@ -2362,7 +2399,7 @@
     $wrapper = file_stream_wrapper_get_instance_by_scheme($scheme);
 
     if ($filename = tempnam($wrapper->getDirectoryPath(), $prefix)) {
-      return $scheme . '://' . basename($filename);
+      return $scheme . '://' . drupal_basename($filename);
     }
     else {
       return FALSE;

Modified: branches/upstream/current-7/includes/filetransfer/filetransfer.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/filetransfer/filetransfer.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/filetransfer/filetransfer.inc (original)
+++ branches/upstream/current-7/includes/filetransfer/filetransfer.inc Sun Feb  5 17:53:08 2012
@@ -211,7 +211,7 @@
    */
   protected function copyDirectoryJailed($source, $destination) {
     if ($this->isDirectory($destination)) {
-      $destination = $destination . '/' . basename($source);
+      $destination = $destination . '/' . drupal_basename($source);
     }
     $this->createDirectory($destination);
     foreach (new RecursiveIteratorIterator(new SkipDotsRecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST) as $filename => $file) {
@@ -302,9 +302,9 @@
     $chroot = '';
     while (count($parts)) {
       $check = implode($parts, '/');
-      if ($this->isFile($check . '/' . basename(__FILE__))) {
+      if ($this->isFile($check . '/' . drupal_basename(__FILE__))) {
         // Remove the trailing slash.
-        return substr($chroot,0,-1);
+        return substr($chroot, 0, -1);
       }
       $chroot .= array_shift($parts) . '/';
     }

Modified: branches/upstream/current-7/includes/form.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/form.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/form.inc (original)
+++ branches/upstream/current-7/includes/form.inc Sun Feb  5 17:53:08 2012
@@ -16,7 +16,7 @@
  * \@see user_pass_validate().
  * \@see user_pass_submit().
  *
- * @} End of "defgroup forms".
+ * @}
  */
 
 /**
@@ -156,6 +156,8 @@
  *       automatically loaded by form_get_cache(). By default the current menu
  *       router item's 'file' definition is added, if any. Use
  *       form_load_include() to add include files from a form constructor.
+ *     - base_form_id: Identification for a base form, as declared in a
+ *       hook_forms() implementation.
  *   - rebuild_info: Internal. Similar to 'build_info', but pertaining to
  *     drupal_rebuild_form().
  *   - rebuild: Normally, after the entire form processing is completed and
@@ -3349,6 +3351,13 @@
     'replace' => '_',
   );
 
+  // By default, machine names are restricted to Latin alphanumeric characters.
+  // So, default to LTR directionality.
+  if (!isset($element['#attributes'])) {
+    $element['#attributes'] = array();
+  }
+  $element['#attributes'] += array('dir' => 'ltr');
+
   // The source element defaults to array('name'), but may have been overidden.
   if (empty($element['#machine_name']['source'])) {
     return $element;
@@ -3786,13 +3795,27 @@
  * Expand weight elements into selects.
  */
 function form_process_weight($element) {
-  for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) {
-    $weights[$n] = $n;
-  }
-  $element['#options'] = $weights;
-  $element['#type'] = 'select';
   $element['#is_weight'] = TRUE;
-  $element += element_info('select');
+
+  // If the number of options is small enough, use a select field.
+  $max_elements = variable_get('drupal_weight_select_max', DRUPAL_WEIGHT_SELECT_MAX);
+  if ($element['#delta'] <= $max_elements) {
+    $element['#type'] = 'select';
+    for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) {
+      $weights[$n] = $n;
+    }
+    $element['#options'] = $weights;
+    $element += element_info('select');
+  }
+  // Otherwise, use a text field.
+  else {
+    $element['#type'] = 'textfield';
+    // Use a field big enough to fit most weights.
+    $element['#size'] = 10;
+    $element['#element_validate'] = array('element_validate_integer');
+    $element += element_info('textfield');
+  }
+
   return $element;
 }
 
@@ -3976,7 +3999,7 @@
   $t = get_t();
 
   // If title and required marker are both empty, output no label.
-  if (empty($element['#title']) && empty($element['#required'])) {
+  if ((!isset($element['#title']) || $element['#title'] === '') && empty($element['#required'])) {
     return '';
   }
 

Modified: branches/upstream/current-7/includes/graph.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/graph.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/graph.inc (original)
+++ branches/upstream/current-7/includes/graph.inc Sun Feb  5 17:53:08 2012
@@ -143,4 +143,3 @@
   // topological order if the graph is acyclic.
   $state['last_visit_order'][] = $start;
 }
-

Modified: branches/upstream/current-7/includes/image.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/image.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/image.inc (original)
+++ branches/upstream/current-7/includes/image.inc Sun Feb  5 17:53:08 2012
@@ -186,14 +186,14 @@
  *   Dimensions to be modified - an array with components width and height, in
  *   pixels.
  * @param $width
- *   The target width, in pixels. This value is omitted then the scaling will
+ *   The target width, in pixels. If this value is NULL then the scaling will be
  *   based only on the height value.
  * @param $height
- *   The target height, in pixels. This value is omitted then the scaling will
- *   based only on the width value.
+ *   The target height, in pixels. If this value is NULL then the scaling will
+ *   be based only on the width value.
  * @param $upscale
- *   Boolean indicating that files smaller than the dimensions will be scaled
- *   up. This generally results in a low quality image.
+ *   Boolean indicating that images smaller than the target dimensions will be
+ *   scaled up. This generally results in a low quality image.
  *
  * @return
  *   TRUE if $dimensions was modified, FALSE otherwise.
@@ -203,31 +203,25 @@
 function image_dimensions_scale(array &$dimensions, $width = NULL, $height = NULL, $upscale = FALSE) {
   $aspect = $dimensions['height'] / $dimensions['width'];
 
-  if ($upscale) {
-    // Set width/height according to aspect ratio if either is empty.
-    $width = !empty($width) ? $width : $height / $aspect;
-    $height = !empty($height) ? $height : $width / $aspect;
+  // Calculate one of the dimensions from the other target dimension,
+  // ensuring the same aspect ratio as the source dimensions. If one of the
+  // target dimensions is missing, that is the one that is calculated. If both
+  // are specified then the dimension calculated is the one that would not be
+  // calculated to be bigger than its target.
+  if (($width && !$height) || ($width && $height && $aspect < $height / $width)) {
+    $height = (int) round($width * $aspect);
   }
   else {
-    // Set impossibly large values if the width and height aren't set.
-    $width = !empty($width) ? $width : 9999999;
-    $height = !empty($height) ? $height : 9999999;
-
-    // Don't scale up.
-    if (round($width) >= $dimensions['width'] && round($height) >= $dimensions['height']) {
-      return FALSE;
-    }
-  }
-
-  if ($aspect < $height / $width) {
-    $dimensions['width'] = $width;
-    $dimensions['height'] = (int) round($width * $aspect);
-  }
-  else {
-    $dimensions['width'] = (int) round($height / $aspect);
-    $dimensions['height'] = $height;
-  }
-
+    $width = (int) round($height / $aspect);
+  }
+
+  // Don't upscale if the option isn't enabled.
+  if (!$upscale && ($width >= $dimensions['width'] || $height >= $dimensions['height'])) {
+    return FALSE;
+  }
+
+  $dimensions['width'] = $width;
+  $dimensions['height'] = $height;
   return TRUE;
 }
 

Modified: branches/upstream/current-7/includes/install.core.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/install.core.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/install.core.inc (original)
+++ branches/upstream/current-7/includes/install.core.inc Sun Feb  5 17:53:08 2012
@@ -570,6 +570,12 @@
 
   // Now add any tasks defined by the installation profile.
   if (!empty($install_state['parameters']['profile'])) {
+    // Load the profile install file, because it is not always loaded when
+    // hook_install_tasks() is invoked (e.g. batch processing).
+    $profile_install_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.install';
+    if (file_exists($profile_install_file)) {
+      include_once $profile_install_file;
+    }
     $function = $install_state['parameters']['profile'] . '_install_tasks';
     if (function_exists($function)) {
       $result = $function($install_state);
@@ -595,7 +601,7 @@
   // Allow the installation profile to modify the full list of tasks.
   if (!empty($install_state['parameters']['profile'])) {
     $profile_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.profile';
-    if (is_file($profile_file)) {
+    if (file_exists($profile_file)) {
       include_once $profile_file;
       $function = $install_state['parameters']['profile'] . '_install_tasks_alter';
       if (function_exists($function)) {
@@ -710,8 +716,10 @@
  *
  * @return
  *   A themed status report, or an exception if there are requirement errors.
- *   Otherwise, no output is returned, so that the next task can be run
- *   in the same page request.
+ *   If there are only requirement warnings, a themed status report is shown
+ *   initially, but the user is allowed to bypass it by providing 'continue=1'
+ *   in the URL. Otherwise, no output is returned, so that the next task can be
+ *   run in the same page request.
  */
 function install_verify_requirements(&$install_state) {
   // Check the installation requirements for Drupal and this profile.
@@ -723,22 +731,30 @@
   // Check the severity of the requirements reported.
   $severity = drupal_requirements_severity($requirements);
 
-  if ($severity == REQUIREMENT_ERROR) {
+  // If there are errors, always display them. If there are only warnings, skip
+  // them if the user has provided a URL parameter acknowledging the warnings
+  // and indicating a desire to continue anyway. See drupal_requirements_url().
+  if ($severity == REQUIREMENT_ERROR || ($severity == REQUIREMENT_WARNING && empty($install_state['parameters']['continue']))) {
     if ($install_state['interactive']) {
       drupal_set_title(st('Requirements problem'));
       $status_report = theme('status_report', array('requirements' => $requirements));
-      $status_report .= st('Check the error messages and <a href="!url">proceed with the installation</a>.', array('!url' => check_url(request_uri())));
+      $status_report .= st('Check the error messages and <a href="!url">proceed with the installation</a>.', array('!url' => check_url(drupal_requirements_url($severity))));
       return $status_report;
     }
     else {
-      // Throw an exception showing all unmet requirements.
+      // Throw an exception showing any unmet requirements.
       $failures = array();
       foreach ($requirements as $requirement) {
+        // Skip warnings altogether for non-interactive installations; these
+        // proceed in a single request so there is no good opportunity (and no
+        // good method) to warn the user anyway.
         if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) {
           $failures[] = $requirement['title'] . ': ' . $requirement['value'] . "\n\n" . $requirement['description'];
         }
       }
-      throw new Exception(implode("\n\n", $failures));
+      if (!empty($failures)) {
+        throw new Exception(implode("\n\n", $failures));
+      }
     }
   }
 }
@@ -1290,7 +1306,7 @@
  */
 function install_load_profile(&$install_state) {
   $profile_file = DRUPAL_ROOT . '/profiles/' . $install_state['parameters']['profile'] . '/' . $install_state['parameters']['profile'] . '.profile';
-  if (is_file($profile_file)) {
+  if (file_exists($profile_file)) {
     include_once $profile_file;
     $install_state['profile_info'] = install_profile_info($install_state['parameters']['profile'], $install_state['parameters']['locale']);
   }
@@ -1408,13 +1424,6 @@
  *   The form API definition for the site configuration form.
  */
 function install_configure_form($form, &$form_state, &$install_state) {
-  if (variable_get('site_name', FALSE) || variable_get('site_mail', FALSE)) {
-    // Site already configured: This should never happen, means re-running the
-    // installer, possibly by an attacker after the 'install_task' variable got
-    // accidentally blown somewhere. Stop it now.
-    throw new Exception(install_already_done_error());
-  }
-
   drupal_set_title(st('Configure site'));
 
   // Warn about settings.php permissions risk
@@ -1816,7 +1825,7 @@
 
   // We precreated user 1 with placeholder values. Let's save the real values.
   $account = user_load(1);
-  $merge_data = array('init' => $form_state['values']['account']['mail'], 'roles' => !empty($account->roles) ? $account->roles : array(), 'status' => 1);
+  $merge_data = array('init' => $form_state['values']['account']['mail'], 'roles' => !empty($account->roles) ? $account->roles : array(), 'status' => 1, 'timezone' => $form_state['values']['date_default_timezone']);
   user_save($account, array_merge($form_state['values']['account'], $merge_data));
   // Load global $user and perform final login tasks.
   $user = user_load(1);

Modified: branches/upstream/current-7/includes/install.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/install.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/install.inc (original)
+++ branches/upstream/current-7/includes/install.inc Sun Feb  5 17:53:08 2012
@@ -999,7 +999,6 @@
   }
 }
 
-
 /**
  * Send the user to a different installer page.
  *
@@ -1014,6 +1013,68 @@
   header('Location: ' . $base_url . '/' . $path);
   header('Cache-Control: no-cache'); // Not a permanent redirect.
   drupal_exit();
+}
+
+/**
+ * Returns the URL of the current script, with modified query parameters.
+ *
+ * This function can be called by low-level scripts (such as install.php and
+ * update.php) and returns the URL of the current script. Existing query
+ * parameters are preserved by default, but new ones can optionally be merged
+ * in.
+ *
+ * This function is used when the script must maintain certain query parameters
+ * over multiple page requests in order to work correctly. In such cases (for
+ * example, update.php, which requires the 'continue=1' parameter to remain in
+ * the URL throughout the update process if there are any requirement warnings
+ * that need to be bypassed), using this function to generate the URL for links
+ * to the next steps of the script ensures that the links will work correctly.
+ *
+ * @param $query
+ *   (optional) An array of query parameters to merge in to the existing ones.
+ *
+ * @return
+ *   The URL of the current script, with query parameters modified by the
+ *   passed-in $query. The URL is not sanitized, so it still needs to be run
+ *   through check_url() if it will be used as an HTML attribute value.
+ *
+ * @see drupal_requirements_url()
+ */
+function drupal_current_script_url($query = array()) {
+  $uri = $_SERVER['SCRIPT_NAME'];
+  $query = array_merge(drupal_get_query_parameters(), $query);
+  if (!empty($query)) {
+    $uri .= '?' . drupal_http_build_query($query);
+  }
+  return $uri;
+}
+
+/**
+ * Returns a URL for proceeding to the next page after a requirements problem.
+ *
+ * This function can be called by low-level scripts (such as install.php and
+ * update.php) and returns a URL that can be used to attempt to proceed to the
+ * next step of the script.
+ *
+ * @param $severity
+ *   The severity of the requirements problem, as returned by
+ *   drupal_requirements_severity().
+ *
+ * @return
+ *   A URL for attempting to proceed to the next step of the script. The URL is
+ *   not sanitized, so it still needs to be run through check_url() if it will
+ *   be used as an HTML attribute value.
+ *
+ * @see drupal_current_script_url()
+ */
+function drupal_requirements_url($severity) {
+  $query = array();
+  // If there are no errors, only warnings, append 'continue=1' to the URL so
+  // the user can bypass this screen on the next page load.
+  if ($severity == REQUIREMENT_WARNING) {
+    $query['continue'] = 1;
+  }
+  return drupal_current_script_url($query);
 }
 
 /**

Modified: branches/upstream/current-7/includes/iso.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/iso.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/iso.inc (original)
+++ branches/upstream/current-7/includes/iso.inc Sun Feb  5 17:53:08 2012
@@ -74,6 +74,7 @@
     'CO' => $t('Colombia'),
     'CR' => $t('Costa Rica'),
     'CU' => $t('Cuba'),
+    'CW' => $t('Curaçao'),
     'CV' => $t('Cape Verde'),
     'CX' => $t('Christmas Island'),
     'CY' => $t('Cyprus'),

Added: branches/upstream/current-7/includes/json-encode.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/json-encode.inc?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/includes/json-encode.inc (added)
+++ branches/upstream/current-7/includes/json-encode.inc Sun Feb  5 17:53:08 2012
@@ -1,0 +1,102 @@
+<?php
+
+/**
+ * @file
+ * Provides a helper to properly encode HTML-safe JSON prior to PHP 5.3.0.
+ */
+
+/**
+ * Encodes a PHP variable to HTML-safe JSON for PHP versions below 5.3.0.
+ *
+ * @see drupal_json_encode()
+ */
+function drupal_json_encode_helper($var) {
+  switch (gettype($var)) {
+    case 'boolean':
+      return $var ? 'true' : 'false'; // Lowercase necessary!
+
+    case 'integer':
+    case 'double':
+      return $var;
+
+    case 'resource':
+    case 'string':
+      // Always use Unicode escape sequences (\u0022) over JSON escape
+      // sequences (\") to prevent browsers interpreting these as
+      // special characters.
+      $replace_pairs = array(
+        // ", \ and U+0000 - U+001F must be escaped according to RFC 4627.
+        '\\' => '\u005C',
+        '"' => '\u0022',
+        "\x00" => '\u0000',
+        "\x01" => '\u0001',
+        "\x02" => '\u0002',
+        "\x03" => '\u0003',
+        "\x04" => '\u0004',
+        "\x05" => '\u0005',
+        "\x06" => '\u0006',
+        "\x07" => '\u0007',
+        "\x08" => '\u0008',
+        "\x09" => '\u0009',
+        "\x0a" => '\u000A',
+        "\x0b" => '\u000B',
+        "\x0c" => '\u000C',
+        "\x0d" => '\u000D',
+        "\x0e" => '\u000E',
+        "\x0f" => '\u000F',
+        "\x10" => '\u0010',
+        "\x11" => '\u0011',
+        "\x12" => '\u0012',
+        "\x13" => '\u0013',
+        "\x14" => '\u0014',
+        "\x15" => '\u0015',
+        "\x16" => '\u0016',
+        "\x17" => '\u0017',
+        "\x18" => '\u0018',
+        "\x19" => '\u0019',
+        "\x1a" => '\u001A',
+        "\x1b" => '\u001B',
+        "\x1c" => '\u001C',
+        "\x1d" => '\u001D',
+        "\x1e" => '\u001E',
+        "\x1f" => '\u001F',
+        // Prevent browsers from interpreting these as as special.
+        "'" => '\u0027',
+        '<' => '\u003C',
+        '>' => '\u003E',
+        '&' => '\u0026',
+        // Prevent browsers from interpreting the solidus as special and
+        // non-compliant JSON parsers from interpreting // as a comment.
+        '/' => '\u002F',
+        // While these are allowed unescaped according to ECMA-262, section
+        // 15.12.2, they cause problems in some JSON parsers.
+        "\xe2\x80\xa8" => '\u2028', // U+2028, Line Separator.
+        "\xe2\x80\xa9" => '\u2029', // U+2029, Paragraph Separator.
+      );
+
+      return '"' . strtr($var, $replace_pairs) . '"';
+
+    case 'array':
+      // Arrays in JSON can't be associative. If the array is empty or if it
+      // has sequential whole number keys starting with 0, it's not associative
+      // so we can go ahead and convert it as an array.
+      if (empty($var) || array_keys($var) === range(0, sizeof($var) - 1)) {
+        $output = array();
+        foreach ($var as $v) {
+          $output[] = drupal_json_encode_helper($v);
+        }
+        return '[ ' . implode(', ', $output) . ' ]';
+      }
+      // Otherwise, fall through to convert the array as an object.
+
+    case 'object':
+      $output = array();
+      foreach ($var as $k => $v) {
+        $output[] = drupal_json_encode_helper(strval($k)) . ':' . drupal_json_encode_helper($v);
+      }
+      return '{' . implode(', ', $output) . '}';
+
+    default:
+      return 'null';
+  }
+}

Modified: branches/upstream/current-7/includes/locale.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/locale.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/locale.inc (original)
+++ branches/upstream/current-7/includes/locale.inc Sun Feb  5 17:53:08 2012
@@ -41,6 +41,36 @@
  * Regular expression pattern used to localize JavaScript strings.
  */
 define('LOCALE_JS_STRING', '(?:(?:\'(?:\\\\\'|[^\'])*\'|"(?:\\\\"|[^"])*")(?:\s*\+\s*)?)+');
+
+/**
+ * Regular expression pattern used to match simple JS object literal.
+ *
+ * This pattern matches a basic JS object, but will fail on an object with
+ * nested objects. Used in JS file parsing for string arg processing.
+ */
+define('LOCALE_JS_OBJECT', '\{.*?\}');
+
+/**
+ * Regular expression to match an object containing a key 'context'.
+ *
+ * Pattern to match a JS object containing a 'context key' with a string value,
+ * which is captured. Will fail if there are nested objects.
+ */
+define('LOCALE_JS_OBJECT_CONTEXT', '
+  \{              # match object literal start
+  .*?             # match anything, non-greedy
+  (?:             # match a form of "context"
+    \'context\'
+    |
+    "context"
+    |
+    context
+  )
+  \s*:\s*         # match key-value separator ":"
+  (' . LOCALE_JS_STRING . ')  # match context string
+  .*?             # match anything, non-greedy
+  \}              # match end of object literal
+');
 
 /**
  * Translation import mode overwriting all existing translations
@@ -1447,6 +1477,9 @@
     [^\w]Drupal\s*\.\s*t\s*                       # match "Drupal.t" with whitespace
     \(\s*                                         # match "(" argument list start
     (' . LOCALE_JS_STRING . ')\s*                 # capture string argument
+    (?:,\s*' . LOCALE_JS_OBJECT . '\s*            # optionally capture str args
+      (?:,\s*' . LOCALE_JS_OBJECT_CONTEXT . '\s*) # optionally capture context
+    ?)?                                           # close optional args
     [,\)]                                         # match ")" or "," to finish
     ~sx', $file, $t_matches);
 
@@ -1474,54 +1507,72 @@
         (?:\s*\+\s*)?             # match "+" with possible whitespace, for str concat
       )+                          # match multiple because we supports concatenating strs
     )\s*                          # end capturing of plural string argument
+    (?:,\s*' . LOCALE_JS_OBJECT . '\s*          # optionally capture string args
+      (?:,\s*' . LOCALE_JS_OBJECT_CONTEXT . '\s*)?  # optionally capture context
+    )?
     [,\)]
     ~sx', $file, $plural_matches);
 
-
-  // Loop through all matches and process them.
-  $all_matches = array_merge($plural_matches[1], $t_matches[1]);
-  foreach ($all_matches as $key => $string) {
-    $strings = array($string);
+  $matches = array();
+
+  // Add strings from Drupal.t().
+  foreach ($t_matches[1] as $key => $string) {
+    $matches[] = array(
+      'string'  => $string,
+      'context' => $t_matches[2][$key],
+    );
+  }
+
+  // Add string from Drupal.formatPlural().
+  foreach ($plural_matches[1] as $key => $string) {
+    $matches[] = array(
+      'string'  => $string,
+      'context' => $plural_matches[3][$key],
+    );
 
     // If there is also a plural version of this string, add it to the strings array.
     if (isset($plural_matches[2][$key])) {
-      $strings[] = $plural_matches[2][$key];
-    }
-
-    foreach ($strings as $key => $string) {
-      // Remove the quotes and string concatenations from the string.
-      $string = implode('', preg_split('~(?<!\\\\)[\'"]\s*\+\s*[\'"]~s', substr($string, 1, -1)));
-
-      $source = db_query("SELECT lid, location FROM {locales_source} WHERE source = :source AND textgroup = 'default'", array(':source' => $string))->fetchObject();
-      if ($source) {
-        // We already have this source string and now have to add the location
-        // to the location column, if this file is not yet present in there.
-        $locations = preg_split('~\s*;\s*~', $source->location);
-
-        if (!in_array($filepath, $locations)) {
-          $locations[] = $filepath;
-          $locations = implode('; ', $locations);
-
-          // Save the new locations string to the database.
-          db_update('locales_source')
-            ->fields(array(
-              'location' => $locations,
-            ))
-            ->condition('lid', $source->lid)
-            ->execute();
-        }
-      }
-      else {
-        // We don't have the source string yet, thus we insert it into the database.
-        db_insert('locales_source')
+      $matches[] = array(
+        'string'  => $plural_matches[2][$key],
+        'context' => $plural_matches[3][$key],
+      );
+    }
+  }
+
+  foreach ($matches as $key => $match) {
+    // Remove the quotes and string concatenations from the string.
+    $string = implode('', preg_split('~(?<!\\\\)[\'"]\s*\+\s*[\'"]~s', substr($match['string'], 1, -1)));
+    $context = implode('', preg_split('~(?<!\\\\)[\'"]\s*\+\s*[\'"]~s', substr($match['context'], 1, -1)));
+
+    $source = db_query("SELECT lid, location FROM {locales_source} WHERE source = :source AND context = :context AND textgroup = 'default'", array(':source' => $string, ':context' => $context))->fetchObject();
+    if ($source) {
+      // We already have this source string and now have to add the location
+      // to the location column, if this file is not yet present in there.
+      $locations = preg_split('~\s*;\s*~', $source->location);
+
+      if (!in_array($filepath, $locations)) {
+        $locations[] = $filepath;
+        $locations = implode('; ', $locations);
+
+        // Save the new locations string to the database.
+        db_update('locales_source')
           ->fields(array(
-            'location' => $filepath,
-            'source' => $string,
-            'context' => '',
-            'textgroup' => 'default',
+            'location' => $locations,
           ))
+          ->condition('lid', $source->lid)
           ->execute();
       }
+    }
+    else {
+      // We don't have the source string yet, thus we insert it into the database.
+      db_insert('locales_source')
+        ->fields(array(
+          'location' => $filepath,
+          'source' => $string,
+          'context' => $context,
+          'textgroup' => 'default',
+        ))
+        ->execute();
     }
   }
 }
@@ -1942,11 +1993,11 @@
 
   // Construct the array for JavaScript translations.
   // Only add strings with a translation to the translations array.
-  $result = db_query("SELECT s.lid, s.source, t.translation FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.location LIKE '%.js%' AND s.textgroup = :textgroup", array(':language' => $language->language, ':textgroup' => 'default'));
+  $result = db_query("SELECT s.lid, s.source, s.context, t.translation FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.location LIKE '%.js%' AND s.textgroup = :textgroup", array(':language' => $language->language, ':textgroup' => 'default'));
 
   $translations = array();
   foreach ($result as $data) {
-    $translations[$data->source] = $data->translation;
+    $translations[$data->context][$data->source] = $data->translation;
   }
 
   // Construct the JavaScript file, if there are translations.
@@ -2242,7 +2293,7 @@
   // The filename is either {langcode}.po or {prefix}.{langcode}.po, so
   // we can extract the language code to use for the import from the end.
   if (preg_match('!(/|\.)([^\./]+)\.po$!', $filepath, $langcode)) {
-    $file = (object) array('filename' => basename($filepath), 'uri' => $filepath);
+    $file = (object) array('filename' => drupal_basename($filepath), 'uri' => $filepath);
     _locale_import_read_po('db-store', $file, LOCALE_IMPORT_KEEP, $langcode[2]);
     $context['results'][] = $filepath;
   }

Modified: branches/upstream/current-7/includes/mail.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/mail.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/mail.inc (original)
+++ branches/upstream/current-7/includes/mail.inc Sun Feb  5 17:53:08 2012
@@ -57,11 +57,30 @@
  *     user_mail_tokens($variables, $data, $options);
  *     switch($key) {
  *       case 'notice':
+ *         // If the recipient can receive such notices by instant-message, do
+ *         // not send by email.
+ *         if (example_im_send($key, $message, $params)) {
+ *           $message['send'] = FALSE;
+ *           break;
+ *         }
  *         $langcode = $message['language']->language;
  *         $message['subject'] = t('Notification from !site', $variables, array('langcode' => $langcode));
  *         $message['body'][] = t("Dear !username\n\nThere is new content available on the site.", $variables, array('langcode' => $langcode));
  *         break;
  *     }
+ *   }
+ * @endcode
+ *
+ * Another example, which uses drupal_mail() to format a message for sending
+ * later:
+ *
+ * @code
+ *   $params = array('current_conditions' => $data);
+ *   $to = 'user at example.com';
+ *   $message = drupal_mail('example', 'notice', $to, $language, $params, FALSE);
+ *   // Only add to the spool if sending was not canceled.
+ *   if ($message['send']) {
+ *     example_spool_message($message);
  *   }
  * @endcode
  *
@@ -86,8 +105,10 @@
  * @param $from
  *   Sets From to this value, if given.
  * @param $send
- *   Send the message directly, without calling drupal_mail_system()->mail()
- *   manually.
+ *   If TRUE, drupal_mail() will call drupal_mail_system()->mail() to deliver
+ *   the message, and store the result in $message['result']. Modules
+ *   implementing hook_mail_alter() may cancel sending by setting
+ *   $message['send'] to FALSE.
  *
  * @return
  *   The $message array structure containing all details of the
@@ -108,6 +129,7 @@
     'from'     => isset($from) ? $from : $default_from,
     'language' => $language,
     'params'   => $params,
+    'send'     => TRUE,
     'subject'  => '',
     'body'     => array()
   );
@@ -148,12 +170,20 @@
 
   // Optionally send e-mail.
   if ($send) {
-    $message['result'] = $system->mail($message);
-
-    // Log errors
-    if (!$message['result']) {
-      watchdog('mail', 'Error sending e-mail (from %from to %to).', array('%from' => $message['from'], '%to' => $message['to']), WATCHDOG_ERROR);
-      drupal_set_message(t('Unable to send e-mail. Contact the site administrator if the problem persists.'), 'error');
+    // The original caller requested sending. Sending was canceled by one or
+    // more hook_mail_alter() implementations. We set 'result' to NULL, because
+    // FALSE indicates an error in sending.
+    if (empty($message['send'])) {
+      $message['result'] = NULL;
+    }
+    // Sending was originally requested and was not canceled.
+    else {
+      $message['result'] = $system->mail($message);
+      // Log errors.
+      if (!$message['result']) {
+        watchdog('mail', 'Error sending e-mail (from %from to %to).', array('%from' => $message['from'], '%to' => $message['to']), WATCHDOG_ERROR);
+        drupal_set_message(t('Unable to send e-mail. Contact the site administrator if the problem persists.'), 'error');
+      }
     }
   }
 

Modified: branches/upstream/current-7/includes/menu.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/menu.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/menu.inc (original)
+++ branches/upstream/current-7/includes/menu.inc Sun Feb  5 17:53:08 2012
@@ -273,6 +273,20 @@
 /**
  * @} End of "Menu tree parameters".
  */
+
+/**
+ * Reserved key to identify the most specific menu link for a given path.
+ *
+ * The value of this constant is a hash of the constant name. We use the hash
+ * so that the reserved key is over 32 characters in length and will not
+ * collide with allowed menu names:
+ * @code
+ * sha1('MENU_PREFERRED_LINK') = 1cf698d64d1aa4b83907cf6ed55db3a7f8e92c91
+ * @endcode
+ *
+ * @see menu_link_get_preferred()
+ */
+define('MENU_PREFERRED_LINK', '1cf698d64d1aa4b83907cf6ed55db3a7f8e92c91');
 
 /**
  * Returns the ancestors (and relevant placeholders) for any given path.
@@ -1241,7 +1255,7 @@
         if ($item['access']) {
           // Find a menu link corresponding to the current path. If $active_path
           // is NULL, let menu_link_get_preferred() determine the path.
-          if ($active_link = menu_link_get_preferred($active_path)) {
+          if ($active_link = menu_link_get_preferred($active_path, $menu_name)) {
             // The active link may only be taken into account to build the
             // active trail, if it resides in the requested menu. Otherwise,
             // we'd needlessly re-run _menu_build_tree() queries for every menu
@@ -1325,6 +1339,8 @@
  *     Defaults to 1, which is the default to build a whole tree for a menu, i.e.
  *     excluding menu container itself.
  *   - max_depth: The maximum depth of menu links in the resulting tree.
+ *   - conditions: An associative array of custom database select query
+ *     condition key/value pairs; see _menu_build_tree() for the actual query.
  *
  * @return
  *   A fully built menu tree.
@@ -1407,6 +1423,12 @@
     }
     if (isset($parameters['max_depth'])) {
       $query->condition('ml.depth', $parameters['max_depth'], '<=');
+    }
+    // Add custom query conditions, if any were passed.
+    if (isset($parameters['conditions'])) {
+      foreach ($parameters['conditions'] as $column => $value) {
+        $query->condition($column, $value);
+      }
     }
 
     // Build an ordered array of links using the query result object.
@@ -2260,6 +2282,13 @@
 
 /**
  * Set (or get) the active menu for the current page - determines the active trail.
+ *
+ * @return
+ *   An array of menu machine names, in order of preference. The
+ *   'menu_default_active_menus' variable may be used to assert a menu order
+ *   different from the order of creation, or to prevent a particular menu from
+ *   being used at all in the active trail.
+ *   E.g., $conf['menu_default_active_menus'] = array('navigation', 'main-menu')
  */
 function menu_set_active_menu_names($menu_names = NULL) {
   $active = &drupal_static(__FUNCTION__);
@@ -2390,23 +2419,30 @@
  * @param $path
  *   The path, for example 'node/5'. The function will find the corresponding
  *   menu link ('node/5' if it exists, or fallback to 'node/%').
+ * @param $selected_menu
+ *   The name of a menu used to restrict the search for a preferred menu link.
+ *   If not specified, all the menus returned by menu_get_active_menu_names()
+ *   will be used.
  *
  * @return
- *   A fully translated menu link, or NULL if no matching menu link was
+ *   A fully translated menu link, or FALSE if no matching menu link was
  *   found. The most specific menu link ('node/5' preferred over 'node/%') in
  *   the most preferred menu (as defined by menu_get_active_menu_names()) is
  *   returned.
  */
-function menu_link_get_preferred($path = NULL) {
+function menu_link_get_preferred($path = NULL, $selected_menu = NULL) {
   $preferred_links = &drupal_static(__FUNCTION__);
 
   if (!isset($path)) {
     $path = $_GET['q'];
   }
 
+  if (empty($selected_menu)) {
+    // Use an illegal menu name as the key for the preferred menu link.
+    $selected_menu = MENU_PREFERRED_LINK;
+  }
+
   if (!isset($preferred_links[$path])) {
-    $preferred_links[$path] = FALSE;
-
     // Look for the correct menu link by building a list of candidate paths,
     // which are ordered by priority (translated hrefs are preferred over
     // untranslated paths). Afterwards, the most relevant path is picked from
@@ -2428,6 +2464,8 @@
 
     // Retrieve a list of menu names, ordered by preference.
     $menu_names = menu_get_active_menu_names();
+    // Put the selected menu at the front of the list.
+    array_unshift($menu_names, $selected_menu);
 
     $query = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC));
     $query->leftJoin('menu_router', 'm', 'm.path = ml.router_path');
@@ -2435,7 +2473,6 @@
     // Weight must be taken from {menu_links}, not {menu_router}.
     $query->addField('ml', 'weight', 'link_weight');
     $query->fields('m');
-    $query->condition('ml.menu_name', $menu_names, 'IN');
     $query->condition('ml.link_path', $path_candidates, 'IN');
 
     // Sort candidates by link path and menu name.
@@ -2443,29 +2480,35 @@
     foreach ($query->execute() as $candidate) {
       $candidate['weight'] = $candidate['link_weight'];
       $candidates[$candidate['link_path']][$candidate['menu_name']] = $candidate;
-    }
-
-    // Pick the most specific link, in the most preferred menu.
+      // Add any menus not already in the menu name search list.
+      if (!in_array($candidate['menu_name'], $menu_names)) {
+        $menu_names[] = $candidate['menu_name'];
+      }
+    }
+
+    // Store the most specific link for each menu. Also save the most specific
+    // link of the most preferred menu in $preferred_link.
     foreach ($path_candidates as $link_path) {
-      if (!isset($candidates[$link_path])) {
-        continue;
-      }
-      foreach ($menu_names as $menu_name) {
-        if (!isset($candidates[$link_path][$menu_name])) {
-          continue;
+      if (isset($candidates[$link_path])) {
+        foreach ($menu_names as $menu_name) {
+          if (empty($preferred_links[$path][$menu_name]) && isset($candidates[$link_path][$menu_name])) {
+            $candidate_item = $candidates[$link_path][$menu_name];
+            $map = explode('/', $path);
+            _menu_translate($candidate_item, $map);
+            if ($candidate_item['access']) {
+              $preferred_links[$path][$menu_name] = $candidate_item;
+              if (empty($preferred_links[$path][MENU_PREFERRED_LINK])) {
+                // Store the most specific link.
+                $preferred_links[$path][MENU_PREFERRED_LINK] = $candidate_item;
+              }
+            }
+          }
         }
-        $candidate_item = $candidates[$link_path][$menu_name];
-        $map = explode('/', $path);
-        _menu_translate($candidate_item, $map);
-        if ($candidate_item['access']) {
-          $preferred_links[$path] = $candidate_item;
-        }
-        break 2;
-      }
-    }
-  }
-
-  return $preferred_links[$path];
+      }
+    }
+  }
+
+  return isset($preferred_links[$path][$selected_menu]) ? $preferred_links[$path][$selected_menu] : FALSE;
 }
 
 /**

Modified: branches/upstream/current-7/includes/module.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/module.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/module.inc (original)
+++ branches/upstream/current-7/includes/module.inc Sun Feb  5 17:53:08 2012
@@ -539,6 +539,7 @@
     system_list_reset();
     module_list(TRUE);
     module_implements('', FALSE, TRUE);
+    entity_info_cache_clear();
     // Invoke hook_modules_disabled before disabling modules,
     // so we can still call module hooks to get information.
     module_invoke_all('modules_disabled', $invoke_modules);
@@ -952,10 +953,24 @@
       }
       // If any modules implement one of the extra hooks that do not implement
       // the primary hook, we need to add them to the $modules array in their
-      // appropriate order.
+      // appropriate order. module_implements() can only return ordered
+      // implementations of a single hook. To get the ordered implementations
+      // of multiple hooks, we mimic the module_implements() logic of first
+      // ordering by module_list(), and then calling
+      // drupal_alter('module_implements').
       if (array_diff($extra_modules, $modules)) {
-        // Order the modules by the order returned by module_list().
+        // Merge the arrays and order by module_list().
         $modules = array_intersect(module_list(), array_merge($modules, $extra_modules));
+        // Since module_implements() already took care of loading the necessary
+        // include files, we can safely pass FALSE for the array values.
+        $implementations = array_fill_keys($modules, FALSE);
+        // Let modules adjust the order solely based on the primary hook. This
+        // ensures the same module order regardless of whether this if block
+        // runs. Calling drupal_alter() recursively in this way does not result
+        // in an infinite loop, because this call is for a single $type, so we
+        // won't end up in this code block again.
+        drupal_alter('module_implements', $implementations, $hook);
+        $modules = array_keys($implementations);
       }
       foreach ($modules as $module) {
         // Since $modules is a merged array, for any given module, we do not
@@ -1003,4 +1018,3 @@
     $function($data, $context1, $context2);
   }
 }
-

Modified: branches/upstream/current-7/includes/password.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/password.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/password.inc (original)
+++ branches/upstream/current-7/includes/password.inc Sun Feb  5 17:53:08 2012
@@ -285,4 +285,3 @@
   // Check whether the iteration count used differs from the standard number.
   return (_password_get_count_log2($account->pass) !== $count_log2);
 }
-

Modified: branches/upstream/current-7/includes/path.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/path.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/path.inc (original)
+++ branches/upstream/current-7/includes/path.inc Sun Feb  5 17:53:08 2012
@@ -13,12 +13,12 @@
  * Initialize the $_GET['q'] variable to the proper normal path.
  */
 function drupal_path_initialize() {
-  if (!empty($_GET['q'])) {
-    $_GET['q'] = drupal_get_normal_path($_GET['q']);
-  }
-  else {
-    $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node'));
-  }
+  // Ensure $_GET['q'] is set before calling drupal_normal_path(), to support
+  // path caching with hook_url_inbound_alter().
+  if (empty($_GET['q'])) {
+    $_GET['q'] = variable_get('site_frontpage', 'node');
+  }
+  $_GET['q'] = drupal_get_normal_path($_GET['q']);
 }
 
 /**

Modified: branches/upstream/current-7/includes/registry.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/registry.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/registry.inc (original)
+++ branches/upstream/current-7/includes/registry.inc Sun Feb  5 17:53:08 2012
@@ -183,4 +183,3 @@
 /**
  * @} End of "defgroup registry".
  */
-

Modified: branches/upstream/current-7/includes/stream_wrappers.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/stream_wrappers.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/stream_wrappers.inc (original)
+++ branches/upstream/current-7/includes/stream_wrappers.inc Sun Feb  5 17:53:08 2012
@@ -317,7 +317,7 @@
     }
 
     $extension = '';
-    $file_parts = explode('.', basename($uri));
+    $file_parts = explode('.', drupal_basename($uri));
 
     // Remove the first part: a full filename should not match an extension.
     array_shift($file_parts);
@@ -377,7 +377,7 @@
     $realpath = realpath($path);
     if (!$realpath) {
       // This file does not yet exist.
-      $realpath = realpath(dirname($path)) . '/' . basename($path);
+      $realpath = realpath(dirname($path)) . '/' . drupal_basename($path);
     }
     $directory = realpath($this->getDirectoryPath());
     if (!$realpath || !$directory || strpos($realpath, $directory) !== 0) {

Modified: branches/upstream/current-7/includes/theme.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/theme.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/theme.inc (original)
+++ branches/upstream/current-7/includes/theme.inc Sun Feb  5 17:53:08 2012
@@ -237,18 +237,33 @@
 /**
  * Get the theme registry.
  *
+ * @param $complete
+ *   Optional boolean to indicate whether to return the complete theme registry
+ *   array or an instance of the ThemeRegistry class. If TRUE, the complete
+ *   theme registry array will be returned. This is useful if you want to
+ *   foreach over the whole registry, use array_* functions or inspect it in a
+ *   debugger. If FALSE, an instance of the ThemeRegistry class will be
+ *   returned, this provides an ArrayObject which allows it to be accessed
+ *   with array syntax and  isset(), and should be more lightweight
+ *   than the full registry. Defaults to TRUE.
+ *
  * @return
- *   The theme registry array if it has been stored in memory, NULL otherwise.
- */
-function theme_get_registry() {
-  static $theme_registry = NULL;
-
-  if (!isset($theme_registry)) {
+ *   The complete theme registry array, or an instance of the ThemeRegistry
+ *   class.
+ */
+function theme_get_registry($complete = TRUE) {
+  static $theme_registry = array();
+  $key = (int) $complete;
+
+  if (!isset($theme_registry[$key])) {
     list($callback, $arguments) = _theme_registry_callback();
-    $theme_registry = call_user_func_array($callback, $arguments);
-  }
-
-  return $theme_registry;
+    if (!$complete) {
+      $arguments[] = FALSE;
+    }
+    $theme_registry[$key] = call_user_func_array($callback, $arguments);
+  }
+
+  return $theme_registry[$key];
 }
 
 /**
@@ -268,7 +283,7 @@
 }
 
 /**
- * Get the theme_registry cache from the database; if it doesn't exist, build it.
+ * Get the theme_registry cache; if it doesn't exist, build it.
  *
  * @param $theme
  *   The loaded $theme object as returned by list_themes().
@@ -277,23 +292,34 @@
  *   oldest first order.
  * @param $theme_engine
  *   The name of the theme engine.
- */
-function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL) {
-  // Check the theme registry cache; if it exists, use it.
-  $cache = cache_get("theme_registry:$theme->name", 'cache');
-  if (isset($cache->data)) {
-    $registry = $cache->data;
+ * @param $complete
+ *   Whether to load the complete theme registry or an instance of the
+ *   ThemeRegistry class.
+ *
+ * @return
+ *   The theme registry array, or an instance of the ThemeRegistry class.
+ */
+function _theme_load_registry($theme, $base_theme = NULL, $theme_engine = NULL, $complete = TRUE) {
+  if ($complete) {
+    // Check the theme registry cache; if it exists, use it.
+    $cached = cache_get("theme_registry:$theme->name");
+    if (isset($cached->data)) {
+      $registry = $cached->data;
+    }
+    else {
+      // If not, build one and cache it.
+      $registry = _theme_build_registry($theme, $base_theme, $theme_engine);
+      // Only persist this registry if all modules are loaded. This assures a
+      // complete set of theme hooks.
+      if (module_load_all(NULL)) {
+        _theme_save_registry($theme, $registry);
+      }
+    }
+    return $registry;
   }
   else {
-    // If not, build one and cache it.
-    $registry = _theme_build_registry($theme, $base_theme, $theme_engine);
-   // Only persist this registry if all modules are loaded. This assures a
-   // complete set of theme hooks.
-    if (module_load_all(NULL)) {
-      _theme_save_registry($theme, $registry);
-    }
-  }
-  return $registry;
+    return new ThemeRegistry('theme_registry:runtime:' . $theme->name, 'cache');
+  }
 }
 
 /**
@@ -310,6 +336,116 @@
  */
 function drupal_theme_rebuild() {
   cache_clear_all('theme_registry', 'cache', TRUE);
+}
+
+/**
+ * Builds the run-time theme registry.
+ *
+ * Extends DrupalCacheArray to allow the theme registry to be accessed as a
+ * complete registry, while internally caching only the parts of the registry
+ * that are actually in use on the site. On cache misses the complete
+ * theme registry is loaded and used to update the run-time cache.
+ */
+class ThemeRegistry Extends DrupalCacheArray {
+
+  /**
+   * Whether the partial registry can be persisted to the cache.
+   *
+   * This is only allowed if all modules and the request method is GET. theme()
+   * should be very rarely called on POST requests and this avoids polluting
+   * the runtime cache.
+   */
+  protected $persistable;
+
+  /**
+   * The complete theme registry array.
+   */
+  protected $completeRegistry;
+
+  function __construct($cid, $bin) {
+    $this->cid = $cid;
+    $this->bin = $bin;
+    $this->persistable = module_load_all(NULL) && $_SERVER['REQUEST_METHOD'] == 'GET';
+
+    $data = array();
+    if ($this->persistable && $cached = cache_get($this->cid, $this->bin)) {
+      $data = $cached->data;
+    }
+    else {
+      // If there is no runtime cache stored, fetch the full theme registry,
+      // but then initialize each value to NULL. This allows offsetExists()
+      // to function correctly on non-registered theme hooks without triggering
+      // a call to resolveCacheMiss().
+      $data = $this->initializeRegistry();
+      if ($this->persistable) {
+        $this->set($data);
+      }
+    }
+    $this->storage = $data;
+  }
+
+  /**
+   * Initializes the full theme registry.
+   *
+   * @return
+   *   An array with the keys of the full theme registry, but the values
+   *   initialized to NULL.
+   */
+  function initializeRegistry() {
+    $this->completeRegistry = theme_get_registry();
+
+    return array_fill_keys(array_keys($this->completeRegistry), NULL);
+  }
+
+  public function offsetExists($offset) {
+    // Since the theme registry allows for theme hooks to be requested that
+    // are not registered, just check the existence of the key in the registry.
+    // Use array_key_exists() here since a NULL value indicates that the theme
+    // hook exists but has not yet been requested.
+    return array_key_exists($offset, $this->storage);
+  }
+
+  public function offsetGet($offset) {
+    // If the offset is set but empty, it is a registered theme hook that has
+    // not yet been requested. Offsets that do not exist at all were not
+    // registered in hook_theme().
+    if (isset($this->storage[$offset])) {
+      return $this->storage[$offset];
+    }
+    elseif (array_key_exists($offset, $this->storage)) {
+      return $this->resolveCacheMiss($offset);
+    }
+  }
+
+  public function resolveCacheMiss($offset) {
+    if (!isset($this->completeRegistry)) {
+      $this->completeRegistry = theme_get_registry();
+    }
+    $this->storage[$offset] = $this->completeRegistry[$offset];
+    if ($this->persistable) {
+      $this->persist($offset);
+    }
+    return $this->storage[$offset];
+  }
+
+  public function set($data, $lock = TRUE) {
+    $lock_name = $this->cid . ':' . $this->bin;
+    if (!$lock || lock_acquire($lock_name)) {
+      if ($cached = cache_get($this->cid, $this->bin)) {
+        // Use array merge instead of union so that filled in values in $data
+        // overwrite empty values in the current cache.
+        $data = array_merge($cached->data, $data);
+      }
+      else {
+        $registry = $this->initializeRegistry();
+        $data = array_merge($registry, $data);
+      }
+      cache_set($this->cid, $data, $this->bin);
+      if ($lock) {
+        lock_release($lock_name);
+      }
+    }
+  }
 }
 
 /**
@@ -657,8 +793,9 @@
  * Generates themed output.
  *
  * All requests for themed output must go through this function. It examines
- * the request and routes it to the appropriate theme function or template, by
- * checking the theme registry.
+ * the request and routes it to the appropriate
+ * @link themeable theme function or template @endlink, by checking the theme
+ * registry.
  *
  * The first argument to this function is the name of the theme hook. For
  * instance, to theme a table, the theme hook name is 'table'. By default, this
@@ -758,6 +895,8 @@
  *
  * @return
  *   An HTML string representing the themed output.
+ *
+ * @see themeable
  */
 function theme($hook, $variables = array()) {
   static $hooks = NULL;
@@ -771,7 +910,7 @@
 
   if (!isset($hooks)) {
     drupal_theme_initialize();
-    $hooks = theme_get_registry();
+    $hooks = theme_get_registry(FALSE);
   }
 
   // If an array of hook candidates were passed, use the first one that has an
@@ -1391,7 +1530,7 @@
  * @param $variables
  *   An associative array containing:
  *   - links: An associative array of links to be themed. The key for each link
- *     is used as its css class. Each link should be itself an array, with the
+ *     is used as its CSS class. Each link should be itself an array, with the
  *     following elements:
  *     - title: The link text.
  *     - href: The link URL. If omitted, the 'title' is shown as a plain text
@@ -1981,6 +2120,8 @@
 /**
  * Returns HTML for a progress bar.
  *
+ * Note that the core Batch API uses this only for non-JavaScript batch jobs.
+ *
  * @param $variables
  *   An associative array containing:
  *   - percent: The percentage of the progress.

Modified: branches/upstream/current-7/includes/token.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/token.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/token.inc (original)
+++ branches/upstream/current-7/includes/token.inc Sun Feb  5 17:53:08 2012
@@ -77,8 +77,13 @@
  *   Text with tokens replaced.
  */
 function token_replace($text, array $data = array(), array $options = array()) {
+  $text_tokens = token_scan($text);
+  if (empty($text_tokens)) {
+    return $text;
+  }
+
   $replacements = array();
-  foreach (token_scan($text) as $type => $tokens) {
+  foreach ($text_tokens as $type => $tokens) {
     $replacements += token_generate($type, $tokens, $data, $options);
     if (!empty($options['clear'])) {
       $replacements += array_fill_keys($tokens, '');

Modified: branches/upstream/current-7/includes/update.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/update.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/update.inc (original)
+++ branches/upstream/current-7/includes/update.inc Sun Feb  5 17:53:08 2012
@@ -746,7 +746,7 @@
     // Rename 'site_offline_message' variable to 'maintenance_mode_message'
     // and 'site_offline' variable to 'maintenance_mode'.
     // Old variable is removed in update for system.module, see
-    // system_update_7036().
+    // system_update_7072().
     if ($message = variable_get('site_offline_message', NULL)) {
       variable_set('maintenance_mode_message', $message);
     }

Modified: branches/upstream/current-7/includes/updater.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/updater.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/updater.inc (original)
+++ branches/upstream/current-7/includes/updater.inc Sun Feb  5 17:53:08 2012
@@ -141,7 +141,7 @@
       return FALSE;
     }
     foreach ($info_files as $info_file) {
-      if (drupal_substr($info_file->filename, 0, -5) == basename($directory)) {
+      if (drupal_substr($info_file->filename, 0, -5) == drupal_basename($directory)) {
         // Info file Has the same name as the directory, return it.
         return $info_file->uri;
       }
@@ -163,7 +163,7 @@
    *   The name of the project.
    */
   public static function getProjectName($directory) {
-    return basename($directory);
+    return drupal_basename($directory);
   }
 
   /**

Modified: branches/upstream/current-7/includes/utility.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/utility.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/utility.inc (original)
+++ branches/upstream/current-7/includes/utility.inc Sun Feb  5 17:53:08 2012
@@ -46,6 +46,13 @@
       $output = "'" . $var . "'";
     }
   }
+  elseif (is_object($var) && get_class($var) === 'stdClass') {
+    // var_export() will export stdClass objects using an undefined
+    // magic method __set_state() leaving the export broken. This
+    // workaround avoids this by casting the object as an array for
+    // export and casting it back to an object when evaluated.
+    $output .= '(object) ' . drupal_var_export((array) $var, $prefix);
+  }
   else {
     $output = var_export($var, TRUE);
   }

Modified: branches/upstream/current-7/includes/xmlrpc.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/xmlrpc.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/xmlrpc.inc (original)
+++ branches/upstream/current-7/includes/xmlrpc.inc Sun Feb  5 17:53:08 2012
@@ -622,4 +622,3 @@
 function xmlrpc_clear_error() {
   xmlrpc_error(NULL, NULL, TRUE);
 }
-

Modified: branches/upstream/current-7/includes/xmlrpcs.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/xmlrpcs.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/includes/xmlrpcs.inc (original)
+++ branches/upstream/current-7/includes/xmlrpcs.inc Sun Feb  5 17:53:08 2012
@@ -382,4 +382,3 @@
   $xmlrpc_server = xmlrpc_server_get();
   return $xmlrpc_server->help[$method];
 }
-

Modified: branches/upstream/current-7/misc/ajax.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/ajax.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/misc/ajax.js (original)
+++ branches/upstream/current-7/misc/ajax.js Sun Feb  5 17:53:08 2012
@@ -318,7 +318,7 @@
 Drupal.ajax.prototype.beforeSubmit = function (form_values, element, options) {
   // This function is left empty to make it simple to override for modules
   // that wish to add functionality here.
-}
+};
 
 /**
  * Prepare the Ajax request before it is sent.

Modified: branches/upstream/current-7/misc/authorize.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/authorize.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/misc/authorize.js (original)
+++ branches/upstream/current-7/misc/authorize.js Sun Feb  5 17:53:08 2012
@@ -16,7 +16,6 @@
 
     // Removes the float on the select box (used for non-JS interface).
     if ($('.connection-settings-update-filetransfer-default-wrapper').length > 0) {
-      console.log($('.connection-settings-update-filetransfer-default-wrapper'));
       $('.connection-settings-update-filetransfer-default-wrapper').css('float', 'none');
     }
     // Hides the submit button for non-js users.

Modified: branches/upstream/current-7/misc/autocomplete.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/autocomplete.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/misc/autocomplete.js (original)
+++ branches/upstream/current-7/misc/autocomplete.js Sun Feb  5 17:53:08 2012
@@ -41,7 +41,7 @@
 Drupal.jsAC = function ($input, db) {
   var ac = this;
   this.input = $input[0];
-  this.ariaLive = $('#' + $input.attr('id') + '-autocomplete-aria-live');
+  this.ariaLive = $('#' + this.input.id + '-autocomplete-aria-live');
   this.db = db;
 
   $input

Modified: branches/upstream/current-7/misc/drupal.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/drupal.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/misc/drupal.js (original)
+++ branches/upstream/current-7/misc/drupal.js Sun Feb  5 17:53:08 2012
@@ -164,7 +164,7 @@
     str = str.replace(key, args[key]);
   }
   return str;
-}
+};
 
 /**
  * Translate strings to the page language or a given language.
@@ -177,13 +177,21 @@
  *   An object of replacements pairs to make after translation. Incidences
  *   of any key in this array are replaced with the corresponding value.
  *   See Drupal.formatString().
+ *
+ * @param options
+ *   - 'context' (defaults to the empty context): The context the source string
+ *     belongs to.
+ *
  * @return
  *   The translated string.
  */
-Drupal.t = function (str, args) {
+Drupal.t = function (str, args, options) {
+  options = options || {};
+  options.context = options.context || '';
+
   // Fetch the localized version of the string.
-  if (Drupal.locale.strings && Drupal.locale.strings[str]) {
-    str = Drupal.locale.strings[str];
+  if (Drupal.locale.strings && Drupal.locale.strings[options.context] && Drupal.locale.strings[options.context][str]) {
+    str = Drupal.locale.strings[options.context][str];
   }
 
   if (args) {
@@ -216,25 +224,27 @@
  *   See Drupal.formatString().
  *   Note that you do not need to include @count in this array.
  *   This replacement is done automatically for the plural case.
+ * @param options
+ *   The options to pass to the Drupal.t() function.
  * @return
  *   A translated string.
  */
-Drupal.formatPlural = function (count, singular, plural, args) {
+Drupal.formatPlural = function (count, singular, plural, args, options) {
   var args = args || {};
   args['@count'] = count;
   // Determine the index of the plural form.
   var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);
 
   if (index == 0) {
-    return Drupal.t(singular, args);
+    return Drupal.t(singular, args, options);
   }
   else if (index == 1) {
-    return Drupal.t(plural, args);
+    return Drupal.t(plural, args, options);
   }
   else {
     args['@count[' + index + ']'] = args['@count'];
     delete args['@count'];
-    return Drupal.t(plural.replace('@count', '@count[' + index + ']'), args);
+    return Drupal.t(plural.replace('@count', '@count[' + index + ']'), args, options);
   }
 };
 

Modified: branches/upstream/current-7/modules/aggregator/aggregator-feed-source.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator-feed-source.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator-feed-source.tpl.php (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator-feed-source.tpl.php Sun Feb  5 17:53:08 2012
@@ -17,6 +17,8 @@
  *
  * @see template_preprocess()
  * @see template_preprocess_aggregator_feed_source()
+ *
+ * @ingroup themeable
  */
 ?>
 <div class="feed-source">

Modified: branches/upstream/current-7/modules/aggregator/aggregator-item.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator-item.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator-item.tpl.php (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator-item.tpl.php Sun Feb  5 17:53:08 2012
@@ -16,6 +16,8 @@
  *
  * @see template_preprocess()
  * @see template_preprocess_aggregator_item()
+ *
+ * @ingroup themeable
  */
 ?>
 <div class="feed-item">

Modified: branches/upstream/current-7/modules/aggregator/aggregator-summary-item.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator-summary-item.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator-summary-item.tpl.php (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator-summary-item.tpl.php Sun Feb  5 17:53:08 2012
@@ -13,6 +13,8 @@
  *
  * @see template_preprocess()
  * @see template_preprocess_aggregator_summary_item()
+ *
+ * @ingroup themeable
  */
 ?>
 <a href="<?php print $feed_url; ?>"><?php print $feed_title; ?></a>

Modified: branches/upstream/current-7/modules/aggregator/aggregator-summary-items.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator-summary-items.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator-summary-items.tpl.php (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator-summary-items.tpl.php Sun Feb  5 17:53:08 2012
@@ -14,6 +14,8 @@
  *
  * @see template_preprocess()
  * @see template_preprocess_aggregator_summary_items()
+ *
+ * @ingroup themeable
  */
 ?>
 <h3><?php print $title; ?></h3>

Modified: branches/upstream/current-7/modules/aggregator/aggregator-wrapper.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator-wrapper.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator-wrapper.tpl.php (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator-wrapper.tpl.php Sun Feb  5 17:53:08 2012
@@ -10,6 +10,8 @@
  *
  * @see template_preprocess()
  * @see template_preprocess_aggregator_wrapper()
+ *
+ * @ingroup themeable
  */
 ?>
 <div id="aggregator">

Modified: branches/upstream/current-7/modules/aggregator/aggregator.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator.admin.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.admin.inc (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.admin.inc Sun Feb  5 17:53:08 2012
@@ -53,7 +53,11 @@
 }
 
 /**
- * Form builder; Generate a form to add/edit feed sources.
+ * Form constructor for adding and editing feed sources.
+ *
+ * @param $feed
+ *   If editing a feed, the feed to edit as a PHP stdClass value; if adding a
+ *   new feed, NULL.
  *
  * @ingroup forms
  * @see aggregator_form_feed_validate()
@@ -129,7 +133,9 @@
 }
 
 /**
- * Validate aggregator_form_feed() form submissions.
+ * Form validation handler for aggregator_form_feed().
+ *
+ * @see aggregator_form_feed_submit()
  */
 function aggregator_form_feed_validate($form, &$form_state) {
   if ($form_state['values']['op'] == t('Save')) {
@@ -156,8 +162,9 @@
 }
 
 /**
- * Process aggregator_form_feed() form submissions.
- *
+ * Form submission handler for aggregator_form_feed().
+ *
+ * @see aggregator_form_feed_validate()
  * @todo Add delete confirmation dialog.
  */
 function aggregator_form_feed_submit($form, &$form_state) {
@@ -198,6 +205,14 @@
   }
 }
 
+/**
+ * Deletes a feed.
+ *
+ * @param $feed
+ *   An associative array describing the feed to be cleared.
+ *
+ * @see aggregator_admin_remove_feed_submit()
+ */
 function aggregator_admin_remove_feed($form, $form_state, $feed) {
   return confirm_form(
     array(
@@ -215,10 +230,9 @@
 }
 
 /**
- * Remove all items from a feed and redirect to the overview page.
- *
- * @param $feed
- *   An associative array describing the feed to be cleared.
+ * Form submission handler for aggregator_admin_remove_feed().
+ *
+ * Removes all items from a feed and redirects to the overview page.
  */
 function aggregator_admin_remove_feed_submit($form, &$form_state) {
   aggregator_remove($form_state['values']['feed']);
@@ -226,7 +240,7 @@
 }
 
 /**
- * Form builder; Generate a form to import feeds from OPML.
+ * Form constructor for importing feeds from OPML.
  *
  * @ingroup forms
  * @see aggregator_form_opml_validate()
@@ -280,7 +294,9 @@
 }
 
 /**
- * Validate aggregator_form_opml form submissions.
+ * Form validation handler for aggregator_form_opml().
+ *
+ * @see aggregator_form_opml_submit()
  */
 function aggregator_form_opml_validate($form, &$form_state) {
   // If both fields are empty or filled, cancel.
@@ -295,7 +311,9 @@
 }
 
 /**
- * Process aggregator_form_opml form submissions.
+ * Form submission handler for aggregator_form_opml().
+ *
+ * @see aggregator_form_opml_validate()
  */
 function aggregator_form_opml_submit($form, &$form_state) {
   $data = '';
@@ -347,7 +365,7 @@
 }
 
 /**
- * Parse an OPML file.
+ * Parses an OPML file.
  *
  * Feeds are recognized as <outline> elements with the attributes "text" and
  * "xmlurl" set.
@@ -357,9 +375,9 @@
  *
  * @return
  *   An array of feeds, each an associative array with a "title" and a "url"
- *   element, or NULL if the OPML document failed to be parsed. An empty
- *   array will be returned if the document is valid but contains no feeds, as
- *   some OPML documents do.
+ *   element, or NULL if the OPML document failed to be parsed. An empty array
+ *   will be returned if the document is valid but contains no feeds, as some
+ *   OPML documents do.
  */
 function _aggregator_parse_opml($opml) {
   $feeds = array();
@@ -394,8 +412,9 @@
 }
 
 /**
- * Form builder; Configure the aggregator system.
- *
+ * Form constructor for the aggregator system settings.
+ *
+ * @see aggregator_admin_form_submit()
  * @ingroup forms
  */
 function aggregator_admin_form($form, $form_state) {
@@ -503,6 +522,9 @@
   return $form;
 }
 
+/**
+ * Form submission handler for aggregator_admin_form().
+ */
 function aggregator_admin_form_submit($form, &$form_state) {
   if (isset($form_state['values']['aggregator_processors'])) {
     $form_state['values']['aggregator_processors'] = array_filter($form_state['values']['aggregator_processors']);
@@ -511,7 +533,13 @@
 }
 
 /**
- * Form builder; Generate a form to add/edit/delete aggregator categories.
+ * Form constructor to add/edit/delete aggregator categories.
+ *
+ * @param $edit
+ *   An associative array containing:
+ *   - title: A string to use for the category title.
+ *   - description: A string to use for the category description.
+ *   - cid: The category ID.
  *
  * @ingroup forms
  * @see aggregator_form_category_validate()
@@ -539,7 +567,9 @@
 }
 
 /**
- * Validate aggregator_form_feed form submissions.
+ * Form validation handler for aggregator_form_category().
+ *
+ * @see aggregator_form_category_submit()
  */
 function aggregator_form_category_validate($form, &$form_state) {
   if ($form_state['values']['op'] == t('Save')) {
@@ -557,8 +587,9 @@
 }
 
 /**
- * Process aggregator_form_category form submissions.
- *
+ * Form submission handler for aggregator_form_category().
+ *
+ * @see aggregator_form_category_validate()
  * @todo Add delete confirmation dialog.
  */
 function aggregator_form_category_submit($form, &$form_state) {

Modified: branches/upstream/current-7/modules/aggregator/aggregator.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator.api.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.api.php (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.api.php Sun Feb  5 17:53:08 2012
@@ -11,21 +11,21 @@
  */
 
 /**
- * Implement this hook to create an alternative fetcher for aggregator module.
- *
- * A fetcher downloads feed data to a Drupal site. The fetcher is called
- * at the first of the three aggregation stages: data is downloaded by the
- * active fetcher, it is converted to a common format by the active parser and
- * finally, it is passed to all active processors which manipulate or store the
- * data.
+ * Create an alternative fetcher for aggregator.module.
+ *
+ * A fetcher downloads feed data to a Drupal site. The fetcher is called at the
+ * first of the three aggregation stages: first, data is downloaded by the
+ * active fetcher; second, it is converted to a common format by the active
+ * parser; and finally, it is passed to all active processors, which manipulate
+ * or store the data.
  *
  * Modules that define this hook can be set as active fetcher on
  * admin/config/services/aggregator. Only one fetcher can be active at a time.
  *
  * @param $feed
- *   The $feed object that describes the resource to be downloaded.
- *   $feed->url contains the link to the feed. Download the data at the URL
- *   and expose it to other modules by attaching it to $feed->source_string.
+ *   A feed object representing the resource to be downloaded. $feed->url
+ *   contains the link to the feed. Download the data at the URL and expose it
+ *   to other modules by attaching it to $feed->source_string.
  *
  * @return
  *   TRUE if fetching was successful, FALSE otherwise.
@@ -41,8 +41,7 @@
 }
 
 /**
- * Implement this hook to expose the title and a short description of your
- * fetcher.
+ * Specify the title and short description of your fetcher.
  *
  * The title and the description provided are shown on
  * admin/config/services/aggregator among other places. Use as title the human
@@ -68,41 +67,37 @@
 }
 
 /**
- * Implement this hook to create an alternative parser for aggregator module.
+ * Create an alternative parser for aggregator module.
  *
  * A parser converts feed item data to a common format. The parser is called
- * at the second of the three aggregation stages: data is downloaded by the
- * active fetcher, it is converted to a common format by the active parser and
- * finally, it is passed to all active processors which manipulate or store the
- * data.
- *
- * Modules that define this hook can be set as active parser on
+ * at the second of the three aggregation stages: first, data is downloaded
+ * by the active fetcher; second, it is converted to a common format by the
+ * active parser; and finally, it is passed to all active processors which
+ * manipulate or store the data.
+ *
+ * Modules that define this hook can be set as the active parser on
  * admin/config/services/aggregator. Only one parser can be active at a time.
  *
  * @param $feed
- *   The $feed object that describes the resource to be parsed.
- *   $feed->source_string contains the raw feed data as a string. Parse data
- *   from $feed->source_string and expose it to other modules as an array of
- *   data items on $feed->items.
- *
- *   Feed format:
- *   - $feed->description (string) - description of the feed
- *   - $feed->image (string) - image for the feed
- *   - $feed->etag (string) - value of feed's entity tag header field
- *   - $feed->modified (UNIX timestamp) - value of feed's last modified header
- *     field
- *   - $feed->items (Array) - array of feed items.
- *
- *   By convention, the common format for a single feed item is:
- *   $item[key-name] = value;
- *
- *   Recognized keys:
- *   TITLE (string) - the title of a feed item
- *   DESCRIPTION (string) - the description (body text) of a feed item
- *   TIMESTAMP (UNIX timestamp) - the feed item's published time as UNIX timestamp
- *   AUTHOR (string) - the feed item's author
- *   GUID (string) - RSS/Atom global unique identifier
- *   LINK (string) - the feed item's URL
+ *   An object describing the resource to be parsed. $feed->source_string
+ *   contains the raw feed data. The hook implementation should parse this data
+ *   and add the following properties to the $feed object:
+ *   - description: The human-readable description of the feed.
+ *   - link: A full URL that directly relates to the feed.
+ *   - image: An image URL used to display an image of the feed.
+ *   - etag: An entity tag from the HTTP header used for cache validation to
+ *     determine if the content has been changed.
+ *   - modified: The UNIX timestamp when the feed was last modified.
+ *   - items: An array of feed items. The common format for a single feed item
+ *     is an associative array containing:
+ *     - title: The human-readable title of the feed item.
+ *     - description: The full body text of the item or a summary.
+ *     - timestamp: The UNIX timestamp when the feed item was last published.
+ *     - author: The author of the feed item.
+ *     - guid: The global unique identifier (GUID) string that uniquely
+ *       identifies the item. If not available, the link is used to identify
+ *       the item.
+ *     - link: A full URL to the individual feed item.
  *
  * @return
  *   TRUE if parsing was successful, FALSE otherwise.
@@ -122,8 +117,7 @@
 }
 
 /**
- * Implement this hook to expose the title and a short description of your
- * parser.
+ * Specify the title and short description of your parser.
  *
  * The title and the description provided are shown on
  * admin/config/services/aggregator among other places. Use as title the human
@@ -149,23 +143,23 @@
 }
 
 /**
- * Implement this hook to create a processor for aggregator module.
+ * Create a processor for aggregator.module.
  *
  * A processor acts on parsed feed data. Active processors are called at the
- * third and last of the aggregation stages: data is downloaded by the active
- * fetcher, it is converted to a common format by the active parser and
- * finally, it is passed to all active processors which manipulate or store the
- * data.
+ * third and last of the aggregation stages: first, data is downloaded by the
+ * active fetcher; second, it is converted to a common format by the active
+ * parser; and finally, it is passed to all active processors that manipulate or
+ * store the data.
  *
  * Modules that define this hook can be activated as processor on
  * admin/config/services/aggregator.
  *
  * @param $feed
- *   The $feed object that describes the resource to be processed. $feed->items
- *   contains an array of feed items downloaded and parsed at the parsing
- *   stage. See hook_aggregator_parse() for the basic format of a single item
- *   in the $feed->items array. For the exact format refer to the particular
- *   parser in use.
+ *   A feed object representing the resource to be processed. $feed->items
+ *   contains an array of feed items downloaded and parsed at the parsing stage.
+ *   See hook_aggregator_parse() for the basic format of a single item in the
+ *   $feed->items array. For the exact format refer to the particular parser in
+ *   use.
  *
  * @see hook_aggregator_process_info()
  * @see hook_aggregator_fetch()
@@ -180,17 +174,16 @@
 }
 
 /**
- * Implement this hook to expose the title and a short description of your
- * processor.
+ * Specify the title and short description of your processor.
  *
  * The title and the description provided are shown most importantly on
  * admin/config/services/aggregator. Use as title the natural name of the
- * processor and as description a brief (40 to 80 characters) explanation of
- * the functionality.
- *
- * This hook is only called if your module implements
- * hook_aggregator_process(). If this hook is not implemented aggregator
- * will use your module's file name as title and there will be no description.
+ * processor and as description a brief (40 to 80 characters) explanation of the
+ * functionality.
+ *
+ * This hook is only called if your module implements hook_aggregator_process().
+ * If this hook is not implemented aggregator will use your module's file name
+ * as title and there will be no description.
  *
  * @return
  *   An associative array defining a title and a description string.
@@ -207,8 +200,7 @@
 }
 
 /**
- * Implement this hook to remove stored data if a feed is being deleted or a
- * feed's items are being removed.
+ * Remove stored feed data.
  *
  * Aggregator calls this hook if either a feed is deleted or a user clicks on
  * "remove items".

Modified: branches/upstream/current-7/modules/aggregator/aggregator.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.info (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 stylesheets[all][] = aggregator.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/aggregator/aggregator.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.module (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.module Sun Feb  5 17:53:08 2012
@@ -266,7 +266,10 @@
 }
 
 /**
- * Title callback for aggregatory category pages.
+ * Title callback: Returns a title for aggregatory category pages.
+ *
+ * @param $category
+ *   An aggregator category.
  *
  * @return
  *   An aggregator category title.
@@ -276,11 +279,11 @@
 }
 
 /**
- * Find out whether there are any aggregator categories.
+ * Determines whether there are any aggregator categories.
  *
  * @return
- *   TRUE if there is at least one category and the user has access to them, FALSE
- *   otherwise.
+ *   TRUE if there is at least one category and the user has access to them;
+ *   FALSE otherwise.
  */
 function _aggregator_has_categories() {
   return user_access('access news feeds') && (bool) db_query_range('SELECT 1 FROM {aggregator_category}', 0, 1)->fetchField();
@@ -425,7 +428,7 @@
 }
 
 /**
- * Add/edit/delete aggregator categories.
+ * Adds/edits/deletes aggregator categories.
  *
  * @param $edit
  *   An associative array describing the category to be added/edited/deleted.
@@ -449,10 +452,12 @@
         ->condition('cid', $edit['cid'])
         ->execute();
       // Make sure there is no active block for this category.
-      db_delete('block')
-        ->condition('module', 'aggregator')
-        ->condition('delta', 'category-' . $edit['cid'])
-        ->execute();
+      if (module_exists('block')) {
+        db_delete('block')
+          ->condition('module', 'aggregator')
+          ->condition('delta', 'category-' . $edit['cid'])
+          ->execute();
+      }
       $edit['title'] = '';
       $op = 'delete';
     }
@@ -511,10 +516,12 @@
       ->condition('fid', $edit['fid'])
       ->execute();
     // Make sure there is no active block for this feed.
-    db_delete('block')
-      ->condition('module', 'aggregator')
-      ->condition('delta', 'feed-' . $edit['fid'])
-      ->execute();
+    if (module_exists('block')) {
+      db_delete('block')
+        ->condition('module', 'aggregator')
+        ->condition('delta', 'feed-' . $edit['fid'])
+        ->execute();
+    }
   }
   elseif (!empty($edit['title'])) {
     $edit['fid'] = db_insert('aggregator_feed')
@@ -570,6 +577,12 @@
     ->execute();
 }
 
+/**
+ * Gets the fetcher, parser, and processors.
+ *
+ * @return
+ *   An array containing the fetcher, parser, and processors.
+ */
 function _aggregator_get_variables() {
   // Fetch the feed.
   $fetcher = variable_get('aggregator_fetcher', 'aggregator');
@@ -656,10 +669,11 @@
 }
 
 /**
- * Load an aggregator feed.
+ * Loads an aggregator feed.
  *
  * @param $fid
  *   The feed id.
+ *
  * @return
  *   An object describing the feed.
  */
@@ -673,10 +687,11 @@
 }
 
 /**
- * Load an aggregator category.
+ * Loads an aggregator category.
  *
  * @param $cid
  *   The category id.
+ *
  * @return
  *   An associative array describing the category.
  */
@@ -705,10 +720,11 @@
 }
 
 /**
- * Safely render HTML content, as allowed.
+ * Safely renders HTML content, as allowed.
  *
  * @param $value
  *   The content to be filtered.
+ *
  * @return
  *   The filtered content.
  */
@@ -717,14 +733,13 @@
 }
 
 /**
- * Check and sanitize aggregator configuration.
- *
- * Goes through all fetchers, parsers and processors and checks whether they are
- * available.
- * If one is missing resets to standard configuration.
+ * Checks and sanitizes the aggregator configuration.
+ *
+ * Goes through all fetchers, parsers and processors and checks whether they
+ * are available. If one is missing resets to standard configuration.
  *
  * @return
- *   TRUE if this function reset the configuration FALSE if not.
+ *   TRUE if this function resets the configuration; FALSE if not.
  */
 function aggregator_sanitize_configuration() {
   $reset = FALSE;
@@ -755,6 +770,7 @@
  *
  * @param $count
  *   Items count.
+ *
  * @return
  *   Plural-formatted "@count items"
  */

Modified: branches/upstream/current-7/modules/aggregator/aggregator.pages.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator.pages.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.pages.inc (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.pages.inc Sun Feb  5 17:53:08 2012
@@ -160,11 +160,13 @@
  * @param $items
  *   The items to be listed.
  * @param $op
- *   Which form should be added to the items. Only 'categorize' is now recognized.
+ *   Which form should be added to the items. Only 'categorize' is now
+ *   recognized.
  * @param $feed_source
  *   The feed source URL.
- * @return
- *   The items HTML.
+ *
+ * @return
+ *   The rendered list of items for a feed.
  */
 function _aggregator_page_list($items, $op, $feed_source = '') {
   if (user_access('administer news feeds') && ($op == 'categorize')) {
@@ -184,14 +186,13 @@
 }
 
 /**
- * Form builder; build the page list form.
+ * Form constructor to build the page list form.
  *
  * @param $items
  *   An array of the feed items.
  * @param $feed_source
  *   The feed source URL.
- * @return
- *   The form structure.
+ *
  * @ingroup forms
  * @see aggregator_categorize_items_submit()
  */
@@ -236,7 +237,7 @@
 }
 
 /**
- * Process aggregator_categorize_items() form submissions.
+ * Form submission handler for aggregator_categorize_items().
  */
 function aggregator_categorize_items_submit($form, &$form_state) {
   if (!empty($form_state['values']['categories'])) {
@@ -293,7 +294,7 @@
 }
 
 /**
- * Process variables for aggregator-wrapper.tpl.php.
+ * Processes variables for aggregator-wrapper.tpl.php.
  *
  * @see aggregator-wrapper.tpl.php
  */
@@ -302,7 +303,7 @@
 }
 
 /**
- * Process variables for aggregator-item.tpl.php.
+ * Processes variables for aggregator-item.tpl.php.
  *
  * @see aggregator-item.tpl.php
  */
@@ -499,7 +500,7 @@
 }
 
 /**
- * Process variables for aggregator-summary-items.tpl.php.
+ * Processes variables for aggregator-summary-items.tpl.php.
  *
  * @see aggregator-summary-items.tpl.php
  */
@@ -510,7 +511,7 @@
 }
 
 /**
- * Process variables for aggregator-summary-item.tpl.php.
+ * Processes variables for aggregator-summary-item.tpl.php.
  *
  * @see aggregator-summary-item.tpl.php
  */
@@ -530,7 +531,7 @@
 }
 
 /**
- * Process variables for aggregator-feed-source.tpl.php.
+ * Processes variables for aggregator-feed-source.tpl.php.
  *
  * @see aggregator-feed-source.tpl.php
  */

Modified: branches/upstream/current-7/modules/aggregator/aggregator.parser.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator.parser.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.parser.inc (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.parser.inc Sun Feb  5 17:53:08 2012
@@ -54,12 +54,13 @@
 }
 
 /**
- * Parse a feed and store its items.
+ * Parses a feed and stores its items.
  *
  * @param $data
  *   The feed data.
  * @param $feed
  *   An object describing the feed to be parsed.
+ *
  * @return
  *   FALSE on error, TRUE otherwise.
  */
@@ -164,7 +165,9 @@
 }
 
 /**
- * Callback function used by the XML parser.
+ * Performs an action when an opening tag is encountered.
+ *
+ * Callback function used by xml_parse() within aggregator_parse_feed().
  */
 function aggregator_element_start($parser, $name, $attributes) {
   global $item, $element, $tag, $items, $channel;
@@ -212,7 +215,9 @@
 }
 
 /**
- * Call-back function used by the XML parser.
+ * Performs an action when a closing tag is encountered.
+ *
+ * Callback function used by xml_parse() within aggregator_parse_feed().
  */
 function aggregator_element_end($parser, $name) {
   global $element;
@@ -234,7 +239,9 @@
 }
 
 /**
- * Callback function used by the XML parser.
+ * Performs an action when data is encountered.
+ *
+ * Callback function used by xml_parse() within aggregator_parse_feed().
  */
 function aggregator_element_data($parser, $data) {
   global $channel, $element, $items, $item, $image, $tag;
@@ -281,14 +288,15 @@
 }
 
 /**
- * Parse the W3C date/time format, a subset of ISO 8601.
- *
- * PHP date parsing functions do not handle this format.
- * See http://www.w3.org/TR/NOTE-datetime for more information.
- * Originally from MagpieRSS (http://magpierss.sourceforge.net/).
+ * Parses the W3C date/time format, a subset of ISO 8601.
+ *
+ * PHP date parsing functions do not handle this format. See
+ * http://www.w3.org/TR/NOTE-datetime for more information. Originally from
+ * MagpieRSS (http://magpierss.sourceforge.net/).
  *
  * @param $date_str
  *   A string with a potentially W3C DTF date.
+ *
  * @return
  *   A timestamp if parsed successfully or FALSE if not.
  */

Modified: branches/upstream/current-7/modules/aggregator/aggregator.processor.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator.processor.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.processor.inc (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.processor.inc Sun Feb  5 17:53:08 2012
@@ -117,7 +117,7 @@
     $form['modules']['aggregator']['aggregator_teaser_length'] = array(
       '#type' => 'select',
       '#title' => t('Length of trimmed description'),
-      '#default_value' => 600,
+      '#default_value' => variable_get('aggregator_teaser_length', 600),
       '#options' => drupal_map_assoc(array(0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000), '_aggregator_characters'),
       '#description' => t("The maximum number of characters used in the trimmed version of content.")
     );
@@ -126,14 +126,17 @@
 }
 
 /**
- * Helper function for teaser length choices.
+ * Creates display text for teaser length option values.
+ *
+ * Callback for drupal_map_assoc() within
+ * aggregator_form_aggregator_admin_form_alter().
  */
 function _aggregator_characters($length) {
   return ($length == 0) ? t('Unlimited') : format_plural($length, '1 character', '@count characters');
 }
 
 /**
- * Add/edit/delete an aggregator item.
+ * Adds/edits/deletes an aggregator item.
  *
  * @param $edit
  *   An associative array describing the item to be added/edited/deleted.
@@ -175,7 +178,7 @@
 }
 
 /**
- * Expire feed items on $feed that are older than aggregator_clear.
+ * Expires items from a feed depending on expiration settings.
  *
  * @param $feed
  *   Object describing feed.

Modified: branches/upstream/current-7/modules/aggregator/aggregator.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/aggregator.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.test (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.test Sun Feb  5 17:53:08 2012
@@ -285,6 +285,38 @@
       $edit['title'] = $this->randomName();
       $edit["body[$langcode][0][value]"] = $this->randomName();
       $this->drupalPost('node/add/article', $edit, t('Save'));
+    }
+  }
+}
+
+/**
+ * Tests aggregator configuration settings.
+ */
+class AggregatorConfigurationTestCase extends AggregatorTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Aggregator configuration',
+      'description' => 'Test aggregator settings page.',
+      'group' => 'Aggregator',
+    );
+  }
+
+  /**
+   * Tests the settings form to ensure the correct default values are used.
+   */
+  function testSettingsPage() {
+    $edit = array(
+      'aggregator_allowed_html_tags' => '<a>',
+      'aggregator_summary_items' => 10,
+      'aggregator_clear' => 3600,
+      'aggregator_category_selector' => 'select',
+      'aggregator_teaser_length' => 200,
+    );
+    $this->drupalPost('admin/config/services/aggregator/settings', $edit, t('Save configuration'));
+    $this->assertText(t('The configuration options have been saved.'));
+
+    foreach ($edit as $name => $value) {
+      $this->assertFieldByName($name, $value, t('"@name" has correct default value.', array('@name' => $name)));
     }
   }
 }

Modified: branches/upstream/current-7/modules/aggregator/tests/aggregator_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/aggregator/tests/aggregator_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/tests/aggregator_test.info (original)
+++ branches/upstream/current-7/modules/aggregator/tests/aggregator_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/block/block-admin-display-form.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/block-admin-display-form.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block-admin-display-form.tpl.php (original)
+++ branches/upstream/current-7/modules/block/block-admin-display-form.tpl.php Sun Feb  5 17:53:08 2012
@@ -21,6 +21,8 @@
  *
  * @see template_preprocess_block_admin_display_form()
  * @see theme_block_admin_display()
+ *
+ * @ingroup themeable
  */
 ?>
 <?php

Modified: branches/upstream/current-7/modules/block/block.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/block.admin.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.admin.inc (original)
+++ branches/upstream/current-7/modules/block/block.admin.inc Sun Feb  5 17:53:08 2012
@@ -57,7 +57,7 @@
 }
 
 /**
- * Form builder for the main blocks administration form.
+ * Form constructor for the main block administration form.
  *
  * @param $blocks
  *   An array of blocks, as returned by block_admin_display_prepare_blocks().
@@ -165,7 +165,7 @@
 }
 
 /**
- * Form submission handler for the main blocks administration form.
+ * Form submission handler for block_admin_display_form().
  *
  * @see block_admin_display_form()
  */
@@ -197,10 +197,9 @@
 }
 
 /**
- * Helper function for sorting blocks on admin/structure/block.
- *
- * Active blocks are sorted by region, then by weight.
- * Disabled blocks are sorted by name.
+ * Sorts active blocks by region, then by weight; sorts inactive blocks by name.
+ *
+ * Callback for usort() in block_admin_display_prepare_blocks().
  */
 function _block_compare($a, $b) {
   global $theme_key;
@@ -240,7 +239,7 @@
 }
 
 /**
- * Form builder for the block configuration form.
+ * Form constructor for the block configuration form.
  *
  * Also used by block_add_block_form() for adding a new custom block.
  *
@@ -441,7 +440,7 @@
 }
 
 /**
- * Form validation handler for the block configuration form.
+ * Form validation handler for block_admin_configure().
  *
  * @see block_admin_configure()
  * @see block_admin_configure_submit()
@@ -459,7 +458,7 @@
 }
 
 /**
- * Form submission handler for the block configuration form.
+ * Form submission handler for block_admin_configure().
  *
  * @see block_admin_configure()
  * @see block_admin_configure_validate()
@@ -519,7 +518,7 @@
 }
 
 /**
- * Form builder for the add block form.
+ * Form constructor for the add block form.
  *
  * @see block_add_block_form_validate()
  * @see block_add_block_form_submit()
@@ -530,7 +529,7 @@
 }
 
 /**
- * Form validation handler for the add block form.
+ * Form validation handler for block_add_block_form().
  *
  * @see block_add_block_form()
  * @see block_add_block_form_submit()
@@ -544,7 +543,7 @@
 }
 
 /**
- * Form submission handler for the add block form.
+ * Form submission handler for block_add_block_form().
  *
  * Saves the new custom block.
  *
@@ -609,7 +608,7 @@
 }
 
 /**
- * Form builder for the custom block deletion form.
+ * Form constructor for the custom block deletion form.
  *
  * @param $module
  *   The name of the module that implements the block to be deleted. This should
@@ -629,7 +628,7 @@
 }
 
 /**
- * Form submission handler for the custom block deletion form.
+ * Form submission handler for block_custom_block_delete().
  *
  * @see block_custom_block_delete()
  */

Modified: branches/upstream/current-7/modules/block/block.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/block.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.info (original)
+++ branches/upstream/current-7/modules/block/block.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/structure/block
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/block/block.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/block.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.module (original)
+++ branches/upstream/current-7/modules/block/block.module Sun Feb  5 17:53:08 2012
@@ -16,27 +16,27 @@
 define('BLOCK_CUSTOM_FIXED', 0);
 
 /**
- *  Show this block by default, but let individual users hide it.
+ *  Shows this block by default, but lets individual users hide it.
  */
 define('BLOCK_CUSTOM_ENABLED', 1);
 
 /**
- * Hide this block by default but let individual users show it.
+ * Hides this block by default but lets individual users show it.
  */
 define('BLOCK_CUSTOM_DISABLED', 2);
 
 /**
- * Show this block on every page except the listed pages.
+ * Shows this block on every page except the listed pages.
  */
 define('BLOCK_VISIBILITY_NOTLISTED', 0);
 
 /**
- * Show this block on only the listed pages.
+ * Shows this block on only the listed pages.
  */
 define('BLOCK_VISIBILITY_LISTED', 1);
 
 /**
- * Show this block if the associated PHP code returns TRUE.
+ * Shows this block if the associated PHP code returns TRUE.
  */
 define('BLOCK_VISIBILITY_PHP', 2);
 
@@ -249,7 +249,7 @@
 /**
  * Implements hook_page_build().
  *
- * Render blocks into their regions.
+ * Renders blocks into their regions.
  */
 function block_page_build(&$page) {
   global $theme;
@@ -305,10 +305,13 @@
 }
 
 /**
- * Get a renderable array of a region containing all enabled blocks.
+ * Gets a renderable array of a region containing all enabled blocks.
  *
  * @param $region
  *   The requested region.
+ *
+ * @return
+ *   A renderable array of a region containing all enabled blocks.
  */
 function block_get_blocks_by_region($region) {
   $build = array();
@@ -319,10 +322,11 @@
 }
 
 /**
- * Get an array of blocks suitable for drupal_render().
+ * Gets an array of blocks suitable for drupal_render().
  *
  * @param $list
  *   A list of blocks such as that returned by block_list().
+ *
  * @return
  *   A renderable array.
  */
@@ -353,7 +357,7 @@
 }
 
 /**
- * Update the 'block' DB table with the blocks currently exported by modules.
+ * Updates the 'block' DB table with the blocks currently exported by modules.
  *
  * @param $theme
  *   The theme to rehash blocks for. If not provided, defaults to the currently
@@ -473,6 +477,7 @@
  *
  * @param $bid
  *   ID of the block to get information for.
+ *
  * @return
  *   Associative array of information stored in the database for this block.
  *   Array keys:
@@ -486,7 +491,14 @@
 }
 
 /**
- * Define the custom block form.
+ * Form constructor for the custom block form.
+ *
+ * @param $edit
+ *   (optional) An associative array of information retrieved by
+ *   block_custom_get_block() if an existing block is being edited, or an empty
+ *   array otherwise. Defaults to array().
+ *
+ * @ingroup forms
  */
 function block_custom_block_form($edit = array()) {
   $edit += array(
@@ -528,6 +540,7 @@
  *     - format: Filter ID of the filter format for the body.
  * @param $delta
  *   Block ID of the block to save.
+ *
  * @return
  *   Always returns TRUE.
  */
@@ -544,7 +557,7 @@
 }
 
 /**
- * Implements hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter() for user_profile_form().
  */
 function block_form_user_profile_form_alter(&$form, &$form_state) {
   if ($form['#user_category'] == 'account') {
@@ -588,7 +601,10 @@
 }
 
 /**
- * Initialize blocks for enabled themes.
+ * Initializes blocks for enabled themes.
+ *
+ * @param $theme_list
+ *   An array of theme names.
  */
 function block_themes_enabled($theme_list) {
   foreach ($theme_list as $theme) {
@@ -597,7 +613,7 @@
 }
 
 /**
- * Assign an initial, default set of blocks for a theme.
+ * Assigns an initial, default set of blocks for a theme.
  *
  * This function is called the first time a new theme is enabled. The new theme
  * gets a copy of the default theme's blocks, with the difference that if a
@@ -628,7 +644,7 @@
 }
 
 /**
- * Return all blocks in the specified region for the current user.
+ * Returns all blocks in the specified region for the current user.
  *
  * @param $region
  *   The name of a region.
@@ -640,7 +656,7 @@
  *   empty to see how many columns are going to be displayed.
  *
  * @todo
- *   Now that the blocks table has a primary key, we should use that as the
+ *   Now that the block table has a primary key, we should use that as the
  *   array key instead of MODULE_DELTA.
  */
 function block_list($region) {
@@ -662,7 +678,7 @@
 }
 
 /**
- * Load a block object from the database.
+ * Loads a block object from the database.
  *
  * @param $module
  *   Name of the module that implements the block to load.
@@ -690,7 +706,10 @@
 }
 
 /**
- * Load blocks information from the database.
+ * Loads blocks' information from the database.
+ *
+ * @return
+ *   An array of blocks grouped by region.
  */
 function _block_load_blocks() {
   global $theme_key;
@@ -721,8 +740,8 @@
 /**
  * Implements hook_block_list_alter().
  *
- * Check the page, user role and user specific visibilty settings.
- * Remove the block if the visibility conditions are not met.
+ * Checks the page, user role, and user-specific visibilty settings.
+ * Removes the block if the visibility conditions are not met.
  */
 function block_block_list_alter(&$blocks) {
   global $user, $theme_key;
@@ -916,9 +935,9 @@
 }
 
 /**
- * Process variables for block.tpl.php
- *
- * Prepare the values passed to the theme_block function to be passed
+ * Processes variables for block.tpl.php.
+ *
+ * Prepares the values passed to the theme_block function to be passed
  * into a pluggable template engine. Uses block properties to generate a
  * series of template file suggestions. If none are found, the default
  * block.tpl.php is used.
@@ -967,7 +986,7 @@
 /**
  * Implements hook_user_role_delete().
  *
- * Remove deleted role from blocks that use it.
+ * Removes deleted role from blocks that use it.
  */
 function block_user_role_delete($role) {
   db_delete('block_role')
@@ -1019,7 +1038,7 @@
 /**
  * Implements hook_modules_uninstalled().
  *
- * Cleanup {block} and {block_role} tables from modules' blocks.
+ * Cleans up {block} and {block_role} tables from modules' blocks.
  */
 function block_modules_uninstalled($modules) {
   db_delete('block')

Modified: branches/upstream/current-7/modules/block/block.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/block.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.test (original)
+++ branches/upstream/current-7/modules/block/block.test Sun Feb  5 17:53:08 2012
@@ -751,3 +751,43 @@
     $this->assertEqual($variables2['theme_hook_suggestions'], array('block__footer', 'block__block', 'block__block__hyphen_test'), t('Hyphens (-) in block delta were replaced by underscore (_)'));
   }
 }
+
+/**
+ * Tests that hidden regions do not inherit blocks when a theme is enabled.
+ */
+class BlockHiddenRegionTestCase extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Blocks not in hidden region',
+      'description' => 'Checks that a newly enabled theme does not inherit blocks to its hidden regions.',
+      'group' => 'Block',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('block_test'));
+  }
+
+  /**
+   * Tests that hidden regions do not inherit blocks when a theme is enabled.
+   */
+  function testBlockNotInHiddenRegion() {
+    // Create administrative user.
+    $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer themes', 'search content'));
+    $this->drupalLogin($admin_user);
+
+    // Enable "block_test_theme" and set it as the default theme.
+    $theme = 'block_test_theme';
+    theme_enable(array($theme));
+    variable_set('theme_default', $theme);
+    menu_rebuild();
+
+    // Ensure that "block_test_theme" is set as the default theme.
+    $this->drupalGet('admin/structure/block');
+    $this->assertText('Block test theme(' . t('active tab') . ')', t('Default local task on blocks admin page is the block test theme.'));
+
+    // Ensure that the search form block is displayed.
+    $this->drupalGet('');
+    $this->assertText('Search form', t('Block was displayed on the front page.'));
+  }
+}

Modified: branches/upstream/current-7/modules/block/block.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/block.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.tpl.php (original)
+++ branches/upstream/current-7/modules/block/block.tpl.php Sun Feb  5 17:53:08 2012
@@ -12,11 +12,12 @@
  * - $block->region: The block region embedding the current block.
  * - $classes: String of classes that can be used to style contextually through
  *   CSS. It can be manipulated through the variable $classes_array from
- *   preprocess functions. The default values can be one or more of the following:
+ *   preprocess functions. The default values can be one or more of the
+ *   following:
  *   - block: The current template type, i.e., "theming hook".
- *   - block-[module]: The module generating the block. For example, the user module
- *     is responsible for handling the default user navigation block. In that case
- *     the class would be "block-user".
+ *   - block-[module]: The module generating the block. For example, the user
+ *     module is responsible for handling the default user navigation block. In
+ *     that case the class would be 'block-user'.
  * - $title_prefix (array): An array containing additional output populated by
  *   modules, intended to be displayed in front of the main title tag that
  *   appears in the template.
@@ -39,6 +40,8 @@
  * @see template_preprocess()
  * @see template_preprocess_block()
  * @see template_process()
+ *
+ * @ingroup themeable
  */
 ?>
 <div id="<?php print $block_html_id; ?>" class="<?php print $classes; ?>"<?php print $attributes; ?>>

Modified: branches/upstream/current-7/modules/block/tests/block_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/tests/block_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/tests/block_test.info (original)
+++ branches/upstream/current-7/modules/block/tests/block_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/block/tests/block_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/tests/block_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/tests/block_test.module (original)
+++ branches/upstream/current-7/modules/block/tests/block_test.module Sun Feb  5 17:53:08 2012
@@ -4,6 +4,14 @@
  * @file
  *   Provide test blocks.
  */
+
+/**
+ * Implements hook_system_theme_info().
+ */
+function block_test_system_theme_info() {
+  $themes['block_test_theme'] = drupal_get_path('module', 'block_test') . '/themes/block_test_theme/block_test_theme.info';
+  return $themes;
+}
 
 /**
  * Implements hook_block_info().

Added: branches/upstream/current-7/modules/block/tests/themes/block_test_theme/block_test_theme.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/tests/themes/block_test_theme/block_test_theme.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/block/tests/themes/block_test_theme/block_test_theme.info (added)
+++ branches/upstream/current-7/modules/block/tests/themes/block_test_theme/block_test_theme.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,20 @@
+name = Block test theme
+description = Theme for testing the block system
+core = 7.x
+hidden = TRUE
+
+regions[sidebar_first] = Left sidebar
+regions_hidden[]  = sidebar_first
+regions[sidebar_second] = Right sidebar
+regions_hidden[]  = sidebar_second
+regions[content] = Content
+regions[header] = Header
+regions[footer] = Footer
+regions[highlighted] = Highlighted
+regions[help] = Help
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Added: branches/upstream/current-7/modules/block/tests/themes/block_test_theme/page.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/tests/themes/block_test_theme/page.tpl.php?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/block/tests/themes/block_test_theme/page.tpl.php (added)
+++ branches/upstream/current-7/modules/block/tests/themes/block_test_theme/page.tpl.php Sun Feb  5 17:53:08 2012
@@ -1,0 +1,78 @@
+<?php
+
+/**
+ * @file
+ * Custom theme implementation to display a single Drupal page without
+ * sidebars. The sidebars are hidden by regions_hidden for this theme, so
+ * the default page.tpl.php will not work without throwing exceptions.
+ */
+?>
+
+  <div id="page-wrapper"><div id="page">
+
+    <div id="header"><div class="section clearfix">
+
+      <?php if ($logo): ?>
+        <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
+          <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
+        </a>
+      <?php endif; ?>
+
+      <?php if ($site_name || $site_slogan): ?>
+        <div id="name-and-slogan">
+          <?php if ($site_name): ?>
+            <?php if ($title): ?>
+              <div id="site-name"><strong>
+                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
+              </strong></div>
+            <?php else: /* Use h1 when the content title is empty */ ?>
+              <h1 id="site-name">
+                <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
+              </h1>
+            <?php endif; ?>
+          <?php endif; ?>
+
+          <?php if ($site_slogan): ?>
+            <div id="site-slogan"><?php print $site_slogan; ?></div>
+          <?php endif; ?>
+        </div> <!-- /#name-and-slogan -->
+      <?php endif; ?>
+
+      <?php print render($page['header']); ?>
+
+    </div></div> <!-- /.section, /#header -->
+
+    <?php if ($main_menu || $secondary_menu): ?>
+      <div id="navigation"><div class="section">
+        <?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Main menu'))); ?>
+        <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Secondary menu'))); ?>
+      </div></div> <!-- /.section, /#navigation -->
+    <?php endif; ?>
+
+    <?php if ($breadcrumb): ?>
+      <div id="breadcrumb"><?php print $breadcrumb; ?></div>
+    <?php endif; ?>
+
+    <?php print $messages; ?>
+
+    <div id="main-wrapper"><div id="main" class="clearfix">
+
+      <div id="content" class="column"><div class="section">
+        <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>
+        <a id="main-content"></a>
+        <?php print render($title_prefix); ?>
+        <?php if ($title): ?><h1 class="title" id="page-title"><?php print $title; ?></h1><?php endif; ?>
+        <?php print render($title_suffix); ?>
+        <?php if ($tabs = render($tabs)): ?><div class="tabs"><?php print $tabs; ?></div><?php endif; ?>
+        <?php print render($page['help']); ?>
+        <?php if ($action_links): ?><ul class="action-links"><?php print render($action_links); ?></ul><?php endif; ?>
+        <?php print render($page['content']); ?>
+        <?php print $feed_icons; ?>
+      </div></div> <!-- /.section, /#content -->
+    </div></div> <!-- /#main, /#main-wrapper -->
+
+    <div id="footer"><div class="section">
+      <?php print render($page['footer']); ?>
+    </div></div> <!-- /.section, /#footer -->
+
+  </div></div> <!-- /#page, /#page-wrapper -->

Modified: branches/upstream/current-7/modules/blog/blog.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/blog/blog.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/blog/blog.info (original)
+++ branches/upstream/current-7/modules/blog/blog.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 files[] = blog.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/book/book.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book.info (original)
+++ branches/upstream/current-7/modules/book/book.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 stylesheets[all][] = book.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/color/color-rtl.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/color/color-rtl.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/color-rtl.css (original)
+++ branches/upstream/current-7/modules/color/color-rtl.css Sun Feb  5 17:53:08 2012
@@ -1,3 +1,7 @@
+/**
+ * @file
+ * Right-to-left specific stylesheet for the Color module.
+ */
 
 #placeholder {
   left: 0;

Modified: branches/upstream/current-7/modules/color/color.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/color/color.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/color.css (original)
+++ branches/upstream/current-7/modules/color/color.css Sun Feb  5 17:53:08 2012
@@ -1,3 +1,7 @@
+/**
+ * @file
+ * Stylesheet for the administration pages of the Color module.
+ */
 
 /* Farbtastic placement */
 .color-form {

Modified: branches/upstream/current-7/modules/color/color.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/color/color.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/color.info (original)
+++ branches/upstream/current-7/modules/color/color.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 files[] = color.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/color/color.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/color/color.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/color.js (original)
+++ branches/upstream/current-7/modules/color/color.js Sun Feb  5 17:53:08 2012
@@ -1,3 +1,8 @@
+/**
+ * @file
+ * Attaches the behaviors for the Color module.
+ */
+
 (function ($) {
 
 Drupal.behaviors.color = {
@@ -65,20 +70,20 @@
     });
 
     /**
-     * Render the preview.
+     * Renders the preview.
      */
     function preview() {
       Drupal.color.callback(context, settings, form, farb, height, width);
     }
 
     /**
-     * Shift a given color, using a reference pair (ref in HSL).
+     * Shifts a given color, using a reference pair (ref in HSL).
      *
      * This algorithm ensures relative ordering on the saturation and luminance
      * axes is preserved, and performs a simple hue shift.
      *
-     * It is also symmetrical. If: shift_color(c, a, b) == d,
-     *                        then shift_color(d, b, a) == c.
+     * It is also symmetrical. If: shift_color(c, a, b) == d, then
+     * shift_color(d, b, a) == c.
      */
     function shift_color(given, ref1, ref2) {
       // Convert to HSL.
@@ -159,7 +164,7 @@
     }
 
     /**
-     * Reset the color scheme selector.
+     * Resets the color scheme selector.
      */
     function resetScheme() {
       $('#edit-scheme', form).each(function () {
@@ -167,7 +172,9 @@
       });
     }
 
-    // Focus the Farbtastic on a particular field.
+    /**
+     * Focuses Farbtastic on a particular field.
+     */
     function focus() {
       var input = this;
       // Remove old bindings.

Modified: branches/upstream/current-7/modules/color/color.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/color/color.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/color.module (original)
+++ branches/upstream/current-7/modules/color/color.module Sun Feb  5 17:53:08 2012
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * Allows users to change the color scheme of themes.
+ */
 
 /**
  * Implements hook_help().
@@ -70,7 +74,13 @@
 }
 
 /**
- * Callback for the theme to alter the resources used.
+ * Replaces style sheets with color-altered style sheets.
+ *
+ * A theme that supports the color module should call this function from its
+ * THEME_process_html() function, so that the correct style sheets are
+ * included when html.tpl.php is rendered.
+ *
+ * @see theme()
  */
 function _color_html_alter(&$vars) {
   global $theme_key;
@@ -86,7 +96,7 @@
       foreach ($color_paths as $color_path) {
         // Color module currently requires unique file names to be used,
         // which allows us to compare different file paths.
-        if (basename($old_path) == basename($color_path)) {
+        if (drupal_basename($old_path) == drupal_basename($color_path)) {
           // Replace the path to the new css file.
           // This keeps the order of the stylesheets intact.
           $vars['css'][$old_path]['data'] = $color_path;
@@ -99,7 +109,13 @@
 }
 
 /**
- * Callback for the theme to alter the resources used.
+ * Replaces the logo with a color-altered logo.
+ *
+ * A theme that supports the color module should call this function from its
+ * THEME_process_page() function, so that the correct logo is included when
+ * page.tpl.php is rendered.
+ *
+ * @see theme()
  */
 function _color_page_alter(&$vars) {
   global $theme_key;
@@ -112,7 +128,7 @@
 }
 
 /**
- * Retrieve the color.module info for a particular theme.
+ * Retrieves the Color module information for a particular theme.
  */
 function color_get_info($theme) {
   static $theme_info = array();
@@ -131,7 +147,7 @@
 }
 
 /**
- * Helper function to retrieve the color palette for a particular theme.
+ * Retrieves the color palette for a particular theme.
  */
 function color_get_palette($theme, $default = FALSE) {
   // Fetch and expand default palette.
@@ -143,7 +159,14 @@
 }
 
 /**
- * Form callback. Returns the configuration form.
+ * Form constructor for the color configuration form for a particular theme.
+ *
+ * @param $theme
+ *   The machine name of the theme whose color settings are being configured.
+ *
+ * @see color_scheme_form_validate()
+ * @see color_scheme_form_submit()
+ * @ingroup forms
  */
 function color_scheme_form($complete_form, &$form_state, $theme) {
   $base = drupal_get_path('module', 'color');
@@ -244,11 +267,11 @@
   $info = $form['info']['#value'];
   $path = drupal_get_path('theme', $theme) . '/';
   drupal_add_css($path . $info['preview_css']);
-  
+
   $preview_js_path = isset($info['preview_js']) ? $path . $info['preview_js'] : drupal_get_path('module', 'color') . '/' . 'preview.js';
   // Add the JS at a weight below color.js.
   drupal_add_js($preview_js_path, array('weight' => -1));
-    
+
   $output  = '';
   $output .= '<div class="color-form clearfix">';
   // Color schemes
@@ -272,7 +295,9 @@
 }
 
 /**
- * Validation handler for color change form.
+ * Form validation handler for color_scheme_form().
+ *
+ * @see color_scheme_form_submit()
  */
 function color_scheme_form_validate($form, &$form_state) {
   // Only accept hexadecimal CSS color strings to avoid XSS upon use.
@@ -284,7 +309,9 @@
 }
 
 /**
- * Submit handler for color change form.
+ * Form submission handler for color_scheme_form().
+ *
+ * @see color_scheme_form_validate()
  */
 function color_scheme_form_submit($form, &$form_state) {
   // Get theme coloring info.
@@ -362,7 +389,7 @@
 
   // Copy over neutral images.
   foreach ($info['copy'] as $file) {
-    $base = basename($file);
+    $base = drupal_basename($file);
     $source = $paths['source'] . $file;
     $filepath = file_unmanaged_copy($source, $paths['target'] . $base);
     $paths['map'][$file] = $base;
@@ -404,7 +431,7 @@
 
       // Rewrite stylesheet with new colors.
       $style = _color_rewrite_stylesheet($theme, $info, $paths, $palette, $style);
-      $base_file = basename($file);
+      $base_file = drupal_basename($file);
       $css[] = $paths['target'] . $base_file;
       _color_save_stylesheet($paths['target'] . $base_file, $style, $paths);
     }
@@ -416,7 +443,7 @@
 }
 
 /**
- * Rewrite the stylesheet to match the colors in the palette.
+ * Rewrites the stylesheet to match the colors in the palette.
  */
 function _color_rewrite_stylesheet($theme, &$info, &$paths, $palette, $style) {
   $themes = list_themes();
@@ -487,7 +514,7 @@
 }
 
 /**
- * Save the rewritten stylesheet to disk.
+ * Saves the rewritten stylesheet to disk.
  */
 function _color_save_stylesheet($file, $style, &$paths) {
   $filepath = file_unmanaged_save_data($style, $file, FILE_EXISTS_REPLACE);
@@ -498,7 +525,7 @@
 }
 
 /**
- * Render images that match a given palette.
+ * Renders images that match a given palette.
  */
 function _color_render_images($theme, &$info, &$paths, $palette) {
   // Prepare template image.
@@ -544,7 +571,7 @@
   // Cut out slices.
   foreach ($info['slices'] as $file => $coord) {
     list($x, $y, $width, $height) = $coord;
-    $base = basename($file);
+    $base = drupal_basename($file);
     $image = drupal_realpath($paths['target'] . $base);
 
     // Cut out slice.
@@ -575,16 +602,16 @@
 }
 
 /**
- * Shift a given color, using a reference pair and a target blend color.
+ * Shifts a given color, using a reference pair and a target blend color.
  *
  * Note: this function is significantly different from the JS version, as it
  * is written to match the blended images perfectly.
  *
- * Constraint: if (ref2 == target + (ref1 - target) * delta) for some fraction delta
- *              then (return == target + (given - target) * delta)
+ * Constraint: if (ref2 == target + (ref1 - target) * delta) for some fraction
+ * delta then (return == target + (given - target) * delta).
  *
  * Loose constraint: Preserve relative positions in saturation and luminance
- *                   space.
+ * space.
  */
 function _color_shift($given, $ref1, $ref2, $target) {
   // We assume that ref2 is a blend of ref1 and target and find
@@ -634,7 +661,7 @@
 }
 
 /**
- * Convert a hex triplet into a GD color.
+ * Converts a hex triplet into a GD color.
  */
 function _color_gd($img, $hex) {
   $c = array_merge(array($img), _color_unpack($hex));
@@ -642,7 +669,7 @@
 }
 
 /**
- * Blend two hex colors and return the GD color.
+ * Blends two hex colors and returns the GD color.
  */
 function _color_blend($img, $hex1, $hex2, $alpha) {
   $in1 = _color_unpack($hex1);
@@ -656,7 +683,7 @@
 }
 
 /**
- * Convert a hex color into an RGB triplet.
+ * Converts a hex color into an RGB triplet.
  */
 function _color_unpack($hex, $normalize = FALSE) {
   if (strlen($hex) == 4) {
@@ -671,7 +698,7 @@
 }
 
 /**
- * Convert an RGB triplet to a hex color.
+ * Converts an RGB triplet to a hex color.
  */
 function _color_pack($rgb, $normalize = FALSE) {
   $out = 0;
@@ -683,7 +710,7 @@
 }
 
 /**
- * Convert a HSL triplet into RGB.
+ * Converts an HSL triplet into RGB.
  */
 function _color_hsl2rgb($hsl) {
   $h = $hsl[0];
@@ -712,7 +739,7 @@
 }
 
 /**
- * Convert an RGB triplet to HSL.
+ * Converts an RGB triplet to HSL.
  */
 function _color_rgb2hsl($rgb) {
   $r = $rgb[0];

Modified: branches/upstream/current-7/modules/color/color.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/color/color.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/color.test (original)
+++ branches/upstream/current-7/modules/color/color.test Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
  */
 
 /**
- * Test color functionality.
+ * Tests the Color module functionality.
  */
 class ColorTestCase extends DrupalWebTestCase {
   protected $big_user;
@@ -57,7 +57,7 @@
   }
 
   /**
-   * Test color module functionality.
+   * Tests the Color module functionality.
    */
   function testColor() {
     foreach ($this->themes as $theme => $test_values) {
@@ -66,7 +66,7 @@
   }
 
   /**
-   * Tests color module functionality using the given theme.
+   * Tests the Color module functionality using the given theme.
    */
   function _testColor($theme, $test_values) {
     variable_set('theme_default', $theme);
@@ -109,7 +109,7 @@
   }
 
   /**
-   * Test to see if the provided color is valid
+   * Tests whether the provided color is valid.
    */
   function testValidColor() {
     variable_set('theme_default', 'bartik');

Modified: branches/upstream/current-7/modules/color/preview.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/color/preview.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/preview.js (original)
+++ branches/upstream/current-7/modules/color/preview.js Sun Feb  5 17:53:08 2012
@@ -1,3 +1,7 @@
+/**
+ * @file
+ * Attaches preview-related behavior for the Color module.
+ */
 
 (function ($) {
   Drupal.color = {

Modified: branches/upstream/current-7/modules/comment/comment.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/comment/comment.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/comment/comment.info (original)
+++ branches/upstream/current-7/modules/comment/comment.info Sun Feb  5 17:53:08 2012
@@ -10,7 +10,7 @@
 stylesheets[all][] = comment.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/comment/comment.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/comment/comment.install?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/comment/comment.install (original)
+++ branches/upstream/current-7/modules/comment/comment.install Sun Feb  5 17:53:08 2012
@@ -165,9 +165,11 @@
 function comment_update_7002() {
   db_rename_table('comments', 'comment');
 
-  // Add user-related indexes.
-  db_add_index('comment', 'comment_uid', array('uid'));
-  db_add_index('node_comment_statistics', 'last_comment_uid', array('last_comment_uid'));
+  // Add user-related indexes. These may already exist from Drupal 6.
+  if (!db_index_exists('comment', 'comment_uid')) {
+    db_add_index('comment', 'comment_uid', array('uid'));
+    db_add_index('node_comment_statistics', 'last_comment_uid', array('last_comment_uid'));
+  }
 
   // Create a language column.
   db_add_field('comment', 'language', array(
@@ -224,8 +226,11 @@
   ));
   db_add_index('node_comment_statistics', 'cid', array('cid'));
 
-  // Add an index on the comment_count.
-  db_add_index('node_comment_statistics', 'comment_count', array('comment_count'));
+  // The comment_count index may have been added in Drupal 6.
+  if (!db_index_exists('node_comment_statistics', 'comment_count')) {
+    // Add an index on the comment_count.
+    db_add_index('node_comment_statistics', 'comment_count', array('comment_count'));
+  }
 }
 
 /**

Modified: branches/upstream/current-7/modules/comment/comment.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/comment/comment.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/comment/comment.module (original)
+++ branches/upstream/current-7/modules/comment/comment.module Sun Feb  5 17:53:08 2012
@@ -1232,8 +1232,8 @@
   // If the node doesn't have any comments, the "hidden" option makes no
   // sense, so don't even bother presenting it to the user.
   if (empty($comment_count)) {
-    unset($form['comment_settings']['comment']['#options'][COMMENT_NODE_HIDDEN]);
-    unset($form['comment_settings']['comment'][COMMENT_NODE_HIDDEN]);
+    $form['comment_settings']['comment'][COMMENT_NODE_HIDDEN]['#access'] = FALSE;
+    // Also adjust the description of the "closed" option.
     $form['comment_settings']['comment'][COMMENT_NODE_CLOSED]['#description'] = t('Users cannot post comments.');
   }
 }
@@ -2294,23 +2294,25 @@
   else {
     $variables['status'] = ($comment->status == COMMENT_NOT_PUBLISHED) ? 'comment-unpublished' : 'comment-published';
   }
+
   // Gather comment classes.
-  if ($comment->uid == 0) {
+  // 'comment-published' class is not needed, it is either 'comment-preview' or
+  // 'comment-unpublished'.
+  if ($variables['status'] != 'comment-published') {
+    $variables['classes_array'][] = $variables['status'];
+  }
+  if ($variables['new']) {
+    $variables['classes_array'][] = 'comment-new';
+  }
+  if (!$comment->uid) {
     $variables['classes_array'][] = 'comment-by-anonymous';
   }
   else {
-    // Published class is not needed. It is either 'comment-preview' or 'comment-unpublished'.
-    if ($variables['status'] != 'comment-published') {
-      $variables['classes_array'][] = $variables['status'];
-    }
-    if ($comment->uid === $variables['node']->uid) {
+    if ($comment->uid == $variables['node']->uid) {
       $variables['classes_array'][] = 'comment-by-node-author';
     }
-    if ($comment->uid === $variables['user']->uid) {
+    if ($comment->uid == $variables['user']->uid) {
       $variables['classes_array'][] = 'comment-by-viewer';
-    }
-    if ($variables['new']) {
-      $variables['classes_array'][] = 'comment-new';
     }
   }
 }

Modified: branches/upstream/current-7/modules/comment/comment.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/comment/comment.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/comment/comment.test (original)
+++ branches/upstream/current-7/modules/comment/comment.test Sun Feb  5 17:53:08 2012
@@ -250,6 +250,169 @@
     preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->drupalGetContent(), $match);
 
     return $match[2];
+  }
+}
+
+class CommentInterfaceTest extends CommentHelperCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Comment interface',
+      'description' => 'Test comment user interfaces.',
+      'group' => 'Comment',
+    );
+  }
+
+  /**
+   * Test comment interface.
+   */
+  function testCommentInterface() {
+    $langcode = LANGUAGE_NONE;
+    // Set comments to have subject and preview disabled.
+    $this->drupalLogin($this->admin_user);
+    $this->setCommentPreview(DRUPAL_DISABLED);
+    $this->setCommentForm(TRUE);
+    $this->setCommentSubject(FALSE);
+    $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.'));
+    $this->drupalLogout();
+
+    // Post comment #1 without subject or preview.
+    $this->drupalLogin($this->web_user);
+    $comment_text = $this->randomName();
+    $comment = $this->postComment($this->node, $comment_text);
+    $comment_loaded = comment_load($comment->id);
+    $this->assertTrue($this->commentExists($comment), t('Comment found.'));
+
+    // Set comments to have subject and preview to required.
+    $this->drupalLogout();
+    $this->drupalLogin($this->admin_user);
+    $this->setCommentSubject(TRUE);
+    $this->setCommentPreview(DRUPAL_REQUIRED);
+    $this->drupalLogout();
+
+    // Create comment #2 that allows subject and requires preview.
+    $this->drupalLogin($this->web_user);
+    $subject_text = $this->randomName();
+    $comment_text = $this->randomName();
+    $comment = $this->postComment($this->node, $comment_text, $subject_text, TRUE);
+    $comment_loaded = comment_load($comment->id);
+    $this->assertTrue($this->commentExists($comment), t('Comment found.'));
+
+    // Check comment display.
+    $this->drupalGet('node/' . $this->node->nid . '/' . $comment->id);
+    $this->assertText($subject_text, t('Individual comment subject found.'));
+    $this->assertText($comment_text, t('Individual comment body found.'));
+
+    // Set comments to have subject and preview to optional.
+    $this->drupalLogout();
+    $this->drupalLogin($this->admin_user);
+    $this->setCommentSubject(TRUE);
+    $this->setCommentPreview(DRUPAL_OPTIONAL);
+
+    // Test changing the comment author to "Anonymous".
+    $this->drupalGet('comment/' . $comment->id . '/edit');
+    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => ''));
+    $comment_loaded = comment_load($comment->id);
+    $this->assertTrue(empty($comment_loaded->name) && $comment_loaded->uid == 0, t('Comment author successfully changed to anonymous.'));
+
+    // Test changing the comment author to an unverified user.
+    $random_name = $this->randomName();
+    $this->drupalGet('comment/' . $comment->id . '/edit');
+    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => $random_name));
+    $this->drupalGet('node/' . $this->node->nid);
+    $this->assertText($random_name . ' (' . t('not verified') . ')', t('Comment author successfully changed to an unverified user.'));
+
+    // Test changing the comment author to a verified user.
+    $this->drupalGet('comment/' . $comment->id . '/edit');
+    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => $this->web_user->name));
+    $comment_loaded = comment_load($comment->id);
+    $this->assertTrue($comment_loaded->name == $this->web_user->name && $comment_loaded->uid == $this->web_user->uid, t('Comment author successfully changed to a registered user.'));
+
+    $this->drupalLogout();
+
+    // Reply to comment #2 creating comment #3 with optional preview and no
+    // subject though field enabled.
+    $this->drupalLogin($this->web_user);
+    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+    $this->assertText($subject_text, t('Individual comment-reply subject found.'));
+    $this->assertText($comment_text, t('Individual comment-reply body found.'));
+    $reply = $this->postComment(NULL, $this->randomName(), '', TRUE);
+    $reply_loaded = comment_load($reply->id);
+    $this->assertTrue($this->commentExists($reply, TRUE), t('Reply found.'));
+    $this->assertEqual($comment->id, $reply_loaded->pid, t('Pid of a reply to a comment is set correctly.'));
+    $this->assertEqual(rtrim($comment_loaded->thread, '/') . '.00/', $reply_loaded->thread, t('Thread of reply grows correctly.'));
+
+    // Second reply to comment #3 creating comment #4.
+    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+    $this->assertText($subject_text, t('Individual comment-reply subject found.'));
+    $this->assertText($comment_text, t('Individual comment-reply body found.'));
+    $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
+    $reply_loaded = comment_load($reply->id);
+    $this->assertTrue($this->commentExists($reply, TRUE), t('Second reply found.'));
+    $this->assertEqual(rtrim($comment_loaded->thread, '/') . '.01/', $reply_loaded->thread, t('Thread of second reply grows correctly.'));
+
+    // Edit reply.
+    $this->drupalGet('comment/' . $reply->id . '/edit');
+    $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
+    $this->assertTrue($this->commentExists($reply, TRUE), t('Modified reply found.'));
+
+    // Correct link count
+    $this->drupalGet('node');
+    $this->assertRaw('4 comments', t('Link to the 4 comments exist.'));
+
+    // Confirm a new comment is posted to the correct page.
+    $this->setCommentsPerPage(2);
+    $comment_new_page = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE);
+    $this->assertTrue($this->commentExists($comment_new_page), t('Page one exists. %s'));
+    $this->drupalGet('node/' . $this->node->nid, array('query' => array('page' => 1)));
+    $this->assertTrue($this->commentExists($reply, TRUE), t('Page two exists. %s'));
+    $this->setCommentsPerPage(50);
+
+    // Attempt to post to node with comments disabled.
+    $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_HIDDEN));
+    $this->assertTrue($this->node, t('Article node created.'));
+    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->assertText('This discussion is closed', t('Posting to node with comments disabled'));
+    $this->assertNoField('edit-comment', t('Comment body field found.'));
+
+    // Attempt to post to node with read-only comments.
+    $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_CLOSED));
+    $this->assertTrue($this->node, t('Article node created.'));
+    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->assertText('This discussion is closed', t('Posting to node with comments read-only'));
+    $this->assertNoField('edit-comment', t('Comment body field found.'));
+
+    // Attempt to post to node with comments enabled (check field names etc).
+    $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_OPEN));
+    $this->assertTrue($this->node, t('Article node created.'));
+    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->assertNoText('This discussion is closed', t('Posting to node with comments enabled'));
+    $this->assertField('edit-comment-body-' . $langcode . '-0-value', t('Comment body field found.'));
+
+    // Delete comment and make sure that reply is also removed.
+    $this->drupalLogout();
+    $this->drupalLogin($this->admin_user);
+    $this->deleteComment($comment);
+    $this->deleteComment($comment_new_page);
+
+    $this->drupalGet('node/' . $this->node->nid);
+    $this->assertFalse($this->commentExists($comment), t('Comment not found.'));
+    $this->assertFalse($this->commentExists($reply, TRUE), t('Reply not found.'));
+
+    // Enabled comment form on node page.
+    $this->drupalLogin($this->admin_user);
+    $this->setCommentForm(TRUE);
+    $this->drupalLogout();
+
+    // Submit comment through node form.
+    $this->drupalLogin($this->web_user);
+    $this->drupalGet('node/' . $this->node->nid);
+    $form_comment = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
+    $this->assertTrue($this->commentExists($form_comment), t('Form comment found.'));
+
+    // Disable comment form on node page.
+    $this->drupalLogout();
+    $this->drupalLogin($this->admin_user);
+    $this->setCommentForm(FALSE);
   }
 
   /**
@@ -301,175 +464,112 @@
     $count = $this->xpath('//div[@id=:id]/div[@class=:class]/ul/li', array(':id' => 'node-' . $this->node->nid, ':class' => 'link-wrapper'));
     $this->assertTrue(count($count) == 2, print_r($count, TRUE));
   }
-}
-
-class CommentInterfaceTest extends CommentHelperCase {
-  public static function getInfo() {
-    return array(
-      'name' => 'Comment interface',
-      'description' => 'Test comment user interfaces.',
-      'group' => 'Comment',
-    );
-  }
-
-  /**
-   * Test comment interface.
-   */
-  function testCommentInterface() {
-    $langcode = LANGUAGE_NONE;
-    // Set comments to have subject and preview disabled.
-    $this->drupalLogin($this->admin_user);
-    $this->setCommentPreview(DRUPAL_DISABLED);
-    $this->setCommentForm(TRUE);
-    $this->setCommentSubject(FALSE);
-    $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.'));
-    $this->drupalLogout();
-
-    // Post comment #1 without subject or preview.
-    $this->drupalLogin($this->web_user);
-    $comment_text = $this->randomName();
-    $comment = $this->postComment($this->node, $comment_text);
-    $comment_loaded = comment_load($comment->id);
-    $this->assertTrue($this->commentExists($comment), t('Comment found.'));
-    $by_viewer_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-viewer")]', array(':comment_id' => 'comment-' . $comment->id));
-    $this->assertTrue(!empty($by_viewer_class), t('HTML class for comments by viewer found.'));
-
-    // Set comments to have subject and preview to required.
-    $this->drupalLogout();
-    $this->drupalLogin($this->admin_user);
-    $this->setCommentSubject(TRUE);
-    $this->setCommentPreview(DRUPAL_REQUIRED);
-    $this->drupalLogout();
-
-    // Create comment #2 that allows subject and requires preview.
-    $this->drupalLogin($this->web_user);
-    $subject_text = $this->randomName();
-    $comment_text = $this->randomName();
-    $comment = $this->postComment($this->node, $comment_text, $subject_text, TRUE);
-    $comment_loaded = comment_load($comment->id);
-    $this->assertTrue($this->commentExists($comment), t('Comment found.'));
-
-    // Check comment display.
-    $this->drupalGet('node/' . $this->node->nid . '/' . $comment->id);
-    $this->assertText($subject_text, t('Individual comment subject found.'));
-    $this->assertText($comment_text, t('Individual comment body found.'));
-
-    // Set comments to have subject and preview to optional.
-    $this->drupalLogout();
-    $this->drupalLogin($this->admin_user);
-    $this->setCommentSubject(TRUE);
-    $this->setCommentPreview(DRUPAL_OPTIONAL);
-
-    // Test changing the comment author to "Anonymous".
-    $this->drupalGet('comment/' . $comment->id . '/edit');
-    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => ''));
-    $comment_loaded = comment_load($comment->id);
-    $this->assertTrue(empty($comment_loaded->name) && $comment_loaded->uid == 0, t('Comment author successfully changed to anonymous.'));
-
-    // Test changing the comment author to an unverified user.
-    $random_name = $this->randomName();
-    $this->drupalGet('comment/' . $comment->id . '/edit');
-    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => $random_name));
-    $this->drupalGet('node/' . $this->node->nid);
-    $this->assertText($random_name . ' (' . t('not verified') . ')', t('Comment author successfully changed to an unverified user.'));
-
-    // Test changing the comment author to a verified user.
-    $this->drupalGet('comment/' . $comment->id . '/edit');
-    $comment = $this->postComment(NULL, $comment->comment, $comment->subject, array('name' => $this->web_user->name));
-    $comment_loaded = comment_load($comment->id);
-    $this->assertTrue($comment_loaded->name == $this->web_user->name && $comment_loaded->uid == $this->web_user->uid, t('Comment author successfully changed to a registered user.'));
-
-    $this->drupalLogout();
-
-    // Reply to comment #2 creating comment #3 with optional preview and no
-    // subject though field enabled.
-    $this->drupalLogin($this->web_user);
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
-    $this->assertText($subject_text, t('Individual comment-reply subject found.'));
-    $this->assertText($comment_text, t('Individual comment-reply body found.'));
-    $reply = $this->postComment(NULL, $this->randomName(), '', TRUE);
-    $reply_loaded = comment_load($reply->id);
-    $this->assertTrue($this->commentExists($reply, TRUE), t('Reply found.'));
-    $this->assertEqual($comment->id, $reply_loaded->pid, t('Pid of a reply to a comment is set correctly.'));
-    $this->assertEqual(rtrim($comment_loaded->thread, '/') . '.00/', $reply_loaded->thread, t('Thread of reply grows correctly.'));
-
-    // Second reply to comment #3 creating comment #4.
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
-    $this->assertText($subject_text, t('Individual comment-reply subject found.'));
-    $this->assertText($comment_text, t('Individual comment-reply body found.'));
-    $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
-    $reply_loaded = comment_load($reply->id);
-    $this->assertTrue($this->commentExists($reply, TRUE), t('Second reply found.'));
-    $this->assertEqual(rtrim($comment_loaded->thread, '/') . '.01/', $reply_loaded->thread, t('Thread of second reply grows correctly.'));
-
-    // Edit reply.
-    $this->drupalGet('comment/' . $reply->id . '/edit');
-    $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
-    $this->assertTrue($this->commentExists($reply, TRUE), t('Modified reply found.'));
-
-    // Correct link count
-    $this->drupalGet('node');
-    $this->assertRaw('4 comments', t('Link to the 4 comments exist.'));
-
-    // Confirm a new comment is posted to the correct page.
-    $this->setCommentsPerPage(2);
-    $comment_new_page = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE);
-    $this->assertTrue($this->commentExists($comment_new_page), t('Page one exists. %s'));
-    $this->drupalGet('node/' . $this->node->nid, array('query' => array('page' => 1)));
-    $this->assertTrue($this->commentExists($reply, TRUE), t('Page two exists. %s'));
-    $this->setCommentsPerPage(50);
-
-    // Create comment #5 to assert HTML class.
-    $comment = $this->postComment($this->node, $this->randomName(), $this->randomName());
-    $by_node_author_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-node-author")]', array(':comment_id' => 'comment-' . $comment->id));
-    $this->assertTrue(!empty($by_node_author_class), t('HTML class for node author found.'));
-
-    // Attempt to post to node with comments disabled.
-    $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_HIDDEN));
-    $this->assertTrue($this->node, t('Article node created.'));
-    $this->drupalGet('comment/reply/' . $this->node->nid);
-    $this->assertText('This discussion is closed', t('Posting to node with comments disabled'));
-    $this->assertNoField('edit-comment', t('Comment body field found.'));
-
-    // Attempt to post to node with read-only comments.
-    $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_CLOSED));
-    $this->assertTrue($this->node, t('Article node created.'));
-    $this->drupalGet('comment/reply/' . $this->node->nid);
-    $this->assertText('This discussion is closed', t('Posting to node with comments read-only'));
-    $this->assertNoField('edit-comment', t('Comment body field found.'));
-
-    // Attempt to post to node with comments enabled (check field names etc).
-    $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_OPEN));
-    $this->assertTrue($this->node, t('Article node created.'));
-    $this->drupalGet('comment/reply/' . $this->node->nid);
-    $this->assertNoText('This discussion is closed', t('Posting to node with comments enabled'));
-    $this->assertField('edit-comment-body-' . $langcode . '-0-value', t('Comment body field found.'));
-
-    // Delete comment and make sure that reply is also removed.
-    $this->drupalLogout();
-    $this->drupalLogin($this->admin_user);
-    $this->deleteComment($comment);
-    $this->deleteComment($comment_new_page);
-
-    $this->drupalGet('node/' . $this->node->nid);
-    $this->assertFalse($this->commentExists($comment), t('Comment not found.'));
-    $this->assertFalse($this->commentExists($reply, TRUE), t('Reply not found.'));
-
-    // Enabled comment form on node page.
-    $this->drupalLogin($this->admin_user);
-    $this->setCommentForm(TRUE);
-    $this->drupalLogout();
-
-    // Submit comment through node form.
-    $this->drupalLogin($this->web_user);
-    $this->drupalGet('node/' . $this->node->nid);
-    $form_comment = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
-    $this->assertTrue($this->commentExists($form_comment), t('Form comment found.'));
-
-    // Disable comment form on node page.
-    $this->drupalLogout();
-    $this->drupalLogin($this->admin_user);
-    $this->setCommentForm(FALSE);
+
+  /**
+   * Tests CSS classes on comments.
+   */
+  function testCommentClasses() {
+    // Create all permutations for comments, users, and nodes.
+    $parameters = array(
+      'node_uid' => array(0, $this->web_user->uid),
+      'comment_uid' => array(0, $this->web_user->uid, $this->admin_user->uid),
+      'comment_status' => array(COMMENT_PUBLISHED, COMMENT_NOT_PUBLISHED),
+      'user' => array('anonymous', 'authenticated', 'admin'),
+    );
+    $permutations = $this->generatePermutations($parameters);
+
+    foreach ($permutations as $case) {
+      // Create a new node.
+      $node = $this->drupalCreateNode(array('type' => 'article', 'uid' => $case['node_uid']));
+
+      // Add a comment.
+      $comment = (object) array(
+        'cid' => NULL,
+        'nid' => $node->nid,
+        'pid' => 0,
+        'uid' => $case['comment_uid'],
+        'status' => $case['comment_status'],
+        'subject' => $this->randomName(),
+        'language' => LANGUAGE_NONE,
+        'comment_body' => array(LANGUAGE_NONE => array($this->randomName())),
+      );
+      comment_save($comment);
+
+      // Adjust the current/viewing user.
+      switch ($case['user']) {
+        case 'anonymous':
+          $this->drupalLogout();
+          $case['user_uid'] = 0;
+          break;
+
+        case 'authenticated':
+          $this->drupalLogin($this->web_user);
+          $case['user_uid'] = $this->web_user->uid;
+          break;
+
+        case 'admin':
+          $this->drupalLogin($this->admin_user);
+          $case['user_uid'] = $this->admin_user->uid;
+          break;
+      }
+      // Request the node with the comment.
+      $this->drupalGet('node/' . $node->nid);
+
+      // Verify classes if the comment is visible for the current user.
+      if ($case['comment_status'] == COMMENT_PUBLISHED || $case['user'] == 'admin') {
+        // Verify the comment-by-anonymous class.
+        $comments = $this->xpath('//*[contains(@class, "comment-by-anonymous")]');
+        if ($case['comment_uid'] == 0) {
+          $this->assertTrue(count($comments) == 1, 'comment-by-anonymous class found.');
+        }
+        else {
+          $this->assertFalse(count($comments), 'comment-by-anonymous class not found.');
+        }
+
+        // Verify the comment-by-node-author class.
+        $comments = $this->xpath('//*[contains(@class, "comment-by-node-author")]');
+        if ($case['comment_uid'] > 0 && $case['comment_uid'] == $case['node_uid']) {
+          $this->assertTrue(count($comments) == 1, 'comment-by-node-author class found.');
+        }
+        else {
+          $this->assertFalse(count($comments), 'comment-by-node-author class not found.');
+        }
+
+        // Verify the comment-by-viewer class.
+        $comments = $this->xpath('//*[contains(@class, "comment-by-viewer")]');
+        if ($case['comment_uid'] > 0 && $case['comment_uid'] == $case['user_uid']) {
+          $this->assertTrue(count($comments) == 1, 'comment-by-viewer class found.');
+        }
+        else {
+          $this->assertFalse(count($comments), 'comment-by-viewer class not found.');
+        }
+      }
+
+      // Verify the comment-unpublished class.
+      $comments = $this->xpath('//*[contains(@class, "comment-unpublished")]');
+      if ($case['comment_status'] == COMMENT_NOT_PUBLISHED && $case['user'] == 'admin') {
+        $this->assertTrue(count($comments) == 1, 'comment-unpublished class found.');
+      }
+      else {
+        $this->assertFalse(count($comments), 'comment-unpublished class not found.');
+      }
+
+      // Verify the comment-new class.
+      if ($case['comment_status'] == COMMENT_PUBLISHED || $case['user'] == 'admin') {
+        $comments = $this->xpath('//*[contains(@class, "comment-new")]');
+        if ($case['user'] != 'anonymous') {
+          $this->assertTrue(count($comments) == 1, 'comment-new class found.');
+
+          // Request the node again. The comment-new class should disappear.
+          $this->drupalGet('node/' . $node->nid);
+          $comments = $this->xpath('//*[contains(@class, "comment-new")]');
+          $this->assertFalse(count($comments), 'comment-new class not found.');
+        }
+        else {
+          $this->assertFalse(count($comments), 'comment-new class not found.');
+        }
+      }
+    }
   }
 
   /**
@@ -970,8 +1070,6 @@
     // Post anonymous comment without contact info.
     $anonymous_comment1 = $this->postComment($this->node, $this->randomName(), $this->randomName());
     $this->assertTrue($this->commentExists($anonymous_comment1), t('Anonymous comment without contact info found.'));
-    $anonymous_class = $this->xpath('//a[@id=:comment_id]/following-sibling::div[1][contains(@class, "comment-by-anonymous")]', array(':comment_id' => 'comment-' . $anonymous_comment1->id));
-    $this->assertTrue(!empty($anonymous_class), t('HTML class for anonymous comments found.'));
 
     // Allow contact info.
     $this->drupalLogin($this->admin_user);

Modified: branches/upstream/current-7/modules/contact/contact.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contact/contact.admin.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contact/contact.admin.inc (original)
+++ branches/upstream/current-7/modules/contact/contact.admin.inc Sun Feb  5 17:53:08 2012
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Admin page callbacks for the contact module.
+ * Admin page callbacks for the Contact module.
  */
 
 /**
@@ -53,7 +53,22 @@
 }
 
 /**
- * Category edit page.
+ * Form constructor for the category edit form.
+ *
+ * @param $category
+ *   An array describing the category to be edited. May be empty for new
+ *   categories. Recognized array keys are:
+ *   - category: The name of the category.
+ *   - recipients: A comma-separated list of recipients.
+ *   - reply: (optional) The body of the auto-reply message.
+ *   - weight: The weight of the category.
+ *   - selected: Boolean indicating whether the category should be selected by
+ *     default.
+ *   - cid: The category ID for which the form is to be displayed.
+ *
+ * @see contact_category_edit_form_validate()
+ * @see contact_category_edit_form_submit()
+ * @ingroup forms
  */
 function contact_category_edit_form($form, &$form_state, array $category = array()) {
   // If this is a new category, add the default values.
@@ -117,7 +132,9 @@
 }
 
 /**
- * Validate the contact category edit page form submission.
+ * Form validation handler for contact_category_edit_form().
+ *
+ * @see contact_category_edit_form_submit()
  */
 function contact_category_edit_form_validate($form, &$form_state) {
   // Validate and each e-mail recipient.
@@ -144,7 +161,9 @@
 }
 
 /**
- * Process the contact category edit page form submission.
+ * Form submission handler for contact_category_edit_form().
+ *
+ * @see contact_category_edit_form_validate()
  */
 function contact_category_edit_form_submit($form, &$form_state) {
   if ($form_state['values']['selected']) {
@@ -167,8 +186,13 @@
 }
 
 /**
- * Form builder for deleting a contact category.
- *
+ * Form constructor for the contact category deletion form.
+ *
+ * @param $contact
+ *   Array describing the contact category to be deleted. See the documentation
+ *   of contact_category_edit_form() for the recognized keys.
+ *
+ * @see contact_menu()
  * @see contact_category_delete_form_submit()
  */
 function contact_category_delete_form($form, &$form_state, array $contact) {
@@ -188,9 +212,7 @@
 }
 
 /**
- * Submit handler for the confirm delete category form.
- *
- * @see contact_category_delete_form()
+ * Form submission handler for contact_category_delete_form().
  */
 function contact_category_delete_form_submit($form, &$form_state) {
   $contact = $form['contact']['#value'];

Modified: branches/upstream/current-7/modules/contact/contact.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contact/contact.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contact/contact.info (original)
+++ branches/upstream/current-7/modules/contact/contact.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/structure/contact
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/contact/contact.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contact/contact.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contact/contact.module (original)
+++ branches/upstream/current-7/modules/contact/contact.module Sun Feb  5 17:53:08 2012
@@ -110,10 +110,7 @@
  * Menu access callback for a user's personal contact form.
  *
  * @param $account
- *   A user account object.
- * @return
- *   TRUE if the current user has access to the requested user's contact form,
- *   or FALSE otherwise.
+ *   The user object of the user whose contact form is being requested.
  */
 function _contact_personal_tab_access($account) {
   global $user;
@@ -148,10 +145,11 @@
 }
 
 /**
- * Load a contact category.
+ * Loads a contact category.
  *
  * @param $cid
  *   The contact category ID.
+ *
  * @return
  *   An array with the contact category's data.
  */
@@ -211,6 +209,8 @@
  * Implements hook_form_FORM_ID_alter().
  *
  * Add the enable personal contact form to an individual user's account page.
+ *
+ * @see user_profile_form()
  */
 function contact_form_user_profile_form_alter(&$form, &$form_state) {
   if ($form['#user_category'] == 'account') {
@@ -241,6 +241,8 @@
  * Implements hook_form_FORM_ID_alter().
  *
  * Add the default personal contact setting on the user settings page.
+ *
+ * @see user_admin_settings()
  */
 function contact_form_user_admin_settings_alter(&$form, &$form_state) {
   $form['contact'] = array(

Modified: branches/upstream/current-7/modules/contact/contact.pages.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contact/contact.pages.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contact/contact.pages.inc (original)
+++ branches/upstream/current-7/modules/contact/contact.pages.inc Sun Feb  5 17:53:08 2012
@@ -2,14 +2,15 @@
 
 /**
  * @file
- * User page callbacks for the contact module.
- */
-
-/**
- * Form builder; the site-wide contact form.
+ * Page callbacks for the Contact module.
+ */
+
+/**
+ * Form constructor for the site-wide contact form.
  *
  * @see contact_site_form_validate()
  * @see contact_site_form_submit()
+ * @ingroup forms
  */
 function contact_site_form($form, &$form_state) {
   global $user;
@@ -112,6 +113,8 @@
 
 /**
  * Form validation handler for contact_site_form().
+ *
+ * @see contact_site_form_submit()
  */
 function contact_site_form_validate($form, &$form_state) {
   if (!$form_state['values']['cid']) {
@@ -124,6 +127,8 @@
 
 /**
  * Form submission handler for contact_site_form().
+ *
+ * @see contact_site_form_validate()
  */
 function contact_site_form_submit($form, &$form_state) {
   global $user, $language;
@@ -166,10 +171,14 @@
 }
 
 /**
- * Form builder; the personal contact form.
- *
+ * Form constructor for the personal contact form.
+ *
+ * Path: user/%user/contact
+ *
+ * @see contact_menu()
  * @see contact_personal_form_validate()
  * @see contact_personal_form_submit()
+ * @ingroup forms
  */
 function contact_personal_form($form, &$form_state, $recipient) {
   global $user;
@@ -244,7 +253,7 @@
 /**
  * Form validation handler for contact_personal_form().
  *
- * @see contact_personal_form()
+ * @see contact_personal_form_submit()
  */
 function contact_personal_form_validate($form, &$form_state) {
   if (!valid_email_address($form_state['values']['mail'])) {
@@ -255,7 +264,7 @@
 /**
  * Form submission handler for contact_personal_form().
  *
- * @see contact_personal_form()
+ * @see contact_personal_form_validate()
  */
 function contact_personal_form_submit($form, &$form_state) {
   global $user, $language;

Modified: branches/upstream/current-7/modules/contact/contact.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contact/contact.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contact/contact.test (original)
+++ branches/upstream/current-7/modules/contact/contact.test Sun Feb  5 17:53:08 2012
@@ -1,10 +1,12 @@
 <?php
-
 /**
- * @file 
- * Tests for contact.module.
+ * @file
+ * Tests for the Contact module.
  */
 
+/**
+ * Tests the site-wide contact form.
+ */
 class ContactSitewideTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
@@ -19,7 +21,7 @@
   }
 
   /**
-   * Test configuration options and site-wide contact form.
+   * Tests configuration options and the site-wide contact form.
    */
   function testSiteWideContact() {
     // Create and login administrative user.
@@ -159,7 +161,7 @@
   }
 
   /**
-  * Test auto-reply on the site-wide contact form.
+  * Tests auto-reply on the site-wide contact form.
   */
   function testAutoReply() {
     // Create and login administrative user.
@@ -200,12 +202,17 @@
   }
 
   /**
-   * Add a category.
+   * Adds a category.
    *
-   * @param string $category Name of category.
-   * @param string $recipients List of recipient e-mail addresses.
-   * @param string $reply Auto-reply text.
-   * @param boolean $selected Defautly selected.
+   * @param string $category
+   *   The category name.
+   * @param string $recipients
+   *   The list of recipient e-mail addresses.
+   * @param string $reply
+   *   The auto-reply text that is sent to a user upon completing the contact
+   *   form.
+   * @param boolean $selected
+   *   Boolean indicating whether the category should be selected by default.
    */
   function addCategory($category, $recipients, $reply, $selected) {
     $edit = array();
@@ -217,12 +224,17 @@
   }
 
   /**
-   * Update a category.
+   * Updates a category.
    *
-   * @param string $category Name of category.
-   * @param string $recipients List of recipient e-mail addresses.
-   * @param string $reply Auto-reply text.
-   * @param boolean $selected Defautly selected.
+   * @param string $category
+   *   The category name.
+   * @param string $recipients
+   *   The list of recipient e-mail addresses.
+   * @param string $reply
+   *   The auto-reply text that is sent to a user upon completing the contact
+   *   form.
+   * @param boolean $selected
+   *   Boolean indicating whether the category should be selected by default.
    */
   function updateCategory($categories, $category, $recipients, $reply, $selected) {
     $category_id = $categories[array_rand($categories)];
@@ -236,13 +248,18 @@
   }
 
   /**
-   * Submit contact form.
+   * Submits the contact form.
    *
-   * @param string $name Name.
-   * @param string $mail E-mail address.
-   * @param string $subject Subject.
-   * @param integer $cid Category id.
-   * @param string $message Message.
+   * @param string $name
+   *   The name of the sender.
+   * @param string $mail
+   *   The e-mail address of the sender.
+   * @param string $subject
+   *   The subject of the message.
+   * @param integer $cid
+   *   The category ID of the message.
+   * @param string $message
+   *   The message body.
    */
   function submitContact($name, $mail, $subject, $cid, $message) {
     $edit = array();
@@ -255,7 +272,7 @@
   }
 
   /**
-   * Delete all categories.
+   * Deletes all categories.
    */
   function deleteCategories() {
     $categories = $this->getCategories();
@@ -267,9 +284,10 @@
   }
 
   /**
-   * Get list category ids.
+   * Gets a list of all category IDs.
    *
-   * @return array Category ids.
+   * @return array
+   *   A list of the category IDs.
    */
   function getCategories() {
     $categories = db_query('SELECT cid FROM {contact}')->fetchCol();
@@ -278,7 +296,7 @@
 }
 
 /**
- * Test the personal contact form.
+ * Tests the personal contact form.
  */
 class ContactPersonalTestCase extends DrupalWebTestCase {
   private $admin_user;
@@ -306,7 +324,7 @@
   }
 
   /**
-   * Test personal contact form access.
+   * Tests access to the personal contact form.
    */
   function testPersonalContactAccess() {
     // Test allowed access to user with contact form enabled.
@@ -369,7 +387,7 @@
   }
 
   /**
-   * Test the personal contact form flood protection.
+   * Tests the personal contact form flood protection.
    */
   function testPersonalContactFlood() {
     $flood_limit = 3;
@@ -399,7 +417,7 @@
   }
 
   /**
-   * Fill out a user's personal contact form and submit.
+   * Fills out a user's personal contact form and submits it.
    *
    * @param $account
    *   A user object of the user being contacted.

Modified: branches/upstream/current-7/modules/contextual/contextual-rtl.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contextual/contextual-rtl.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contextual/contextual-rtl.css (original)
+++ branches/upstream/current-7/modules/contextual/contextual-rtl.css Sun Feb  5 17:53:08 2012
@@ -1,3 +1,7 @@
+/**
+ * @file
+ * Stylesheet specific to right-to-left languages.
+ */
 
 div.contextual-links-wrapper {
   left: 5px;

Modified: branches/upstream/current-7/modules/contextual/contextual.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contextual/contextual.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contextual/contextual.css (original)
+++ branches/upstream/current-7/modules/contextual/contextual.css Sun Feb  5 17:53:08 2012
@@ -1,3 +1,7 @@
+/**
+ * @file
+ * Stylesheet for the Contextual module.
+ */
 
 /**
  * Contextual links regions.

Modified: branches/upstream/current-7/modules/contextual/contextual.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contextual/contextual.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contextual/contextual.info (original)
+++ branches/upstream/current-7/modules/contextual/contextual.info Sun Feb  5 17:53:08 2012
@@ -5,7 +5,7 @@
 core = 7.x
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/contextual/contextual.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contextual/contextual.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contextual/contextual.js (original)
+++ branches/upstream/current-7/modules/contextual/contextual.js Sun Feb  5 17:53:08 2012
@@ -1,9 +1,14 @@
+/**
+ * @file
+ * Attaches behaviors for the Contextual module.
+ */
+
 (function ($) {
 
 Drupal.contextualLinks = Drupal.contextualLinks || {};
 
 /**
- * Attach outline behavior for regions associated with contextual links.
+ * Attaches outline behavior for regions associated with contextual links.
  */
 Drupal.behaviors.contextualLinks = {
   attach: function (context) {

Modified: branches/upstream/current-7/modules/contextual/contextual.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contextual/contextual.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contextual/contextual.module (original)
+++ branches/upstream/current-7/modules/contextual/contextual.module Sun Feb  5 17:53:08 2012
@@ -77,21 +77,17 @@
 }
 
 /**
- * Template variable preprocessor for contextual links.
+ * Implements hook_preprocess().
  *
  * @see contextual_pre_render_links()
  */
 function contextual_preprocess(&$variables, $hook) {
-  static $hooks;
-
   // Nothing to do here if the user is not permitted to access contextual links.
   if (!user_access('access contextual links')) {
     return;
   }
 
-  if (!isset($hooks)) {
-    $hooks = theme_get_registry();
-  }
+  $hooks = theme_get_registry(FALSE);
 
   // Determine the primary theme function argument.
   if (!empty($hooks[$hook]['variables'])) {
@@ -136,6 +132,7 @@
  *   A renderable array representing contextual links.
  *
  * @see menu_contextual_links()
+ * @see contextual_element_info()
  */
 function contextual_pre_render_links($element) {
   // Retrieve contextual menu links.

Modified: branches/upstream/current-7/modules/dashboard/dashboard.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dashboard/dashboard.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dashboard/dashboard.info (original)
+++ branches/upstream/current-7/modules/dashboard/dashboard.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 configure = admin/dashboard/customize
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/dblog/dblog.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dblog/dblog.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dblog/dblog.info (original)
+++ branches/upstream/current-7/modules/dblog/dblog.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 files[] = dblog.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/field.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.api.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.api.php (original)
+++ branches/upstream/current-7/modules/field/field.api.php Sun Feb  5 17:53:08 2012
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * @ingroup field_fieldable_type
+ * @ingroup hooks
  * @{
  */
 
@@ -74,15 +74,11 @@
 function hook_field_extra_fields_alter(&$info) {
   // Force node title to always be at the top of the list by default.
   foreach (node_type_get_types() as $bundle) {
-    if (isset($info['node'][$bundle->type]['title'])) {
-      $info['node'][$bundle->type]['title']['weight'] = -20;
-    }
-  }
-}
-
-/**
- * @} End of "ingroup field_fieldable_type"
- */
+    if (isset($info['node'][$bundle->type]['form']['title'])) {
+      $info['node'][$bundle->type]['form']['title']['weight'] = -20;
+    }
+  }
+}
 
 /**
  * @defgroup field_types Field Types API
@@ -119,6 +115,9 @@
  *
  * A third kind of pluggable handlers, storage backends, is defined by the
  * @link field_storage Field Storage API @endlink.
+ *
+ * See @link field Field API @endlink for information about the other parts of
+ * the Field API.
  */
 
 /**
@@ -706,6 +705,7 @@
  * @see hook_field_widget_form_alter()
  * @see hook_field_widget_WIDGET_TYPE_form_alter()
  * @see hook_field_widget_error()
+ * @see hook_field_widget_settings_form()
  */
 function hook_field_widget_info() {
     return array(
@@ -1505,10 +1505,6 @@
  * @} End of "ingroup field_attach"
  */
 
-/**********************************************************************
- * Field Storage API
- **********************************************************************/
-
 /**
  * @ingroup field_storage
  * @{
@@ -2346,10 +2342,6 @@
  * @} End of "ingroup field_storage"
  */
 
-/**********************************************************************
- * Field CRUD API
- **********************************************************************/
-
 /**
  * @ingroup field_crud
  * @{
@@ -2603,10 +2595,6 @@
  * @} End of "ingroup field_crud"
  */
 
-/**********************************************************************
- * TODO: I'm not sure where these belong yet.
- **********************************************************************/
-
 /**
  * Determine whether the user has access to a given field.
  *
@@ -2633,3 +2621,7 @@
   }
   return TRUE;
 }
+
+/**
+ * @} End of "ingroup hooks"
+ */

Modified: branches/upstream/current-7/modules/field/field.attach.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.attach.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.attach.inc (original)
+++ branches/upstream/current-7/modules/field/field.attach.inc Sun Feb  5 17:53:08 2012
@@ -44,6 +44,9 @@
  *
  * Each field defines which storage backend it uses. The Drupal system variable
  * 'field_storage_default' identifies the storage backend used by default.
+ *
+ * See @link field Field API @endlink for information about the other parts of
+ * the Field API.
  */
 
 /**
@@ -117,6 +120,12 @@
  * The pre-operation hooks do not make the Field Storage API irrelevant. The
  * Field Storage API is essentially the "fallback mechanism" for any fields
  * that aren't being intercepted explicitly by pre-operation hooks.
+ *
+ * @link field_language Field Language API @endlink provides information about
+ * the structure of field objects.
+ *
+ * See @link field Field API @endlink for information about the other parts of
+ * the Field API.
  */
 
 /**
@@ -185,8 +194,10 @@
   // Iterate through the instances and collect results.
   $return = array();
   foreach ($instances as $instance) {
-    $field_name = $instance['field_name'];
-    $field = field_info_field($field_name);
+    // field_info_field() is not available for deleted fields, so use
+    // field_info_field_by_id().
+    $field = field_info_field_by_id($instance['field_id']);
+    $field_name = $field['field_name'];
     $function = $options['default'] ? 'field_default_' . $op : $field['module'] . '_field_' . $op;
     if (function_exists($function)) {
       // Determine the list of languages to iterate on.
@@ -694,7 +705,8 @@
     }
 
     // Invoke field-type module's hook_field_load().
-    _field_invoke_multiple('load', $entity_type, $queried_entities, $age, $options);
+    $null = NULL;
+    _field_invoke_multiple('load', $entity_type, $queried_entities, $age, $null, $options);
 
     // Invoke hook_field_attach_load(): let other modules act on loading the
     // entitiy.

Modified: branches/upstream/current-7/modules/field/field.crud.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.crud.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.crud.inc (original)
+++ branches/upstream/current-7/modules/field/field.crud.inc Sun Feb  5 17:53:08 2012
@@ -15,6 +15,9 @@
  *
  * The Field CRUD API uses
  * @link field Field API data structures @endlink.
+ *
+ * See @link field Field API @endlink for information about the other parts of
+ * the Field API.
  */
 
 /**
@@ -42,10 +45,11 @@
  *       system variable.
  *     - settings: each omitted setting is given the default value specified in
  *       hook_field_storage_info().
+ *
  * @return
  *   The $field array with the id property filled in.
- * @throw
- *   FieldException
+ *
+ * @throws FieldException
  *
  * See: @link field Field API data structures @endlink.
  */
@@ -442,8 +446,8 @@
  *
  * @return
  *   The $instance array with the id property filled in.
- * @throw
- *   FieldException
+ *
+ * @throws FieldException
  *
  * See: @link field Field API data structures @endlink.
  */
@@ -510,8 +514,7 @@
  *   properties specified in $instance overwrite the existing values for
  *   the instance.
  *
- * @throw
- *   FieldException
+ * @throws FieldException
  *
  * @see field_create_instance()
  */
@@ -824,6 +827,9 @@
  *     ),
  *   );
  * @endcode
+ *
+ * See @link field Field API @endlink for information about the other parts of
+ * the Field API.
  */
 
 /**

Modified: branches/upstream/current-7/modules/field/field.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.info (original)
+++ branches/upstream/current-7/modules/field/field.info Sun Feb  5 17:53:08 2012
@@ -11,7 +11,7 @@
 stylesheets[all][] = theme/field.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/field.info.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.info.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.info.inc (original)
+++ branches/upstream/current-7/modules/field/field.info.inc Sun Feb  5 17:53:08 2012
@@ -13,6 +13,9 @@
  * The Field Info API exposes information about field types, fields,
  * instances, bundles, widget types, display formatters, behaviors,
  * and settings defined by or with the Field API.
+ *
+ * See @link field Field API @endlink for information about the other parts of
+ * the Field API.
  */
 
 /**
@@ -24,6 +27,7 @@
  */
 function field_info_cache_clear() {
   drupal_static_reset('field_view_mode_settings');
+  drupal_static_reset('field_available_languages');
 
   // @todo: Remove this when field_attach_*_bundle() bundle management
   // functions are moved to the entity API.
@@ -602,8 +606,9 @@
  *
  * @param $field_name
  *   The name of the field to retrieve. $field_name can only refer to a
- *   non-deleted, active field. Use field_read_fields() to retrieve information
- *   on deleted or inactive fields.
+ *   non-deleted, active field. For deleted fields, use
+ *   field_info_field_by_id(). To retrieve information about inactive fields,
+ *   use field_read_fields().
  *
  * @return
  *   The field array, as returned by field_read_fields(), with an
@@ -624,7 +629,7 @@
  *
  * @param $field_id
  *   The id of the field to retrieve. $field_id can refer to a
- *   deleted field.
+ *   deleted field, but not an inactive one.
  *
  * @return
  *   The field array, as returned by field_read_fields(), with an

Modified: branches/upstream/current-7/modules/field/field.multilingual.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.multilingual.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.multilingual.inc (original)
+++ branches/upstream/current-7/modules/field/field.multilingual.inc Sun Feb  5 17:53:08 2012
@@ -57,6 +57,9 @@
  *   even disabled by modules implementing hook_field_language_alter(), making
  *   it possible to choose the first approach. The display language for each
  *   field is returned by field_language().
+ *
+ * See @link field Field API @endlink for information about the other parts of
+ * the Field API.
  */
 
 /**

Modified: branches/upstream/current-7/modules/field/modules/field_sql_storage/field_sql_storage.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/field_sql_storage/field_sql_storage.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/field_sql_storage/field_sql_storage.info (original)
+++ branches/upstream/current-7/modules/field/modules/field_sql_storage/field_sql_storage.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 required = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/modules/list/list.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/list/list.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/list/list.info (original)
+++ branches/upstream/current-7/modules/field/modules/list/list.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 files[] = tests/list.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/modules/list/tests/list_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/list/tests/list_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/list/tests/list_test.info (original)
+++ branches/upstream/current-7/modules/field/modules/list/tests/list_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/modules/number/number.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/number/number.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/number/number.info (original)
+++ branches/upstream/current-7/modules/field/modules/number/number.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 files[] = number.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/modules/options/options.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/options/options.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/options/options.info (original)
+++ branches/upstream/current-7/modules/field/modules/options/options.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 files[] = options.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/modules/text/text.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/text/text.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/text/text.info (original)
+++ branches/upstream/current-7/modules/field/modules/text/text.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 required = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/tests/field.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/tests/field.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/tests/field.test (original)
+++ branches/upstream/current-7/modules/field/tests/field.test Sun Feb  5 17:53:08 2012
@@ -72,12 +72,13 @@
 }
 
 class FieldAttachTestCase extends FieldTestCase {
-  function setUp($modules = array()) {
+  function setUp() {
     // Since this is a base class for many test cases, support the same
     // flexibility that DrupalWebTestCase::setUp() has for the modules to be
     // passed in as either an array or a variable number of string arguments.
-    if (!is_array($modules)) {
-      $modules = func_get_args();
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
     }
     if (!in_array('field_test', $modules)) {
       $modules[] = 'field_test';
@@ -2674,7 +2675,7 @@
 
     // Test field_available_languages() behavior for untranslatable fields.
     $this->field['translatable'] = FALSE;
-    $this->field_name = $this->field['field_name'] = $this->instance['field_name'] = drupal_strtolower($this->randomName() . '_field_name');
+    field_update_field($this->field);
     $available_languages = field_available_languages($this->entity_type, $this->field);
     $this->assertTrue(count($available_languages) == 1 && $available_languages[0] === LANGUAGE_NONE, t('For untranslatable fields only LANGUAGE_NONE is available.'));
   }
@@ -2989,22 +2990,54 @@
    */
   function _generateStubEntities($entity_type, $entities, $field_name = NULL) {
     $stubs = array();
-    foreach ($entities as $entity) {
+    foreach ($entities as $id => $entity) {
       $stub = entity_create_stub_entity($entity_type, entity_extract_ids($entity_type, $entity));
       if (isset($field_name)) {
         $stub->{$field_name} = $entity->{$field_name};
       }
-      $stubs[] = $stub;
+      $stubs[$id] = $stub;
     }
     return $stubs;
+  }
+
+  /**
+   * Tests that the expected hooks have been invoked on the expected entities.
+   *
+   * @param $expected_hooks
+   *   An array keyed by hook name, with one entry per expected invocation.
+   *   Each entry is the value of the "$entity" parameter the hook is expected
+   *   to have been passed.
+   * @param $actual_hooks
+   *   The array of actual hook invocations recorded by field_test_memorize().
+   */
+  function checkHooksInvocations($expected_hooks, $actual_hooks) {
+    foreach ($expected_hooks as $hook => $invocations) {
+      $actual_invocations = $actual_hooks[$hook];
+
+      // Check that the number of invocations is correct.
+      $this->assertEqual(count($actual_invocations), count($invocations), "$hook() was called the expected number of times.");
+
+      // Check that the hook was called for each expected argument.
+      foreach ($invocations as $argument) {
+        $found = FALSE;
+        foreach ($actual_invocations as $actual_arguments) {
+          if ($actual_arguments[1] == $argument) {
+            $found = TRUE;
+            break;
+          }
+        }
+        $this->assertTrue($found, "$hook() was called on expected argument");
+      }
+    }
   }
 
   function setUp() {
     parent::setUp('field_test');
 
-    // Clean up data from previous test cases.
     $this->fields = array();
     $this->instances = array();
+    $this->entities = array();
+    $this->entities_by_bundles = array();
 
     // Create two bundles.
     $this->bundles = array('bb_1' => 'bb_1', 'bb_2' => 'bb_2');
@@ -3040,7 +3073,10 @@
         foreach ($this->fields as $field) {
           $entity->{$field['field_name']}[LANGUAGE_NONE] = $this->_generateTestFieldValues($field['cardinality']);
         }
+
         $this->entities[$id] = $entity;
+        // Also keep track of the entities per bundle.
+        $this->entities_by_bundles[$bundle][$id] = $entity;
         field_attach_insert($this->entity_type, $entity);
         $id++;
       }
@@ -3105,6 +3141,7 @@
    * instance is deleted.
    */
   function testPurgeInstance() {
+    // Start recording hook invocations.
     field_test_memorize();
 
     $bundle = reset($this->bundles);
@@ -3119,7 +3156,7 @@
     $this->assertEqual(count($mem), 0, 'No field hooks were called');
 
     $batch_size = 2;
-    for ($count = 8; $count >= 0; $count -= 2) {
+    for ($count = 8; $count >= 0; $count -= $batch_size) {
       // Purge two entities.
       field_purge_batch($batch_size);
 
@@ -3133,19 +3170,21 @@
       $this->assertEqual($count ? count($found['test_entity']) : count($found), $count, 'Correct number of entities found after purging 2');
     }
 
-    // hook_field_delete() was called on a pseudo-entity for each entity. Each
-    // pseudo entity has a $field property that matches the original entity,
-    // but no others.
-    $mem = field_test_memorize();
-    $this->assertEqual(count($mem['field_test_field_delete']), 10, 'hook_field_delete was called for the right number of entities');
-    $stubs = $this->_generateStubEntities($this->entity_type, $this->entities, $field['field_name']);
-    $count = count($stubs);
-    foreach ($mem['field_test_field_delete'] as $args) {
-      $entity = $args[1];
-      $this->assertEqual($stubs[$entity->ftid], $entity, 'hook_field_delete() called with the correct stub');
-      unset($stubs[$entity->ftid]);
-    }
-    $this->assertEqual(count($stubs), $count-10, 'hook_field_delete was called with each entity once');
+    // Check hooks invocations.
+    // - hook_field_load() (multiple hook) should have been called on all
+    // entities by pairs of two.
+    // - hook_field_delete() should have been called once for each entity in the
+    // bundle.
+    $actual_hooks = field_test_memorize();
+    $hooks = array();
+    $stubs = $this->_generateStubEntities($this->entity_type, $this->entities_by_bundles[$bundle], $field['field_name']);
+    foreach (array_chunk($stubs, $batch_size, TRUE) as $chunk) {
+      $hooks['field_test_field_load'][] = $chunk;
+    }
+    foreach ($stubs as $stub) {
+      $hooks['field_test_field_delete'][] = $stub;
+    }
+    $this->checkHooksInvocations($hooks, $actual_hooks);
 
     // The instance still exists, deleted.
     $instances = field_read_instances(array('field_id' => $field['id'], 'deleted' => 1), array('include_deleted' => 1, 'include_inactive' => 1));
@@ -3168,14 +3207,36 @@
    * instances are deleted and purged.
    */
   function testPurgeField() {
+    // Start recording hook invocations.
+    field_test_memorize();
+
     $field = reset($this->fields);
 
     // Delete the first instance.
-    $instance = field_info_instance($this->entity_type, $field['field_name'], 'bb_1');
+    $bundle = reset($this->bundles);
+    $instance = field_info_instance($this->entity_type, $field['field_name'], $bundle);
     field_delete_instance($instance);
+
+    // Assert that hook_field_delete() was not called yet.
+    $mem = field_test_memorize();
+    $this->assertEqual(count($mem), 0, 'No field hooks were called.');
 
     // Purge the data.
     field_purge_batch(10);
+
+    // Check hooks invocations.
+    // - hook_field_load() (multiple hook) should have been called once, for all
+    // entities in the bundle.
+    // - hook_field_delete() should have been called once for each entity in the
+    // bundle.
+    $actual_hooks = field_test_memorize();
+    $hooks = array();
+    $stubs = $this->_generateStubEntities($this->entity_type, $this->entities_by_bundles[$bundle], $field['field_name']);
+    $hooks['field_test_field_load'][] = $stubs;
+    foreach ($stubs as $stub) {
+      $hooks['field_test_field_delete'][] = $stub;
+    }
+    $this->checkHooksInvocations($hooks, $actual_hooks);
 
     // Purge again to purge the instance.
     field_purge_batch(0);
@@ -3185,11 +3246,26 @@
     $this->assertTrue(isset($fields[$field['id']]) && !$fields[$field['id']]['deleted'], 'The field exists and is not deleted');
 
     // Delete the second instance.
-    $instance = field_info_instance($this->entity_type, $field['field_name'], 'bb_2');
+    $bundle = next($this->bundles);
+    $instance = field_info_instance($this->entity_type, $field['field_name'], $bundle);
     field_delete_instance($instance);
+
+    // Assert that hook_field_delete() was not called yet.
+    $mem = field_test_memorize();
+    $this->assertEqual(count($mem), 0, 'No field hooks were called.');
 
     // Purge the data.
     field_purge_batch(10);
+
+    // Check hooks invocations (same as above, for the 2nd bundle).
+    $actual_hooks = field_test_memorize();
+    $hooks = array();
+    $stubs = $this->_generateStubEntities($this->entity_type, $this->entities_by_bundles[$bundle], $field['field_name']);
+    $hooks['field_test_field_load'][] = $stubs;
+    foreach ($stubs as $stub) {
+      $hooks['field_test_field_delete'][] = $stub;
+    }
+    $this->checkHooksInvocations($hooks, $actual_hooks);
 
     // The field still exists, deleted.
     $fields = field_read_fields(array('id' => $field['id']), array('include_deleted' => 1));

Modified: branches/upstream/current-7/modules/field/tests/field_test.entity.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/tests/field_test.entity.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/tests/field_test.entity.inc (original)
+++ branches/upstream/current-7/modules/field/tests/field_test.entity.inc Sun Feb  5 17:53:08 2012
@@ -58,7 +58,7 @@
         'id' => 'ftid',
         'bundle' => 'fttype',
       ),
-      'bundles' => array('bundle1' => array('label' => 'Bundle1'), 'bundle2' => array('label' => 'Bundle2')),
+      'bundles' => array('bundle1' => array('label' => 'Bundle1'), 'bundle2' => array('label' => 'Bundle2')) + $bundles,
       'view modes' => $test_entity_modes,
     ),
     // In this case, the bundle key is not stored in the database.
@@ -72,7 +72,7 @@
         'id' => 'ftid',
         'bundle' => 'fttype',
       ),
-      'bundles' => array('test_entity_2' => array('label' => 'Test entity 2')),
+      'bundles' => array('test_entity_2' => array('label' => 'Test entity 2')) + $bundles,
       'view modes' => $test_entity_modes,
     ),
     // @see EntityPropertiesTestCase::testEntityLabel()

Modified: branches/upstream/current-7/modules/field/tests/field_test.field.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/tests/field_test.field.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/tests/field_test.field.inc (original)
+++ branches/upstream/current-7/modules/field/tests/field_test.field.inc Sun Feb  5 17:53:08 2012
@@ -58,6 +58,9 @@
  * Implements hook_field_load().
  */
 function field_test_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
+  $args = func_get_args();
+  field_test_memorize(__FUNCTION__, $args);
+
   foreach ($items as $id => $item) {
     // To keep the test non-intrusive, only act for instances with the
     // test_hook_field_load setting explicitly set to TRUE.
@@ -73,12 +76,39 @@
 }
 
 /**
+ * Implements hook_field_insert().
+ */
+function field_test_field_insert($entity_type, $entity, $field, $instance, $items) {
+  $args = func_get_args();
+  field_test_memorize(__FUNCTION__, $args);
+}
+
+/**
+ * Implements hook_field_update().
+ */
+function field_test_field_update($entity_type, $entity, $field, $instance, $items) {
+  $args = func_get_args();
+  field_test_memorize(__FUNCTION__, $args);
+}
+
+/**
+ * Implements hook_field_delete().
+ */
+function field_test_field_delete($entity_type, $entity, $field, $instance, $items) {
+  $args = func_get_args();
+  field_test_memorize(__FUNCTION__, $args);
+}
+
+/**
  * Implements hook_field_validate().
  *
  * Possible error codes:
  * - 'field_test_invalid': The value is invalid.
  */
 function field_test_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
+  $args = func_get_args();
+  field_test_memorize(__FUNCTION__, $args);
+
   foreach ($items as $delta => $item) {
     if ($item['value'] == -1) {
       $errors[$field['field_name']][$langcode][$delta][] = array(
@@ -350,11 +380,13 @@
       break;
 
     case 'field_test_multiple':
-      $array = array();
-      foreach ($items as $delta => $item) {
-        $array[] = $delta . ':' . $item['value'];
-      }
-      $element[0] = array('#markup' => $settings['test_formatter_setting_multiple'] . '|' . implode('|', $array));
+      if (!empty($items)) {
+        $array = array();
+        foreach ($items as $delta => $item) {
+          $array[] = $delta . ':' . $item['value'];
+        }
+        $element[0] = array('#markup' => $settings['test_formatter_setting_multiple'] . '|' . implode('|', $array));
+      }
       break;
   }
 

Modified: branches/upstream/current-7/modules/field/tests/field_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/tests/field_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/tests/field_test.info (original)
+++ branches/upstream/current-7/modules/field/tests/field_test.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field/tests/field_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/tests/field_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/tests/field_test.module (original)
+++ branches/upstream/current-7/modules/field/tests/field_test.module Sun Feb  5 17:53:08 2012
@@ -183,30 +183,6 @@
 }
 
 /**
- * Memorize calls to hook_field_insert().
- */
-function field_test_field_insert($entity_type, $entity, $field, $instance, $items) {
-  $args = func_get_args();
-  field_test_memorize(__FUNCTION__, $args);
-}
-
-/**
- * Memorize calls to hook_field_update().
- */
-function field_test_field_update($entity_type, $entity, $field, $instance, $items) {
-  $args = func_get_args();
-  field_test_memorize(__FUNCTION__, $args);
-}
-
-/**
- * Memorize calls to hook_field_delete().
- */
-function field_test_field_delete($entity_type, $entity, $field, $instance, $items) {
-  $args = func_get_args();
-  field_test_memorize(__FUNCTION__, $args);
-}
-
-/**
  * Implements hook_entity_query_alter().
  */
 function field_test_entity_query_alter(&$query) {
@@ -248,3 +224,38 @@
     $output['test_field'][] = array('#markup' => 'field_test_field_attach_view_alter');
   }
 }
+
+/**
+ * Implements hook_field_widget_properties_alter().
+ */
+function field_test_field_widget_properties_alter(&$widget, $context) {
+  // Make the alter_test_text field 42 characters for nodes and comments.
+  if (in_array($context['entity_type'], array('node', 'comment')) && ($context['field']['field_name'] == 'alter_test_text')) {
+    $widget['settings']['size'] = 42;
+  }
+}
+
+/**
+ * Implements hook_field_widget_properties_ENTITY_TYPE_alter().
+ */
+function field_test_field_widget_properties_user_alter(&$widget, $context) {
+  // Always use buttons for the alter_test_options field on user forms.
+  if ($context['field']['field_name'] == 'alter_test_options') {
+    $widget['type'] = 'options_buttons';
+  }
+}
+
+/**
+ * Implements hook_field_widget_form_alter().
+ */
+function field_test_field_widget_form_alter(&$element, &$form_state, $context) {
+  switch ($context['field']['field_name']) {
+    case 'alter_test_text':
+      drupal_set_message('Field size: ' . $context['instance']['widget']['settings']['size']);
+      break;
+
+    case 'alter_test_options':
+      drupal_set_message('Widget type: ' . $context['instance']['widget']['type']);
+      break;
+  }
+}

Modified: branches/upstream/current-7/modules/field_ui/field_ui-rtl.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field_ui/field_ui-rtl.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui-rtl.css (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui-rtl.css Sun Feb  5 17:53:08 2012
@@ -1,3 +1,7 @@
+/**
+ * @file
+ * Right-to-left specific stylesheet for the Field UI module.
+ */
 
 /* 'Manage fields' overview */
 table.field-ui-overview tr.add-new .label-input {

Modified: branches/upstream/current-7/modules/field_ui/field_ui.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field_ui/field_ui.admin.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.admin.inc (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.admin.inc Sun Feb  5 17:53:08 2012
@@ -51,7 +51,7 @@
 }
 
 /**
- * Helper function to display a message about inactive fields.
+ * Displays a message listing the inactive fields of a given bundle.
  */
 function field_ui_inactive_message($entity_type, $bundle) {
   $inactive_instances = field_ui_inactive_instances($entity_type, $bundle);
@@ -72,9 +72,9 @@
 }
 
 /**
- * Helper function: determines the rendering order of a tree array.
- *
- * This is intended as a callback for array_reduce().
+ * Determines the rendering order of an array representing a tree.
+ *
+ * Callback for array_reduce() within field_ui_table_pre_render().
  */
 function _field_ui_reduce_order($array, $a) {
   $array = !isset($array) ? array() : $array;
@@ -91,8 +91,9 @@
 /**
  * Returns the region to which a row in the 'Manage fields' screen belongs.
  *
- * This function is used as a #row_callback in field_ui_field_overview_form(),
- * and is called during field_ui_table_pre_render().
+ * This function is used as a #region_callback in
+ * field_ui_field_overview_form(). It is called during
+ * field_ui_table_pre_render().
  */
 function field_ui_field_overview_row_region($row) {
   switch ($row['#row_type']) {
@@ -109,8 +110,9 @@
 /**
  * Returns the region to which a row in the 'Manage display' screen belongs.
  *
- * This function is used as a #row_callback in field_ui_field_overview_form(),
- * and is called during field_ui_table_pre_render().
+ * This function is used as a #region_callback in
+ * field_ui_field_overview_form(), and is called during
+ * field_ui_table_pre_render().
  */
 function field_ui_display_overview_row_region($row) {
   switch ($row['#row_type']) {
@@ -215,9 +217,9 @@
 
   // Determine the colspan to use for region rows, by checking the number of
   // columns in the headers.
-  $colums_count = 0;
+  $columns_count = 0;
   foreach ($table['header'] as $header) {
-    $colums_count += (is_array($header) && isset($header['colspan']) ? $header['colspan'] : 1);
+    $columns_count += (is_array($header) && isset($header['colspan']) ? $header['colspan'] : 1);
   }
 
   // Render rows, region by region.
@@ -230,7 +232,7 @@
         'class' => array('region-title', 'region-' . $region_name_class . '-title'),
         'no_striping' => TRUE,
         'data' => array(
-          array('data' => $region['title'], 'colspan' => $colums_count),
+          array('data' => $region['title'], 'colspan' => $columns_count),
         ),
       );
     }
@@ -240,7 +242,7 @@
         'class' => array('region-message', 'region-' . $region_name_class . '-message', $class),
         'no_striping' => TRUE,
         'data' => array(
-          array('data' => $region['message'], 'colspan' => $colums_count),
+          array('data' => $region['message'], 'colspan' => $columns_count),
         ),
       );
     }
@@ -274,9 +276,13 @@
 }
 
 /**
- * Menu callback; listing of fields for a bundle.
+ * Form constructor for the 'Manage fields' form of a bundle.
  *
  * Allows fields and pseudo-fields to be re-ordered.
+ *
+ * @see field_ui_overview_form_validate().
+ * @see field_ui_overview_form_submit().
+ * @ingroup forms
  */
 function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle) {
   $bundle = field_extract_bundle($entity_type, $bundle);
@@ -630,7 +636,9 @@
 }
 
 /**
- * Validate handler for the field overview form.
+ * Form validation handler for field_ui_field_overview_form().
+ *
+ * @see field_ui_field_overview_form_submit()
  */
 function field_ui_field_overview_form_validate($form, &$form_state) {
   _field_ui_field_overview_form_validate_add_new($form, $form_state);
@@ -638,9 +646,9 @@
 }
 
 /**
- * Helper function for field_ui_field_overview_form_validate.
- *
- * Validate the 'add new field' row.
+ * Validates the 'add new field' row of field_ui_field_overview_form().
+ *
+ * @see field_ui_field_overview_form_validate()
  */
 function _field_ui_field_overview_form_validate_add_new($form, &$form_state) {
   $field = $form_state['values']['fields']['_add_new_field'];
@@ -702,9 +710,9 @@
 }
 
 /**
- * Helper function for field_ui_field_overview_form_validate.
- *
- * Validate the 'add existing field' row.
+ * Validates the 'add existing field' row of field_ui_field_overview_form().
+ *
+ * @see field_ui_field_overview_form_validate()
  */
 function _field_ui_field_overview_form_validate_add_existing($form, &$form_state) {
   // The form element might be absent if no existing fields can be added to
@@ -740,7 +748,9 @@
 }
 
 /**
- * Submit handler for the field overview form.
+ * Form submission handler for field_ui_field_overview_form().
+ *
+ * @see field_ui_field_overview_form_validate()
  */
 function field_ui_field_overview_form_submit($form, &$form_state) {
   $form_values = $form_state['values']['fields'];
@@ -799,7 +809,7 @@
       $form_state['fields_added']['_add_new_field'] = $field['field_name'];
     }
     catch (Exception $e) {
-      drupal_set_message(t('There was a problem creating field %label: @message.', array('%label' => $instance['label'], '@message' => $e->getMessage())), 'error');
+      drupal_set_message(t('There was a problem creating field %label: !message', array('%label' => $instance['label'], '!message' => $e->getMessage())), 'error');
     }
   }
 
@@ -808,7 +818,7 @@
     $values = $form_values['_add_existing_field'];
     $field = field_info_field($values['field_name']);
     if (!empty($field['locked'])) {
-      drupal_set_message(t('The field %label cannot be added because it is locked.', array('%label' => $values['label'])));
+      drupal_set_message(t('The field %label cannot be added because it is locked.', array('%label' => $values['label'])), 'error');
     }
     else {
       $instance = array(
@@ -846,7 +856,11 @@
 }
 
 /**
- * Menu callback; presents field display settings for a given view mode.
+ * Form constructor for the field display settings for a given view mode.
+ *
+ * @see field_ui_display_overview_multistep_submit()
+ * @see field_ui_display_overview_form_submit()
+ * @ingroup forms
  */
 function field_ui_display_overview_form($form, &$form_state, $entity_type, $bundle, $view_mode) {
   $bundle = field_extract_bundle($entity_type, $bundle);
@@ -1198,7 +1212,7 @@
 
 
 /**
- * Form submit handler for multistep buttons on the 'Manage display' screen.
+ * Form submission handler for buttons in field_ui_display_overview_form().
  */
 function field_ui_display_overview_multistep_submit($form, &$form_state) {
   $trigger = $form_state['triggering_element'];
@@ -1244,7 +1258,7 @@
   $trigger = $form_state['triggering_element'];
   $op = $trigger['#op'];
 
-  // Pick the elements that need ro receive the ajax-new-content effect.
+  // Pick the elements that need to receive the ajax-new-content effect.
   switch ($op) {
     case 'edit':
       $updated_rows = array($trigger['#field_name']);
@@ -1276,7 +1290,7 @@
 }
 
 /**
- * Submit handler for the display overview form.
+ * Form submission handler for field_ui_display_overview_form().
  */
 function field_ui_display_overview_form_submit($form, &$form_state) {
   $form_values = $form_state['values'];
@@ -1354,7 +1368,7 @@
 }
 
 /**
- * Helper function for field_ui_display_overview_form_submit().
+ * Populates display settings for a new view mode from the default view mode.
  *
  * When an administrator decides to use custom display settings for a view mode,
  * that view mode needs to be initialized with the display settings for the
@@ -1362,8 +1376,6 @@
  * adds the new custom display settings to this bundle's instances, and saves
  * them. It also modifies the passed-in $settings array, which the caller can
  * then save using field_bundle_settings().
- *
- * @see field_bundle_settings()
  *
  * @param $entity_type
  *   The bundle's entity type.
@@ -1374,6 +1386,9 @@
  * @param $settings
  *   An associative array of bundle settings, as expected by
  *   field_bundle_settings().
+ *
+ * @see field_ui_display_overview_form_submit().
+ * @see field_bundle_settings()
  */
 function _field_ui_add_default_view_mode_settings($entity_type, $bundle, $view_mode, &$settings) {
   // Update display settings for field instances.
@@ -1398,7 +1413,7 @@
 }
 
 /**
- * Return an array of field_type options.
+ * Returns an array of field_type options.
  */
 function field_ui_field_type_options() {
   $options = &drupal_static(__FUNCTION__);
@@ -1420,7 +1435,7 @@
 }
 
 /**
- * Return an array of widget type options for a field type.
+ * Returns an array of widget type options for a field type.
  *
  * If no field type is provided, returns a nested array of all widget types,
  * keyed by field type human name.
@@ -1456,7 +1471,7 @@
 }
 
 /**
- * Return an array of formatter options for a field type.
+ * Returns an array of formatter options for a field type.
  *
  * If no field type is provided, returns a nested array of all formatters, keyed
  * by field type.
@@ -1484,7 +1499,7 @@
 }
 
 /**
- * Return an array of existing field to be added to a bundle.
+ * Returns an array of existing fields to be added to a bundle.
  */
 function field_ui_existing_field_options($entity_type, $bundle) {
   $options = array();
@@ -1522,7 +1537,10 @@
 }
 
 /**
- * Menu callback; presents the field settings edit page.
+ * Form constructor for the field settings edit page.
+ *
+ * @see field_ui_settings_form_submit()
+ * @ingroups forms
  */
 function field_ui_field_settings_form($form, &$form_state, $instance) {
   $bundle = $instance['bundle'];
@@ -1576,7 +1594,7 @@
 }
 
 /**
- * Save a field's settings after editing.
+ * Form submission handler for field_ui_field_settings_form().
  */
 function field_ui_field_settings_form_submit($form, &$form_state) {
   $form_values = $form_state['values'];
@@ -1603,7 +1621,15 @@
 }
 
 /**
- * Menu callback; select a widget for the field.
+ * Form constructor for the widget selection form.
+ *
+ * Path: BUNDLE_ADMIN_PATH/fields/%field/widget-type, where BUNDLE_ADMIN_PATH is
+ * the path stored in the ['admin']['info'] property in the return value of
+ * hook_entity_info().
+ *
+ * @see field_ui_menu()
+ * @see field_ui_widget_type_form_submit()
+ * @ingroup forms
  */
 function field_ui_widget_type_form($form, &$form_state, $instance) {
   drupal_set_title($instance['label']);
@@ -1647,7 +1673,7 @@
 }
 
 /**
- * Submit the change in widget type.
+ * Form submission handler for field_ui_widget_type_form().
  */
 function field_ui_widget_type_form_submit($form, &$form_state) {
   $form_values = $form_state['values'];
@@ -1670,14 +1696,17 @@
     drupal_set_message(t('Changed the widget for field %label.', array('%label' => $instance['label'])));
   }
   catch (Exception $e) {
-    drupal_set_message(t('There was a problem changing the widget for field %label.', array('%label' => $instance['label'])));
+    drupal_set_message(t('There was a problem changing the widget for field %label.', array('%label' => $instance['label'])), 'error');
   }
 
   $form_state['redirect'] = field_ui_next_destination($entity_type, $bundle);
 }
 
 /**
- * Menu callback; present a form for removing a field instance from a bundle.
+ * Form constructor for removing a field instance from a bundle.
+ *
+ * @see field_ui_delete_form_submit()
+ * @ingroup forms
  */
 function field_ui_field_delete_form($form, &$form_state, $instance) {
   $bundle = $instance['bundle'];
@@ -1707,9 +1736,10 @@
 }
 
 /**
- * Removes a field instance from a bundle.
- *
- * If the field has no more instances, it will be marked as deleted too.
+ * Form submission handler for field_ui_field_delete_form().
+ *
+ * Removes a field instance from a bundle. If the field has no more instances,
+ * it will be marked as deleted too.
  */
 function field_ui_field_delete_form_submit($form, &$form_state) {
   $form_values = $form_state['values'];
@@ -1727,7 +1757,7 @@
     drupal_set_message(t('The field %field has been deleted from the %type content type.', array('%field' => $instance['label'], '%type' => $bundle_label)));
   }
   else {
-    drupal_set_message(t('There was a problem removing the %field from the %type content type.', array('%field' => $instance['label'], '%type' => $bundle_label)));
+    drupal_set_message(t('There was a problem removing the %field from the %type content type.', array('%field' => $instance['label'], '%type' => $bundle_label)), 'error');
   }
 
   $admin_path = _field_ui_bundle_admin_path($entity_type, $bundle);
@@ -1743,7 +1773,11 @@
 }
 
 /**
- * Menu callback; presents the field instance edit page.
+ * Form constructor for the field instance settings form.
+ *
+ * @see field_ui_field_edit_form_validate()
+ * @see field_ui_field_edit_form_submit()
+ * @ingroup forms
  */
 function field_ui_field_edit_form($form, &$form_state, $instance) {
   $bundle = $instance['bundle'];
@@ -1924,7 +1958,7 @@
 }
 
 /**
- * Build default value fieldset.
+ * Builds the default value fieldset for a given field instance.
  */
 function field_ui_default_value_widget($field, $instance, &$form, &$form_state) {
   $field_name = $field['field_name'];
@@ -1947,13 +1981,15 @@
   $instance['description'] = '';
 
   // @todo Allow multiple values (requires more work on 'add more' JS handler).
-  $element += field_default_form(NULL, NULL, $field, $instance, LANGUAGE_NONE, $items, $element, $form_state, 0);
+  $element += field_default_form($instance['entity_type'], NULL, $field, $instance, LANGUAGE_NONE, $items, $element, $form_state, 0);
 
   return $element;
 }
 
 /**
- * Form validation handler for field instance settings form.
+ * Form validation handler for field_ui_field_edit_form().
+ *
+ * @see field_ui_field_edit_form_submit().
  */
 function field_ui_field_edit_form_validate($form, &$form_state) {
   // Take the incoming values as the $instance definition, so that the 'default
@@ -1988,7 +2024,9 @@
 }
 
 /**
- * Form submit handler for field instance settings form.
+ * Form submission handler for field_ui_field_edit_form().
+ *
+ * @see field_ui_field_edit_form_validate().
  */
 function field_ui_field_edit_form_submit($form, &$form_state) {
   $instance = $form_state['values']['instance'];
@@ -2028,7 +2066,9 @@
 }
 
 /**
- * Helper functions to handle multipage redirects.
+ * Extracts next redirect path from an array of multiple destinations.
+ *
+ * @see field_ui_next_destination()
  */
 function field_ui_get_destinations($destinations) {
   $path = array_shift($destinations);
@@ -2040,7 +2080,7 @@
 }
 
 /**
- * Return the next redirect path in a multipage sequence.
+ * Returns the next redirect path in a multipage sequence.
  */
 function field_ui_next_destination($entity_type, $bundle) {
   $destinations = !empty($_REQUEST['destinations']) ? $_REQUEST['destinations'] : array();

Modified: branches/upstream/current-7/modules/field_ui/field_ui.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field_ui/field_ui.api.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.api.php (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.api.php Sun Feb  5 17:53:08 2012
@@ -132,7 +132,7 @@
 
 
 /**
- * Returns form elements for a formatter's settings.
+ * Specify the form elements for a formatter's settings.
  *
  * @param $field
  *   The field structure being configured.
@@ -170,7 +170,7 @@
 }
 
 /**
- * Returns a short summary for the current formatter settings of an instance.
+ * Return a short summary for the current formatter settings of an instance.
  *
  * If an empty result is returned, the formatter is assumed to have no
  * configurable settings, and no UI will be provided to display a settings

Modified: branches/upstream/current-7/modules/field_ui/field_ui.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field_ui/field_ui.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.css (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.css Sun Feb  5 17:53:08 2012
@@ -1,4 +1,8 @@
-
+/**
+ * @file
+ * Stylesheet for the Field UI module.
+ */
+ 
 /* 'Manage fields' and 'Manage display' overviews */
 table.field-ui-overview tr.add-new .label-input {
   float: left; /* LTR */

Modified: branches/upstream/current-7/modules/field_ui/field_ui.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field_ui/field_ui.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.info (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 files[] = field_ui.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/field_ui/field_ui.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field_ui/field_ui.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.js (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.js Sun Feb  5 17:53:08 2012
@@ -1,4 +1,8 @@
-
+/**
+ * @file
+ * Attaches the behaviors for the Field UI module.
+ */
+ 
 (function($) {
 
 Drupal.behaviors.fieldUIFieldOverview = {
@@ -118,7 +122,7 @@
         data.tableDrag = tableDrag;
 
         // Create the row handler, make it accessible from the DOM row element.
-        var rowHandler = eval('new rowHandlers.' + data.rowHandler + '(row, data);');
+        var rowHandler = new rowHandlers[data.rowHandler](row, data);
         $(row).data('fieldUIRowHandler', rowHandler);
       }
     });

Modified: branches/upstream/current-7/modules/field_ui/field_ui.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field_ui/field_ui.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.module (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.module Sun Feb  5 17:53:08 2012
@@ -1,8 +1,7 @@
 <?php
-
 /**
  * @file
- * Allows administrators to associate custom fields to fieldable types.
+ * Allows administrators to attach custom fields to fieldable types.
  */
 
 /**
@@ -213,6 +212,11 @@
  *   The position of $bundle_name in $map.
  * @param $map
  *   The translated menu router path argument map.
+ *
+ * @return
+ *   The field instance array.
+ *
+ * @ingroup field
  */
 function field_ui_menu_load($field_name, $entity_type, $bundle_name, $bundle_pos, $map) {
   // Extract the actual bundle name from the translated argument map.
@@ -261,7 +265,8 @@
   // part of _menu_check_access().
   if ($visibility) {
     // Grab the variable 'access arguments' part.
-    $args = array_slice(func_get_args(), 4);
+    $all_args = func_get_args();
+    $args = array_slice($all_args, 4);
     $callback = empty($access_callback) ? 0 : trim($access_callback);
     if (is_numeric($callback)) {
       return (bool) $callback;
@@ -313,7 +318,7 @@
 }
 
 /**
- * Helper function to create the right administration path for a bundle.
+ * Determines the adminstration path for a bundle.
  */
 function _field_ui_bundle_admin_path($entity_type, $bundle_name) {
   $bundles = field_info_bundles($entity_type);
@@ -324,7 +329,7 @@
 }
 
 /**
- * Helper function to identify inactive fields within a bundle.
+ * Identifies inactive fields within a bundle.
  */
 function field_ui_inactive_instances($entity_type, $bundle_name = NULL) {
   if (!empty($bundle_name)) {
@@ -351,7 +356,12 @@
 }
 
 /**
- * Add a button Save and add fields to Create content type form.
+ * Implements hook_form_FORM_ID_alter().
+ *
+ * Adds a button 'Save and add fields' to the 'Create content type' form.
+ *
+ * @see node_type_form()
+ * @see field_ui_form_node_type_form_submit()
  */
 function field_ui_form_node_type_form_alter(&$form, $form_state) {
   // We want to display the button only on add page.
@@ -366,7 +376,9 @@
 }
 
 /**
- * Redirect to manage fields form.
+ * Form submission handler for the 'Save and add fields' button.
+ *
+ * @see field_ui_form_node_type_form_alter()
  */
 function field_ui_form_node_type_form_submit($form, &$form_state) {
   if ($form_state['triggering_element']['#parents'][0] === 'save_continue') {

Modified: branches/upstream/current-7/modules/field_ui/field_ui.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field_ui/field_ui.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.test (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.test Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
  */
 
 /**
- * Helper class for Field UI test classes.
+ * Provides common functionality for the Field UI test classes.
  */
 class FieldUITestCase extends DrupalWebTestCase {
 
@@ -34,10 +34,10 @@
   }
 
   /**
-   * Create a new field through the Field UI.
+   * Creates a new field through the Field UI.
    *
    * @param $bundle_path
-   *   Path of the 'Manage fields' page for the bundle.
+   *   Admin path of the bundle that the new field is to be attached to.
    * @param $initial_edit
    *   $edit parameter for drupalPost() on the first step ('Manage fields'
    *   screen).
@@ -74,10 +74,10 @@
   }
 
   /**
-   * Add an existing field through the Field UI.
+   * Adds an existing field through the Field UI.
    *
    * @param $bundle_path
-   *   Path of the 'Manage fields' page for the bundle.
+   *   Admin path of the bundle that the field is to be attached to.
    * @param $initial_edit
    *   $edit parameter for drupalPost() on the first step ('Manage fields'
    *   screen).
@@ -105,10 +105,10 @@
   }
 
   /**
-   * Delete a field instance through the Field UI.
+   * Deletes a field instance through the Field UI.
    *
    * @param $bundle_path
-   *   Path of the 'Manage fields' page for the bundle.
+   *   Admin path of the bundle that the field instance is to be deleted from.
    * @param $field_name
    *   The name of the field.
    * @param $label
@@ -131,7 +131,7 @@
 }
 
 /**
- * Field UI tests for the 'Manage fields' screen.
+ * Tests the functionality of the 'Manage fields' screen.
  */
 class FieldUIManageFieldsTestCase extends FieldUITestCase {
   public static function getInfo() {
@@ -152,7 +152,7 @@
   }
 
   /**
-   * Main entry point for the field CRUD tests.
+   * Runs the field CRUD tests.
    *
    * In order to act on the same fields, and not create the fields over and over
    * again the following tests create, update and delete the same fields.
@@ -165,7 +165,7 @@
   }
 
   /**
-   * Test the manage fields page.
+   * Tests the manage fields page.
    */
   function manageFieldsPage() {
     $this->drupalGet('admin/structure/types/manage/' . $this->hyphen_type . '/fields');
@@ -190,7 +190,7 @@
   }
 
   /**
-   * Test adding a new field.
+   * Tests adding a new field.
    *
    * @todo Assert properties can bet set in the form and read back in $field and
    * $instances.
@@ -212,7 +212,7 @@
   }
 
   /**
-   * Test editing an existing field.
+   * Tests editing an existing field.
    */
   function updateField() {
     // Go to the field edit page.
@@ -235,7 +235,7 @@
   }
 
   /**
-   * Test adding an existing field in another content type.
+   * Tests adding an existing field in another content type.
    */
   function addExistingField() {
     // Check "Add existing field" appears.
@@ -256,7 +256,7 @@
   }
 
   /**
-   * Assert the field settings.
+   * Asserts field settings are as expected.
    *
    * @param $bundle
    *   The bundle name for the instance.
@@ -378,7 +378,7 @@
   }
 
   /**
-   * Test that Field UI respects the 'no_ui' option in hook_field_info().
+   * Tests that Field UI respects the 'no_ui' option in hook_field_info().
    */
   function testHiddenFields() {
     $bundle_path = 'admin/structure/types/manage/' . $this->hyphen_type . '/fields/';
@@ -429,7 +429,7 @@
 }
 
 /**
- * Field UI tests for the 'Manage display' screens.
+ * Tests the functionality of the 'Manage display' screens.
  */
 class FieldUIManageDisplayTestCase extends FieldUITestCase {
   public static function getInfo() {
@@ -445,7 +445,7 @@
   }
 
   /**
-   * Test formatter formatter settings.
+   * Tests formatter settings.
    */
   function testFormatterUI() {
     $manage_fields = 'admin/structure/types/manage/' . $this->hyphen_type;
@@ -493,7 +493,7 @@
   }
 
   /**
-   * Test switching view modes to use custom or 'default' settings'.
+   * Tests switching view modes to use custom or 'default' settings'.
    */
   function testViewModeCustom() {
     // Create a field, and a node with some data for the field.
@@ -565,7 +565,7 @@
   }
 
   /**
-   * Pass if the text is found in the rendered node in a given view mode.
+   * Asserts that a string is found in the rendered node in a view mode.
    *
    * @param $node
    *   The node.
@@ -584,7 +584,7 @@
   }
 
   /**
-   * Pass if the text is node found in the rendered node in a given view mode.
+   * Asserts that a string is not found in the rendered node in a view mode.
    *
    * @param $node
    *   The node.
@@ -602,7 +602,10 @@
   }
 
   /**
-   * Helper for assertNodeViewText and assertNodeViewNoText.
+   * Asserts that a string is (not) found in the rendered nodein a view mode.
+   *
+   * This helper function is used by assertNodeViewText() and
+   * assertNodeViewNoText().
    *
    * @param $node
    *   The node.
@@ -643,3 +646,87 @@
     return $return;
   }
 }
+
+/**
+ * Tests custom widget hooks and callbacks on the field administration pages.
+ */
+class FieldUIAlterTestCase extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Widget customization',
+      'description' => 'Test custom field widget hooks and callbacks on field administration pages.',
+      'group' => 'Field UI',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('field_test'));
+
+    // Create test user.
+    $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer users'));
+    $this->drupalLogin($admin_user);
+  }
+
+  /**
+   * Tests hook_field_widget_properties_alter() on the default field widget.
+   *
+   * @see field_test_field_widget_properties_alter()
+   * @see field_test_field_widget_properties_user_alter()
+   * @see field_test_field_widget_form_alter()
+   */
+  function testDefaultWidgetPropertiesAlter() {
+    // Create the alter_test_text field and an instance on article nodes.
+    field_create_field(array(
+      'field_name' => 'alter_test_text',
+      'type' => 'text',
+    ));
+    field_create_instance(array(
+      'field_name' => 'alter_test_text',
+      'entity_type' => 'node',
+      'bundle' => 'article',
+      'widget' => array(
+        'type' => 'text_textfield',
+        'size' => 60,
+      ),
+    ));
+
+    // Test that field_test_field_widget_properties_alter() sets the size to
+    // 42 and that field_test_field_widget_form_alter() reports the correct
+    // size when the form is displayed.
+    $this->drupalGet('admin/structure/types/manage/article/fields/alter_test_text');
+    $this->assertText('Field size: 42', 'Altered field size is found in hook_field_widget_form_alter().');
+
+    // Create the alter_test_options field.
+    field_create_field(array(
+      'field_name' => 'alter_test_options',
+      'type' => 'list_text'
+    ));
+    // Create instances on users and page nodes.
+    field_create_instance(array(
+      'field_name' => 'alter_test_options',
+      'entity_type' => 'user',
+      'bundle' => 'user',
+      'widget' => array(
+        'type' => 'options_select',
+      )
+    ));
+    field_create_instance(array(
+      'field_name' => 'alter_test_options',
+      'entity_type' => 'node',
+      'bundle' => 'page',
+      'widget' => array(
+        'type' => 'options_select',
+      )
+    ));
+
+    // Test that field_test_field_widget_properties_user_alter() replaces
+    // the widget and that field_test_field_widget_form_alter() reports the
+    // correct widget name when the form is displayed.
+    $this->drupalGet('admin/config/people/accounts/fields/alter_test_options');
+    $this->assertText('Widget type: options_buttons', 'Widget type is altered for users in hook_field_widget_form_alter().');
+
+    // Test that the widget is not altered on page nodes.
+    $this->drupalGet('admin/structure/types/manage/page/fields/alter_test_options');
+    $this->assertText('Widget type: options_select', 'Widget type is not altered for pages in hook_field_widget_form_alter().');
+  }
+}

Modified: branches/upstream/current-7/modules/file/file.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/file.api.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/file.api.php (original)
+++ branches/upstream/current-7/modules/file/file.api.php Sun Feb  5 17:53:08 2012
@@ -55,8 +55,8 @@
  * @return
  *   An array of grants, keyed by module name, each with a Boolean grant value.
  *   Return an empty array to assert FALSE. You may choose to return your own
- *   module's value in addition to other grants or to overwrite the values set by
- *   other modules.
+ *   module's value in addition to other grants or to overwrite the values set
+ *   by other modules.
  */
 function hook_file_download_access_alter(&$grants, $file_item, $entity_type, $entity) {
   // For our example module, we always enforce the rules set by node module.

Modified: branches/upstream/current-7/modules/file/file.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/file.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/file.css (original)
+++ branches/upstream/current-7/modules/file/file.css Sun Feb  5 17:53:08 2012
@@ -1,3 +1,7 @@
+/**
+ * @file
+ * Admin stylesheet for file module.
+ */
 
 /**
  * Managed file element styles.
@@ -19,10 +23,6 @@
   padding: 1px 5px 2px 5px;
 }
 
-.form-managed-file div.ajax-progress div {
-  display: inline;
-}
-
 .form-managed-file div.ajax-progress-bar {
   display: none;
   margin-top: 4px;

Modified: branches/upstream/current-7/modules/file/file.field.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/file.field.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/file.field.inc (original)
+++ branches/upstream/current-7/modules/file/file.field.inc Sun Feb  5 17:53:08 2012
@@ -312,7 +312,7 @@
 }
 
 /**
- * Decrements a file usage count and attempts to delete it.
+ * Decrements the usage count for a file and attempts to delete it.
  *
  * This function only has an effect if the file being deleted is used only by
  * File module.
@@ -358,12 +358,13 @@
 }
 
 /**
- * Determine whether a file should be displayed when outputting field content.
+ * Determines whether a file should be displayed when outputting field content.
  *
  * @param $item
  *   A field item array.
  * @param $field
  *   A field array.
+ *
  * @return
  *   Boolean TRUE if the file will be displayed, FALSE if the file is hidden.
  */
@@ -463,6 +464,7 @@
     '#upload_validators' => file_field_widget_upload_validators($field, $instance),
     '#value_callback' => 'file_field_widget_value',
     '#process' => array_merge($element_info['#process'], array('file_field_widget_process')),
+    '#progress_indicator' => $instance['widget']['settings']['progress_indicator'],
     // Allows this field to return an array instead of a single value.
     '#extended' => TRUE,
   );
@@ -515,10 +517,11 @@
 }
 
 /**
- * Get the upload validators for a file field.
+ * Retrieves the upload validators for a file field.
  *
  * @param $field
  *   A field array.
+ *
  * @return
  *   An array suitable for passing to file_save_upload() or the file field
  *   element's '#upload_validators' property.
@@ -544,7 +547,7 @@
 }
 
 /**
- * Determine the URI for a file field instance.
+ * Determines the URI for a file field instance.
  *
  * @param $field
  *   A field array.
@@ -552,6 +555,7 @@
  *   A field instance array.
  * @param $data
  *   An array of token objects to pass to token_replace().
+ *
  * @return
  *   A file directory URI with tokens replaced.
  *
@@ -703,10 +707,13 @@
 }
 
 /**
- * Helper function for file_field_widget_process_multiple().
+ * Retrieves the file description from a field field element.
+ *
+ * This helper function is used by file_field_widget_process_multiple().
  *
  * @param $element
  *   The element being processed.
+ *
  * @return
  *   A description of the file suitable for use in the administrative interface.
  */
@@ -724,7 +731,7 @@
 }
 
 /**
- * Submit handler for upload and remove buttons of file_generic fields.
+ * Form submission handler for upload/remove button of file_field_widget_form().
  *
  * This runs in addition to and after file_managed_file_submit().
  *
@@ -969,11 +976,13 @@
       break;
 
     case 'file_table':
-      // Display all values in a single element..
-      $element[0] = array(
-        '#theme' => 'file_formatter_table',
-        '#items' => $items,
-      );
+      if (!empty($items)) {
+        // Display all values in a single element..
+        $element[0] = array(
+          '#theme' => 'file_formatter_table',
+          '#items' => $items,
+        );
+      }
       break;
   }
 

Modified: branches/upstream/current-7/modules/file/file.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/file.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/file.info (original)
+++ branches/upstream/current-7/modules/file/file.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 files[] = tests/file.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/file/file.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/file.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/file.module (original)
+++ branches/upstream/current-7/modules/file/file.module Sun Feb  5 17:53:08 2012
@@ -45,7 +45,6 @@
   );
   $items['file/progress'] = array(
     'page callback' => 'file_ajax_progress',
-    'delivery callback' => 'ajax_deliver',
     'access arguments' => array('access content'),
     'theme callback' => 'ajax_base_page_theme',
     'type' => MENU_CALLBACK,
@@ -57,7 +56,7 @@
 /**
  * Implements hook_element_info().
  *
- * The managed file element may be used independently anywhere in Drupal.
+ * The managed file element may be used anywhere in Drupal.
  */
 function file_element_info() {
   $file_path = drupal_get_path('module', 'file');
@@ -321,7 +320,7 @@
 }
 
 /**
- * Determine the preferred upload progress implementation.
+ * Determines the preferred upload progress implementation.
  *
  * @return
  *   A string indicating which upload progress system is available. Either "apc"
@@ -387,7 +386,9 @@
     '#weight' => -5,
   );
 
-  $ajax_settings['progress']['type'] ? $ajax_settings['progress']['type'] == 'bar' : 'throbber';
+  // Force the progress indicator for the remove button to be either 'none' or
+  // 'throbber', even if the upload button is using something else.
+  $ajax_settings['progress']['type'] = ($element['#progress_indicator'] == 'none') ? 'none' : 'throbber';
   $ajax_settings['progress']['message'] = NULL;
   $ajax_settings['effect'] = 'none';
   $element['remove_button'] = array(
@@ -415,6 +416,9 @@
         '#type' => 'hidden',
         '#value' => $upload_progress_key,
         '#attributes' => array('class' => array('file-progress')),
+        // Uploadprogress extension requires this field to be at the top of the
+        // form.
+        '#weight' => -20,
       );
     }
     elseif ($implementation == 'apc') {
@@ -422,6 +426,9 @@
         '#type' => 'hidden',
         '#value' => $upload_progress_key,
         '#attributes' => array('class' => array('file-progress')),
+        // Uploadprogress extension requires this field to be at the top of the
+        // form.
+        '#weight' => -20,
       );
     }
 
@@ -566,7 +573,9 @@
 }
 
 /**
- * Submit handler for upload and remove buttons of managed_file elements.
+ * Form submission handler for upload / remove buttons of managed_file elements.
+ *
+ * @see file_managed_file_process()
  */
 function file_managed_file_submit($form, &$form_state) {
   // Determine whether it was the upload or the remove button that was clicked,
@@ -607,10 +616,11 @@
 }
 
 /**
- * Given a managed_file element, save any files that have been uploaded into it.
+ * Saves any files that have been uploaded into a managed_file element.
  *
  * @param $element
  *   The FAPI element whose values are being saved.
+ *
  * @return
  *   The file object representing the file that was saved, or FALSE if no file
  *   was saved.
@@ -757,13 +767,14 @@
 }
 
 /**
- * Given a file object, create a URL to a matching icon.
+ * Creates a URL to the icon for a file object.
  *
  * @param $file
  *   A file object.
  * @param $icon_directory
  *   (optional) A path to a directory of icons to be used for files. Defaults to
  *   the value of the "file_icon_directory" variable.
+ *
  * @return
  *   A URL string to the icon, or FALSE if an appropriate icon cannot be found.
  */
@@ -775,13 +786,14 @@
 }
 
 /**
- * Given a file object, create a path to a matching icon.
+ * Creates a path to the icon for a file object.
  *
  * @param $file
  *   A file object.
  * @param $icon_directory
  *   (optional) A path to a directory of icons to be used for files. Defaults to
  *   the value of the "file_icon_directory" variable.
+ *
  * @return
  *   A string to the icon as a local path, or FALSE if an appropriate icon could
  *   not be found.
@@ -827,10 +839,11 @@
 }
 
 /**
- * Determine the generic icon MIME package based on a file's MIME type.
+ * Determines the generic icon MIME package based on a file's MIME type.
  *
  * @param $file
  *   A file object.
+ *
  * @return
  *   The generic icon MIME package expected for this file.
  */
@@ -958,7 +971,7 @@
  */
 
 /**
- * Gets a list of references to a file.
+ * Retrieves a list of references to a file.
  *
  * @param $file
  *   A file object.

Modified: branches/upstream/current-7/modules/file/tests/file.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/tests/file.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/tests/file.test (original)
+++ branches/upstream/current-7/modules/file/tests/file.test Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
  */
 
 /**
- * This class provides methods specifically for testing File's field handling.
+ * Provides methods specifically for testing File module's field handling.
  */
 class FileFieldTestCase extends DrupalWebTestCase {
   protected $admin_user;
@@ -27,7 +27,7 @@
   }
 
   /**
-   * Get a sample file of the specified type.
+   * Retrieves a sample file of the specified type.
    */
   function getTestFile($type_name, $size = NULL) {
     // Get a file to upload.
@@ -40,14 +40,14 @@
   }
 
   /**
-   * Get the fid of the last inserted file.
+   * Retrieves the fid of the last inserted file.
    */
   function getLastFileId() {
     return (int) db_query('SELECT MAX(fid) FROM {file_managed}')->fetchField();
   }
 
   /**
-   * Create a new file field.
+   * Creates a new file field.
    *
    * @param $name
    *   The name of the new field (all lowercase), exclude the "field_" prefix.
@@ -74,7 +74,7 @@
   }
 
   /**
-   * Attach a file field to an entity.
+   * Attaches a file field to an entity.
    *
    * @param $name
    *   The name of the new field (all lowercase), exclude the "field_" prefix.
@@ -108,7 +108,7 @@
   }
 
   /**
-   * Update an existing file field with new settings.
+   * Updates an existing file field with new settings.
    */
   function updateFileField($name, $type_name, $instance_settings = array(), $widget_settings = array()) {
     $instance = field_info_instance('node', $name, $type_name);
@@ -119,7 +119,7 @@
   }
 
   /**
-   * Upload a file to a node.
+   * Uploads a file to a node.
    */
   function uploadNodeFile($file, $field_name, $nid_or_type, $new_revision = TRUE, $extras = array()) {
     $langcode = LANGUAGE_NONE;
@@ -150,7 +150,7 @@
   }
 
   /**
-   * Remove a file from a node.
+   * Removes a file from a node.
    *
    * Note that if replacing a file, it must first be removed then added again.
    */
@@ -164,7 +164,7 @@
   }
 
   /**
-   * Replace a file within a node.
+   * Replaces a file within a node.
    */
   function replaceNodeFile($file, $field_name, $nid, $new_revision = TRUE) {
     $edit = array(
@@ -177,7 +177,7 @@
   }
 
   /**
-   * Assert that a file exists physically on disk.
+   * Asserts that a file exists physically on disk.
    */
   function assertFileExists($file, $message = NULL) {
     $message = isset($message) ? $message : t('File %file exists on the disk.', array('%file' => $file->uri));
@@ -185,7 +185,7 @@
   }
 
   /**
-   * Assert that a file exists in the database.
+   * Asserts that a file exists in the database.
    */
   function assertFileEntryExists($file, $message = NULL) {
     entity_get_controller('file')->resetCache();
@@ -195,7 +195,7 @@
   }
 
   /**
-   * Assert that a file does not exist on disk.
+   * Asserts that a file does not exist on disk.
    */
   function assertFileNotExists($file, $message = NULL) {
     $message = isset($message) ? $message : t('File %file exists on the disk.', array('%file' => $file->uri));
@@ -203,7 +203,7 @@
   }
 
   /**
-   * Assert that a file does not exist in the database.
+   * Asserts that a file does not exist in the database.
    */
   function assertFileEntryNotExists($file, $message) {
     entity_get_controller('file')->resetCache();
@@ -212,7 +212,7 @@
   }
 
   /**
-   * Assert that a file's status is set to permanent in the database.
+   * Asserts that a file's status is set to permanent in the database.
    */
   function assertFileIsPermanent($file, $message = NULL) {
     $message = isset($message) ? $message : t('File %file is permanent.', array('%file' => $file->uri));
@@ -221,7 +221,7 @@
 }
 
 /**
- * Test class for testing the 'managed_file' element type on its own, not as part of a file field.
+ * Tests the 'managed_file' element type.
  *
  * @todo Create a FileTestCase base class and move FileFieldTestCase methods
  *   that aren't related to fields into it.
@@ -311,7 +311,7 @@
 }
 
 /**
- * Test class to test file field widget, single and multi-valued, with and without Ajax, with public and private files.
+ * Tests file field widget.
  */
 class FileFieldWidgetTestCase extends FileFieldTestCase {
   public static function getInfo() {
@@ -323,7 +323,7 @@
   }
 
   /**
-   * Tests upload and remove buttons, with and without Ajax, for a single-valued File field.
+   * Tests upload and remove buttons for a single-valued File field.
    */
   function testSingleValuedWidget() {
     // Use 'page' instead of 'article', so that the 'article' image field does
@@ -380,7 +380,7 @@
   }
 
   /**
-   * Tests upload and remove buttons, with and without Ajax, for multiple multi-valued File field.
+   * Tests upload and remove buttons for multiple multi-valued File fields.
    */
   function testMultiValuedWidget() {
     // Use 'page' instead of 'article', so that the 'article' image field does
@@ -616,7 +616,7 @@
 }
 
 /**
- * Test class to test file handling with node revisions.
+ * Tests file handling with node revisions.
  */
 class FileFieldRevisionTestCase extends FileFieldTestCase {
   public static function getInfo() {
@@ -628,7 +628,7 @@
   }
 
   /**
-   * Test creating multiple revisions of a node and managing the attached files.
+   * Tests creating multiple revisions of a node and managing attached files.
    *
    * Expected behaviors:
    *  - Adding a new revision will make another entry in the field table, but
@@ -731,7 +731,7 @@
 }
 
 /**
- * Test class to check that formatters are working properly.
+ * Tests that formatters are working properly.
  */
 class FileFieldDisplayTestCase extends FileFieldTestCase {
   public static function getInfo() {
@@ -743,7 +743,7 @@
   }
 
   /**
-   * Test normal formatter display on node display.
+   * Tests normal formatter display on node display.
    */
   function testNodeDisplay() {
     $field_name = strtolower($this->randomName());
@@ -760,6 +760,19 @@
     $field = field_info_field($field_name);
     $instance = field_info_instance('node', $field_name, $type_name);
 
+    // Create a new node *without* the file field set, and check that the field
+    // is not shown for each node display.
+    $node = $this->drupalCreateNode(array('type' => $type_name));
+    $file_formatters = array('file_default', 'file_table', 'file_url_plain', 'hidden');
+    foreach ($file_formatters as $formatter) {
+      $edit = array(
+        "fields[$field_name][type]" => $formatter,
+      );
+      $this->drupalPost("admin/structure/types/manage/$type_name/display", $edit, t('Save'));
+      $this->drupalGet('node/' . $node->nid);
+      $this->assertNoText($field_name, t('Field label is hidden when no file attached for formatter %formatter', array('%formatter' => $formatter)));
+    }
+
     $test_file = $this->getTestFile('text');
 
     // Create a new node with the uploaded file.
@@ -782,7 +795,7 @@
 }
 
 /**
- * Test class to check for various validations.
+ * Tests various validations.
  */
 class FileFieldValidateTestCase extends FileFieldTestCase {
   protected $field;
@@ -797,7 +810,7 @@
   }
 
   /**
-   * Test required property on file fields.
+   * Tests the required property on file fields.
    */
   function testRequired() {
     $type_name = 'article';
@@ -845,7 +858,7 @@
   }
 
   /**
-   * Test the max file size validator.
+   * Tests the max file size validator.
    */
   function testFileMaxSize() {
     $type_name = 'article';
@@ -897,7 +910,7 @@
   }
 
   /**
-   * Test the file extension, do additional checks if mimedetect is installed.
+   * Tests file extension checking.
    */
   function testFileExtension() {
     $type_name = 'article';
@@ -943,7 +956,7 @@
 }
 
 /**
- * Test class to check that files are uploaded to proper locations.
+ * Tests that files are uploaded to proper locations.
  */
 class FileFieldPathTestCase extends FileFieldTestCase {
   public static function getInfo() {
@@ -955,7 +968,7 @@
   }
 
   /**
-   * Test normal formatter display on node display.
+   * Tests the normal formatter display on node display.
    */
   function testUploadPath() {
     $field_name = strtolower($this->randomName());
@@ -1000,7 +1013,7 @@
   }
 
   /**
-   * A loose assertion to check that a file is uploaded to the right location.
+   * Asserts that a file is uploaded to the right location.
    *
    * @param $expected_path
    *   The location where the file is expected to be uploaded. Duplicate file
@@ -1023,7 +1036,7 @@
 }
 
 /**
- * Test file token replacement in strings.
+ * Tests the file token replacement in strings.
  */
 class FileTokenReplaceTestCase extends FileFieldTestCase {
   public static function getInfo() {
@@ -1052,6 +1065,9 @@
     $instance = field_info_instance('node', $field_name, $type_name);
 
     $test_file = $this->getTestFile('text');
+    // Coping a file to test uploads with non-latin filenames.
+    $filename = drupal_dirname($test_file->uri) . '/текстовый файл.txt';
+    $test_file = file_copy($test_file, $filename);
 
     // Create a new node with the uploaded file.
     $nid = $this->uploadNodeFile($test_file, $field_name, $type_name);
@@ -1095,7 +1111,7 @@
 }
 
 /**
- * Test class to test file access on private nodes.
+ * Tests file access on private nodes.
  */
 class FilePrivateTestCase extends FileFieldTestCase {
   public static function getInfo() {
@@ -1113,7 +1129,7 @@
   }
 
   /**
-   * Uploads a file to a private node, then tests that access is allowed and denied when appropriate.
+   * Tests file access for file uploaded to a private node.
    */
   function testPrivateFile() {
     // Use 'page' instead of 'article', so that the 'article' image field does

Modified: branches/upstream/current-7/modules/file/tests/file_module_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/tests/file_module_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/tests/file_module_test.info (original)
+++ branches/upstream/current-7/modules/file/tests/file_module_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/file/tests/file_module_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/tests/file_module_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/tests/file_module_test.module (original)
+++ branches/upstream/current-7/modules/file/tests/file_module_test.module Sun Feb  5 17:53:08 2012
@@ -22,7 +22,10 @@
 }
 
 /**
- * Form builder for testing a 'managed_file' element.
+ * Form constructor for testing a 'managed_file' element.
+ *
+ * @see file_module_test_form_submit()
+ * @ingroup forms
  */
 function file_module_test_form($form, &$form_state, $tree = TRUE, $extended = FALSE, $default_fid = NULL) {
   $form['#tree'] = (bool) $tree;

Modified: branches/upstream/current-7/modules/filter/filter.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/filter/filter.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/filter/filter.info (original)
+++ branches/upstream/current-7/modules/filter/filter.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 configure = admin/config/content/formats
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/forum/forum.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/forum/forum.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/forum/forum.info (original)
+++ branches/upstream/current-7/modules/forum/forum.info Sun Feb  5 17:53:08 2012
@@ -10,7 +10,7 @@
 stylesheets[all][] = forum.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/forum/forum.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/forum/forum.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/forum/forum.module (original)
+++ branches/upstream/current-7/modules/forum/forum.module Sun Feb  5 17:53:08 2012
@@ -553,27 +553,24 @@
       $first_call[$entity->nid] = FALSE;
       db_delete('forum_index')->condition('nid', $entity->nid)->execute();
     }
-    // Only save data to the table if the node is published.
-    if ($entity->status) {
-      $query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp'));
-      foreach ($entity->taxonomy_forums as $language) {
-        foreach ($language as $item) {
-          $query->values(array(
-            'nid' => $entity->nid,
-            'title' => $entity->title,
-            'tid' => $item['tid'],
-            'sticky' => $entity->sticky,
-            'created' => $entity->created,
-            'comment_count' => 0,
-            'last_comment_timestamp' => $entity->created,
-          ));
-        }
-      }
-      $query->execute();
-      // The logic for determining last_comment_count is fairly complex, so
-      // call _forum_update_forum_index() too.
-      _forum_update_forum_index($entity->nid);
-    }
+    $query = db_insert('forum_index')->fields(array('nid', 'title', 'tid', 'sticky', 'created', 'comment_count', 'last_comment_timestamp'));
+    foreach ($entity->taxonomy_forums as $language) {
+      foreach ($language as $item) {
+        $query->values(array(
+          'nid' => $entity->nid,
+          'title' => $entity->title,
+          'tid' => $item['tid'],
+          'sticky' => $entity->sticky,
+          'created' => $entity->created,
+          'comment_count' => 0,
+          'last_comment_timestamp' => $entity->created,
+        ));
+      }
+    }
+    $query->execute();
+    // The logic for determining last_comment_count is fairly complex, so
+    // call _forum_update_forum_index() too.
+    _forum_update_forum_index($entity->nid);
   }
 }
 

Modified: branches/upstream/current-7/modules/help/help.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/help/help.admin.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/help/help.admin.inc (original)
+++ branches/upstream/current-7/modules/help/help.admin.inc Sun Feb  5 17:53:08 2012
@@ -17,6 +17,9 @@
 
 /**
  * Menu callback; prints a page listing general help for a module.
+ *
+ * @param $name
+ *   A module name to display a help page for.
  */
 function help_page($name) {
   $output = '';
@@ -46,6 +49,12 @@
   return $output;
 }
 
+/**
+ * Provides a formatted list of available help topics.
+ *
+ * @return
+ *   A string containing the formatted list.
+ */
 function help_links_as_list() {
   $empty_arg = drupal_help_arg();
   $module_info = system_rebuild_module_data();
@@ -58,7 +67,7 @@
   }
   asort($modules);
 
-  // Output pretty four-column list
+  // Output pretty four-column list.
   $count = count($modules);
   $break = ceil($count / 4);
   $output = '<div class="clearfix"><div class="help-items"><ul>';

Modified: branches/upstream/current-7/modules/help/help.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/help/help.api.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/help/help.api.php (original)
+++ branches/upstream/current-7/modules/help/help.api.php Sun Feb  5 17:53:08 2012
@@ -42,6 +42,7 @@
  *   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.
  */

Modified: branches/upstream/current-7/modules/help/help.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/help/help.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/help/help.info (original)
+++ branches/upstream/current-7/modules/help/help.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 files[] = help.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/help/help.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/help/help.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/help/help.test (original)
+++ branches/upstream/current-7/modules/help/help.test Sun Feb  5 17:53:08 2012
@@ -5,8 +5,18 @@
  * Tests for help.module.
  */
 
+/**
+ * Tests help display and user access for all modules implementing help.
+ */
 class HelpTestCase extends DrupalWebTestCase {
+  /**
+   * The admin user that will be created.
+   */
   protected $big_user;
+
+  /**
+   * The anonymous user that will be created.
+   */
   protected $any_user;
 
   public static function getInfo() {
@@ -17,9 +27,6 @@
     );
   }
 
-  /**
-   * Enable modules and create users with specific permissions.
-   */
   function setUp() {
     parent::setUp('blog', 'poll');
 
@@ -31,7 +38,7 @@
   }
 
   /**
-   * Login users, create dblog events, and test dblog functionality through the admin and user interfaces.
+   * Logs in users, creates dblog events, and tests dblog functionality.
    */
   function testHelp() {
     // Login the admin user.
@@ -60,9 +67,10 @@
   }
 
   /**
-   * Verify the logged in user has the desired access to the various help nodes and the nodes display help.
+   * Verifies the logged in user has access to the various help nodes.
    *
-   * @param integer $response HTTP response code.
+   * @param integer $response
+   *   An HTTP response code.
    */
   protected function verifyHelp($response = 200) {
     foreach ($this->modules as $module => $name) {
@@ -77,9 +85,10 @@
   }
 
   /**
-   * Get list of enabled modules that implement hook_help().
+   * Gets the list of enabled modules that implement hook_help().
    *
-   * @return array Enabled modules.
+   * @return array
+   *   A list of enabled modules.
    */
   protected function getModuleList() {
     $this->modules = array();
@@ -94,9 +103,12 @@
 }
 
 /**
- * Tests module without help to verify it is not listed in help page.
+ * Tests a module without help to verify it is not listed in the help page.
  */
 class NoHelpTestCase extends DrupalWebTestCase {
+  /**
+   * The user who will be created.
+   */
   protected $big_user;
 
   public static function getInfo() {
@@ -114,7 +126,7 @@
   }
 
   /**
-   * Ensure modules not implementing help do not appear on admin/help.
+   * Ensures modules not implementing help do not appear on admin/help.
    */
   function testMainPageNoHelp() {
     $this->drupalLogin($this->big_user);

Modified: branches/upstream/current-7/modules/image/image.effects.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/image/image.effects.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.effects.inc (original)
+++ branches/upstream/current-7/modules/image/image.effects.inc Sun Feb  5 17:53:08 2012
@@ -124,12 +124,10 @@
 function image_scale_effect(&$image, $data) {
   // Set sane default values.
   $data += array(
+    'width' => NULL,
+    'height' => NULL,
     'upscale' => FALSE,
   );
-
-  // Set impossibly large values if the width and height aren't set.
-  $data['width'] = empty($data['width']) ? PHP_INT_MAX : $data['width'];
-  $data['height'] = empty($data['height']) ? PHP_INT_MAX : $data['height'];
 
   if (!image_scale($image, $data['width'], $data['height'], $data['upscale'])) {
     watchdog('image', 'Image scale failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);

Modified: branches/upstream/current-7/modules/image/image.field.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/image/image.field.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.field.inc (original)
+++ branches/upstream/current-7/modules/image/image.field.inc Sun Feb  5 17:53:08 2012
@@ -403,7 +403,8 @@
     '#type' => 'textfield',
     '#default_value' => isset($item['alt']) ? $item['alt'] : '',
     '#description' => t('This text will be used by screen readers, search engines, or when the image cannot be loaded.'),
-    '#maxlength' => variable_get('image_alt_length', 80), // See http://www.gawds.org/show.php?contentid=28.
+    // @see http://www.gawds.org/show.php?contentid=28
+    '#maxlength' => 512,
     '#weight' => -2,
     '#access' => (bool) $item['fid'] && $settings['alt_field'],
   );
@@ -412,7 +413,7 @@
     '#title' => t('Title'),
     '#default_value' => isset($item['title']) ? $item['title'] : '',
     '#description' => t('The title is used as a tool tip when the user hovers the mouse over the image.'),
-    '#maxlength' => variable_get('image_title_length', 500),
+    '#maxlength' => 1024,
     '#weight' => -1,
     '#access' => (bool) $item['fid'] && $settings['title_field'],
   );

Modified: branches/upstream/current-7/modules/image/image.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/image/image.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.info (original)
+++ branches/upstream/current-7/modules/image/image.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 configure = admin/config/media/image-styles
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/image/image.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/image/image.install?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.install (original)
+++ branches/upstream/current-7/modules/image/image.install Sun Feb  5 17:53:08 2012
@@ -121,13 +121,13 @@
       'alt' => array(
         'description' => "Alternative image text, for the image's 'alt' attribute.",
         'type' => 'varchar',
-        'length' => 128,
+        'length' => 512,
         'not null' => FALSE,
       ),
       'title' => array(
         'description' => "Image title text, for the image's 'title' attribute.",
         'type' => 'varchar',
-        'length' => 128,
+        'length' => 1024,
         'not null' => FALSE,
       ),
       'width' => array(
@@ -386,6 +386,51 @@
 }
 
 /**
+ * Remove the variables that set alt and title length since they were not
+ * used for database column size and could cause PDO exceptions.
+ */
+function image_update_7003() {
+  variable_del('image_alt_length');
+  variable_del('image_title_length');
+}
+
+/**
+ * Use a large setting (512 and 1024 characters) for the length of the image alt
+ * and title fields.
+ */
+function image_update_7004() {
+  $alt_spec = array(
+    'type' => 'varchar',
+    'length' => 512,
+    'not null' => FALSE,
+  );
+
+  $title_spec = array(
+    'type' => 'varchar',
+    'length' => 1024,
+    'not null' => FALSE,
+  );
+
+  $fields = _update_7000_field_read_fields(array(
+    'module' => 'image',
+    'storage_type' => 'field_sql_storage',
+  ));
+
+  foreach ($fields as $field_name => $field) {
+    $tables = array(
+      _field_sql_storage_tablename($field),
+      _field_sql_storage_revision_tablename($field),
+    );
+    $alt_column = $field['field_name'] . '_alt';
+    $title_column = $field['field_name'] . '_title';
+    foreach ($tables as $table) {
+      db_change_field($table, $alt_column, $alt_column, $alt_spec);
+      db_change_field($table, $title_column, $title_column, $title_spec);
+    }
+  }
+}
+
+/**
  * Implements hook_requirements() to check the PHP GD Library.
  *
  * @param $phase

Modified: branches/upstream/current-7/modules/image/image.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/image/image.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.test (original)
+++ branches/upstream/current-7/modules/image/image.test Sun Feb  5 17:53:08 2012
@@ -192,7 +192,7 @@
     $this->assertNotIdentical(FALSE, $original_uri, t('Created the generated image file.'));
 
     // Get the URL of a file that has not been generated and try to create it.
-    $generated_uri = $scheme . '://styles/' . $this->style_name . '/' . $scheme . '/'. basename($original_uri);
+    $generated_uri = $scheme . '://styles/' . $this->style_name . '/' . $scheme . '/'. drupal_basename($original_uri);
     $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
     $generate_url = image_style_url($this->style_name, $original_uri);
 
@@ -746,7 +746,10 @@
     $widget_settings = array(
       'preview_image_style' => 'medium',
     );
-    $this->createImageField($field_name, 'article', array(), $instance_settings, $widget_settings);
+    $field = $this->createImageField($field_name, 'article', array(), $instance_settings, $widget_settings);
+    $field['deleted'] = 0;
+    $table = _field_sql_storage_tablename($field);
+    $schema = drupal_get_schema($table, TRUE);
     $instance = field_info_instance('node', $field_name, 'article');
 
     $this->drupalGet('node/add/article');
@@ -786,6 +789,22 @@
     $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save'));
     $default_output = theme('image', $image_info);
     $this->assertRaw($default_output, t('Image displayed using user supplied alt and title attributes.'));
+
+    // Verify that alt/title longer than allowed results in a validation error.
+    $test_size = 2000;
+    $edit = array(
+      $field_name . '[' . LANGUAGE_NONE . '][0][alt]' => $this->randomName($test_size),
+      $field_name . '[' . LANGUAGE_NONE . '][0][title]' => $this->randomName($test_size),
+    );
+    $this->drupalPost('node/' . $nid . '/edit', $edit, t('Save'));
+    $this->assertRaw(t('Alternate text cannot be longer than %max characters but is currently %length characters long.', array(
+      '%max' => $schema['fields'][$field_name .'_alt']['length'],
+      '%length' => $test_size,
+    )));
+    $this->assertRaw(t('Title cannot be longer than %max characters but is currently %length characters long.', array(
+      '%max' => $schema['fields'][$field_name .'_title']['length'],
+      '%length' => $test_size,
+    )));
   }
 
   /**
@@ -940,7 +959,7 @@
 
     // Create a style.
     $style = image_style_save(array('name' => 'test'));
-    $generated_uri = 'public://styles/test/public/'. basename($original_uri);
+    $generated_uri = 'public://styles/test/public/'. drupal_basename($original_uri);
     $url = image_style_url('test', $original_uri);
 
     $variables = array(
@@ -1129,3 +1148,144 @@
     $this->assertEqual($img_tag, '<img typeof="foaf:Image" src="' . $url . '" alt="" />', t('Expected img tag was found.'));
   }
 }
+
+/**
+ * Tests image_dimensions_scale().
+ */
+class ImageDimensionsScaleTestCase extends DrupalUnitTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'image_dimensions_scale()',
+      'description' => 'Tests all control flow branches in image_dimensions_scale().',
+      'group' => 'Image',
+    );
+  }
+
+  /**
+   * Tests all control flow branches in image_dimensions_scale().
+   */
+  function testImageDimensionsScale() {
+    // Define input / output datasets to test different branch conditions.
+    $test = array();
+
+    // Test branch conditions:
+    // - No height.
+    // - Upscale, don't need to upscale.
+    $tests[] = array(
+      'input' => array(
+        'dimensions' => array(
+          'width' => 1000,
+          'height' => 2000,
+        ),
+        'width' => 200,
+        'height' => NULL,
+        'upscale' => TRUE,
+      ),
+      'output' => array(
+        'dimensions' => array(
+          'width' => 200,
+          'height' => 400,
+        ),
+        'return_value' => TRUE,
+      ),
+    );
+
+    // Test branch conditions:
+    // - No width.
+    // - Don't upscale, don't need to upscale.
+    $tests[] = array(
+      'input' => array(
+        'dimensions' => array(
+          'width' => 1000,
+          'height' => 800,
+        ),
+        'width' => NULL,
+        'height' => 140,
+        'upscale' => FALSE,
+      ),
+      'output' => array(
+        'dimensions' => array(
+          'width' => 175,
+          'height' => 140,
+        ),
+        'return_value' => TRUE,
+      ),
+    );
+
+    // Test branch conditions:
+    // - Source aspect ratio greater than target.
+    // - Upscale, need to upscale.
+    $tests[] = array(
+      'input' => array(
+        'dimensions' => array(
+          'width' => 8,
+          'height' => 20,
+        ),
+        'width' => 200,
+        'height' => 140,
+        'upscale' => TRUE,
+      ),
+      'output' => array(
+        'dimensions' => array(
+          'width' => 56,
+          'height' => 140,
+        ),
+        'return_value' => TRUE,
+      ),
+    );
+
+    // Test branch condition: target aspect ratio greater than source.
+    $tests[] = array(
+      'input' => array(
+        'dimensions' => array(
+          'width' => 2000,
+          'height' => 800,
+        ),
+        'width' => 200,
+        'height' => 140,
+        'upscale' => FALSE,
+      ),
+      'output' => array(
+        'dimensions' => array(
+          'width' => 200,
+          'height' => 80,
+        ),
+        'return_value' => TRUE,
+      ),
+    );
+
+    // Test branch condition: don't upscale, need to upscale.
+    $tests[] = array(
+      'input' => array(
+        'dimensions' => array(
+          'width' => 100,
+          'height' => 50,
+        ),
+        'width' => 200,
+        'height' => 140,
+        'upscale' => FALSE,
+      ),
+      'output' => array(
+        'dimensions' => array(
+          'width' => 100,
+          'height' => 50,
+        ),
+        'return_value' => FALSE,
+      ),
+    );
+
+    foreach ($tests as $test) {
+      // Process the test dataset.
+      $return_value = image_dimensions_scale($test['input']['dimensions'], $test['input']['width'], $test['input']['height'], $test['input']['upscale']);
+
+      // Check the width.
+      $this->assertEqual($test['output']['dimensions']['width'], $test['input']['dimensions']['width'], t('Computed width (@computed_width) equals expected width (@expected_width)', array('@computed_width' => $test['output']['dimensions']['width'], '@expected_width' => $test['input']['dimensions']['width'])));
+
+      // Check the height.
+      $this->assertEqual($test['output']['dimensions']['height'], $test['input']['dimensions']['height'], t('Computed height (@computed_height) equals expected height (@expected_height)', array('@computed_height' => $test['output']['dimensions']['height'], '@expected_height' => $test['input']['dimensions']['height'])));
+
+      // Check the return value.
+      $this->assertEqual($test['output']['return_value'], $return_value, t('Correct return value.'));
+    }
+  }
+}

Modified: branches/upstream/current-7/modules/image/tests/image_module_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/image/tests/image_module_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/tests/image_module_test.info (original)
+++ branches/upstream/current-7/modules/image/tests/image_module_test.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/locale/locale.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/locale.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.info (original)
+++ branches/upstream/current-7/modules/locale/locale.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/config/regional/language
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/locale/locale.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/locale.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.module (original)
+++ branches/upstream/current-7/modules/locale/locale.module Sun Feb  5 17:53:08 2012
@@ -630,7 +630,14 @@
  */
 function locale($string = NULL, $context = NULL, $langcode = NULL) {
   global $language;
-  $locale_t = &drupal_static(__FUNCTION__);
+
+  // Use the advanced drupal_static() pattern, since this is called very often.
+  static $drupal_static_fast;
+  if (!isset($drupal_static_fast)) {
+    $drupal_static_fast['locale'] = &drupal_static(__FUNCTION__);
+  }
+  $locale_t = &$drupal_static_fast['locale'];
+
 
   if (!isset($string)) {
     // Return all cached strings if no string was specified
@@ -1000,13 +1007,12 @@
         $negotiation = variable_get("language_negotiation_$type", array());
 
         foreach ($negotiation as $id => $provider) {
-          if (isset($provider['file'])) {
-            require_once DRUPAL_ROOT . '/' . $provider['file'];
-          }
-
-          // Avoid duplicate callback entries.
           if (isset($provider['callbacks']['url_rewrite'])) {
-            $callbacks[$provider['callbacks']['url_rewrite']] = NULL;
+            if (isset($provider['file'])) {
+              require_once DRUPAL_ROOT . '/' . $provider['file'];
+            }
+            // Avoid duplicate callback entries.
+            $callbacks[$provider['callbacks']['url_rewrite']] = TRUE;
           }
         }
       }

Modified: branches/upstream/current-7/modules/locale/locale.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/locale.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.test (original)
+++ branches/upstream/current-7/modules/locale/locale.test Sun Feb  5 17:53:08 2012
@@ -204,43 +204,65 @@
 
     // Get all of the source strings that were found.
     $source_strings = db_select('locales_source', 's')
-      ->fields('s', array('source', 'lid'))
+      ->fields('s', array('source', 'context'))
       ->condition('s.location', $filename)
       ->execute()
       ->fetchAllKeyed();
 
     // List of all strings that should be in the file.
     $test_strings = array(
-      "Standard Call t",
-      "Whitespace Call t",
-
-      "Single Quote t",
-      "Single Quote \\'Escaped\\' t",
-      "Single Quote Concat strings t",
-
-      "Double Quote t",
-      "Double Quote \\\"Escaped\\\" t",
-      "Double Quote Concat strings t",
-
-      "Standard Call plural",
-      "Standard Call @count plural",
-      "Whitespace Call plural",
-      "Whitespace Call @count plural",
-
-      "Single Quote plural",
-      "Single Quote @count plural",
-      "Single Quote \\'Escaped\\' plural",
-      "Single Quote \\'Escaped\\' @count plural",
-
-      "Double Quote plural",
-      "Double Quote @count plural",
-      "Double Quote \\\"Escaped\\\" plural",
-      "Double Quote \\\"Escaped\\\" @count plural",
+      "Standard Call t" => '',
+      "Whitespace Call t" => '',
+
+      "Single Quote t" => '',
+      "Single Quote \\'Escaped\\' t" => '',
+      "Single Quote Concat strings t" => '',
+
+      "Double Quote t" => '',
+      "Double Quote \\\"Escaped\\\" t" => '',
+      "Double Quote Concat strings t" => '',
+
+      "Context !key Args t" => "Context string",
+
+      "Context Unquoted t" => "Context string unquoted",
+      "Context Single Quoted t" => "Context string single quoted",
+      "Context Double Quoted t" => "Context string double quoted",
+
+      "Standard Call plural" => '',
+      "Standard Call @count plural" => '',
+      "Whitespace Call plural" => '',
+      "Whitespace Call @count plural" => '',
+
+      "Single Quote plural" => '',
+      "Single Quote @count plural" => '',
+      "Single Quote \\'Escaped\\' plural" => '',
+      "Single Quote \\'Escaped\\' @count plural" => '',
+
+      "Double Quote plural" => '',
+      "Double Quote @count plural" => '',
+      "Double Quote \\\"Escaped\\\" plural" => '',
+      "Double Quote \\\"Escaped\\\" @count plural" => '',
+
+      "Context !key Args plural" => "Context string",
+      "Context !key Args @count plural" => "Context string",
+
+      "Context Unquoted plural" => "Context string unquoted",
+      "Context Unquoted @count plural" => "Context string unquoted",
+      "Context Single Quoted plural" => "Context string single quoted",
+      "Context Single Quoted @count plural" => "Context string single quoted",
+      "Context Double Quoted plural" => "Context string double quoted",
+      "Context Double Quoted @count plural" => "Context string double quoted",
     );
 
     // Assert that all strings were found properly.
-    foreach ($test_strings as $str) {
-      $this->assertTrue(isset($source_strings[$str]), t("Found source string: %source", array('%source' => $str)));
+    foreach ($test_strings as $str => $context) {
+      $args = array('%source' => $str, '%context' => $context);
+
+      // Make sure that the string was found in the file.
+      $this->assertTrue(isset($source_strings[$str]), t("Found source string: %source", $args));
+
+      // Make sure that the proper context was matched.
+      $this->assertTrue(isset($source_strings[$str]) && $source_strings[$str] === $context, strlen($context) > 0 ? t("Context for %source is %context", $args) : t("Context for %source is blank", $args));
     }
 
     $this->assertEqual(count($source_strings), count($test_strings), t("Found correct number of source strings."));
@@ -1856,6 +1878,34 @@
 
   function setUp() {
     parent::setUp('locale');
+  }
+
+  /**
+   * Verifies that machine name fields are always LTR.
+   */
+  function testMachineNameLTR() {
+    // User to add and remove language.
+    $admin_user = $this->drupalCreateUser(array('administer languages', 'administer content types', 'access administration pages'));
+
+    // Log in as admin.
+    $this->drupalLogin($admin_user);
+
+    // Verify that the machine name field is LTR for a new content type.
+    $this->drupalGet('admin/structure/types/add');
+    $this->assertFieldByXpath('//input[@name="type" and @dir="ltr"]', NULL, 'The machine name field is LTR when no additional language is configured.');
+
+    // Install the Arabic language (which is RTL) and configure as the default.
+    $edit = array();
+    $edit['langcode'] = 'ar';
+    $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
+
+    $edit = array();
+    $edit['site_default'] = 'ar';
+    $this->drupalPost(NULL, $edit, t('Save configuration'));
+
+    // Verify that the machine name field is still LTR for a new content type.
+    $this->drupalGet('admin/structure/types/add');
+    $this->assertFieldByXpath('//input[@name="type" and @dir="ltr"]', NULL, 'The machine name field is LTR when the default language is RTL.');
   }
 
   /**

Modified: branches/upstream/current-7/modules/locale/tests/locale_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/tests/locale_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/tests/locale_test.info (original)
+++ branches/upstream/current-7/modules/locale/tests/locale_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/locale/tests/locale_test.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/tests/locale_test.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/tests/locale_test.js (original)
+++ branches/upstream/current-7/modules/locale/tests/locale_test.js Sun Feb  5 17:53:08 2012
@@ -16,6 +16,11 @@
 Drupal.t("Double Quote \"Escaped\" t");
 Drupal.t("Double Quote " + "Concat " + "strings " + "t");
 
+Drupal.t("Context Unquoted t", {}, {context: "Context string unquoted"});
+Drupal.t("Context Single Quoted t", {}, {'context': "Context string single quoted"});
+Drupal.t("Context Double Quoted t", {}, {"context": "Context string double quoted"});
+
+Drupal.t("Context !key Args t", {'!key': 'value'}, {context: "Context string"});
 
 Drupal.formatPlural(1, "Standard Call plural", "Standard Call @count plural");
 Drupal
@@ -24,7 +29,7 @@
 (
 1,
 "Whitespace Call plural",
-"Whitespace Call @count plural",
+"Whitespace Call @count plural"
 )
 ;
 
@@ -33,3 +38,9 @@
 
 Drupal.formatPlural(1, "Double Quote plural", "Double Quote @count plural");
 Drupal.formatPlural(1, "Double Quote \"Escaped\" plural", "Double Quote \"Escaped\" @count plural");
+
+Drupal.formatPlural(1, "Context Unquoted plural", "Context Unquoted @count plural", {}, {context: "Context string unquoted"});
+Drupal.formatPlural(1, "Context Single Quoted plural", "Context Single Quoted @count plural", {}, {'context': "Context string single quoted"});
+Drupal.formatPlural(1, "Context Double Quoted plural", "Context Double Quoted @count plural", {}, {"context": "Context string double quoted"});
+
+Drupal.formatPlural(1, "Context !key Args plural", "Context !key Args @count plural", {'!key': 'value'}, {context: "Context string"});

Modified: branches/upstream/current-7/modules/menu/menu.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/menu/menu.admin.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.admin.inc (original)
+++ branches/upstream/current-7/modules/menu/menu.admin.inc Sun Feb  5 17:53:08 2012
@@ -679,7 +679,7 @@
     '#empty_option' => t('No Secondary links'),
     '#options' => $menu_options,
     '#tree' => FALSE,
-    '#description' => t('Select the source for the Secondary links. An advanced option allows you to use the same source for both Main links (currently %main) and Secondary links: if your source menu has two levels of hierarchy, the top level menu links will appear in the Main links, and the children of the active link will appear in the Secondary links.', array('%main' => $main ? $menu_options[$main] : 'none')),
+    '#description' => t('Select the source for the Secondary links. An advanced option allows you to use the same source for both Main links (currently %main) and Secondary links: if your source menu has two levels of hierarchy, the top level menu links will appear in the Main links, and the children of the active link will appear in the Secondary links.', array('%main' => $main ? $menu_options[$main] : t('none'))),
   );
 
   return system_settings_form($form);

Modified: branches/upstream/current-7/modules/menu/menu.admin.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/menu/menu.admin.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.admin.js (original)
+++ branches/upstream/current-7/modules/menu/menu.admin.js Sun Feb  5 17:53:08 2012
@@ -1,47 +1,46 @@
-
 (function ($) {
 
-  Drupal.behaviors.menuChangeParentItems = {
-    attach: function (context, settings) {
-      $('fieldset#edit-menu input').each(function () {
-        $(this).change(function () {
-          // Update list of available parent menu items.
-          Drupal.menu_update_parent_list();
-        });
+Drupal.behaviors.menuChangeParentItems = {
+  attach: function (context, settings) {
+    $('fieldset#edit-menu input').each(function () {
+      $(this).change(function () {
+        // Update list of available parent menu items.
+        Drupal.menu_update_parent_list();
+      });
+    });
+  }
+};
+
+/**
+ * Function to set the options of the menu parent item dropdown.
+ */
+Drupal.menu_update_parent_list = function () {
+  var values = [];
+
+  $('input:checked', $('fieldset#edit-menu')).each(function () {
+    // Get the names of all checked menus.
+    values.push(Drupal.checkPlain($.trim($(this).val())));
+  });
+
+  var url = Drupal.settings.basePath + 'admin/structure/menu/parents';
+  $.ajax({
+    url: location.protocol + '//' + location.host + url,
+    type: 'POST',
+    data: {'menus[]' : values},
+    dataType: 'json',
+    success: function (options) {
+      // Save key of last selected element.
+      var selected = $('fieldset#edit-menu #edit-menu-parent :selected').val();
+      // Remove all exisiting options from dropdown.
+      $('fieldset#edit-menu #edit-menu-parent').children().remove();
+      // Add new options to dropdown.
+      jQuery.each(options, function(index, value) {
+        $('fieldset#edit-menu #edit-menu-parent').append(
+          $('<option ' + (index == selected ? ' selected="selected"' : '') + '></option>').val(index).text(value)
+        );
       });
     }
-  }
-
-  /**
-   * Function to set the options of the menu parent item dropdown.
-   */
-  Drupal.menu_update_parent_list = function () {
-    var values = [];
-
-    $('input:checked', $('fieldset#edit-menu')).each(function () {
-      // Get the names of all checked menus.
-      values.push(Drupal.checkPlain($.trim($(this).val())));
-    });
-
-    var url = Drupal.settings.basePath + 'admin/structure/menu/parents';
-    $.ajax({
-      url: location.protocol + '//' + location.host + url,
-      type: 'POST',
-      data: {'menus[]' : values},
-      dataType: 'json',
-      success: function (options) {
-        // Save key of last selected element.
-        var selected = $('fieldset#edit-menu #edit-menu-parent :selected').val();
-        // Remove all exisiting options from dropdown.
-        $('fieldset#edit-menu #edit-menu-parent').children().remove();
-        // Add new options to dropdown.
-        jQuery.each(options, function(index, value) {
-          $('fieldset#edit-menu #edit-menu-parent').append(
-            $('<option ' + (index == selected ? ' selected="selected"' : '') + '></option>').val(index).text(value)
-          );
-        });
-      }
-    });
-  }
+  });
+};
 
 })(jQuery);

Modified: branches/upstream/current-7/modules/menu/menu.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/menu/menu.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.info (original)
+++ branches/upstream/current-7/modules/menu/menu.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/structure/menu
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/menu/menu.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/menu/menu.install?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.install (original)
+++ branches/upstream/current-7/modules/menu/menu.install Sun Feb  5 17:53:08 2012
@@ -183,6 +183,28 @@
   }
 }
 /**
+ * Add missing custom menus to active menus list.
+ */
+function menu_update_7003(&$sandbox) {
+  // Make sure all custom menus are present in the active menus variable so that
+  // their items may appear in the active trail.
+  // @see menu_set_active_menu_names()
+  $active_menus = variable_get('menu_default_active_menus', array_keys(menu_list_system_menus()));
+  $update_variable = FALSE;
+  foreach (menu_get_names() as $menu_name) {
+    if (!in_array($menu_name, $active_menus) && (strpos($menu_name, 'menu-') === 0)) {
+      $active_menus[] = $menu_name;
+      $update_variable = TRUE;
+    }
+  }
+  if ($update_variable) {
+    variable_set('menu_default_active_menus', $active_menus);
+  }
+  // Clear the menu cache.
+  cache_clear_all(NULL, 'cache_menu');
+}
+
+/**
  * @} End of "defgroup updates-7.x-extra"
  * The next series of updates should start at 8000.
  */

Modified: branches/upstream/current-7/modules/menu/menu.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/menu/menu.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.js (original)
+++ branches/upstream/current-7/modules/menu/menu.js Sun Feb  5 17:53:08 2012
@@ -1,4 +1,3 @@
-
 (function ($) {
 
 Drupal.behaviors.menuFieldsetSummaries = {

Modified: branches/upstream/current-7/modules/menu/menu.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/menu/menu.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.module (original)
+++ branches/upstream/current-7/modules/menu/menu.module Sun Feb  5 17:53:08 2012
@@ -268,6 +268,15 @@
 
   switch ($status) {
     case SAVED_NEW:
+      // Make sure the menu is present in the active menus variable so that its
+      // items may appear in the menu active trail.
+      // @see menu_set_active_menu_names()
+      $active_menus = variable_get('menu_default_active_menus', array_keys(menu_get_menus()));
+      if (!in_array($menu['menu_name'], $active_menus)) {
+        $active_menus[] = $menu['menu_name'];
+        variable_set('menu_default_active_menus', $active_menus);
+      }
+
       module_invoke_all('menu_insert', $menu);
       break;
 
@@ -304,6 +313,15 @@
 function menu_delete($menu) {
   // Delete all links from the menu.
   menu_delete_links($menu['menu_name']);
+
+  // Remove menu from active menus variable.
+  $active_menus = variable_get('menu_default_active_menus', array_keys(menu_get_menus()));
+  foreach ($active_menus as $i => $menu_name) {
+    if ($menu['menu_name'] == $menu_name) {
+      unset($active_menus[$i]);
+      variable_set('menu_default_active_menus', $active_menus);
+    }
+  }
 
   // Delete the custom menu.
   db_delete('menu_custom')
@@ -614,7 +632,7 @@
   // menu_parent_options() is goofy and can actually handle either a menu link
   // or a node type both as second argument. Pick based on whether there is
   // a link already (menu_node_prepare() sets mlid default to 0).
-  $options = menu_parent_options(menu_get_menus(), $link['mlid'] ? $link : $type);
+  $options = menu_parent_options(menu_get_menus(), $link['mlid'] ? $link : $type, $type);
   // If no possible parent menu items were found, there is nothing to display.
   if (empty($options)) {
     return;

Modified: branches/upstream/current-7/modules/menu/menu.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/menu/menu.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.test (original)
+++ branches/upstream/current-7/modules/menu/menu.test Sun Feb  5 17:53:08 2012
@@ -205,7 +205,7 @@
 
     // Add menu links.
     $item1 = $this->addMenuLink(0, 'node/' . $node1->nid, $menu_name);
-    $item2 = $this->addMenuLink($item1['mlid'], 'node/' . $node2->nid, $menu_name);
+    $item2 = $this->addMenuLink($item1['mlid'], 'node/' . $node2->nid, $menu_name, FALSE);
     $item3 = $this->addMenuLink($item2['mlid'], 'node/' . $node3->nid, $menu_name);
     $this->assertMenuLink($item1['mlid'], array('depth' => 1, 'has_children' => 1, 'p1' => $item1['mlid'], 'p2' => 0));
     $this->assertMenuLink($item2['mlid'], array('depth' => 2, 'has_children' => 1, 'p1' => $item1['mlid'], 'p2' => $item2['mlid'], 'p3' => 0));
@@ -283,7 +283,7 @@
    * @param string $menu_name Menu name.
    * @return array Menu link created.
    */
-  function addMenuLink($plid = 0, $link = '<front>', $menu_name = 'navigation') {
+  function addMenuLink($plid = 0, $link = '<front>', $menu_name = 'navigation', $expanded = TRUE) {
     // View add menu link page.
     $this->drupalGet("admin/structure/menu/manage/$menu_name/add");
     $this->assertResponse(200);
@@ -294,7 +294,7 @@
       'link_title' => $title,
       'description' => '',
       'enabled' => TRUE, // Use this to disable the menu and test.
-      'expanded' => TRUE, // Setting this to true should test whether it works when we do the std_user tests.
+      'expanded' => $expanded, // Setting this to true should test whether it works when we do the std_user tests.
       'parent' =>  $menu_name . ':' . $plid,
       'weight' => '0',
     );
@@ -345,7 +345,7 @@
     if (isset($parent)) {
       // Verify menu link.
       $title = $parent['link_title'];
-      $this->assertText($title, 'Parent menu link was displayed');
+      $this->assertLink($title, 0, 'Parent menu link was displayed');
 
       // Verify menu link link.
       $this->clickLink($title);
@@ -355,7 +355,7 @@
 
     // Verify menu link.
     $title = $item['link_title'];
-    $this->assertText($title, 'Menu link was displayed');
+    $this->assertLink($title, 0, 'Menu link was displayed');
 
     // Verify menu link link.
     $this->clickLink($title);
@@ -698,6 +698,8 @@
     // Assert that it is not possible to set the parent of the first node to itself or the second node.
     $this->assertNoOption('edit-menu-parent', 'navigation:'. $item['mlid']);
     $this->assertNoOption('edit-menu-parent', 'navigation:'. $child_item['mlid']);
+    // Assert that unallowed Management menu is not available in options.
+    $this->assertNoOption('edit-menu-parent', 'management:0');
   }
 
   /**

Modified: branches/upstream/current-7/modules/node/node.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/node.api.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.api.php (original)
+++ branches/upstream/current-7/modules/node/node.api.php Sun Feb  5 17:53:08 2012
@@ -570,8 +570,12 @@
  * block access, return NODE_ACCESS_IGNORE or simply return nothing.
  * Blindly returning FALSE will break other node access modules.
  *
- * @param $node
- *   Either a node object or a (machine-readable) content type on which to
+ * Also note that this function isn't called for node listings (e.g., RSS feeds,
+ * the default home page at path 'node', a recent content block, etc.) See
+ * @link node_access Node access rights @endlink for a full explanation.
+ *
+ * @param $node
+ *   Either a node object or the machine name of the content type on which to
  *   perform the access check.
  * @param $op
  *   The operation to be performed. Possible values:
@@ -583,9 +587,9 @@
  *   The user object to perform the access check operation on.
  *
  * @return
- *   NODE_ACCESS_ALLOW if the operation is to be allowed;
- *   NODE_ACCESS_DENY if the operation is to be denied;
- *   NODE_ACCESS_IGNORE to not affect this operation at all.
+ *   - NODE_ACCESS_ALLOW: if the operation is to be allowed.
+ *   - NODE_ACCESS_DENY: if the operation is to be denied.
+ *   - NODE_ACCESS_IGNORE: to not affect this operation at all.
  *
  * @ingroup node_access
  */
@@ -972,6 +976,7 @@
  *   The node type object that is being created.
  */
 function hook_node_type_insert($info) {
+  drupal_set_message(t('You have just created a content type with a machine name %type.', array('%type' => $info->type)));
 }
 
 /**
@@ -1229,9 +1234,12 @@
 /**
  * Display a node.
  *
- * This is a hook used by node modules. It allows a module to define a
- * custom method of displaying its nodes, usually by displaying extra
- * information particular to that node type.
+ * This hook is invoked only on the module that defines the node's content type
+ * (use hook_node_view() to act on all node views).
+ *
+ * This hook is invoked during node viewing after the node is fully loaded,
+ * so that the node type module can define a custom method for display, or
+ * add to the default display.
  *
  * @param $node
  *   The node to be displayed, as returned by node_load().
@@ -1249,8 +1257,6 @@
  *   view of the node, you might consider implementing one of these hooks
  *   instead.
  *
- * For a detailed usage example, see node_example.module.
- *
  * @ingroup node_api_hooks
  */
 function hook_view($node, $view_mode) {

Modified: branches/upstream/current-7/modules/node/node.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/node.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.info (original)
+++ branches/upstream/current-7/modules/node/node.info Sun Feb  5 17:53:08 2012
@@ -10,7 +10,7 @@
 stylesheets[all][] = node.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/node/node.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/node.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.module (original)
+++ branches/upstream/current-7/modules/node/node.module Sun Feb  5 17:53:08 2012
@@ -919,7 +919,7 @@
  *   Whether to reset the node_load_multiple cache.
  *
  * @return
- *   A fully-populated node object.
+ *   A fully-populated node object, or FALSE if the node is not found.
  */
 function node_load($nid = NULL, $vid = NULL, $reset = FALSE) {
   $nids = (isset($nid) ? array($nid) : array());
@@ -1396,7 +1396,7 @@
  * @param $message
  *   A flag which sets a page title relevant to the revision being viewed.
  * @return
- *   A $page element suitable for use by drupal_page_render().
+ *   A $page element suitable for use by drupal_render().
  */
 function node_show($node, $message = FALSE) {
   if ($message) {
@@ -2790,13 +2790,14 @@
  * that this table is a list of grants; any matching row is sufficient to
  * grant access to the node.
  *
- * In node listings, the process above is followed except that
- * hook_node_access() is not called on each node for performance reasons and for
- * proper functioning of the pager system. When adding a node listing to your
- * module, be sure to use a dynamic query created by db_select() and add a tag
- * of "node_access". This will allow modules dealing with node access to ensure
- * only nodes to which the user has access are retrieved, through the use of
- * hook_query_TAG_alter().
+ * In node listings (lists of nodes generated from a select query, such as the
+ * default home page at path 'node', an RSS feed, a recent content block, etc.),
+ * the process above is followed except that hook_node_access() is not called on
+ * each node for performance reasons and for proper functioning of the pager
+ * system. When adding a node listing to your module, be sure to use a dynamic
+ * query created by db_select() and add a tag of "node_access". This will allow
+ * modules dealing with node access to ensure only nodes to which the user has
+ * access are retrieved, through the use of hook_query_TAG_alter().
  *
  * Note: Even a single module returning NODE_ACCESS_DENY from hook_node_access()
  * will block access to the node. Therefore, implementers should take care to
@@ -2961,7 +2962,6 @@
  */
 function node_list_permissions($type) {
   $info = node_type_get_type($type);
-  $type = check_plain($info->type);
 
   // Build standard list of node permissions for this type.
   $perms = array(

Modified: branches/upstream/current-7/modules/node/node.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/node.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.test (original)
+++ branches/upstream/current-7/modules/node/node.test Sun Feb  5 17:53:08 2012
@@ -1088,7 +1088,15 @@
     $this->assertTaxonomyPage(TRUE);
   }
 
-  protected function assertTaxonomyPage($super) {
+  /**
+   * Checks taxonomy/term listings to ensure only accessible nodes are listed.
+   *
+   * @param $is_admin
+   *   A boolean indicating whether the current user is an administrator. If
+   *   TRUE, all nodes should be listed. If FALSE, only public nodes and the
+   *   user's own private nodes should be listed.
+   */
+  protected function assertTaxonomyPage($is_admin) {
     foreach (array($this->publicTid, $this->privateTid) as $tid_is_private => $tid) {
       $this->drupalGet("taxonomy/term/$tid");
       $this->nids_visible = array();
@@ -1101,8 +1109,9 @@
           // Private nodes should be visible on the private term page,
           // public nodes should be visible on the public term page.
           $should_be_visible = $tid_is_private == $is_private;
-          // Non-superusers on the private page can only see their own nodes.
-          if (!$super && $tid_is_private) {
+          // Non-administrators can only see their own nodes on the private
+          // term page.
+          if (!$is_admin && $tid_is_private) {
             $should_be_visible = $should_be_visible && $uid == $this->webUser->uid;
           }
           $this->assertIdentical(isset($this->nids_visible[$nid]), $should_be_visible, strtr('A %private node by user %uid is %visible for user %current_uid on the %tid_is_private page.', array(

Modified: branches/upstream/current-7/modules/node/tests/node_access_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/tests/node_access_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/tests/node_access_test.info (original)
+++ branches/upstream/current-7/modules/node/tests/node_access_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/node/tests/node_access_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/tests/node_access_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/tests/node_access_test.module (original)
+++ branches/upstream/current-7/modules/node/tests/node_access_test.module Sun Feb  5 17:53:08 2012
@@ -159,7 +159,7 @@
 }
 
 /**
- * Implements hook_form_node_form_alter().
+ * Implements hook_form_BASE_FORM_ID_alter().
  */
 function node_access_test_form_node_form_alter(&$form, $form_state) {
   // Only show this checkbox for NodeAccessBaseTableTestCase.

Modified: branches/upstream/current-7/modules/node/tests/node_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/tests/node_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/tests/node_test.info (original)
+++ branches/upstream/current-7/modules/node/tests/node_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/node/tests/node_test_exception.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/tests/node_test_exception.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/tests/node_test_exception.info (original)
+++ branches/upstream/current-7/modules/node/tests/node_test_exception.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/openid/openid.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/openid/openid.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/openid/openid.info (original)
+++ branches/upstream/current-7/modules/openid/openid.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 files[] = openid.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/openid/tests/openid_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/openid/tests/openid_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/openid/tests/openid_test.info (original)
+++ branches/upstream/current-7/modules/openid/tests/openid_test.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/overlay/overlay-child-rtl.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/overlay/overlay-child-rtl.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/overlay/overlay-child-rtl.css (original)
+++ branches/upstream/current-7/modules/overlay/overlay-child-rtl.css Sun Feb  5 17:53:08 2012
@@ -31,5 +31,5 @@
   right: auto;
 }
 #overlay-tabs li {
-  margin: 0 -3px 0 O;
+  margin: 0 -3px 0 0;
 }

Modified: branches/upstream/current-7/modules/overlay/overlay-parent.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/overlay/overlay-parent.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/overlay/overlay-parent.js (original)
+++ branches/upstream/current-7/modules/overlay/overlay-parent.js Sun Feb  5 17:53:08 2012
@@ -334,7 +334,7 @@
   $placeholder.one('blur', function () {
     $(this).remove();
   });
-}
+};
 
 /**
  * Check if the given link is in the administrative section of the site.
@@ -961,7 +961,7 @@
   var $element = $(this);
   var tabindex = $(this).attr('tabindex');
   $element.data('drupalOverlayOriginalTabIndex', tabindex);
-}
+};
 
 /**
  * Restore an element's original tabindex.

Modified: branches/upstream/current-7/modules/overlay/overlay.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/overlay/overlay.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/overlay/overlay.info (original)
+++ branches/upstream/current-7/modules/overlay/overlay.info Sun Feb  5 17:53:08 2012
@@ -5,7 +5,7 @@
 core = 7.x
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/overlay/overlay.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/overlay/overlay.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/overlay/overlay.module (original)
+++ branches/upstream/current-7/modules/overlay/overlay.module Sun Feb  5 17:53:08 2012
@@ -146,7 +146,7 @@
       // If this page shouldn't be rendered inside the overlay, redirect to the
       // parent.
       elseif (!path_is_admin($current_path)) {
-        overlay_close_dialog($current_path);
+        overlay_close_dialog($current_path, array('query' => drupal_get_query_parameters(NULL, array('q', 'render'))));
       }
 
       // Indicate that we are viewing an overlay child page.

Modified: branches/upstream/current-7/modules/path/path.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/path/path.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/path/path.info (original)
+++ branches/upstream/current-7/modules/path/path.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/config/search/path
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/php/php.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/php/php.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/php/php.info (original)
+++ branches/upstream/current-7/modules/php/php.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 files[] = php.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/php/php.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/php/php.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/php/php.module (original)
+++ branches/upstream/current-7/modules/php/php.module Sun Feb  5 17:53:08 2012
@@ -36,23 +36,29 @@
 }
 
 /**
- * Evaluate a string of PHP code.
+ * Evaluates a string of PHP code.
  *
- * This is a wrapper around PHP's eval(). It uses output buffering to capture both
- * returned and printed text. Unlike eval(), we require code to be surrounded by
- * <?php ?> tags; in other words, we evaluate the code as if it were a stand-alone
- * PHP file.
+ * This is a wrapper around PHP's eval(). It uses output buffering to capture
+ * both returned and printed text. Unlike eval(), we require code to be
+ * surrounded by <?php ?> tags; in other words, we evaluate the code as if it
+ * were a stand-alone PHP file.
  *
  * Using this wrapper also ensures that the PHP code which is evaluated can not
  * overwrite any variables in the calling code, unlike a regular eval() call.
  *
+ * This function is also used as an implementation of
+ * hook_filter_FILTER_process().
+ *
  * @param $code
  *   The code to evaluate.
+ *
  * @return
- *   A string containing the printed output of the code, followed by the returned
- *   output of the code.
+ *   A string containing the printed output of the code, followed by the
+ *   returned output of the code.
  *
  * @ingroup php_wrappers
+ *
+ * @see php_filter_info()
  */
 function php_eval($code) {
   global $theme_path, $theme_info, $conf;
@@ -82,7 +88,9 @@
 }
 
 /**
- * Tips callback for php filter.
+ * Implements hook_filter_FILTER_tips().
+ *
+ * @see php_filter_info()
  */
 function _php_filter_tips($filter, $format, $long = FALSE) {
   global $base_url;
@@ -137,4 +145,3 @@
   );
   return $filters;
 }
-

Modified: branches/upstream/current-7/modules/php/php.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/php/php.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/php/php.test (original)
+++ branches/upstream/current-7/modules/php/php.test Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
  */
 
 /**
- * Base PHP test case class.
+ * Defines a base PHP test case class.
  */
 class PHPTestCase extends DrupalWebTestCase {
   protected $php_code_format;
@@ -38,7 +38,7 @@
   }
 
   /**
-   * Create a test node with PHP code in the body.
+   * Creates a test node with PHP code in the body.
    *
    * @return stdObject Node object.
    */
@@ -60,7 +60,7 @@
   }
 
   /**
-   * Make sure that the PHP filter evaluates PHP code when used.
+   * Makes sure that the PHP filter evaluates PHP code when used.
    */
   function testPHPFilter() {
     // Log in as a user with permission to use the PHP code text format.
@@ -101,7 +101,7 @@
   }
 
   /**
-   * Make sure that user can't use the PHP filter when not given access.
+   * Makes sure that the user can't use the PHP filter when not given access.
    */
   function testNoPrivileges() {
     // Create node with PHP filter enabled.

Modified: branches/upstream/current-7/modules/poll/poll.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/poll/poll.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/poll/poll.info (original)
+++ branches/upstream/current-7/modules/poll/poll.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 stylesheets[all][] = poll.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/poll/poll.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/poll/poll.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/poll/poll.module (original)
+++ branches/upstream/current-7/modules/poll/poll.module Sun Feb  5 17:53:08 2012
@@ -288,9 +288,10 @@
 
   // Add initial or additional choices.
   $existing_delta = $delta;
-  $weight++;
   for ($delta; $delta < $choice_count; $delta++) {
     $key = 'new:' . ($delta - $existing_delta);
+    // Increase the weight of each new choice.
+    $weight++;
     $form['choice_wrapper']['choice'][$key] = _poll_choice_form($key, NULL, '', 0, $weight, $choice_count);
   }
 
@@ -408,6 +409,7 @@
     '#maxlength' => 7,
     '#parents' => array('choice', $key, 'chvotes'),
     '#access' => user_access('administer nodes'),
+    '#element_validate' => array('element_validate_integer'),
   );
 
   $form['weight'] = array(
@@ -451,10 +453,8 @@
  */
 function poll_validate($node, $form) {
   if (isset($node->title)) {
-    // Check for at least two options and validate amount of votes:
+    // Check for at least two options and validate amount of votes.
     $realchoices = 0;
-    // Renumber fields
-    $node->choice = array_values($node->choice);
     foreach ($node->choice as $i => $choice) {
       if ($choice['chtext'] != '') {
         $realchoices++;
@@ -586,8 +586,10 @@
           'weight' => $choice['weight'],
         ))
         ->insertFields(array(
-           'nid' => $node->nid,
-           'chtext' => $choice['chtext'],
+          'nid' => $node->nid,
+          'chtext' => $choice['chtext'],
+          'chvotes' => (int) $choice['chvotes'],
+          'weight' => $choice['weight'],
         ))
         ->execute();
     }

Modified: branches/upstream/current-7/modules/poll/poll.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/poll/poll.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/poll/poll.test (original)
+++ branches/upstream/current-7/modules/poll/poll.test Sun Feb  5 17:53:08 2012
@@ -24,13 +24,26 @@
   function pollCreate($title, $choices, $preview = TRUE) {
     $this->assertTrue(TRUE, 'Create a poll');
 
+    $admin_user = $this->drupalCreateUser(array('create poll content', 'administer nodes'));
     $web_user = $this->drupalCreateUser(array('create poll content', 'access content', 'edit own poll content'));
-    $this->drupalLogin($web_user);
+    $this->drupalLogin($admin_user);
 
     // Get the form first to initialize the state of the internal browser.
     $this->drupalGet('node/add/poll');
 
     // Prepare a form with two choices.
+    list($edit, $index) = $this->_pollGenerateEdit($title, $choices);
+
+    // Verify that the vote count element only allows non-negative integers.
+    $edit['choice[new:1][chvotes]'] = -1;
+    $edit['choice[new:0][chvotes]'] = $this->randomString(7);
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText(t('Negative values are not allowed.'));
+    $this->assertText(t('Vote count for new choice must be an integer.'));
+
+    // Repeat steps for initializing the state of the internal browser.
+    $this->drupalLogin($web_user);
+    $this->drupalGet('node/add/poll');
     list($edit, $index) = $this->_pollGenerateEdit($title, $choices);
 
     // Re-submit the form until all choices are filled in.
@@ -88,10 +101,6 @@
     }
     foreach ($new_choices as $k => $text) {
       $edit['choice[new:' . $k . '][chtext]'] = $text;
-      // To test poll choice weights, every new choice is sorted in front of
-      // existing choices. Existing/already submitted choices should keep their
-      // weight.
-      $edit['choice[new:' . $k . '][weight]'] = (- $index - $k);
     }
     return array($edit, count($already_submitted_choices) + count($new_choices));
   }
@@ -122,11 +131,11 @@
    */
   function assertPollChoiceOrder(array $choices, $index = 0, $preview = FALSE) {
     $expected = array();
+    $weight = 0;
     foreach ($choices as $id => $label) {
       if ($id < $index) {
-        // The expected weight of each choice is exactly the negated id.
-        // @see PollTestCase::_pollGenerateEdit()
-        $weight = -$id;
+        // The expected weight of each choice is higher than the previous one.
+        $weight++;
         // Directly assert the weight form element value for this choice.
         $this->assertFieldByName('choice[chid:' . $id . '][weight]', $weight, t('Found choice @id with weight @weight.', array(
           '@id' => $id,
@@ -205,11 +214,12 @@
 
     $new_option = $this->randomName();
 
+    $vote_count = '2000';
     $node->choice[] = array(
       'chid' => '',
       'chtext' => $new_option,
-      'chvotes' => 0,
-      'weight' => 0,
+      'chvotes' => (int) $vote_count,
+      'weight' => 1000,
     );
 
     node_save($node);
@@ -217,6 +227,12 @@
     $this->drupalGet('poll');
     $this->clickLink($title);
     $this->assertText($new_option, 'New option found.');
+
+    $option = $this->xpath('//div[@id="node-1"]//div[@class="poll"]//div[@class="text"]');
+    $this->assertEqual(end($option), $new_option, 'Last item is equal to new option.');
+
+    $votes = $this->xpath('//div[@id="node-1"]//div[@class="poll"]//div[@class="percent"]');
+    $this->assertTrue(strpos(end($votes), $vote_count) > 0, t("Votes saved."));
   }
 
   function testPollClose() {

Modified: branches/upstream/current-7/modules/profile/profile.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/profile/profile.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/profile/profile.info (original)
+++ branches/upstream/current-7/modules/profile/profile.info Sun Feb  5 17:53:08 2012
@@ -12,7 +12,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/profile/profile.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/profile/profile.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/profile/profile.module (original)
+++ branches/upstream/current-7/modules/profile/profile.module Sun Feb  5 17:53:08 2012
@@ -214,7 +214,7 @@
  * Implements hook_user_presave().
  */
 function profile_user_presave(&$edit, $account, $category) {
-  if ($account->uid) {
+  if (!empty($account->uid)) {
     profile_save_profile($edit, $account, $category);
   }
 }

Modified: branches/upstream/current-7/modules/profile/profile.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/profile/profile.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/profile/profile.test (original)
+++ branches/upstream/current-7/modules/profile/profile.test Sun Feb  5 17:53:08 2012
@@ -481,6 +481,46 @@
   }
 }
 
+/**
+ * Test profile integration with user CRUD operations.
+ */
+class ProfileCrudTestCase extends ProfileTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Profile CRUD tests',
+      'description' => 'Test profile integration with user create, read, update, delete.',
+      'group' => 'Profile',
+    );
+  }
+
+  /**
+   * Test profile integration with user CRUD operations.
+   */
+  public function testUserCRUD() {
+    // @todo Add profile fields in addition to base user properties.
+    $edit = array(
+      'name' => 'Test user',
+      'mail' => 'test at example.com',
+    );
+
+    // Create.
+    // @todo Add assertions.
+    $account = user_save(NULL, $edit);
+
+    // Read.
+    // @todo Add assertions.
+    $account = user_load($account->uid);
+
+    // Update.
+    // @todo Add assertions.
+    $account = user_save($account, $edit);
+
+    // Delete.
+    // @todo Add assertions.
+    user_delete($account->uid);
+  }
+}
+
   /**
    * TODO:
    * - Test field visibility

Modified: branches/upstream/current-7/modules/rdf/rdf.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/rdf/rdf.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/rdf/rdf.info (original)
+++ branches/upstream/current-7/modules/rdf/rdf.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 files[] = rdf.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/rdf/rdf.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/rdf/rdf.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/rdf/rdf.module (original)
+++ branches/upstream/current-7/modules/rdf/rdf.module Sun Feb  5 17:53:08 2012
@@ -769,6 +769,9 @@
  * Implements MODULE_preprocess_HOOK().
  */
 function rdf_preprocess_image(&$variables) {
+  // Adds the RDF type for image. We cannot use the usual entity-based mapping
+  // to get 'foaf:Image' because image does not have its own entity type or
+  // bundle.
   $variables['attributes']['typeof'] = array('foaf:Image');
 }
 

Modified: branches/upstream/current-7/modules/rdf/tests/rdf_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/rdf/tests/rdf_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/rdf/tests/rdf_test.info (original)
+++ branches/upstream/current-7/modules/rdf/tests/rdf_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/search/search.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/search/search.api.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.api.php (original)
+++ branches/upstream/current-7/modules/search/search.api.php Sun Feb  5 17:53:08 2012
@@ -22,13 +22,11 @@
  * on your module's type of content. If you want to have your content
  * indexed in the standard search index, your module should also implement
  * hook_update_index(). If your search type has settings, you can implement
- * hook_search_admin() to add them to the search settings page. You can also
- * alter the display of your module's search results by implementing
- * hook_search_page(). You can use hook_form_FORM_ID_alter(), with
- * FORM_ID set to 'search', to add fields to the search form (see
- * node_form_search_form_alter() for an example). You can use
- * hook_search_access() to limit access to searching, and hook_search_page() to
- * override how search results are displayed.
+ * hook_search_admin() to add them to the search settings page. You can use
+ * hook_form_FORM_ID_alter(), with FORM_ID set to 'search_form', to add fields
+ * to the search form (see node_form_search_form_alter() for an example).
+ * You can use hook_search_access() to limit access to searching,
+ * and hook_search_page() to override how search results are displayed.
  *
  * @return
  *   Array with optional keys:

Modified: branches/upstream/current-7/modules/search/search.extender.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/search/search.extender.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.extender.inc (original)
+++ branches/upstream/current-7/modules/search/search.extender.inc Sun Feb  5 17:53:08 2012
@@ -123,6 +123,16 @@
   protected $multiply = array();
 
   /**
+   * Whether or not search expressions were ignored.
+   *
+   * The maximum number of AND/OR combinations exceeded can be configured to
+   * avoid Denial-of-Service attacks. Expressions beyond the limit are ignored.
+   *
+   * @var boolean
+   */
+  protected $expressionsIgnored = FALSE;
+
+  /**
    * Sets up the search query expression.
    *
    * @param $query
@@ -183,7 +193,17 @@
     // Classify tokens.
     $or = FALSE;
     $warning = '';
+    $limit_combinations = variable_get('search_and_or_limit', 7);
+    // The first search expression does not count as AND.
+    $and_count = -1;
+    $or_count = 0;
     foreach ($keywords as $match) {
+      if ($or_count && $and_count + $or_count >= $limit_combinations) {
+        // Ignore all further search expressions to prevent Denial-of-Service
+        // attacks using a high number of AND/OR combinations.
+        $this->expressionsIgnored = TRUE;
+        break;
+      }
       $phrase = FALSE;
       // Strip off phrase quotes.
       if ($match[2]{0} == '"') {
@@ -212,6 +232,7 @@
         }
         $this->keys['positive'][] = $last;
         $or = TRUE;
+        $or_count++;
         continue;
       }
       // AND operator: implied, so just ignore it.
@@ -231,6 +252,7 @@
         }
         else {
           $this->keys['positive'] = array_merge($this->keys['positive'], $words);
+          $and_count++;
         }
       }
       $or = FALSE;
@@ -323,6 +345,9 @@
       form_set_error('keys', format_plural(variable_get('minimum_word_size', 3), 'You must include at least one positive keyword with 1 character or more.', 'You must include at least one positive keyword with @count characters or more.'));
       return FALSE;
     }
+    if ($this->expressionsIgnored) {
+      drupal_set_message(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => variable_get('search_and_or_limit', 7))), 'warning');
+    }
     $this->executedFirstPass = TRUE;
 
     if (!empty($this->words)) {

Modified: branches/upstream/current-7/modules/search/search.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/search/search.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.info (original)
+++ branches/upstream/current-7/modules/search/search.info Sun Feb  5 17:53:08 2012
@@ -9,7 +9,7 @@
 stylesheets[all][] = search.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/search/search.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/search/search.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.module (original)
+++ branches/upstream/current-7/modules/search/search.module Sun Feb  5 17:53:08 2012
@@ -1188,7 +1188,7 @@
           if (($s = strrpos($end, ' ')) !== FALSE) {
             // Account for the added spaces.
             $q = max($q - 1, 0);
-            $s = min($s, drupal_strlen($end) - 1);
+            $s = min($s, strlen($end) - 1);
             $ranges[$q] = $p + $s;
             $length += $p + $s - $q;
             $included[$key] = $p + 1;

Modified: branches/upstream/current-7/modules/search/search.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/search/search.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.test (original)
+++ branches/upstream/current-7/modules/search/search.test Sun Feb  5 17:53:08 2012
@@ -290,6 +290,20 @@
     $this->drupalGet('search/node/' . $arg);
     $input = $this->xpath("//input[@id='edit-keys' and @value='{$arg}']");
     $this->assertFalse(empty($input), 'Search keys with a / are correctly set as the default value in the search box.');
+
+    // Test a search input exceeding the limit of AND/OR combinations to test
+    // the Denial-of-Service protection.
+    $limit = variable_get('search_and_or_limit', 7);
+    $keys = array();
+    for ($i = 0; $i < $limit + 1; $i++) {
+      $keys[] = $this->randomName(3);
+      if ($i % 2 == 0) {
+        $keys[] = 'OR';
+      }
+    }
+    $edit['keys'] = implode(' ', $keys);
+    $this->drupalPost('search/node', $edit, t('Search'));
+    $this->assertRaw(t('Your search used too many AND/OR expressions. Only the first @count terms were included in this search.', array('@count' => $limit)));
   }
 }
 
@@ -1585,6 +1599,12 @@
     $result = preg_replace('| +|', ' ', search_excerpt('nothing', $entities));
     $this->assertFalse(strpos($result, '&'), 'Entities are not present in excerpt');
     $this->assertTrue(strpos($result, 'í') > 0, 'Entities are converted in excerpt');
+
+    // The node body that will produce this rendered $text is:
+    // 123456789 HTMLTest +123456789+‘  +‘  +‘  +‘  +12345678      +‘  +‘  +‘   ‘
+    $text = "<div class=\"field field-name-body field-type-text-with-summary field-label-hidden\"><div class=\"field-items\"><div class=\"field-item even\" property=\"content:encoded\"><p>123456789 HTMLTest +123456789+‘  +‘  +‘  +‘  +12345678      +‘  +‘  +‘   ‘</p>\n</div></div></div> ";
+    $result = search_excerpt('HTMLTest', $text);
+    $this->assertFalse(empty($result),  'Rendered Multi-byte HTML encodings are not corrupted in search excerpts');
   }
 
   /**
@@ -1975,7 +1995,7 @@
    * Tests that search returns results with punctuation in the search phrase.
    */
   function testPhraseSearchPunctuation() {
-    $node = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => "The bunny's ears were furry.")))));
+    $node = $this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => "The bunny's ears were fuzzy.")))));
 
     // Update the search index.
     module_invoke_all('update_index');

Modified: branches/upstream/current-7/modules/search/tests/search_embedded_form.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/search/tests/search_embedded_form.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/tests/search_embedded_form.info (original)
+++ branches/upstream/current-7/modules/search/tests/search_embedded_form.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/search/tests/search_extra_type.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/search/tests/search_extra_type.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/tests/search_extra_type.info (original)
+++ branches/upstream/current-7/modules/search/tests/search_extra_type.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/shortcut/shortcut.admin.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/shortcut/shortcut.admin.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/shortcut/shortcut.admin.js (original)
+++ branches/upstream/current-7/modules/shortcut/shortcut.admin.js Sun Feb  5 17:53:08 2012
@@ -33,7 +33,7 @@
       tableDrag.row.prototype.onSwap = function (swappedRow) {
         var disabledIndex = $(table).find('tr').index($(table).find('tr.shortcut-status-disabled')) - slots - 2,
           count = 0;
-        $(table).find('tr.shortcut-status-enabled').nextAll().filter(':not(.shortcut-slot-empty)').each(function(index) {
+        $(table).find('tr.shortcut-status-enabled').nextAll(':not(.shortcut-slot-empty)').each(function(index) {
           if (index < disabledIndex) {
             count++;
           }
@@ -41,7 +41,19 @@
         var total = slots - count;
         if (total == -1) {
           var disabled = $(table).find('tr.shortcut-status-disabled');
-          disabled.after(disabled.prevAll().filter(':not(.shortcut-slot-empty)').get(0));
+          // To maintain the shortcut links limit, we need to move the last
+          // element from the enabled section to the disabled section.
+          var changedRow = disabled.prevAll(':not(.shortcut-slot-empty)').not($(this.element)).get(0);
+          disabled.after(changedRow);
+          if ($(changedRow).hasClass('draggable')) {
+            // The dropped element will automatically be marked as changed by
+            // the tableDrag system. However, the row that swapped with it
+            // has moved to the "disabled" section, so we need to force its
+            // status to be disabled and mark it also as changed.
+            var changedRowObject = new tableDrag.row(changedRow, 'mouse', self.indentEnabled, self.maxDepth, true);
+            changedRowObject.markChanged();
+            rowStatusChange(changedRowObject);
+          }
         }
         else if (total != visibleLength) {
           if (total > visibleLength) {
@@ -59,14 +71,18 @@
 
       // Add a handler so when a row is dropped, update fields dropped into new regions.
       tableDrag.onDrop = function () {
+        rowStatusChange(this.rowObject);
+        return true;
+      };
+
+      function rowStatusChange(rowObject) {
         // Use "status-message" row instead of "status" row because
         // "status-{status_name}-message" is less prone to regexp match errors.
-        var statusRow = $(this.rowObject.element).prevAll('tr.shortcut-status').get(0);
+        var statusRow = $(rowObject.element).prevAll('tr.shortcut-status').get(0);
         var statusName = statusRow.className.replace(/([^ ]+[ ]+)*shortcut-status-([^ ]+)([ ]+[^ ]+)*/, '$2');
-        var statusField = $('select.shortcut-status-select', this.rowObject.element);
+        var statusField = $('select.shortcut-status-select', rowObject.element);
         statusField.val(statusName);
-        return true;
-      };
+      }
 
       tableDrag.restripeTable = function () {
         // :even and :odd are reversed because jQuery counts from 0 and

Modified: branches/upstream/current-7/modules/shortcut/shortcut.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/shortcut/shortcut.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/shortcut/shortcut.info (original)
+++ branches/upstream/current-7/modules/shortcut/shortcut.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/config/user-interface/shortcut
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/drupal_web_test_case.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/drupal_web_test_case.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/drupal_web_test_case.php (original)
+++ branches/upstream/current-7/modules/simpletest/drupal_web_test_case.php Sun Feb  5 17:53:08 2012
@@ -74,6 +74,18 @@
   protected $skipClasses = array(__CLASS__ => TRUE);
 
   /**
+   * Flag to indicate whether the test has been set up.
+   *
+   * The setUp() method isolates the test from the parent Drupal site by
+   * creating a random prefix for the database and setting up a clean file
+   * storage directory. The tearDown() method then cleans up this test
+   * environment. We must ensure that setUp() has been run. Otherwise,
+   * tearDown() will act on the parent Drupal site rather than the test
+   * environment, destroying live data.
+   */
+  protected $setup = FALSE;
+
+  /**
    * Constructor for DrupalTestCase.
    *
    * @param $test_id
@@ -127,7 +139,15 @@
     );
 
     // Store assertion for display after the test has completed.
-    Database::getConnection('default', 'simpletest_original_default')
+    try {
+      $connection = Database::getConnection('default', 'simpletest_original_default');
+    }
+    catch (DatabaseConnectionNotDefinedException $e) {
+      // If the test was not set up, the simpletest_original_default
+      // connection does not exist.
+      $connection = Database::getConnection('default', 'default');
+    }
+    $connection
       ->insert('simpletest')
       ->fields($assertion)
       ->execute();
@@ -474,14 +494,19 @@
         );
         $completion_check_id = DrupalTestCase::insertAssert($this->testId, $class, FALSE, t('The test did not complete due to a fatal error.'), 'Completion check', $caller);
         $this->setUp();
-        try {
-          $this->$method();
-          // Finish up.
+        if ($this->setup) {
+          try {
+            $this->$method();
+            // Finish up.
+          }
+          catch (Exception $e) {
+            $this->exceptionHandler($e);
+          }
+          $this->tearDown();
         }
-        catch (Exception $e) {
-          $this->exceptionHandler($e);
+        else {
+          $this->fail(t("The test cannot be executed because it has not been set up properly."));
         }
-        $this->tearDown();
         // Remove the completion check record.
         DrupalTestCase::deleteAssert($completion_check_id);
       }
@@ -691,6 +716,7 @@
       unset($module_list['locale']);
       module_list(TRUE, FALSE, FALSE, $module_list);
     }
+    $this->setup = TRUE;
   }
 
   protected function tearDown() {
@@ -1045,28 +1071,35 @@
   }
 
   /**
-   * Create a user with a given set of permissions. The permissions correspond to the
-   * names given on the privileges page.
-   *
-   * @param $permissions
-   *   Array of permission names to assign to user.
-   * @return
+   * Create a user with a given set of permissions.
+   *
+   * @param array $permissions
+   *   Array of permission names to assign to user. Note that the user always
+   *   has the default permissions derived from the "authenticated users" role.
+   *
+   * @return object|false
    *   A fully loaded user object with pass_raw property, or FALSE if account
    *   creation fails.
    */
-  protected function drupalCreateUser($permissions = array('access comments', 'access content', 'post comments', 'skip comment approval')) {
-    // Create a role with the given permission set.
-    if (!($rid = $this->drupalCreateRole($permissions))) {
-      return FALSE;
+  protected function drupalCreateUser(array $permissions = array()) {
+    // Create a role with the given permission set, if any.
+    $rid = FALSE;
+    if ($permissions) {
+      $rid = $this->drupalCreateRole($permissions);
+      if (!$rid) {
+        return FALSE;
+      }
     }
 
     // Create a user assigned to that role.
     $edit = array();
     $edit['name']   = $this->randomName();
     $edit['mail']   = $edit['name'] . '@example.com';
-    $edit['roles']  = array($rid => $rid);
     $edit['pass']   = user_password();
     $edit['status'] = 1;
+    if ($rid) {
+      $edit['roles'] = array($rid => $rid);
+    }
 
     $account = user_save(drupal_anonymous_user(), $edit);
 
@@ -1294,6 +1327,13 @@
     $test_info['test_run_id'] = $this->databasePrefix;
     $test_info['in_child_site'] = FALSE;
 
+    // Preset the 'install_profile' system variable, so the first call into
+    // system_rebuild_module_data() (in drupal_install_system()) will register
+    // the test's profile as a module. Without this, the installation profile of
+    // the parent site (executing the test) is registered, and the test
+    // profile's hook_install() and other hook implementations are never invoked.
+    $conf['install_profile'] = $this->profile;
+
     include_once DRUPAL_ROOT . '/includes/install.inc';
     drupal_install_system();
 
@@ -1357,6 +1397,7 @@
     variable_set('mail_system', array('default-system' => 'TestingMailSystem'));
 
     drupal_set_time_limit($this->timeLimit);
+    $this->setup = TRUE;
   }
 
   /**
@@ -1631,7 +1672,16 @@
    *   An header.
    */
   protected function curlHeaderCallback($curlHandler, $header) {
-    $this->headers[] = $header;
+    // Header fields can be extended over multiple lines by preceding each
+    // extra line with at least one SP or HT. They should be joined on receive.
+    // Details are in RFC2616 section 4.
+    if ($header[0] == ' ' || $header[0] == "\t") {
+      // Normalize whitespace between chucks.
+      $this->headers[] = array_pop($this->headers) . ' ' . trim($header);
+    }
+    else {
+      $this->headers[] = $header;
+    }
 
     // Errors are being sent via X-Drupal-Assertion-* headers,
     // generated by _drupal_log_error() in the exact form required
@@ -1968,6 +2018,16 @@
       $id = (string) $element['id'];
       $extra_post .= '&' . urlencode('ajax_html_ids[]') . '=' . urlencode($id);
     }
+    if (isset($drupal_settings['ajaxPageState'])) {
+      $extra_post .= '&' . urlencode('ajax_page_state[theme]') . '=' . urlencode($drupal_settings['ajaxPageState']['theme']);
+      $extra_post .= '&' . urlencode('ajax_page_state[theme_token]') . '=' . urlencode($drupal_settings['ajaxPageState']['theme_token']);
+      foreach ($drupal_settings['ajaxPageState']['css'] as $key => $value) {
+        $extra_post .= '&' . urlencode("ajax_page_state[css][$key]") . '=1';
+      }
+      foreach ($drupal_settings['ajaxPageState']['js'] as $key => $value) {
+        $extra_post .= '&' . urlencode("ajax_page_state[js][$key]") . '=1';
+      }
+    }
 
     // Unless a particular path is specified, use the one specified by the
     // Ajax settings, or else 'system/ajax'.
@@ -1992,7 +2052,7 @@
       foreach ($return as $command) {
         switch ($command['command']) {
           case 'settings':
-            $drupal_settings = array_merge_recursive($drupal_settings, $command['settings']);
+            $drupal_settings = drupal_array_merge_deep($drupal_settings, $command['settings']);
             break;
 
           case 'insert':
@@ -3059,8 +3119,21 @@
    * @return
    *   TRUE on pass, FALSE on fail.
    */
-  protected function assertFieldByName($name, $value = '', $message = '') {
-    return $this->assertFieldByXPath($this->constructFieldXpath('name', $name), $value, $message ? $message : t('Found field by name @name', array('@name' => $name)), t('Browser'));
+  protected function assertFieldByName($name, $value = NULL, $message = NULL) {
+    if (!isset($message)) {
+      if (!isset($value)) {
+        $message = t('Found field with name @name', array(
+          '@name' => var_export($name, TRUE),
+        ));
+      }
+      else {
+        $message = t('Found field with name @name and value @value', array(
+          '@name' => var_export($name, TRUE),
+          '@value' => var_export($value, TRUE),
+        ));
+      }
+    }
+    return $this->assertFieldByXPath($this->constructFieldXpath('name', $name), $value, $message, t('Browser'));
   }
 
   /**

Modified: branches/upstream/current-7/modules/simpletest/simpletest.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/simpletest.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/simpletest.info (original)
+++ branches/upstream/current-7/modules/simpletest/simpletest.info Sun Feb  5 17:53:08 2012
@@ -50,7 +50,7 @@
 files[] = tests/upgrade/upgrade.user.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/simpletest.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/simpletest.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/simpletest.module (original)
+++ branches/upstream/current-7/modules/simpletest/simpletest.module Sun Feb  5 17:53:08 2012
@@ -504,3 +504,16 @@
   }
   return 0;
 }
+
+/**
+ * Implements hook_mail_alter().
+ *
+ * Aborts sending of messages with ID 'simpletest_cancel_test'.
+ *
+ * @see MailTestCase::testCancelMessage()
+ */
+function simpletest_mail_alter(&$message) {
+  if ($message['id'] == 'simpletest_cancel_test') {
+    $message['send'] = FALSE;
+  }
+}

Modified: branches/upstream/current-7/modules/simpletest/simpletest.pages.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/simpletest.pages.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/simpletest.pages.inc (original)
+++ branches/upstream/current-7/modules/simpletest/simpletest.pages.inc Sun Feb  5 17:53:08 2012
@@ -254,7 +254,7 @@
       $row = array();
       $row[] = $assertion->message;
       $row[] = $assertion->message_group;
-      $row[] = basename($assertion->file);
+      $row[] = drupal_basename($assertion->file);
       $row[] = $assertion->line;
       $row[] = $assertion->function;
       $row[] = simpletest_result_status_image($assertion->status);

Modified: branches/upstream/current-7/modules/simpletest/simpletest.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/simpletest.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/simpletest.test (original)
+++ branches/upstream/current-7/modules/simpletest/simpletest.test Sun Feb  5 17:53:08 2012
@@ -20,10 +20,7 @@
   public static function getInfo() {
     return array(
       'name' => 'SimpleTest functionality',
-      'description' => 'Test SimpleTest\'s web interface: check that the intended tests were
-                          run and ensure that test reports display the intended results. Also
-                          test SimpleTest\'s internal browser and API\'s both explicitly and
-                          implicitly.',
+      'description' => "Test SimpleTest's web interface: check that the intended tests were run and ensure that test reports display the intended results. Also test SimpleTest's internal browser and API's both explicitly and implicitly.",
       'group' => 'SimpleTest'
     );
   }
@@ -503,3 +500,70 @@
     $this->fail(t('Running test with missing required module.'));
   }
 }
+
+/**
+ * Tests a test case that does not run parent::setUp() in its setUp() method.
+ *
+ * If a test case does not call parent::setUp(), running
+ * DrupalTestCase::tearDown() would destroy the main site's database tables.
+ * Therefore, we ensure that tests which are not set up properly are skipped.
+ *
+ * @see DrupalTestCase
+ */
+class SimpleTestBrokenSetUp extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Broken SimpleTest method',
+      'description' => 'Tests a test case that does not call parent::setUp().',
+      'group' => 'SimpleTest'
+    );
+  }
+
+  function setUp() {
+    // If the test is being run from the main site, set up normally.
+    if (!drupal_valid_test_ua()) {
+      parent::setUp('simpletest');
+      // Create and log in user.
+      $admin_user = $this->drupalCreateUser(array('administer unit tests'));
+      $this->drupalLogin($admin_user);
+    }
+    // If the test is being run from within simpletest, set up the broken test.
+    else {
+      $this->pass(t('The test setUp() method has been run.'));
+      // Don't call parent::setUp(). This should trigger an error message.
+    }
+  }
+
+  function tearDown() {
+    // If the test is being run from the main site, tear down normally.
+    if (!drupal_valid_test_ua()) {
+      parent::tearDown();
+    }
+    else {
+      // If the test is being run from within simpletest, output a message.
+      $this->pass(t('The tearDown() method has run.'));
+    }
+  }
+
+  /**
+   * Runs this test case from within the simpletest child site.
+   */
+  function testBreakSetUp() {
+    // If the test is being run from the main site, run it again from the web
+    // interface within the simpletest child site.
+    if (!drupal_valid_test_ua()) {
+      $edit['SimpleTestBrokenSetUp'] = TRUE;
+      $this->drupalPost('admin/config/development/testing', $edit, t('Run tests'));
+
+      // Verify that the broken test and its tearDown() method are skipped.
+      $this->assertRaw(t('The test setUp() method has been run.'));
+      $this->assertRaw(t('The test cannot be executed because it has not been set up properly.'));
+      $this->assertNoRaw(t('The test method has run.'));
+      $this->assertNoRaw(t('The tearDown() method has run.'));
+    }
+    // If the test is being run from within simpletest, output a message.
+    else {
+      $this->pass(t('The test method has run.'));
+    }
+  }
+}

Modified: branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/ajax.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/ajax.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/ajax.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/ajax.test Sun Feb  5 17:53:08 2012
@@ -116,6 +116,64 @@
     );
      $this->assertCommand($commands, $expected, t('Custom error message is output.'));
   }
+
+  /**
+   * Test that new JavaScript and CSS files added during an AJAX request are returned.
+   */
+  function testLazyLoad() {
+    $expected = array(
+      'setting_name' => 'ajax_forms_test_lazy_load_form_submit',
+      'setting_value' => 'executed',
+      'css' => drupal_get_path('module', 'system') . '/system.admin.css',
+      'js' => drupal_get_path('module', 'system') . '/system.js',
+    );
+
+    // Get the base page.
+    $this->drupalGet('ajax_forms_test_lazy_load_form');
+    $original_settings = $this->drupalGetSettings();
+    $original_css = $original_settings['ajaxPageState']['css'];
+    $original_js = $original_settings['ajaxPageState']['js'];
+
+    // Verify that the base page doesn't have the settings and files that are to
+    // be lazy loaded as part of the next request.
+    $this->assertTrue(!isset($original_settings[$expected['setting_name']]), t('Page originally lacks the %setting, as expected.', array('%setting' => $expected['setting_name'])));
+    $this->assertTrue(!isset($original_settings[$expected['css']]), t('Page originally lacks the %css file, as expected.', array('%css' => $expected['css'])));
+    $this->assertTrue(!isset($original_settings[$expected['js']]), t('Page originally lacks the %js file, as expected.', array('%js' => $expected['js'])));
+
+    // Submit the AJAX request.
+    $commands = $this->drupalPostAJAX(NULL, array(), array('op' => t('Submit')));
+    $new_settings = $this->drupalGetSettings();
+    $new_css = $new_settings['ajaxPageState']['css'];
+    $new_js = $new_settings['ajaxPageState']['js'];
+
+    // Verify the expected setting was added.
+    $this->assertIdentical($new_settings[$expected['setting_name']], $expected['setting_value'], t('Page now has the %setting.', array('%setting' => $expected['setting_name'])));
+
+    // Verify the expected CSS file was added, both to Drupal.settings, and as
+    // an AJAX command for inclusion into the HTML.
+    // @todo A drupal_css_defaults() function in Drupal 8 would be nice.
+    $expected_css_html = drupal_get_css(array($expected['css'] => array(
+      'type' => 'file',
+      'group' => CSS_DEFAULT,
+      'weight' => 0,
+      'every_page' => FALSE,
+      'media' => 'all',
+      'preprocess' => TRUE,
+      'data' => $expected['css'],
+      'browsers' => array('IE' => TRUE, '!IE' => TRUE),
+    )), TRUE);
+    $this->assertEqual($new_css, $original_css + array($expected['css'] => 1), t('Page state now has the %css file.', array('%css' => $expected['css'])));
+    $this->assertCommand($commands, array('data' => $expected_css_html), t('Page now has the %css file.', array('%css' => $expected['css'])));
+
+    // Verify the expected JS file was added, both to Drupal.settings, and as
+    // an AJAX command for inclusion into the HTML. By testing for an exact HTML
+    // string containing the SCRIPT tag, we also ensure that unexpected
+    // JavaScript code, such as a jQuery.extend() that would potentially clobber
+    // rather than properly merge settings, didn't accidentally get added.
+    $expected_js_html = drupal_get_js('header', array($expected['js'] => drupal_js_defaults($expected['js'])), TRUE);
+    $this->assertEqual($new_js, $original_js + array($expected['js'] => 1), t('Page state now has the %js file.', array('%js' => $expected['js'])));
+    $this->assertCommand($commands, array('data' => $expected_js_html), t('Page now has the %js file.', array('%js' => $expected['js'])));
+  }
 }
 
 /**

Modified: branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/ajax_forms_test.module Sun Feb  5 17:53:08 2012
@@ -27,6 +27,12 @@
     'title' => 'AJAX Validation Test',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('ajax_forms_test_validation_form'),
+    'access callback' => TRUE,
+  );
+  $items['ajax_forms_test_lazy_load_form'] = array(
+    'title' => 'AJAX forms lazy load test',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('ajax_forms_test_lazy_load_form'),
     'access callback' => TRUE,
   );
   return $items;
@@ -457,3 +463,38 @@
   drupal_set_message(t("Callback: drivertext=%drivertext, spare_required_field=%spare_required_field", array('%drivertext' => $form_state['values']['drivertext'], '%spare_required_field' => $form_state['values']['spare_required_field'])));
   return '<div id="message_area">ajax_forms_test_validation_form_callback at ' . date('c') . '</div>';
 }
+
+/**
+ * Form builder: Builds a form that triggers a simple AJAX callback.
+ */
+function ajax_forms_test_lazy_load_form($form, &$form_state) {
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Submit'),
+    '#ajax' => array(
+      'callback' => 'ajax_forms_test_lazy_load_form_ajax',
+    ),
+  );
+  return $form;
+}
+
+/**
+ * Form submit handler: Adds JavaScript and CSS that wasn't on the original form.
+ */
+function ajax_forms_test_lazy_load_form_submit($form, &$form_state) {
+  drupal_add_js(array('ajax_forms_test_lazy_load_form_submit' => 'executed'), 'setting');
+  drupal_add_css(drupal_get_path('module', 'system') . '/system.admin.css');
+  drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
+  $form_state['rebuild'] = TRUE;
+}
+
+/**
+ * AJAX callback for the ajax_forms_test_lazy_load_form() form.
+ *
+ * This function returns nothing, because all we're interested in testing is
+ * ajax_render() adding commands for JavaScript and CSS added during the page
+ * request, such as the ones added in ajax_forms_test_lazy_load_form_submit().
+ */
+function ajax_forms_test_lazy_load_form_ajax($form, &$form_state) {
+  return NULL;
+}

Modified: branches/upstream/current-7/modules/simpletest/tests/ajax_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/ajax_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/ajax_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/ajax_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/batch_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/batch_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/batch_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/batch_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/bootstrap.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/bootstrap.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/bootstrap.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/bootstrap.test Sun Feb  5 17:53:08 2012
@@ -350,8 +350,18 @@
     // Retrieving the location of a theme engine.
     $this->assertIdentical(drupal_get_filename('theme_engine', 'phptemplate'), 'themes/engines/phptemplate/phptemplate.engine', t('Retrieve theme engine location.'));
 
-    // Retrieving a file that is definitely not stored in the database.
+    // Retrieving the location of a profile. Profiles are a special case with
+    // a fixed location and naming.
     $this->assertIdentical(drupal_get_filename('profile', 'standard'), 'profiles/standard/standard.profile', t('Retrieve install profile location.'));
+
+    // When a file is not found in the database cache, drupal_get_filename()
+    // searches several locations on the filesystem, including the DRUPAL_ROOT
+    // directory. We use the '.script' extension below because this is a
+    // non-existent filetype that will definitely not exist in the database.
+    // Since there is already a scripts directory, drupal_get_filename() will
+    // automatically check there for 'script' files, just as it does for (e.g.)
+    // 'module' files in modules.
+    $this->assertIdentical(drupal_get_filename('script', 'test'), 'scripts/test.script', t('Retrieve test script location.'));
   }
 }
 

Modified: branches/upstream/current-7/modules/simpletest/tests/common.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/common.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/common.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/common.test Sun Feb  5 17:53:08 2012
@@ -56,6 +56,14 @@
     $this->assertEqual($array_copy, $array_expected, t('First argument to drupal_alter() was altered.'));
     $this->assertEqual($entity_copy, $entity_expected, t('Second argument to drupal_alter() was altered.'));
     $this->assertEqual($array2_copy, $array2_expected, t('Third argument to drupal_alter() was altered.'));
+
+    // Verify alteration order when passing an array of types to drupal_alter().
+    // common_test_module_implements_alter() places 'block' implementation after
+    // other modules.
+    $array_copy = $array;
+    $array_expected = array('foo' => 'Drupal block theme');
+    drupal_alter(array('drupal_alter', 'drupal_alter_foo'), $array_copy);
+    $this->assertEqual($array_copy, $array_expected, t('hook_TYPE_alter() implementations ran in correct order.'));
   }
 }
 
@@ -516,7 +524,7 @@
 /**
  * Test drupal_explode_tags() and drupal_implode_tags().
  */
-class DrupalTagsHandlingTestCase extends DrupalWebTestCase {
+class DrupalTagsHandlingTestCase extends DrupalUnitTestCase {
   var $validTags = array(
     'Drupal' => 'Drupal',
     'Drupal with some spaces' => 'Drupal with some spaces',
@@ -1738,6 +1746,37 @@
     $this->assertFieldByXPath($xpath, $element['#value'], t('#type @type was properly rendered.', array(
       '@type' => var_export($element['#type'], TRUE),
     )));
+  }
+
+  /**
+   * Tests caching of an empty render item.
+   */
+  function testDrupalRenderCache() {
+    // Force a request via GET.
+    $request_method = $_SERVER['REQUEST_METHOD'];
+    $_SERVER['REQUEST_METHOD'] = 'GET';
+    // Create an empty element.
+    $test_element = array(
+      '#cache' => array(
+        'cid' => 'render_cache_test',
+      ),
+      '#markup' => '',
+    );
+
+    // Render the element and confirm that it goes through the rendering
+    // process (which will set $element['#printed']).
+    $element = $test_element;
+    drupal_render($element);
+    $this->assertTrue(isset($element['#printed']), t('No cache hit'));
+
+    // Render the element again and confirm that it is retrieved from the cache
+    // instead (so $element['#printed'] will not be set).
+    $element = $test_element;
+    drupal_render($element);
+    $this->assertFalse(isset($element['#printed']), t('Cache hit'));
+
+    // Restore the previous request method.
+    $_SERVER['REQUEST_METHOD'] = $request_method;
   }
 }
 
@@ -2064,7 +2103,7 @@
   function assertError($error, $group, $function, $file, $message = NULL) {
     $this->assertEqual($error['group'], $group, t("Group was %group", array('%group' => $group)));
     $this->assertEqual($error['caller']['function'], $function, t("Function was %function", array('%function' => $function)));
-    $this->assertEqual(basename($error['caller']['file']), $file, t("File was %file", array('%file' => $file)));
+    $this->assertEqual(drupal_basename($error['caller']['file']), $file, t("File was %file", array('%file' => $file)));
     if (isset($message)) {
       $this->assertEqual($error['message'], $message, t("Message was %message", array('%message' => $message)));
     }
@@ -2074,7 +2113,7 @@
 /**
  * Test the drupal_parse_info_file() API function.
  */
-class ParseInfoFilesTestCase extends DrupalWebTestCase {
+class ParseInfoFilesTestCase extends DrupalUnitTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Parsing .info files',
@@ -2333,8 +2372,10 @@
       $str .= chr($i);
     }
     // Characters that must be escaped.
-    $html_unsafe = array('<', '>', '&');
-    $html_unsafe_escaped = array('\u003c', '\u003e', '\u0026');
+    // We check for unescaped " separately.
+    $html_unsafe = array('<', '>', '\'', '&');
+    // The following are the encoded forms of: < > ' & "
+    $html_unsafe_escaped = array('\u003C', '\u003E', '\u0027', '\u0026', '\u0022');
 
     // Verify there aren't character encoding problems with the source string.
     $this->assertIdentical(strlen($str), 128, t('A string with the full ASCII table has the correct length.'));
@@ -2345,6 +2386,11 @@
     // Verify that JSON encoding produces a string with all of the characters.
     $json = drupal_json_encode($str);
     $this->assertTrue(strlen($json) > strlen($str), t('A JSON encoded string is larger than the source string.'));
+
+    // The first and last characters should be ", and no others.
+    $this->assertTrue($json[0] == '"', t('A JSON encoded string begins with ".'));
+    $this->assertTrue($json[strlen($json) - 1] == '"', t('A JSON encoded string ends with ".'));
+    $this->assertTrue(substr_count($json, '"') == 2, t('A JSON encoded string contains exactly two ".'));
 
     // Verify that encoding/decoding is reversible.
     $json_decoded = drupal_json_decode($json);

Modified: branches/upstream/current-7/modules/simpletest/tests/common_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/common_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/common_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/common_test.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/common_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/common_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/common_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/common_test.module Sun Feb  5 17:53:08 2012
@@ -162,6 +162,34 @@
     elseif (is_object($arg3)) {
       $arg3->foo .= ' theme';
     }
+  }
+}
+
+/**
+ * Implements hook_TYPE_alter() on behalf of block module.
+ *
+ * This is for verifying that drupal_alter(array(TYPE1, TYPE2), ...) allows
+ * hook_module_implements_alter() to affect the order in which module
+ * implementations are executed.
+ */
+function block_drupal_alter_foo_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) {
+  $data['foo'] .= ' block';
+}
+
+/**
+ * Implements hook_module_implements_alter().
+ *
+ * @see block_drupal_alter_foo_alter()
+ */
+function common_test_module_implements_alter(&$implementations, $hook) {
+  // For drupal_alter(array('drupal_alter', 'drupal_alter_foo'), ...), make the
+  // block module implementations run after all the other modules. Note that
+  // when drupal_alter() is called with an array of types, the first type is
+  // considered primary and controls the module order.
+  if ($hook == 'drupal_alter_alter' && isset($implementations['block'])) {
+    $group = $implementations['block'];
+    unset($implementations['block']);
+    $implementations['block'] = $group;
   }
 }
 

Modified: branches/upstream/current-7/modules/simpletest/tests/common_test_cron_helper.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/common_test_cron_helper.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/common_test_cron_helper.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/common_test_cron_helper.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/database_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/database_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/database_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/database_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/database_test.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/database_test.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/database_test.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/database_test.test Sun Feb  5 17:53:08 2012
@@ -2062,6 +2062,16 @@
     $this->assertEqual($record->$age_field, 27, t('Correct data retrieved.'));
   }
 
+  function testHavingCountQuery() {
+    $query = db_select('test')
+      ->extend('PagerDefault')
+      ->having('age + 1 > 0');
+    $query->addField('test', 'age');
+    $query->addExpression('age + 1');
+    $count = count($query->execute()->fetchCol());
+    $this->assertEqual($count, 4, t('Counted the correct number of records.'));
+  }
+
   /**
    * Test that countQuery properly removes 'all_fields' statements and
    * ordering clauses.
@@ -3426,35 +3436,89 @@
    */
   function testTransactionWithDdlStatement() {
     // First, test that a commit works normally, even with DDL statements.
-    try {
-      $this->transactionOuterLayer('D', FALSE, TRUE);
-
-      // Because we committed, the inserted rows should both be present.
-      $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DavidD'))->fetchField();
-      $this->assertIdentical($saved_age, '24', t('Can retrieve DavidD row after commit.'));
-      $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DanielD'))->fetchField();
-      $this->assertIdentical($saved_age, '19', t('Can retrieve DanielD row after commit.'));
-      // The created table should also exist.
-      $count = db_query('SELECT COUNT(id) FROM {database_test_1}')->fetchField();
-      $this->assertIdentical($count, '0', t('Table was successfully created inside a transaction.'));
-    }
-    catch (Exception $e) {
-      $this->fail((string) $e);
-    }
-
-    // If we rollback the transaction, an exception might be thrown.
-    try {
-      $this->transactionOuterLayer('E', TRUE, TRUE);
-
-      // Because we rolled back, the inserted rows shouldn't be present.
-      $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DavidE'))->fetchField();
-      $this->assertNotIdentical($saved_age, '24', t('Cannot retrieve DavidE row after rollback.'));
-      $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'DanielE'))->fetchField();
-      $this->assertNotIdentical($saved_age, '19', t('Cannot retrieve DanielE row after rollback.'));
-    }
-    catch (Exception $e) {
-      // An exception also lets the test pass.
-      $this->assertTrue(true, t('Exception thrown on rollback after a DDL statement was executed.'));
+    $transaction = db_transaction();
+    $this->insertRow('row');
+    $this->executeDDLStatement();
+    unset($transaction);
+    $this->assertRowPresent('row');
+
+    // Even in different order.
+    $this->cleanUp();
+    $transaction = db_transaction();
+    $this->executeDDLStatement();
+    $this->insertRow('row');
+    unset($transaction);
+    $this->assertRowPresent('row');
+
+    // Even with stacking.
+    $this->cleanUp();
+    $transaction = db_transaction();
+    $transaction2 = db_transaction();
+    $this->executeDDLStatement();
+    unset($transaction2);
+    $transaction3 = db_transaction();
+    $this->insertRow('row');
+    unset($transaction3);
+    unset($transaction);
+    $this->assertRowPresent('row');
+
+    // A transaction after a DDL statement should still work the same.
+    $this->cleanUp();
+    $transaction = db_transaction();
+    $transaction2 = db_transaction();
+    $this->executeDDLStatement();
+    unset($transaction2);
+    $transaction3 = db_transaction();
+    $this->insertRow('row');
+    $transaction3->rollback();
+    unset($transaction3);
+    unset($transaction);
+    $this->assertRowAbsent('row');
+
+    // The behavior of a rollback depends on the type of database server.
+    if (Database::getConnection()->supportsTransactionalDDL()) {
+      // For database servers that support transactional DDL, a rollback
+      // of a transaction including DDL statements should be possible.
+      $this->cleanUp();
+      $transaction = db_transaction();
+      $this->insertRow('row');
+      $this->executeDDLStatement();
+      $transaction->rollback();
+      unset($transaction);
+      $this->assertRowAbsent('row');
+
+      // Including with stacking.
+      $this->cleanUp();
+      $transaction = db_transaction();
+      $transaction2 = db_transaction();
+      $this->executeDDLStatement();
+      unset($transaction2);
+      $transaction3 = db_transaction();
+      $this->insertRow('row');
+      unset($transaction3);
+      $transaction->rollback();
+      unset($transaction);
+      $this->assertRowAbsent('row');
+    }
+    else {
+      // For database servers that do not support transactional DDL,
+      // the DDL statement should commit the transaction stack.
+      $this->cleanUp();
+      $transaction = db_transaction();
+      $this->insertRow('row');
+      $this->executeDDLStatement();
+      // Rollback the outer transaction.
+      try {
+        $transaction->rollback();
+        unset($transaction);
+        // @TODO: an exception should be triggered here, but is not, because
+        // "ROLLBACK" fails silently in MySQL if there is no transaction active.
+        // $this->fail(t('Rolling back a transaction containing DDL should fail.'));
+      }
+      catch (DatabaseTransactionNoActiveException $e) {
+        $this->pass(t('Rolling back a transaction containing DDL should fail.'));
+      }
+      $this->assertRowPresent('row');
     }
   }
 
@@ -3467,6 +3531,24 @@
         'name' => $name,
       ))
       ->execute();
+  }
+
+  /**
+   * Execute a DDL statement.
+   */
+  protected function executeDDLStatement() {
+    static $count = 0;
+    $table = array(
+      'fields' => array(
+        'id' => array(
+          'type' => 'serial',
+          'unsigned' => TRUE,
+          'not null' => TRUE,
+        ),
+      ),
+      'primary key' => array('id'),
+    );
+    db_create_table('database_test_' . ++$count, $table);
   }
 
   /**
@@ -3513,8 +3595,8 @@
    * Test transaction stacking and commit / rollback.
    */
   function testTransactionStacking() {
-    // This test won't work right if transactions are supported.
-    if (Database::getConnection()->supportsTransactions()) {
+    // This test won't work right if transactions are not supported.
+    if (!Database::getConnection()->supportsTransactions()) {
       return;
     }
 
@@ -3593,26 +3675,33 @@
     $this->insertRow('outer');
     $transaction2 = db_transaction();
     $this->insertRow('inner');
+    $transaction3 = db_transaction();
+    $this->insertRow('inner2');
     // Rollback the outer transaction.
     try {
       $transaction->rollback();
       unset($transaction);
       $this->fail(t('Rolling back the outer transaction while the inner transaction is active resulted in an exception.'));
     }
-    catch (Exception $e) {
+    catch (DatabaseTransactionOutOfOrderException $e) {
       $this->pass(t('Rolling back the outer transaction while the inner transaction is active resulted in an exception.'));
     }
     $this->assertFalse($database->inTransaction(), t('No more in a transaction after rolling back the outer transaction'));
-    // Try to commit the inner transaction.
+    // Try to commit one inner transaction.
+    unset($transaction3);
+    $this->pass(t('Trying to commit an inner transaction resulted in an exception.'));
+    // Try to rollback one inner transaction.
     try {
+      $transaction->rollback();
       unset($transaction2);
-      $this->fail(t('Trying to commit the inner transaction resulted in an exception.'));
-    }
-    catch (Exception $e) {
-      $this->pass(t('Trying to commit the inner transaction resulted in an exception.'));
+      $this->fail(t('Trying to commit an inner transaction resulted in an exception.'));
+    }
+    catch (DatabaseTransactionNoActiveException $e) {
+      $this->pass(t('Trying to commit an inner transaction resulted in an exception.'));
     }
     $this->assertRowAbsent('outer');
     $this->assertRowAbsent('inner');
+    $this->assertRowAbsent('inner2');
   }
 }
 

Modified: branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/entity_cache_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/entity_cache_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/entity_cache_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/entity_cache_test.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/entity_cache_test_dependency.module Sun Feb  5 17:53:08 2012
@@ -11,7 +11,7 @@
 function entity_cache_test_dependency_entity_info() {
   return array(
     'entity_cache_test' => array(
-      'label' => 'Entity Cache Test',
+      'label' => variable_get('entity_cache_test_label', 'Entity Cache Test'),
     ),
   );
 }

Modified: branches/upstream/current-7/modules/simpletest/tests/entity_crud_hook_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/entity_crud_hook_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/entity_crud_hook_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/entity_crud_hook_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/entity_query.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/entity_query.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/entity_query.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/entity_query.test Sun Feb  5 17:53:08 2012
@@ -22,10 +22,10 @@
   function setUp() {
     parent::setUp(array('field_test'));
 
-    field_attach_create_bundle('test_entity_bundle_key', 'bundle1');
-    field_attach_create_bundle('test_entity_bundle_key', 'bundle2');
-    field_attach_create_bundle('test_entity', 'test_bundles');
-    field_attach_create_bundle('test_entity_bundle', 'test_entity_bundle');
+    field_test_create_bundle('bundle1');
+    field_test_create_bundle('bundle2');
+    field_test_create_bundle('test_bundle');
+    field_test_create_bundle('test_entity_bundle');
 
     $instances = array();
     $this->fields = array();
@@ -1084,7 +1084,6 @@
     $this->fields[0]['cardinality'] = 1;
     field_update_field($this->fields[0]);
     field_test_entity_info_translatable('test_entity', TRUE);
-    drupal_static_reset('field_available_languages');
 
     // Create more items with different languages.
     $entity = new stdClass();
@@ -1121,7 +1120,6 @@
     $this->fields[0]['translatable'] = TRUE;
     field_update_field($this->fields[0]);
     field_test_entity_info_translatable('test_entity', TRUE);
-    drupal_static_reset('field_available_languages');
 
     // Create more items with different languages.
     $entity = new stdClass();

Modified: branches/upstream/current-7/modules/simpletest/tests/error_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/error_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/error_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/error_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/file.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/file.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/file.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/file.test Sun Feb  5 17:53:08 2012
@@ -198,7 +198,9 @@
    */
   function createFile($filepath = NULL, $contents = NULL, $scheme = NULL) {
     if (!isset($filepath)) {
-      $filepath = $this->randomName();
+      // Prefix with non-latin characters to ensure that all file-related
+      // tests work with international filenames.
+      $filepath = 'Файл для тестирования ' . $this->randomName();
     }
     if (!isset($scheme)) {
       $scheme = file_default_scheme();
@@ -214,7 +216,7 @@
 
     $file = new stdClass();
     $file->uri = $filepath;
-    $file->filename = basename($file->uri);
+    $file->filename = drupal_basename($file->uri);
     $file->filemime = 'text/plain';
     $file->uid = 1;
     $file->timestamp = REQUEST_TIME;
@@ -372,11 +374,11 @@
 
     $this->image = new stdClass();
     $this->image->uri = 'misc/druplicon.png';
-    $this->image->filename = basename($this->image->uri);
+    $this->image->filename = drupal_basename($this->image->uri);
 
     $this->non_image = new stdClass();
     $this->non_image->uri = 'misc/jquery.js';
-    $this->non_image->filename = basename($this->non_image->uri);
+    $this->non_image->filename = drupal_basename($this->non_image->uri);
   }
 
   /**
@@ -539,7 +541,7 @@
     // Provide a filename.
     $filepath = file_unmanaged_save_data($contents, 'public://asdf.txt', FILE_EXISTS_REPLACE);
     $this->assertTrue($filepath, t('Unnamed file saved correctly.'));
-    $this->assertEqual('asdf.txt', basename($filepath), t('File was named correctly.'));
+    $this->assertEqual('asdf.txt', drupal_basename($filepath), t('File was named correctly.'));
     $this->assertEqual($contents, file_get_contents($filepath), t('Contents of the file are correct.'));
     $this->assertFilePermissions($filepath, variable_get('file_chmod_file', 0664));
   }
@@ -666,7 +668,7 @@
     $this->drupalPost('file-test/upload', $edit, t('Submit'));
     $this->assertResponse(200, t('Received a 200 response for posted test file.'));
     $this->assertRaw(t('You WIN!'));
-    $this->assertTrue(is_file('temporary://' . $dir . '/' . trim(basename($image3_realpath))));
+    $this->assertTrue(is_file('temporary://' . $dir . '/' . trim(drupal_basename($image3_realpath))));
 
     // Check that file_load_multiple() with no arguments returns FALSE.
     $this->assertFalse(file_load_multiple(), t('No files were loaded.'));
@@ -2202,7 +2204,7 @@
     $this->assertTrue($result, t('Unnamed file saved correctly.'));
 
     $this->assertEqual(file_default_scheme(), file_uri_scheme($result->uri), t("File was placed in Drupal's files directory."));
-    $this->assertEqual($result->filename, basename($result->uri), t("Filename was set to the file's basename."));
+    $this->assertEqual($result->filename, drupal_basename($result->uri), t("Filename was set to the file's basename."));
     $this->assertEqual($contents, file_get_contents($result->uri), t('Contents of the file are correct.'));
     $this->assertEqual($result->filemime, 'application/octet-stream', t('A MIME type was set.'));
     $this->assertEqual($result->status, FILE_STATUS_PERMANENT, t("The file's status was set to permanent."));
@@ -2220,11 +2222,14 @@
   function testWithFilename() {
     $contents = $this->randomName(8);
 
-    $result = file_save_data($contents, 'public://' . 'asdf.txt');
+    // Using filename with non-latin characters.
+    $filename = 'Текстовый файл.txt';
+
+    $result = file_save_data($contents, 'public://' . $filename);
     $this->assertTrue($result, t('Unnamed file saved correctly.'));
 
     $this->assertEqual('public', file_uri_scheme($result->uri), t("File was placed in Drupal's files directory."));
-    $this->assertEqual('asdf.txt', basename($result->uri), t('File was named correctly.'));
+    $this->assertEqual($filename, drupal_basename($result->uri), t('File was named correctly.'));
     $this->assertEqual($contents, file_get_contents($result->uri), t('Contents of the file are correct.'));
     $this->assertEqual($result->filemime, 'text/plain', t('A MIME type was set.'));
     $this->assertEqual($result->status, FILE_STATUS_PERMANENT, t("The file's status was set to permanent."));
@@ -2336,7 +2341,10 @@
     // Test generating an URL to a created file.
     $file = $this->createFile();
     $url = file_create_url($file->uri);
-    $this->assertEqual($GLOBALS['base_url'] . '/' . file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath() . '/' . $file->filename, $url, t('Correctly generated a URL for a created file.'));
+    // URLs can't contain characters outside the ASCII set so $filename has to be
+    // encoded.
+    $filename = $GLOBALS['base_url'] . '/' . file_stream_wrapper_get_instance_by_scheme('public')->getDirectoryPath() . '/' . rawurlencode($file->filename);
+    $this->assertEqual($filename, $url, t('Correctly generated a URL for a created file.'));
     $this->drupalHead($url);
     $this->assertResponse(200, t('Confirmed that the generated URL is correct by downloading the created file.'));
 
@@ -2356,15 +2364,19 @@
     // Set file downloads to private so handler functions get called.
 
     // Create a file.
-    $file = $this->createFile(NULL, NULL, 'private');
+    $contents = $this->randomName(8);
+    $file = $this->createFile(NULL, $contents, 'private');
     $url  = file_create_url($file->uri);
 
     // Set file_test access header to allow the download.
     file_test_set_return('download', array('x-foo' => 'Bar'));
-    $this->drupalHead($url);
+    $this->drupalGet($url);
     $headers = $this->drupalGetHeaders();
-    $this->assertEqual($headers['x-foo'] , 'Bar', t('Found header set by file_test module on private download.'));
+    $this->assertEqual($headers['x-foo'], 'Bar', t('Found header set by file_test module on private download.'));
     $this->assertResponse(200, t('Correctly allowed access to a file when file_test provides headers.'));
+
+    // Test that the file transfered correctly.
+    $this->assertEqual($contents, $this->content, t('Contents of the file are correct.'));
 
     // Deny access to all downloads via a -1 header.
     file_test_set_return('download', -1);
@@ -2602,7 +2614,7 @@
    * Test mapping of mimetypes from filenames.
    */
   public function testFileMimeTypeDetection() {
-    $prefix = 'simpletest://';
+    $prefix = 'public://';
 
     $test_case = array(
       'test.jar' => 'application/java-archive',

Modified: branches/upstream/current-7/modules/simpletest/tests/file_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/file_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/file_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/file_test.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/file_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/file_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/file_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/file_test.module Sun Feb  5 17:53:08 2012
@@ -138,7 +138,7 @@
 /**
  * Reset/initialize the history of calls to the file_* hooks.
  *
- * @see file_test_get_calls() 
+ * @see file_test_get_calls()
  * @see file_test_reset()
  */
 function file_test_reset() {

Modified: branches/upstream/current-7/modules/simpletest/tests/filter_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/filter_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/filter_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/filter_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/form.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/form.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/form.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/form.test Sun Feb  5 17:53:08 2012
@@ -588,8 +588,16 @@
     $elements = $this->xpath('//input[@id="edit-form-checkboxes-test-third-checkbox"]/following-sibling::label[@for="edit-form-checkboxes-test-third-checkbox" and @class="option"]');
     $this->assertTrue(isset($elements[0]), t("Label follows field and label option class correct for regular checkboxes."));
 
+    // Make sure the label is rendered for checkboxes.
+    $elements = $this->xpath('//input[@id="edit-form-checkboxes-test-0"]/following-sibling::label[@for="edit-form-checkboxes-test-0" and @class="option"]');
+    $this->assertTrue(isset($elements[0]), t("Label 0 found checkbox."));
+
     $elements = $this->xpath('//input[@id="edit-form-radios-test-second-radio"]/following-sibling::label[@for="edit-form-radios-test-second-radio" and @class="option"]');
     $this->assertTrue(isset($elements[0]), t("Label follows field and label option class correct for regular radios."));
+
+    // Make sure the label is rendered for radios.
+    $elements = $this->xpath('//input[@id="edit-form-radios-test-0"]/following-sibling::label[@for="edit-form-radios-test-0" and @class="option"]');
+    $this->assertTrue(isset($elements[0]), t("Label 0 found radios."));
 
     // Exercise various defaults for checkboxes and modifications to ensure
     // appropriate override and correct behaviour.

Modified: branches/upstream/current-7/modules/simpletest/tests/form_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/form_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/form_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/form_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/form_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/form_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/form_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/form_test.module Sun Feb  5 17:53:08 2012
@@ -688,6 +688,7 @@
       'first-checkbox' => t('First checkbox'),
       'second-checkbox' => t('Second checkbox'),
       'third-checkbox' => t('Third checkbox'),
+      '0' => t('0'),
     ),
   );
   $form['form_radios_test'] = array(
@@ -697,6 +698,7 @@
       'first-radio' => t('First radio'),
       'second-radio' => t('Second radio'),
       'third-radio' => t('Third radio'),
+      '0' => t('0'),
     ),
     // Test #field_prefix and #field_suffix placement.
     '#field_prefix' => '<span id="form-test-radios-field-prefix">' . t('Radios #field_prefix element') . '</span>',

Modified: branches/upstream/current-7/modules/simpletest/tests/image_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/image_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/image_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/image_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/mail.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/mail.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/mail.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/mail.test Sun Feb  5 17:53:08 2012
@@ -22,7 +22,7 @@
   }
 
   function setUp() {
-    parent::setUp();
+    parent::setUp(array('simpletest'));
 
     // Set MailTestCase (i.e. this class) as the SMTP library
     variable_set('mail_system', array('default-system' => 'MailTestCase'));
@@ -35,10 +35,28 @@
     global $language;
 
     // Use MailTestCase for sending a message.
-    $message = drupal_mail('simpletest', 'mail_test', 'testing at drupal.org', $language);
+    $message = drupal_mail('simpletest', 'mail_test', 'testing at example.com', $language);
 
     // Assert whether the message was sent through the send function.
-    $this->assertEqual(self::$sent_message['to'], 'testing at drupal.org', t('Pluggable mail system is extendable.'));
+    $this->assertEqual(self::$sent_message['to'], 'testing at example.com', t('Pluggable mail system is extendable.'));
+  }
+
+  /**
+   * Test that message sending may be canceled.
+   *
+   * @see simpletest_mail_alter()
+   */
+  function testCancelMessage() {
+    global $language;
+
+    // Reset the class variable holding a copy of the last sent message.
+    self::$sent_message = NULL;
+
+    // Send a test message that simpletest_mail_alter should cancel.
+    $message = drupal_mail('simpletest', 'cancel_test', 'cancel at example.com', $language);
+
+    // Assert that the message was not actually sent.
+    $this->assertNull(self::$sent_message, 'Message was canceled.');
   }
 
   /**

Modified: branches/upstream/current-7/modules/simpletest/tests/menu_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/menu_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/menu_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/menu_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/module_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/module_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/module_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/module_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/path.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/path.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/path.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/path.test Sun Feb  5 17:53:08 2012
@@ -201,6 +201,14 @@
   }
 
   /**
+   * Tests that $_GET['q'] is initialized when the request path is empty.
+   */
+  function testGetQInitialized() {
+    $this->drupalGet('');
+    $this->assertText("\$_GET['q'] is non-empty with an empty request path.", "\$_GET['q'] is initialized with an empty request path.");
+  }
+
+  /**
    * Assert that an outbound path is altered to an expected value.
    *
    * @param $original

Modified: branches/upstream/current-7/modules/simpletest/tests/requirements1_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/requirements1_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/requirements1_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/requirements1_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/requirements2_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/requirements2_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/requirements2_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/requirements2_test.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/session_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/session_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/session_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/session_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/system_dependencies_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_dependencies_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_dependencies_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/system_dependencies_test.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 dependencies[] = _missing_dependency
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Added: branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info (added)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,13 @@
+name = "System incompatible core version dependencies test"
+description = "Support module for testing system dependencies."
+package = Testing
+version = VERSION
+core = 7.x
+hidden = TRUE
+dependencies[] = system_incompatible_core_version_test
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Added: branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.module?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.module (added)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.module Sun Feb  5 17:53:08 2012
@@ -1,0 +1,1 @@
+<?php

Added: branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.info (added)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,12 @@
+name = "System incompatible core version test"
+description = "Support module for testing system dependencies."
+package = Testing
+version = VERSION
+core = 5.x
+hidden = TRUE
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Added: branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.module?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.module (added)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.module Sun Feb  5 17:53:08 2012
@@ -1,0 +1,1 @@
+<?php

Added: branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info (added)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,14 @@
+name = "System incompatible module version dependencies test"
+description = "Support module for testing system dependencies."
+package = Testing
+version = VERSION
+core = 7.x
+hidden = TRUE
+; system_incompatible_module_version_test declares version 1.0
+dependencies[] = system_incompatible_module_version_test (>2.0)
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Added: branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.module?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.module (added)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.module Sun Feb  5 17:53:08 2012
@@ -1,0 +1,1 @@
+<?php

Added: branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.info (added)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,12 @@
+name = "System incompatible module version test"
+description = "Support module for testing system dependencies."
+package = Testing
+version = 1.0
+core = 7.x
+hidden = TRUE
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Added: branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.module?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.module (added)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.module Sun Feb  5 17:53:08 2012
@@ -1,0 +1,1 @@
+<?php

Modified: branches/upstream/current-7/modules/simpletest/tests/system_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/system_test.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/system_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/system_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/system_test.module Sun Feb  5 17:53:08 2012
@@ -264,6 +264,14 @@
   if ($file->name == 'system_dependencies_test') {
     $info['hidden'] = FALSE;
   }
+  if (in_array($file->name, array(
+    'system_incompatible_module_version_dependencies_test',
+    'system_incompatible_core_version_dependencies_test',
+    'system_incompatible_module_version_test',
+    'system_incompatible_core_version_test',
+  ))) {
+    $info['hidden'] = FALSE;
+  }
   if ($file->name == 'requirements1_test' || $file->name == 'requirements2_test') {
     $info['hidden'] = FALSE;
   }

Modified: branches/upstream/current-7/modules/simpletest/tests/taxonomy_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/taxonomy_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/taxonomy_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/taxonomy_test.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 dependencies[] = taxonomy
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/theme.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/theme.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/theme.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/theme.test Sun Feb  5 17:53:08 2012
@@ -9,6 +9,8 @@
  * Unit tests for the Theme API.
  */
 class ThemeUnitTest extends DrupalWebTestCase {
+  protected $profile = 'testing';
+
   public static function getInfo() {
     return array(
       'name' => 'Theme API',
@@ -194,7 +196,7 @@
 /**
  * Unit tests for theme_links().
  */
-class ThemeLinksUnitTest extends DrupalUnitTestCase {
+class ThemeLinksTest extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Links',
@@ -380,3 +382,54 @@
     $this->assertEqual('<title>title test</title>'."\n", theme_html_tag($tag), t('Test title tag generation.'));
   }
 }
+
+/**
+ * Tests for the ThemeRegistry class.
+ */
+class ThemeRegistryTestCase extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'ThemeRegistry',
+      'description' => 'Tests the behavior of the ThemeRegistry class',
+      'group' => 'Theme',
+    );
+  }
+  function setUp() {
+    parent::setUp('theme_test');
+  }
+
+  /**
+   * Tests the behavior of the theme registry class.
+   */
+  function testRaceCondition() {
+    $_SERVER['REQUEST_METHOD'] = 'GET';
+    $cid = 'test_theme_registry';
+
+    // Directly instantiate the theme registry, this will cause a base cache
+    // entry to be written in __construct().
+    $registry = new ThemeRegistry($cid, 'cache');
+
+    $this->assertTrue(cache_get($cid), 'Cache entry was created.');
+
+    // Trigger a cache miss for an offset.
+    $this->assertTrue($registry['theme_test_template_test'], 'Offset was returned correctly from the theme registry.');
+    // This will cause the ThemeRegistry class to write an updated version of
+    // the cache entry when it is destroyed, usually at the end of the request.
+    // Before that happens, manually delete the cache entry we created earlier
+    // so that the new entry is written from scratch.
+    cache_clear_all($cid, 'cache');
+
+    // Destroy the class so that it triggers a cache write for the offset.
+    unset($registry);
+
+    $this->assertTrue(cache_get($cid), 'Cache entry was created.');
+
+    // Create a new instance of the class. Confirm that both the offset
+    // requested previously, and one that has not yet been requested are both
+    // available.
+    $registry = new ThemeRegistry($cid, 'cache');
+
+    $this->assertTrue($registry['theme_test_template_test'], 'Offset was returned correctly from the theme registry');
+    $this->assertTrue($registry['theme_test_template_test_2'], 'Offset was returned correctly from the theme registry');
+  }
+}

Modified: branches/upstream/current-7/modules/simpletest/tests/theme_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/theme_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/theme_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/theme_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/theme_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/theme_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/theme_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/theme_test.module Sun Feb  5 17:53:08 2012
@@ -1,4 +1,26 @@
 <?php
+
+/**
+ * Implements hook_theme().
+ */
+function theme_test_theme($existing, $type, $theme, $path) {
+  $items['theme_test_template_test'] = array(
+    'template' => 'theme_test.template_test',
+  );
+  $items['theme_test_template_test_2'] = array(
+    'template' => 'theme_test.template_test',
+  );
+
+  return $items;
+}
+
+/**
+ * Implements hook_system_theme_info().
+ */
+function theme_test_system_theme_info() {
+  $themes['test_theme'] = drupal_get_path('module', 'theme_test') . '/themes/test_theme/test_theme.info';
+  return $themes;
+}
 
 /**
  * Implements hook_menu().

Added: branches/upstream/current-7/modules/simpletest/tests/theme_test.template_test.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/theme_test.template_test.tpl.php?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/theme_test.template_test.tpl.php (added)
+++ branches/upstream/current-7/modules/simpletest/tests/theme_test.template_test.tpl.php Sun Feb  5 17:53:08 2012
@@ -1,0 +1,2 @@
+<!-- Output for Theme API test -->
+Fail: Template not overridden.

Added: branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/template.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/template.php?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/template.php (added)
+++ branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/template.php Sun Feb  5 17:53:08 2012
@@ -1,0 +1,21 @@
+<?php
+
+/**
+ * Tests a theme overriding a suggestion of a base theme hook.
+ */
+function test_theme_breadcrumb__suggestion($variables) {
+  // Tests that preprocess functions for the base theme hook get called even
+  // when the suggestion has an implementation.
+  return 'test_theme_breadcrumb__suggestion: ' . $variables['theme_test_preprocess_breadcrumb'];
+}
+
+/**
+ * Tests a theme implementing an alter hook.
+ *
+ * The confusing function name here is due to this being an implementation of
+ * the alter hook invoked when the 'theme_test' module calls
+ * drupal_alter('theme_test_alter').
+ */
+function test_theme_theme_test_alter_alter(&$data) {
+  $data = 'test_theme_theme_test_alter_alter was invoked';
+}

Added: branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/test_theme.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/test_theme.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/test_theme.info (added)
+++ branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/test_theme.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,22 @@
+name = Test theme
+description = Theme for testing the theme system
+core = 7.x
+hidden = TRUE
+
+; Normally, themes may list CSS files like this, and if they exist in the theme
+; folder, then they get added to the page. If they have the same file name as a
+; module CSS file, then the theme's version overrides the module's version, so
+; that the module's version is not added to the page. Additionally, a theme may
+; have an entry like this one, without having the corresponding CSS file in the
+; theme's folder, and in this case, it just stops the module's version from
+; being loaded, and does not replace it with an alternate version. We have this
+; here in order for a test to ensure that this correctly prevents the module
+; version from being loaded, and that errors aren't caused by the lack of this
+; file within the theme folder.
+stylesheets[all][] = system.base.css
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Modified: branches/upstream/current-7/modules/simpletest/tests/unicode.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/unicode.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/unicode.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/unicode.test Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 /**
  * Test unicode handling features implemented in unicode.inc.
  */
-class UnicodeUnitTest extends DrupalWebTestCase {
+class UnicodeUnitTest extends DrupalUnitTestCase {
 
   /**
    * Whether to run the extended version of the tests (including non latin1 characters).

Added: branches/upstream/current-7/modules/simpletest/tests/update_script_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/update_script_test.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/update_script_test.info (added)
+++ branches/upstream/current-7/modules/simpletest/tests/update_script_test.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,12 @@
+name = "Update script test"
+description = "Support module for update script testing."
+package = Testing
+version = VERSION
+core = 7.x
+hidden = TRUE
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Added: branches/upstream/current-7/modules/simpletest/tests/update_script_test.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/update_script_test.install?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/update_script_test.install (added)
+++ branches/upstream/current-7/modules/simpletest/tests/update_script_test.install Sun Feb  5 17:53:08 2012
@@ -1,0 +1,45 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions for the update_script_test module.
+ */
+
+/**
+ * Implements hook_requirements().
+ */
+function update_script_test_requirements($phase) {
+  $requirements = array();
+
+  if ($phase == 'update') {
+    // Set a requirements warning or error when the test requests it.
+    $requirement_type = variable_get('update_script_test_requirement_type');
+    switch ($requirement_type) {
+      case REQUIREMENT_WARNING:
+        $requirements['update_script_test'] = array(
+          'title' => 'Update script test',
+          'value' => 'Warning',
+          'description' => 'This is a requirements warning provided by the update_script_test module.',
+          'severity' => REQUIREMENT_WARNING,
+        );
+        break;
+      case REQUIREMENT_ERROR:
+        $requirements['update_script_test'] = array(
+          'title' => 'Update script test',
+          'value' => 'Error',
+          'description' => 'This is a requirements error provided by the update_script_test module.',
+          'severity' => REQUIREMENT_ERROR,
+        );
+        break;
+    }
+  }
+
+  return $requirements;
+}
+
+/**
+ * Dummy update function to run during the tests.
+ */
+function update_script_test_update_7000() {
+  return t('The update_script_test_update_7000() update was executed successfully.');
+}

Added: branches/upstream/current-7/modules/simpletest/tests/update_script_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/update_script_test.module?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/update_script_test.module (added)
+++ branches/upstream/current-7/modules/simpletest/tests/update_script_test.module Sun Feb  5 17:53:08 2012
@@ -1,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * This file provides testing functionality for update.php.
+ */
+
+/**
+ * Implements hook_flush_caches().
+ *
+ * This sets a message to confirm that all caches are cleared whenever
+ * update.php completes.
+ *
+ * @see UpdateScriptFunctionalTest::testRequirements()
+ */
+function update_script_test_flush_caches() {
+  drupal_set_message(t('hook_flush_caches() invoked for update_script_test.module.'));
+}

Modified: branches/upstream/current-7/modules/simpletest/tests/update_test_1.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/update_test_1.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/update_test_1.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/update_test_1.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/update_test_2.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/update_test_2.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/update_test_2.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/update_test_2.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/update_test_3.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/update_test_3.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/update_test_3.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/update_test_3.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php (added)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.node_type_broken.database.php Sun Feb  5 17:53:08 2012
@@ -1,0 +1,34 @@
+<?php
+db_insert('comments')->fields(array(
+  'cid',
+  'pid',
+  'nid',
+  'uid',
+  'subject',
+  'comment',
+  'hostname',
+  'timestamp',
+  'status',
+  'format',
+  'thread',
+  'name',
+  'mail',
+  'homepage',
+))
+->values(array(
+  'cid' => 1,
+  'pid' => 0,
+  'nid' => 37,
+  'uid' => 3,
+  'subject' => 'Comment title 1',
+  'comment' => 'Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1 - Comment body 1',
+  'hostname' => '127.0.0.1',
+  'timestamp' => 1008617630,
+  'status' => 0,
+  'format' => 1,
+  'thread' => '01/',
+  'name' => NULL,
+  'mail' => NULL,
+  'homepage' => '',
+))
+->execute();

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.bare.minimal.database.php.gz
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.bare.minimal.database.php.gz?rev=2257&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.bare.minimal.database.php.gz
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.bare.standard_all.database.php.gz
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.bare.standard_all.database.php.gz?rev=2257&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.bare.standard_all.database.php.gz
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.filled.minimal.database.php.gz
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.filled.minimal.database.php.gz?rev=2257&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.filled.minimal.database.php.gz
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.filled.standard_all.database.php.gz
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.filled.standard_all.database.php.gz?rev=2257&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.filled.standard_all.database.php.gz
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.node.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.node.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.node.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.node.test Sun Feb  5 17:53:08 2012
@@ -47,6 +47,38 @@
     // Check that fields created during the upgrade can be edited and resaved
     // in the UI.
     $this->drupalPost('admin/structure/types/manage/story/fields/body', array(), t('Save settings'));
+  }
+}
+
+/**
+ * Tests the upgrade path for node disabled node types.
+ *
+ * Load a filled installation of Drupal 6 and run the upgrade process on it.
+ */
+class DisabledNodeTypeTestCase extends UpgradePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Disabled node type upgrade path',
+      'description'  => 'Disabled node type upgrade path tests.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Path to the database dump.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.filled.database.php',
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-6.node_type_broken.database.php',
+    );
+    parent::setUp();
+  }
+
+  /**
+   * Tests a successful upgrade.
+   */
+  public function testDisabledNodeTypeUpgrade() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+    $this->assertTrue(field_info_instance('comment', 'comment_body', 'comment_node_broken'), 'Comment body field instance was created for comments attached to the disabled broken node type');
   }
 }
 

Modified: branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.test Sun Feb  5 17:53:08 2012
@@ -28,86 +28,31 @@
   var $loadedModules = array();
 
   /**
-   * Override of DrupalWebTestCase::setUp() specialized for upgrade testing.
-   */
-  protected function setUp() {
-    global $user, $language, $conf;
-
-    // Load the Update API.
-    require_once DRUPAL_ROOT . '/includes/update.inc';
-
-    // Reset flags.
-    $this->upgradedSite = FALSE;
-    $this->upgradeErrors = array();
-
-    $this->loadedModules = module_list();
-
-    // Generate a temporary prefixed database to ensure that tests have a clean starting point.
-    $this->databasePrefix = 'simpletest' . mt_rand(1000, 1000000);
-    db_update('simpletest_test_id')
-      ->fields(array('last_prefix' => $this->databasePrefix))
-      ->condition('test_id', $this->testId)
-      ->execute();
-
-    // Clone the current connection and replace the current prefix.
-    $connection_info = Database::getConnectionInfo('default');
-    Database::renameConnection('default', 'simpletest_original_default');
-    foreach ($connection_info as $target => $value) {
-      $connection_info[$target]['prefix'] = array(
-        'default' => $value['prefix']['default'] . $this->databasePrefix,
-      );
-    }
-    Database::addConnectionInfo('default', 'default', $connection_info['default']);
-
-    // Store necessary current values before switching to prefixed database.
-    $this->originalLanguage = $language;
-    $this->originalLanguageDefault = variable_get('language_default');
-    $this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files');
-    $this->originalProfile = drupal_get_profile();
-    $clean_url_original = variable_get('clean_url', 0);
-
-    // Unregister the registry.
-    // This is required to make sure that the database layer works properly.
-    spl_autoload_unregister('drupal_autoload_class');
-    spl_autoload_unregister('drupal_autoload_interface');
-
-    // Create test directories ahead of installation so fatal errors and debug
-    // information can be logged during installation process.
-    // Use mock files directories with the same prefix as the database.
-    $public_files_directory  = $this->originalFileDirectory . '/simpletest/' . substr($this->databasePrefix, 10);
-    $private_files_directory = $public_files_directory . '/private';
-    $temp_files_directory    = $private_files_directory . '/temp';
-
-    // Create the directories.
-    file_prepare_directory($public_files_directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
-    file_prepare_directory($private_files_directory, FILE_CREATE_DIRECTORY);
-    file_prepare_directory($temp_files_directory, FILE_CREATE_DIRECTORY);
-    $this->generatedTestFiles = FALSE;
-
-    // Log fatal errors.
-    ini_set('log_errors', 1);
-    ini_set('error_log', $public_files_directory . '/error.log');
-
-    // Reset all statics and variables to perform tests in a clean environment.
-    $conf = array();
-
-    // Load the database from the portable PHP dump.
-    foreach ($this->databaseDumpFiles as $file) {
-      require $file;
-    }
-
-    // Set path variables.
-    $this->variable_set('file_public_path', $public_files_directory);
-    $this->variable_set('file_private_path', $private_files_directory);
-    $this->variable_set('file_temporary_path', $temp_files_directory);
-
-    $this->pass('Finished loading the dump.');
-
-    // Load user 1.
-    $this->originalUser = $user;
-    drupal_save_session(FALSE);
-    $user = db_query('SELECT * FROM {users} WHERE uid = :uid', array(':uid' => 1))->fetchObject();
-
+   * Flag to indicate whether zlib is installed or not.
+   */
+  var $zlibInstalled = TRUE;
+
+  /**
+   * Flag to indicate whether there are pending updates or not.
+   */
+  var $pendingUpdates = TRUE;
+
+  /**
+   * Constructs an UpgradePathTestCase object.
+   *
+   * @param $test_id
+   *   (optional) The ID of the test. Tests with the same id are reported
+   *   together.
+   */
+  function __construct($test_id = NULL) {
+    parent::__construct($test_id);
+    $this->zlibInstalled = function_exists('gzopen');
+  }
+
+  /**
+   * Prepares the appropriate session for the release of Drupal being upgraded.
+   */
+  protected function prepareD7Session() {
     // Generate and set a D6-compatible session cookie.
     $this->curlInitialize();
     $sid = drupal_hash_base64(uniqid(mt_rand(), TRUE) . drupal_random_bytes(55));
@@ -123,12 +68,110 @@
     // Remove the temporarily added ssid column.
     db_drop_field('sessions', 'ssid');
     drupal_save_session(FALSE);
+  }
+
+  /**
+   * Override of DrupalWebTestCase::setUp() specialized for upgrade testing.
+   */
+  protected function setUp() {
+    // We are going to set a missing zlib requirement property for usage
+    // during the performUpgrade() and tearDown() methods. Also set that the
+    // tests failed.
+    if (!$this->zlibInstalled) {
+      parent::setUp();
+      return;
+    }
+
+    global $user, $language, $conf;
+
+    // Load the Update API.
+    require_once DRUPAL_ROOT . '/includes/update.inc';
+
+    // Reset flags.
+    $this->upgradedSite = FALSE;
+    $this->upgradeErrors = array();
+
+    $this->loadedModules = module_list();
+
+    // Generate a temporary prefixed database to ensure that tests have a clean starting point.
+    $this->databasePrefix = 'simpletest' . mt_rand(1000, 1000000);
+    db_update('simpletest_test_id')
+      ->fields(array('last_prefix' => $this->databasePrefix))
+      ->condition('test_id', $this->testId)
+      ->execute();
+
+    // Clone the current connection and replace the current prefix.
+    $connection_info = Database::getConnectionInfo('default');
+    Database::renameConnection('default', 'simpletest_original_default');
+    foreach ($connection_info as $target => $value) {
+      $connection_info[$target]['prefix'] = array(
+        'default' => $value['prefix']['default'] . $this->databasePrefix,
+      );
+    }
+    Database::addConnectionInfo('default', 'default', $connection_info['default']);
+
+    // Store necessary current values before switching to prefixed database.
+    $this->originalLanguage = $language;
+    $this->originalLanguageDefault = variable_get('language_default');
+    $this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files');
+    $this->originalProfile = drupal_get_profile();
+    $clean_url_original = variable_get('clean_url', 0);
+
+    // Unregister the registry.
+    // This is required to make sure that the database layer works properly.
+    spl_autoload_unregister('drupal_autoload_class');
+    spl_autoload_unregister('drupal_autoload_interface');
+
+    // Create test directories ahead of installation so fatal errors and debug
+    // information can be logged during installation process.
+    // Use mock files directories with the same prefix as the database.
+    $public_files_directory  = $this->originalFileDirectory . '/simpletest/' . substr($this->databasePrefix, 10);
+    $private_files_directory = $public_files_directory . '/private';
+    $temp_files_directory    = $private_files_directory . '/temp';
+
+    // Create the directories.
+    file_prepare_directory($public_files_directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
+    file_prepare_directory($private_files_directory, FILE_CREATE_DIRECTORY);
+    file_prepare_directory($temp_files_directory, FILE_CREATE_DIRECTORY);
+    $this->generatedTestFiles = FALSE;
+
+    // Log fatal errors.
+    ini_set('log_errors', 1);
+    ini_set('error_log', $public_files_directory . '/error.log');
+
+    // Reset all statics and variables to perform tests in a clean environment.
+    $conf = array();
+
+    // Load the database from the portable PHP dump.
+    // The files may be gzipped.
+    foreach ($this->databaseDumpFiles as $file) {
+      if (substr($file, -3) == '.gz') {
+        $file = "compress.zlib://$file";
+      }
+      require $file;
+    }
+
+    // Set path variables.
+    $this->variable_set('file_public_path', $public_files_directory);
+    $this->variable_set('file_private_path', $private_files_directory);
+    $this->variable_set('file_temporary_path', $temp_files_directory);
+
+    $this->pass('Finished loading the dump.');
+
+    // Load user 1.
+    $this->originalUser = $user;
+    drupal_save_session(FALSE);
+    $user = db_query('SELECT * FROM {users} WHERE uid = :uid', array(':uid' => 1))->fetchObject();
+
+    // Generate and set a D6-compatible session cookie.
+    $this->prepareD7Session();
 
     // Restore necessary variables.
     $this->variable_set('clean_url', $clean_url_original);
     $this->variable_set('site_mail', 'simpletest at example.com');
 
     drupal_set_time_limit($this->timeLimit);
+    $this->setup = TRUE;
   }
 
   /**
@@ -136,6 +179,11 @@
    */
   protected function tearDown() {
     global $user, $language;
+
+    if (!$this->zlibInstalled) {
+      parent::tearDown();
+      return;
+    }
 
     // In case a fatal error occurred that was not in the test process read the
     // log to pick up any fatal errors.
@@ -231,6 +279,11 @@
    *   TRUE if the upgrade succeeded, FALSE otherwise.
    */
   protected function performUpgrade($register_errors = TRUE) {
+    if (!$this->zlibInstalled) {
+      $this->fail(t('Missing zlib requirement for upgrade tests.'));
+      return FALSE;
+    }
+
     $update_url = $GLOBALS['base_url'] . '/update.php';
 
     // Load the first update screen.
@@ -243,6 +296,14 @@
     $this->drupalPost(NULL, array(), t('Continue'));
     if (!$this->assertResponse(200)) {
       return FALSE;
+    }
+
+    // The test should pass if there are no pending updates.
+    $content = $this->drupalGetContent();
+    if (strpos($content, t('No pending updates.')) !== FALSE) {
+      $this->pass(t('No pending updates and therefore no upgrade process to test.'));
+      $this->pendingUpdates = FALSE;
+      return TRUE;
     }
 
     // Go!
@@ -316,6 +377,26 @@
       ->execute();
   }
 
+}
+
+/**
+ * Performs end-to-end point test of the release update path.
+ */
+abstract class UpdatePathTestCase extends UpgradePathTestCase {
+  /**
+   * Overrides UpgradePathTestCase::prepareD7Session().
+   */
+  protected function prepareD7Session() {
+    // Generate and set a D7-compatible session cookie.
+    $this->curlInitialize();
+    $sid = drupal_hash_base64(uniqid(mt_rand(), TRUE) . drupal_random_bytes(55));
+    curl_setopt($this->curlHandle, CURLOPT_COOKIE, rawurlencode(session_name()) . '=' . rawurlencode($sid));
+
+    // Force our way into the session of the child site.
+    drupal_save_session(TRUE);
+    _drupal_session_write($sid, '');
+    drupal_save_session(FALSE);
+  }
 }
 
 /**
@@ -351,7 +432,7 @@
     // Destroy a table that the upgrade process needs.
     db_drop_table('access');
     // Assert that the upgrade fails.
-    $this->assertFalse($this->performUpgrade(FALSE), t('A failed upgrade should return messages.'));
+    $this->assertFalse($this->performUpgrade(FALSE) && $this->pendingUpdates, t('A failed upgrade should return messages.'));
   }
 
   /**
@@ -408,3 +489,309 @@
     $this->assertFalse($update_d6, t('The D6 upgrade flag variable has been correctly disabled.'));
   }
 }
+
+/**
+ * Performs point release update tests on a bare database.
+ *
+ * Loads an installation of Drupal 7.0 and runs the update process on it.
+ *
+ * The install contains the standard profile (plus all optional) modules
+ * without any content so that an update from any of the modules under this
+ * profile installation can be wholly tested.
+ */
+class BasicStandardUpdatePath extends UpdatePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Basic standard + all profile update path',
+      'description'  => 'Basic update path tests for a standard profile install with all enabled modules.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Path to the database dump files.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-7.bare.standard_all.database.php.gz',
+    );
+    parent::setUp();
+  }
+
+  /**
+   * Tests a successful point release update.
+   */
+  public function testBasicStandardUpdate() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+
+    // Hit the frontpage.
+    $this->drupalGet('');
+    $this->assertResponse(200);
+
+    // Verify that we are still logged in.
+    $this->drupalGet('user');
+    $this->clickLink(t('Edit'));
+    $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
+
+    // Logout and verify that we can login back in with our initial password.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
+    // The previous login should've triggered a password rehash, so login one
+    // more time to make sure the new hash is readable.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
+    // Test that the site name is correctly displayed.
+    $this->assertText('drupal', t('The site name is correctly displayed.'));
+
+    // Verify that the main admin sections are available.
+    $this->drupalGet('admin');
+    $this->assertText(t('Content'));
+    $this->assertText(t('Appearance'));
+    $this->assertText(t('People'));
+    $this->assertText(t('Configuration'));
+    $this->assertText(t('Reports'));
+    $this->assertText(t('Structure'));
+    $this->assertText(t('Modules'));
+
+    // Confirm that no {menu_links} entry exists for user/autocomplete.
+    $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
+    $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
+  }
+}
+
+/**
+ * Performs point release update tests on a bare database.
+ *
+ * Loads an installation of Drupal 7.0 and runs the update process on it.
+ *
+ * The install contains the minimal profile modules (without any generated
+ * content) so that an update from of a site under this profile may be tested.
+ */
+class BasicMinimalUpdatePath extends UpdatePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Basic minimal profile update path',
+      'description'  => 'Basic update path tests for a minimal profile install.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Path to the database dump files.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-7.bare.minimal.database.php.gz',
+    );
+    parent::setUp();
+  }
+
+  /**
+   * Tests a successful point release update.
+   */
+  public function testBasicMinimalUpdate() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+
+    // Hit the frontpage.
+    $this->drupalGet('');
+    $this->assertResponse(200);
+
+    // Verify that we are still logged in.
+    $this->drupalGet('user');
+    $this->clickLink(t('Edit'));
+    $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
+
+    // Logout and verify that we can login back in with our initial password.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
+    // The previous login should've triggered a password rehash, so login one
+    // more time to make sure the new hash is readable.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
+    // Test that the site name is correctly displayed.
+    $this->assertText('drupal', t('The site name is correctly displayed.'));
+
+    // Verify that the main admin sections are available.
+    $this->drupalGet('admin');
+    $this->assertText(t('Content'));
+    $this->assertText(t('Appearance'));
+    $this->assertText(t('People'));
+    $this->assertText(t('Configuration'));
+    $this->assertText(t('Reports'));
+    $this->assertText(t('Structure'));
+    $this->assertText(t('Modules'));
+
+    // Confirm that no {menu_links} entry exists for user/autocomplete.
+    $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
+    $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
+  }
+}
+
+/**
+ * Performs point release update tests on a 'filled' database.
+ *
+ * Loads an installation of Drupal 7.0 and runs the update process on it.
+ *
+ * The install contains the standard profile (plus all optional) modules
+ * with generated content so that an update from any of the modules under this
+ * profile installation can be wholly tested.
+ */
+class FilledStandardUpdatePath extends UpdatePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Basic standard + all profile update path, populated database',
+      'description'  => 'Basic update path tests for a standard profile install with all enabled modules and a populated database.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Path to the database dump files.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-7.filled.standard_all.database.php.gz',
+    );
+    parent::setUp();
+  }
+
+  /**
+   * Tests a successful point release update.
+   */
+  public function testFilledStandardUpdate() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+
+    // Hit the frontpage.
+    $this->drupalGet('');
+    $this->assertResponse(200);
+
+    // Verify that we are still logged in.
+    $this->drupalGet('user');
+    $this->clickLink(t('Edit'));
+    $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
+
+    // Logout and verify that we can login back in with our initial password.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
+    // The previous login should've triggered a password rehash, so login one
+    // more time to make sure the new hash is readable.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
+    // Test that the site name is correctly displayed.
+    $this->assertText('drupal', t('The site name is correctly displayed.'));
+
+    // Verify that the main admin sections are available.
+    $this->drupalGet('admin');
+    $this->assertText(t('Content'));
+    $this->assertText(t('Appearance'));
+    $this->assertText(t('People'));
+    $this->assertText(t('Configuration'));
+    $this->assertText(t('Reports'));
+    $this->assertText(t('Structure'));
+    $this->assertText(t('Modules'));
+
+    // Confirm that no {menu_links} entry exists for user/autocomplete.
+    $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
+    $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
+  }
+}
+
+/**
+ * Performs point release update tests on a populated database.
+ *
+ * Loads an installation of Drupal 7.0 and runs the update process on it.
+ *
+ * The install contains the minimal profile modules (along with generated
+ * content) so that an update from of a site under this profile may be tested.
+ */
+class FilledMinimalUpdatePath extends UpdatePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Basic minimal profile update path, populated database',
+      'description'  => 'Basic update path tests for a minimal profile install with a populated database.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Path to the database dump files.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-7.filled.minimal.database.php.gz',
+    );
+    parent::setUp();
+  }
+
+  /**
+   * Tests a successful point release update.
+   */
+  public function testFilledStandardUpdate() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+
+    // Hit the frontpage.
+    $this->drupalGet('');
+    $this->assertResponse(200);
+
+    // Verify that we are still logged in.
+    $this->drupalGet('user');
+    $this->clickLink(t('Edit'));
+    $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.'));
+
+    // Logout and verify that we can login back in with our initial password.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
+    // The previous login should've triggered a password rehash, so login one
+    // more time to make sure the new hash is readable.
+    $this->drupalLogout();
+    $this->drupalLogin((object) array(
+      'uid' => 1,
+      'name' => 'admin',
+      'pass_raw' => 'admin',
+    ));
+
+    // Test that the site name is correctly displayed.
+    $this->assertText('drupal', t('The site name is correctly displayed.'));
+
+    // Verify that the main admin sections are available.
+    $this->drupalGet('admin');
+    $this->assertText(t('Content'));
+    $this->assertText(t('Appearance'));
+    $this->assertText(t('People'));
+    $this->assertText(t('Configuration'));
+    $this->assertText(t('Reports'));
+    $this->assertText(t('Structure'));
+    $this->assertText(t('Modules'));
+
+    // Confirm that no {menu_links} entry exists for user/autocomplete.
+    $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField();
+    $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete'));
+  }
+}

Modified: branches/upstream/current-7/modules/simpletest/tests/url_alter_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/url_alter_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/url_alter_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/url_alter_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/url_alter_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/url_alter_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/url_alter_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/url_alter_test.module Sun Feb  5 17:53:08 2012
@@ -30,6 +30,10 @@
  * Implements hook_url_inbound_alter().
  */
 function url_alter_test_url_inbound_alter(&$path, $original_path, $path_language) {
+  if (!request_path() && !empty($_GET['q'])) {
+    drupal_set_message("\$_GET['q'] is non-empty with an empty request path.");
+  }
+
   // Rewrite user/username to user/uid.
   if (preg_match('!^user/([^/]+)(/.*)?!', $path, $matches)) {
     if ($account = user_load_by_name($matches[1])) {

Modified: branches/upstream/current-7/modules/simpletest/tests/xmlrpc_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/xmlrpc_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/xmlrpc_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/xmlrpc_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/statistics/statistics.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/statistics/statistics.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/statistics/statistics.info (original)
+++ branches/upstream/current-7/modules/statistics/statistics.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/config/system/statistics
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/statistics/statistics.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/statistics/statistics.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/statistics/statistics.module (original)
+++ branches/upstream/current-7/modules/statistics/statistics.module Sun Feb  5 17:53:08 2012
@@ -75,11 +75,14 @@
   }
   if (variable_get('statistics_enable_access_log', 0)) {
     drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
+
+    // For anonymous users unicode.inc will not have been loaded.
+    include_once DRUPAL_ROOT . '/includes/unicode.inc';
     // Log this page access.
     db_insert('accesslog')
       ->fields(array(
-        'title' => strip_tags(drupal_get_title()),
-        'path' => $_GET['q'],
+        'title' => truncate_utf8(strip_tags(drupal_get_title()), 255),
+        'path' => truncate_utf8($_GET['q'], 255),
         'url' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '',
         'hostname' => ip_address(),
         'uid' => $user->uid,

Modified: branches/upstream/current-7/modules/statistics/statistics.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/statistics/statistics.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/statistics/statistics.test (original)
+++ branches/upstream/current-7/modules/statistics/statistics.test Sun Feb  5 17:53:08 2012
@@ -63,9 +63,10 @@
   function setUp() {
     parent::setUp('statistics');
 
+    $this->auth_user = $this->drupalCreateUser(array('access content', 'create page content', 'edit own page content'));
+
     // Ensure we have a node page to access.
-    $this->node = $this->drupalCreateNode();
-    $this->auth_user = $this->drupalCreateUser();
+    $this->node = $this->drupalCreateNode(array('title' => $this->randomName(255), 'uid' => $this->auth_user->uid));
 
     // Enable page caching.
     variable_set('cache', TRUE);
@@ -116,6 +117,27 @@
     $this->assertEqual(array_intersect_key($log[5], $expected), $expected);
     $node_counter = statistics_get($this->node->nid);
     $this->assertIdentical($node_counter['totalcount'], '3');
+
+    // Visit edit page to generate a title greater than 255.
+    $path = 'node/' . $this->node->nid . '/edit';
+    $expected = array(
+      'title' => truncate_utf8(t('Edit Basic page') . ' ' . $this->node->title, 255),
+      'path' => $path,
+    );
+    $this->drupalGet($path);
+    $log = db_query('SELECT * FROM {accesslog}')->fetchAll(PDO::FETCH_ASSOC);
+    $this->assertTrue(is_array($log) && count($log) == 7, t('Page request was logged.'));
+    $this->assertEqual(array_intersect_key($log[6], $expected), $expected);
+
+    // Create a path longer than 255 characters.
+    $long_path = $this->randomName(256);
+
+    // Test that the long path is properly truncated when logged.
+    $this->drupalGet($long_path);
+    $log = db_query('SELECT * FROM {accesslog}')->fetchAll(PDO::FETCH_ASSOC);
+    $this->assertTrue(is_array($log) && count($log) == 8, 'Page request was logged for a path over 255 characters.');
+    $this->assertEqual($log[7]['path'], truncate_utf8($long_path, 255));
+
   }
 }
 

Modified: branches/upstream/current-7/modules/syslog/syslog.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/syslog/syslog.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/syslog/syslog.info (original)
+++ branches/upstream/current-7/modules/syslog/syslog.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 files[] = syslog.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/syslog/syslog.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/syslog/syslog.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/syslog/syslog.module (original)
+++ branches/upstream/current-7/modules/syslog/syslog.module Sun Feb  5 17:53:08 2012
@@ -6,6 +6,15 @@
  */
 
 if (defined('LOG_LOCAL0')) {
+  /**
+   * Sets the proper logging facility.
+   *
+   * Note that LOG_LOCAL0 through LOG_LOCAL7 are not available on Windows, so we
+   * check for availability. If LOG_LOCAL0 is defined by the PHP environment, we
+   * set that as the default; if not, we use LOG_USER.
+   *
+   * @see http://php.net/manual/function.syslog.php
+   */
   define('DEFAULT_SYSLOG_FACILITY', LOG_LOCAL0);
 }
 else {

Modified: branches/upstream/current-7/modules/system/system.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.admin.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.admin.inc (original)
+++ branches/upstream/current-7/modules/system/system.admin.inc Sun Feb  5 17:53:08 2012
@@ -622,7 +622,7 @@
     }
     else {
       // File upload failed.
-      form_set_error('logo_upload', t('The favicon could not be uploaded.'));
+      form_set_error('favicon_upload', t('The favicon could not be uploaded.'));
     }
   }
 
@@ -811,10 +811,19 @@
       // Only display visible modules.
       elseif (isset($visible_files[$requires])) {
         $requires_name = $files[$requires]->info['name'];
+        // Disable this module if it is incompatible with the dependency's version.
         if ($incompatible_version = drupal_check_incompatibility($v, str_replace(DRUPAL_CORE_COMPATIBILITY . '-', '', $files[$requires]->info['version']))) {
           $extra['requires'][$requires] = t('@module (<span class="admin-missing">incompatible with</span> version @version)', array(
             '@module' => $requires_name . $incompatible_version,
             '@version' => $files[$requires]->info['version'],
+          ));
+          $extra['disabled'] = TRUE;
+        }
+        // Disable this module if the dependency is incompatible with this
+        // version of Drupal core.
+        elseif ($files[$requires]->info['core'] != DRUPAL_CORE_COMPATIBILITY) {
+          $extra['requires'][$requires] = t('@module (<span class="admin-missing">incompatible with</span> this version of Drupal core)', array(
+            '@module' => $requires_name,
           ));
           $extra['disabled'] = TRUE;
         }

Modified: branches/upstream/current-7/modules/system/system.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.api.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.api.php (original)
+++ branches/upstream/current-7/modules/system/system.api.php Sun Feb  5 17:53:08 2012
@@ -991,7 +991,8 @@
  *   );
  * @endcode
  * When path 'my-module/foo/edit' is requested, integer 1 will be replaced
- * with 'foo' and passed to the callback function.
+ * with 'foo' and passed to the callback function. Note that wildcards may not
+ * be used as the first component.
  *
  * Registered paths may also contain special "auto-loader" wildcard components
  * in the form of '%mymodule_abc', where the '%' part means that this path
@@ -1018,7 +1019,11 @@
  * @endcode
  * This 'abc' object will then be passed into the callback functions defined
  * for the menu item, such as the page callback function mymodule_abc_edit()
- * to replace the integer 1 in the argument array.
+ * to replace the integer 1 in the argument array. Note that a load function
+ * should return FALSE when it is unable to provide a loadable object. For 
+ * example, the node_load() function for the 'node/%node/edit' menu item will
+ * return FALSE for the path 'node/999/edit' if a node with a node ID of 999
+ * does not exist. The menu routing system will return a 404 error in this case.
  *
  * You can also define a %wildcard_to_arg() function (for the example menu
  * entry above this would be 'mymodule_abc_to_arg()'). The _to_arg() function
@@ -1578,12 +1583,21 @@
  * One popular use of this hook is to add form elements to the node form. When
  * altering a node form, the node object can be accessed at $form['#node'].
  *
- * Note that instead of hook_form_alter(), which is called for all forms, you
- * can also use hook_form_FORM_ID_alter() to alter a specific form. For each
- * module (in system weight order) the general form alter hook implementation
- * is invoked first, then the form ID specific alter implementation is called.
- * After all module hook implementations are invoked, the hook_form_alter()
- * implementations from themes are invoked in the same manner.
+ * In addition to hook_form_alter(), which is called for all forms, there are
+ * two more specific form hooks available. The first,
+ * hook_form_BASE_FORM_ID_alter(), allows targeting of a form/forms via a base
+ * form (if one exists). The second, hook_form_FORM_ID_alter(), can be used to
+ * target a specific form directly.
+ *
+ * The call order is as follows: all existing form alter functions are called
+ * for module A, then all for module B, etc., followed by all for any base
+ * theme(s), and finally for the theme itself. The module order is determined
+ * by system weight, then by module name.
+ *
+ * Within each module, form alter hooks are called in the following order:
+ * first, hook_form_alter(); second, hook_form_BASE_FORM_ID_alter(); third,
+ * hook_form_FORM_ID_alter(). So, for each module, the more general hooks are
+ * called first followed by the more specific.
  *
  * @param $form
  *   Nested array of form elements that comprise the form.
@@ -1595,6 +1609,7 @@
  *   String representing the name of the form itself. Typically this is the
  *   name of the function that generated the form.
  *
+ * @see hook_form_BASE_FORM_ID_alter()
  * @see hook_form_FORM_ID_alter()
  */
 function hook_form_alter(&$form, &$form_state, $form_id) {
@@ -1614,6 +1629,10 @@
  * Modules can implement hook_form_FORM_ID_alter() to modify a specific form,
  * rather than implementing hook_form_alter() and checking the form ID, or
  * using long switch statements to alter multiple forms.
+ *
+ * Form alter hooks are called in the following order: hook_form_alter(),
+ * hook_form_BASE_FORM_ID_alter(), hook_form_FORM_ID_alter(). See
+ * hook_form_alter() for more details.
  *
  * @param $form
  *   Nested array of form elements that comprise the form.
@@ -1626,6 +1645,7 @@
  *   name of the function that generated the form.
  *
  * @see hook_form_alter()
+ * @see hook_form_BASE_FORM_ID_alter()
  * @see drupal_prepare_form()
  */
 function hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
@@ -1642,17 +1662,27 @@
 }
 
 /**
- * Provide a form-specific alteration for shared forms.
+ * Provide a form-specific alteration for shared ('base') forms.
+ *
+ * By default, when drupal_get_form() is called, Drupal looks for a function
+ * with the same name as the form ID, and uses that function to build the form.
+ * In contrast, base forms allow multiple form IDs to be mapped to a single base
+ * (also called 'factory') form function.
  *
  * Modules can implement hook_form_BASE_FORM_ID_alter() to modify a specific
- * form belonging to multiple form_ids, rather than implementing
- * hook_form_alter() and checking for conditions that would identify the
- * shared form constructor.
- *
- * Examples for such forms are node_form() or comment_form().
- *
- * Note that this hook fires after hook_form_FORM_ID_alter() and before
- * hook_form_alter().
+ * base form, rather than implementing hook_form_alter() and checking for
+ * conditions that would identify the shared form constructor.
+ *
+ * To identify the base form ID for a particular form (or to determine whether
+ * one exists) check the $form_state. The base form ID is stored under
+ * $form_state['build_info']['base_form_id'].
+ *
+ * See hook_forms() for more information on how to implement base forms in
+ * Drupal.
+ *
+ * Form alter hooks are called in the following order: hook_form_alter(),
+ * hook_form_BASE_FORM_ID_alter(), hook_form_FORM_ID_alter(). See
+ * hook_form_alter() for more details.
  *
  * @param $form
  *   Nested array of form elements that comprise the form.
@@ -1662,8 +1692,10 @@
  *   String representing the name of the form itself. Typically this is the
  *   name of the function that generated the form.
  *
+ * @see hook_form_alter()
  * @see hook_form_FORM_ID_alter()
  * @see drupal_prepare_form()
+ * @see hook_forms()
  */
 function hook_form_BASE_FORM_ID_alter(&$form, &$form_state, $form_id) {
   // Modification for the form with the given BASE_FORM_ID goes here. For
@@ -1683,13 +1715,25 @@
  *
  * By default, when drupal_get_form() is called, the system will look for a
  * function with the same name as the form ID, and use that function to build
- * the form. This hook allows you to override that behavior in two ways.
+ * the form. If no such function is found, Drupal calls this hook. Modules
+ * implementing this hook can then provide their own instructions for mapping
+ * form IDs to constructor functions. As a result, you can easily map multiple
+ * form IDs to a single form constructor (referred to as a 'base' form).
+ *
+ * Using a base form can help to avoid code duplication, by allowing many
+ * similar forms to use the same code base. Another benefit is that it becomes
+ * much easier for other modules to apply a general change to the group of
+ * forms; hook_form_BASE_FORM_ID_alter() can be used to easily alter multiple
+ * forms at once by directly targeting the shared base form.
+ *
+ * Two example use cases where base forms may be useful are given below.
  *
  * First, you can use this hook to tell the form system to use a different
  * function to build certain forms in your module; this is often used to define
  * a form "factory" function that is used to build several similar forms. In
  * this case, your hook implementation will likely ignore all of the input
- * arguments. See node_forms() for an example of this.
+ * arguments. See node_forms() for an example of this. Note, node_forms() is the
+ * hook_forms() implementation; the base form itself is defined in node_form().
  *
  * Second, you could use this hook to define how to build a form with a
  * dynamically-generated form ID. In this case, you would need to verify that
@@ -1706,7 +1750,9 @@
  * @return
  *   An associative array whose keys define form_ids and whose values are an
  *   associative array defining the following keys:
- *   - callback: The name of the form builder function to invoke.
+ *   - callback: The name of the form builder function to invoke. This will be
+ *     used for the base form ID, for example, to target a base form using
+ *     hook_form_BASE_FORM_ID_alter().
  *   - callback arguments: (optional) Additional arguments to pass to the
  *     function defined in 'callback', which are prepended to $args.
  *   - wrapper_callback: (optional) The name of a form builder function to
@@ -1861,12 +1907,20 @@
  *  - 'language':
  *     The language object used to build the message before hook_mail_alter()
  *     is invoked.
+ *  - 'send':
+ *     Set to FALSE to abort sending this email message.
  *
  * @see drupal_mail()
  */
 function hook_mail_alter(&$message) {
   if ($message['id'] == 'modulename_messagekey') {
-    $message['body'][] = "--\nMail sent out from " . variable_get('sitename', t('Drupal'));
+    if (!example_notifications_optin($message['to'], $message['id'])) {
+      // If the recipient has opted to not receive such messages, cancel
+      // sending.
+      $message['send'] = FALSE;
+      return;
+    }
+    $message['body'][] = "--\nMail sent out from " . variable_get('site_name', t('Drupal'));
   }
 }
 
@@ -1876,6 +1930,15 @@
  * This hook is invoked during module_implements(). A module may implement this
  * hook in order to reorder the implementing modules, which are otherwise
  * ordered by the module's system weight.
+ *
+ * Note that hooks invoked using drupal_alter() can have multiple variations
+ * (such as hook_form_alter() and hook_form_FORM_ID_alter()). drupal_alter()
+ * will call all such variants defined by a single module in turn. For the
+ * purposes of hook_module_implements_alter(), these variants are treated as
+ * a single hook. Thus, to ensure that your implementation of
+ * hook_form_FORM_ID_alter() is called at the right time, you will have to
+ * have to change the order of hook_form_alter() implementation in
+ * hook_module_implements_alter().
  *
  * @param $implementations
  *   An array keyed by the module's name. The value of each item corresponds
@@ -1894,6 +1957,25 @@
     unset($implementations['my_module']);
     $implementations['my_module'] = $group;
   }
+}
+
+/**
+ * Return additional themes provided by modules.
+ *
+ * Only use this hook for testing purposes. Use a hidden MYMODULE_test.module
+ * to implement this hook. Testing themes should be hidden, too.
+ *
+ * This hook is invoked from _system_rebuild_theme_data() and allows modules to
+ * register additional themes outside of the regular 'themes' directories of a
+ * Drupal installation.
+ *
+ * @return
+ *   An associative array. Each key is the system name of a theme and each value
+ *   is the corresponding path to the theme's .info file.
+ */
+function hook_system_theme_info() {
+  $themes['mymodule_test_theme'] = drupal_get_path('module', 'mymodule') . '/mymodule_test_theme/mymodule_test_theme.info';
+  return $themes;
 }
 
 /**
@@ -2583,7 +2665,7 @@
  *   An array of file objects, indexed by fid.
  *
  * @see file_load_multiple()
- * @see upload_file_load()
+ * @see file_load()
  */
 function hook_file_load($files) {
   // Add the upload specific data into the file object.
@@ -2708,7 +2790,6 @@
  *   The file that has just been deleted.
  *
  * @see file_delete()
- * @see upload_file_delete()
  */
 function hook_file_delete($file) {
   // Delete all information associated with the file.
@@ -2881,7 +2962,7 @@
   // Test PHP version
   $requirements['php'] = array(
     'title' => $t('PHP'),
-    'value' => ($phase == 'runtime') ? l(phpversion(), 'admin/logs/status/php') : phpversion(),
+    'value' => ($phase == 'runtime') ? l(phpversion(), 'admin/reports/status/php') : phpversion(),
   );
   if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) {
     $requirements['php']['description'] = $t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP));
@@ -2903,7 +2984,7 @@
       );
     }
 
-    $requirements['cron']['description'] .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/logs/status/run-cron')));
+    $requirements['cron']['description'] .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
 
     $requirements['cron']['title'] = $t('Cron maintenance tasks');
   }
@@ -2930,7 +3011,8 @@
  * By declaring the tables used by your module via an implementation of
  * hook_schema(), these tables will be available on all supported database
  * engines. You don't have to deal with the different SQL dialects for table
- * creation and alteration of the supported database engines *
+ * creation and alteration of the supported database engines.
+ *
  * See the Schema API Handbook at http://drupal.org/node/146843 for
  * details on schema definition structures.
  *
@@ -3160,13 +3242,10 @@
  *
  * A good rule of thumb is to remove updates older than two major releases of
  * Drupal. See hook_update_last_removed() to notify Drupal about the removals.
+ * For further information about releases and release numbers see:
+ * @link http://drupal.org/node/711070 Maintaining a drupal.org project with Git @endlink
  *
  * Never renumber update functions.
- *
- * Further information about releases and release numbers:
- * - @link http://drupal.org/handbook/version-info http://drupal.org/handbook/version-info @endlink
- * - @link http://drupal.org/node/93999 http://drupal.org/node/93999 @endlink (Overview of contributions branches and tags)
- * - @link http://drupal.org/handbook/cvs/releases http://drupal.org/handbook/cvs/releases @endlink
  *
  * Implementations of this hook should be placed in a mymodule.install file in
  * the same directory as mymodule.module. Drupal core's updates are implemented
@@ -4033,7 +4112,7 @@
  * @param $path
  *   The outbound path to alter, not adjusted for path aliases yet. It won't be
  *   adjusted for path aliases until all modules are finished altering it, thus
- *   being consistent with hook_url_alter_inbound(), which adjusts for all path
+ *   being consistent with hook_url_inbound_alter(), which adjusts for all path
  *   aliases before allowing modules to alter it. This may have been altered by
  *   other modules before this one.
  * @param $options

Modified: branches/upstream/current-7/modules/system/system.base.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.base.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.base.css (original)
+++ branches/upstream/current-7/modules/system/system.base.css Sun Feb  5 17:53:08 2012
@@ -157,12 +157,9 @@
 .progress .percentage {
   float: right; /* LTR */
 }
-.progress-disabled {
-  float: left; /* LTR */
-}
 /* Throbber */
 .ajax-progress {
-  float: left; /* LTR */
+  display: inline-block;
 }
 .ajax-progress .throbber {
   background: transparent url(../../misc/throbber.gif) no-repeat 0px -18px;
@@ -171,6 +168,9 @@
   margin: 2px;
   width: 15px;
 }
+.ajax-progress .message {
+  padding-left: 20px;
+}
 tr .ajax-progress .throbber {
   margin: 0 2px;
 }

Modified: branches/upstream/current-7/modules/system/system.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.info (original)
+++ branches/upstream/current-7/modules/system/system.info Sun Feb  5 17:53:08 2012
@@ -13,7 +13,7 @@
 configure = admin/config/system
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/system/system.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.install?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.install (original)
+++ branches/upstream/current-7/modules/system/system.install Sun Feb  5 17:53:08 2012
@@ -465,7 +465,7 @@
       $requirements['update status'] = array(
         'value' => $t('Not enabled'),
         'severity' => REQUIREMENT_WARNING,
-        'description' => $t('Update notifications are not enabled. It is <strong>highly recommended</strong> that you enable the update status module from the <a href="@module">module administration page</a> in order to stay up-to-date on new releases. For more information, <a href="@update">Update status handbook page</a>.', array('@update' => 'http://drupal.org/handbook/modules/update', '@module' => url('admin/modules'))),
+        'description' => $t('Update notifications are not enabled. It is <strong>highly recommended</strong> that you enable the update manager module from the <a href="@module">module administration page</a> in order to stay up-to-date on new releases. For more information, <a href="@update">Update status handbook page</a>.', array('@update' => 'http://drupal.org/handbook/modules/update', '@module' => url('admin/modules'))),
       );
     }
     else {
@@ -2242,10 +2242,6 @@
     ));
   }
   $insert->execute();
-
-  // Remove obsolete variable 'site_offline_message'. See
-  // update_fix_d7_requirements().
-  variable_del('site_offline_message');
 }
 
 /**
@@ -2974,6 +2970,15 @@
 }
 
 /**
+ * Remove the obsolete 'site_offline_message' variable.
+ *
+ * @see update_fix_d7_requirements()
+ */
+function system_update_7072() {
+  variable_del('site_offline_message');
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */

Modified: branches/upstream/current-7/modules/system/system.mail.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.mail.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.mail.inc (original)
+++ branches/upstream/current-7/modules/system/system.mail.inc Sun Feb  5 17:53:08 2012
@@ -65,28 +65,49 @@
     // For headers, PHP's API suggests that we use CRLF normally,
     // but some MTAs incorrectly replace LF with CRLF. See #234403.
     $mail_headers = join("\n", $mimeheaders);
-    if (isset($message['Return-Path']) && !ini_get('safe_mode')) {
-      $mail_result = mail(
-        $message['to'],
-        $mail_subject,
-        $mail_body,
-        $mail_headers,
-        // Pass the Return-Path via sendmail's -f command.
-        '-f ' . $message['Return-Path']
-      );
-    }
-    else {
-      // The optional $additional_parameters argument to mail() is not allowed
-      // if safe_mode is enabled. Passing any value throws a PHP warning and
-      // makes mail() return FALSE.
-      $mail_result = mail(
-        $message['to'],
-        $mail_subject,
-        $mail_body,
-        $mail_headers
-      );
-    }
-    return $mail_result;
+
+    // We suppress warnings and notices from mail() because of issues on some
+    // hosts. The return value of this method will still indicate whether mail
+    // was sent successfully.
+    if (!isset($_SERVER['WINDIR']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Win32') === FALSE) {
+      if (isset($message['Return-Path']) && !ini_get('safe_mode')) {
+        // On most non-Windows systems, the "-f" option to the sendmail command
+        // is used to set the Return-Path. There is no space between -f and
+        // the value of the return path.
+        $mail_result = @mail(
+          $message['to'],
+          $mail_subject,
+          $mail_body,
+          $mail_headers,
+          '-f' . $message['Return-Path']
+        );
+      }
+      else {
+        // The optional $additional_parameters argument to mail() is not
+        // allowed if safe_mode is enabled. Passing any value throws a PHP
+        // warning and makes mail() return FALSE.
+        $mail_result = @mail(
+          $message['to'],
+          $mail_subject,
+          $mail_body,
+          $mail_headers
+        );
+      }
+     }
+     else {
+      // On Windows, PHP will use the value of sendmail_from for the
+      // Return-Path header.
+      $old_from = ini_get('sendmail_from');
+      ini_set('sendmail_from', $message['Return-Path']);
+      $mail_result = @mail(
+         $message['to'],
+         $mail_subject,
+         $mail_body,
+         $mail_headers
+       );
+      ini_set('sendmail_from', $old_from);
+     }
+     return $mail_result;
   }
 }
 

Modified: branches/upstream/current-7/modules/system/system.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.module (original)
+++ branches/upstream/current-7/modules/system/system.module Sun Feb  5 17:53:08 2012
@@ -44,6 +44,13 @@
  * Required option on forms and settings
  */
 define('DRUPAL_REQUIRED', 2);
+
+/**
+ * Maximum number of values in a weight select element.
+ *
+ * If the number of values is over the maximum, a text field is used instead.
+ */
+define('DRUPAL_WEIGHT_SELECT_MAX', 100);
 
 /**
  * Return only visible regions.
@@ -969,7 +976,7 @@
   );
   $items['admin/config/system/site-information'] = array(
     'title' => 'Site information',
-    'description' => t('Change site name, e-mail address, slogan, default front page, and number of posts per page, error pages.'),
+    'description' => 'Change site name, e-mail address, slogan, default front page, and number of posts per page, error pages.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('system_site_information_settings'),
     'access arguments' => array('administer site configuration'),
@@ -977,8 +984,8 @@
     'weight' => -20,
   );
   $items['admin/config/system/cron'] = array(
-    'title' => t('Cron'),
-    'description' => t('Manage automatic site maintenance tasks.'),
+    'title' => 'Cron',
+    'description' => 'Manage automatic site maintenance tasks.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('system_cron_settings'),
     'access arguments' => array('administer site configuration'),
@@ -1108,7 +1115,7 @@
     'title' => 'Drupal progress indicator',
     'version' => VERSION,
     'js' => array(
-      'misc/progress.js' => array('group' => JS_DEFAULT, 'cache' => FALSE),
+      'misc/progress.js' => array('group' => JS_DEFAULT),
     ),
   );
 
@@ -2465,6 +2472,18 @@
 function _system_rebuild_theme_data() {
   // Find themes
   $themes = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info$/', 'themes');
+  // Allow modules to add further themes.
+  if ($module_themes = module_invoke_all('system_theme_info')) {
+    foreach ($module_themes as $name => $uri) {
+      // @see file_scan_directory()
+      $themes[$name] = (object) array(
+        'uri' => $uri,
+        'filename' => pathinfo($uri, PATHINFO_FILENAME),
+        'name' => $name,
+      );
+    }
+  }
+
   // Find theme engines
   $engines = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.engine$/', 'themes/engines');
 
@@ -2700,8 +2719,8 @@
  * Implements hook_system_info_alter().
  */
 function system_system_info_alter(&$info, $file, $type) {
-  // Remove page-top from the blocks UI since it is reserved for modules to
-  // populate from outside the blocks system.
+  // Remove page-top and page-bottom from the blocks UI since they are reserved for
+  // modules to populate from outside the blocks system.
   if ($type == 'theme') {
     $info['regions_hidden'][] = 'page_top';
     $info['regions_hidden'][] = 'page_bottom';
@@ -2864,7 +2883,18 @@
 }
 
 /**
- * Determines if the current user is in compact mode.
+ * Determines whether the current user is in compact mode.
+ *
+ * Compact mode shows certain administration pages with less description text,
+ * such as the configuration page and the permissions page.
+ *
+ * Whether the user is in compact mode is determined by a cookie, which is set
+ * for the user by system_admin_compact_page().
+ *
+ * If the user does not have the cookie, the default value is given by the
+ * system variable 'admin_compact_mode', which itself defaults to FALSE. This
+ * does not have a user interface to set it: it is a hidden variable which can
+ * be set in the settings.php file.
  *
  * @return
  *   TRUE when in compact mode, FALSE when in expanded mode.
@@ -3420,12 +3450,12 @@
 function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FILE_EXISTS_RENAME) {
   $parsed_url = parse_url($url);
   if (!isset($destination)) {
-    $path = file_build_uri(basename($parsed_url['path']));
+    $path = file_build_uri(drupal_basename($parsed_url['path']));
   }
   else {
     if (is_dir(drupal_realpath($destination))) {
       // Prevent URIs with triple slashes when glueing parts together.
-      $path = str_replace('///', '//', "$destination/") . basename($parsed_url['path']);
+      $path = str_replace('///', '//', "$destination/") . drupal_basename($parsed_url['path']);
     }
     else {
       $path = $destination;
@@ -3860,7 +3890,10 @@
     drupal_write_record('date_formats', $info, $keys);
   }
 
+  // Retrieve an array of language objects for enabled languages.
   $languages = language_list('enabled');
+  // This list is keyed off the value of $language->enabled; we want the ones
+  // that are enabled (value of 1).
   $languages = $languages[1];
 
   $locale_format = array();

Modified: branches/upstream/current-7/modules/system/system.queue.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.queue.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.queue.inc (original)
+++ branches/upstream/current-7/modules/system/system.queue.inc Sun Feb  5 17:53:08 2012
@@ -45,13 +45,13 @@
  * would be an in-memory queue backend which might lose items if it crashes.
  * However, such a backend would be able to deal with significantly more writes
  * than a reliable queue and for many tasks this is more important. See
- * aggregator_cron() for an example of how can this not be a problem. Another
- * example is doing Twitter statistics -- the small possibility of losing a few
- * items is insignificant next to power of the queue being able to keep up with
- * writes. As described in the processing section, regardless of the queue
- * being reliable or not, the processing code should be aware that an item
- * might be handed over for processing more than once (because the processing
- * code might time out before it finishes).
+ * aggregator_cron() for an example of how to effectively utilize a
+ * non-reliable queue. Another example is doing Twitter statistics -- the small
+ * possibility of losing a few items is insignificant next to power of the
+ * queue being able to keep up with writes. As described in the processing
+ * section, regardless of the queue being reliable or not, the processing code
+ * should be aware that an item might be handed over for processing more than
+ * once (because the processing code might time out before it finishes).
  */
 
 /**

Modified: branches/upstream/current-7/modules/system/system.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.test (original)
+++ branches/upstream/current-7/modules/system/system.test Sun Feb  5 17:53:08 2012
@@ -272,12 +272,32 @@
   }
 
   /**
-   * Tests entity cache after enabling a module with a dependency on an enitity
-   * providing module.
+   * Ensures entity info cache is updated after changes.
+   */
+  function testEntityInfoChanges() {
+    module_enable(array('entity_cache_test'));
+    $entity_info = entity_get_info();
+    $this->assertTrue(isset($entity_info['entity_cache_test']), 'Test entity type found.');
+
+    // Change the label of the test entity type and make sure changes appear
+    // after flushing caches.
+    variable_set('entity_cache_test_label', 'New label.');
+    drupal_flush_all_caches();
+    $info = entity_get_info('entity_cache_test');
+    $this->assertEqual($info['label'], 'New label.', 'New label appears in entity info.');
+
+    // Disable the providing module and make sure the entity type is gone.
+    module_disable(array('entity_cache_test', 'entity_cache_test_dependency'));
+    $entity_info = entity_get_info();
+    $this->assertFalse(isset($entity_info['entity_cache_test']), 'Entity type of the providing module is gone.');
+  }
+
+  /**
+   * Tests entity info cache after enabling a module with a dependency on an entity providing module.
    *
    * @see entity_cache_test_watchdog()
    */
-  function testEntityCache() {
+  function testEntityInfoCacheWatchdog() {
     module_enable(array('entity_cache_test'));
     $info = variable_get('entity_cache_test');
     $this->assertEqual($info['label'], 'Entity Cache Test', 'Entity info label is correct.');
@@ -419,6 +439,35 @@
 
     // Verify that the module has been disabled.
     $this->assertModules(array('system_dependencies_test'), FALSE);
+  }
+
+  /**
+   * Tests enabling a module that depends on an incompatible version of a module.
+   */
+  function testIncompatibleModuleVersionDependency() {
+    // Test that the system_incompatible_module_version_dependencies_test is
+    // marked as having an incompatible dependency.
+    $this->drupalGet('admin/modules');
+    $this->assertRaw(t('@module (<span class="admin-missing">incompatible with</span> version @version)', array(
+      '@module' => 'System incompatible module version test (>2.0)',
+      '@version' => '1.0',
+    )), 'A module that depends on an incompatible version of a module is marked as such.');
+    $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Testing][system_incompatible_module_version_dependencies_test][enable]"]');
+    $this->assert(count($checkbox) == 1, t('Checkbox for the module is disabled.'));
+  }
+
+  /**
+   * Tests enabling a module that depends on a module with an incompatible core version.
+   */
+  function testIncompatibleCoreVersionDependency() {
+    // Test that the system_incompatible_core_version_dependencies_test is
+    // marked as having an incompatible dependency.
+    $this->drupalGet('admin/modules');
+    $this->assertRaw(t('@module (<span class="admin-missing">incompatible with</span> this version of Drupal core)', array(
+      '@module' => 'System incompatible core version test',
+    )), 'A module that depends on a module with an incompatible core version is marked as such.');
+    $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Testing][system_incompatible_core_version_dependencies_test][enable]"]');
+    $this->assert(count($checkbox) == 1, t('Checkbox for the module is disabled.'));
   }
 
   /**
@@ -1832,6 +1881,9 @@
 
     $generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE));
     $this->assertEqual($generated['[node:title]'], $node->title, t('Unsanitized token generated properly.'));
+
+    // Test token replacement when the string contains no tokens.
+    $this->assertEqual(token_replace('No tokens here.'), 'No tokens here.');
   }
 
   /**
@@ -2086,7 +2138,7 @@
   }
 
   function setUp() {
-    parent::setUp();
+    parent::setUp('update_script_test');
     $this->update_url = $GLOBALS['base_url'] . '/update.php';
     $this->update_user = $this->drupalCreateUser(array('administer software updates'));
   }
@@ -2123,6 +2175,58 @@
   }
 
   /**
+   * Tests that requirements warnings and errors are correctly displayed.
+   */
+  function testRequirements() {
+    $this->drupalLogin($this->update_user);
+
+    // If there are no requirements warnings or errors, we expect to be able to
+    // go through the update process uninterrupted.
+    $this->drupalGet($this->update_url, array('external' => TRUE));
+    $this->drupalPost(NULL, array(), t('Continue'));
+    $this->assertText(t('No pending updates.'), t('End of update process was reached.'));
+    // Confirm that all caches were cleared.
+    $this->assertText(t('hook_flush_caches() invoked for update_script_test.module.'), 'Caches were cleared when there were no requirements warnings or errors.');
+
+    // If there is a requirements warning, we expect it to be initially
+    // displayed, but clicking the link to proceed should allow us to go
+    // through the rest of the update process uninterrupted.
+
+    // First, run this test with pending updates to make sure they can be run
+    // successfully.
+    variable_set('update_script_test_requirement_type', REQUIREMENT_WARNING);
+    drupal_set_installed_schema_version('update_script_test', drupal_get_installed_schema_version('update_script_test') - 1);
+    $this->drupalGet($this->update_url, array('external' => TRUE));
+    $this->assertText('This is a requirements warning provided by the update_script_test module.');
+    $this->clickLink('try again');
+    $this->assertNoText('This is a requirements warning provided by the update_script_test module.');
+    $this->drupalPost(NULL, array(), t('Continue'));
+    $this->drupalPost(NULL, array(), t('Apply pending updates'));
+    $this->assertText(t('The update_script_test_update_7000() update was executed successfully.'), t('End of update process was reached.'));
+    // Confirm that all caches were cleared.
+    $this->assertText(t('hook_flush_caches() invoked for update_script_test.module.'), 'Caches were cleared after resolving a requirements warning and applying updates.');
+
+    // Now try again without pending updates to make sure that works too.
+    $this->drupalGet($this->update_url, array('external' => TRUE));
+    $this->assertText('This is a requirements warning provided by the update_script_test module.');
+    $this->clickLink('try again');
+    $this->assertNoText('This is a requirements warning provided by the update_script_test module.');
+    $this->drupalPost(NULL, array(), t('Continue'));
+    $this->assertText(t('No pending updates.'), t('End of update process was reached.'));
+    // Confirm that all caches were cleared.
+    $this->assertText(t('hook_flush_caches() invoked for update_script_test.module.'), 'Caches were cleared after applying updates and re-running the script.');
+
+    // If there is a requirements error, it should be displayed even after
+    // clicking the link to proceed (since the problem that triggered the error
+    // has not been fixed).
+    variable_set('update_script_test_requirement_type', REQUIREMENT_ERROR);
+    $this->drupalGet($this->update_url, array('external' => TRUE));
+    $this->assertText('This is a requirements error provided by the update_script_test module.');
+    $this->clickLink('try again');
+    $this->assertText('This is a requirements error provided by the update_script_test module.');
+  }
+
+  /**
    * Tests the effect of using the update script on the theme system.
    */
   function testThemeSystem() {
@@ -2193,7 +2297,7 @@
   function testFileRetrieving() {
     // Test 404 handling by trying to fetch a randomly named file.
     drupal_mkdir($sourcedir = 'public://' . $this->randomName());
-    $filename = $this->randomName();
+    $filename = 'Файл для тестирования ' . $this->randomName();
     $url = file_create_url($sourcedir . '/' . $filename);
     $retrieved_file = system_retrieve_file($url);
     $this->assertFalse($retrieved_file, t('Non-existent file not fetched.'));
@@ -2201,7 +2305,12 @@
     // Actually create that file, download it via HTTP and test the returned path.
     file_put_contents($sourcedir . '/' . $filename, 'testing');
     $retrieved_file = system_retrieve_file($url);
-    $this->assertEqual($retrieved_file, 'public://' . $filename, t('Sane path for downloaded file returned (public:// scheme).'));
+
+    // URLs could not contains characters outside the ASCII set so $filename
+    // has to be encoded.
+    $encoded_filename = rawurlencode($filename);
+
+    $this->assertEqual($retrieved_file, 'public://' . $encoded_filename, t('Sane path for downloaded file returned (public:// scheme).'));
     $this->assertTrue(is_file($retrieved_file), t('Downloaded file does exist (public:// scheme).'));
     $this->assertEqual(filesize($retrieved_file), 7, t('File size of downloaded file is correct (public:// scheme).'));
     file_unmanaged_delete($retrieved_file);
@@ -2209,7 +2318,7 @@
     // Test downloading file to a different location.
     drupal_mkdir($targetdir = 'temporary://' . $this->randomName());
     $retrieved_file = system_retrieve_file($url, $targetdir);
-    $this->assertEqual($retrieved_file, "$targetdir/$filename", t('Sane path for downloaded file returned (temporary:// scheme).'));
+    $this->assertEqual($retrieved_file, "$targetdir/$encoded_filename", t('Sane path for downloaded file returned (temporary:// scheme).'));
     $this->assertTrue(is_file($retrieved_file), t('Downloaded file does exist (temporary:// scheme).'));
     $this->assertEqual(filesize($retrieved_file), 7, t('File size of downloaded file is correct (temporary:// scheme).'));
     file_unmanaged_delete($retrieved_file);

Modified: branches/upstream/current-7/modules/taxonomy/taxonomy.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/taxonomy/taxonomy.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.info (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.info Sun Feb  5 17:53:08 2012
@@ -9,7 +9,7 @@
 configure = admin/structure/taxonomy
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/taxonomy/taxonomy.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/taxonomy/taxonomy.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.module (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.module Sun Feb  5 17:53:08 2012
@@ -295,7 +295,9 @@
   $items['taxonomy/term/%taxonomy_term/edit'] = array(
     'title' => 'Edit',
     'page callback' => 'drupal_get_form',
-    'page arguments' => array('taxonomy_form_term', 2),
+    // Pass a NULL argument to ensure that additional path components are not
+    // passed to taxonomy_form_term() as the vocabulary machine name argument.
+    'page arguments' => array('taxonomy_form_term', 2, NULL),
     'access callback' => 'taxonomy_term_edit_access',
     'access arguments' => array(2),
     'type' => MENU_LOCAL_TASK,
@@ -426,6 +428,7 @@
 
   if (!empty($vocabulary->vid) && !empty($vocabulary->name)) {
     $status = drupal_write_record('taxonomy_vocabulary', $vocabulary, 'vid');
+    taxonomy_vocabulary_static_reset(array($vocabulary->vid));
     if ($vocabulary->old_machine_name != $vocabulary->machine_name) {
       field_attach_rename_bundle('taxonomy_term', $vocabulary->old_machine_name, $vocabulary->machine_name);
     }
@@ -434,6 +437,7 @@
   }
   elseif (empty($vocabulary->vid)) {
     $status = drupal_write_record('taxonomy_vocabulary', $vocabulary);
+    taxonomy_vocabulary_static_reset();
     field_attach_create_bundle('taxonomy_term', $vocabulary->machine_name);
     module_invoke_all('taxonomy_vocabulary_insert', $vocabulary);
     module_invoke_all('entity_insert', $vocabulary, 'taxonomy_vocabulary');
@@ -441,7 +445,6 @@
 
   unset($vocabulary->original);
   cache_clear_all();
-  taxonomy_vocabulary_static_reset(array($vocabulary->vid));
 
   return $status;
 }
@@ -863,7 +866,8 @@
  *   A taxonomy term ID.
  *
  * @return
- *   An array of term objects which are the parents of the term $tid.
+ *   An array of term objects which are the parents of the term $tid, or an
+ *   empty array if parents are not found.
  */
 function taxonomy_get_parents($tid) {
   $parents = &drupal_static(__FUNCTION__, array());
@@ -1022,9 +1026,9 @@
           break;
         }
         $term = $load_entities ? $term_entities[$child] : $terms[$vid][$child];
-        if (count($parents[$vid][$term->tid]) > 1) {
-          // We have a term with multi parents here. Clone the term,
-          // so that the depth attribute remains correct.
+        if (isset($parents[$vid][$term->tid])) {
+          // Clone the term so that the depth attribute remains correct
+          // in the event of multiple parents.
           $term = clone $term;
         }
         $term->depth = $depth;
@@ -1193,6 +1197,8 @@
  * @return
  *   The vocabulary object with all of its metadata, if exists, FALSE otherwise.
  *   Results are statically cached.
+ *
+ * @see taxonomy_vocabulary_machine_name_load()
  */
 function taxonomy_vocabulary_load($vid) {
   $vocabularies = taxonomy_vocabulary_load_multiple(array($vid));
@@ -1208,6 +1214,8 @@
  * @return
  *   The vocabulary object with all of its metadata, if exists, FALSE otherwise.
  *   Results are statically cached.
+ *
+ * @see taxonomy_vocabulary_load()
  */
 function taxonomy_vocabulary_machine_name_load($name) {
   $vocabularies = taxonomy_vocabulary_load_multiple(NULL, array('machine_name' => $name));
@@ -1723,48 +1731,75 @@
 }
 
 /**
- * Implements hook_field_insert().
- */
-function taxonomy_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
+ * Implements hook_node_insert().
+ */
+function taxonomy_node_insert($node) {
+  // Add taxonomy index entries for the node.
+  taxonomy_build_node_index($node);
+}
+
+/**
+ * Builds and inserts taxonomy index entries for a given node.
+ *
+ * The index lists all terms that are related to a given node entity, and is
+ * therefore maintained at the entity level.
+ *
+ * @param $node
+ *   The node object.
+ */
+function taxonomy_build_node_index($node) {
   // We maintain a denormalized table of term/node relationships, containing
   // only data for current, published nodes.
-  if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node' && $entity->status) {
-    $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created', ));
-    foreach ($items as $item) {
-      $query->values(array(
-        'nid' => $entity->nid,
-        'tid' => $item['tid'],
-        'sticky' => $entity->sticky,
-        'created' => $entity->created,
-      ));
-    }
-    $query->execute();
-  }
-}
-
-/**
- * Implements hook_field_update().
- */
-function taxonomy_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) {
-  if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node') {
-    $first_call = &drupal_static(__FUNCTION__, array());
-
-    // We don't maintain data for old revisions, so clear all previous values
-    // from the table. Since this hook runs once per field, per object, make
-    // sure we only wipe values once.
-    if (!isset($first_call[$entity->nid])) {
-      $first_call[$entity->nid] = FALSE;
-      db_delete('taxonomy_index')->condition('nid', $entity->nid)->execute();
-    }
-    // Only save data to the table if the node is published.
-    if ($entity->status) {
+  $status = NULL;
+  if (variable_get('taxonomy_maintain_index_table', TRUE)) {
+    // If a node property is not set in the node object when node_save() is
+    // called, the old value from $node->original is used.
+    if (!empty($node->original)) {
+      $status = (int)(!empty($node->status) || (!isset($node->status) && !empty($node->original->status)));
+      $sticky = (int)(!empty($node->sticky) || (!isset($node->sticky) && !empty($node->original->sticky)));
+    }
+    else {
+      $status = (int)(!empty($node->status));
+      $sticky = (int)(!empty($node->sticky));
+    }
+  }
+  // We only maintain the taxonomy index for published nodes.
+  if ($status) {
+    // Collect a unique list of all the term IDs from all node fields.
+    $tid_all = array();
+    foreach (field_info_instances('node', $node->type) as $instance) {
+      $field_name = $instance['field_name'];
+      $field = field_info_field($field_name);
+      if ($field['module'] == 'taxonomy' && $field['storage']['type'] == 'field_sql_storage') {
+        // If a field value is not set in the node object when node_save() is
+        // called, the old value from $node->original is used.
+        if (isset($node->{$field_name})) {
+          $items = $node->{$field_name};
+        }
+        elseif (isset($node->original->{$field_name})) {
+          $items = $node->original->{$field_name};
+        }
+        else {
+          continue;
+        }
+        foreach (field_available_languages('node', $field) as $langcode) {
+          if (!empty($items[$langcode])) {
+            foreach ($items[$langcode] as $item) {
+              $tid_all[$item['tid']] = $item['tid'];
+            }
+          }
+        }
+      }
+    }
+    // Insert index entries for all the node's terms.
+    if (!empty($tid_all)) {
       $query = db_insert('taxonomy_index')->fields(array('nid', 'tid', 'sticky', 'created'));
-      foreach ($items as $item) {
+      foreach ($tid_all as $tid) {
         $query->values(array(
-          'nid' => $entity->nid,
-          'tid' => $item['tid'],
-          'sticky' => $entity->sticky,
-          'created' => $entity->created,
+          'nid' => $node->nid,
+          'tid' => $tid,
+          'sticky' => $sticky,
+          'created' => $node->created,
         ));
       }
       $query->execute();
@@ -1773,11 +1808,30 @@
 }
 
 /**
+ * Implements hook_node_update().
+ */
+function taxonomy_node_update($node) {
+  // Always rebuild the node's taxonomy index entries on node save.
+  taxonomy_delete_node_index($node);
+  taxonomy_build_node_index($node);
+}
+
+/**
  * Implements hook_node_delete().
  */
 function taxonomy_node_delete($node) {
+  // Clean up the {taxonomy_index} table when nodes are deleted.
+  taxonomy_delete_node_index($node);
+}
+
+/**
+ * Deletes taxonomy index entries for a given node.
+ *
+ * @param $node
+ *   The node object.
+ */
+function taxonomy_delete_node_index($node) {
   if (variable_get('taxonomy_maintain_index_table', TRUE)) {
-    // Clean up the {taxonomy_index} table when nodes are deleted.
     db_delete('taxonomy_index')->condition('nid', $node->nid)->execute();
   }
 }

Modified: branches/upstream/current-7/modules/taxonomy/taxonomy.pages.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/taxonomy/taxonomy.pages.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.pages.inc (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.pages.inc Sun Feb  5 17:53:08 2012
@@ -77,7 +77,35 @@
 }
 
 /**
- * Helper function for autocompletion
+ * Page callback: Outputs JSON for taxonomy autocomplete suggestions.
+ *
+ * Path: taxonomy/autocomplete
+ *
+ * This callback outputs term name suggestions in response to Ajax requests
+ * made by the taxonomy autocomplete widget for taxonomy term reference
+ * fields. The output is a JSON object of plain-text term suggestions, keyed by
+ * the user-entered value with the completed term name appended.  Term names
+ * containing commas are wrapped in quotes.
+ *
+ * For example, suppose the user has entered the string 'red fish, blue' in the
+ * field, and there are two taxonomy terms, 'blue fish' and 'blue moon'. The
+ * JSON output would have the following structure:
+ * @code
+ *   {
+ *     "red fish, blue fish": "blue fish",
+ *     "red fish, blue moon": "blue moon",
+ *   };
+ * @endcode
+ *
+ * @param $field_name
+ *   The name of the term reference field.
+ * @param $tags_typed
+ *   (optional) A comma-separated list of term names entered in the
+ *   autocomplete form element. Only the last term is used for autocompletion.
+ *   Defaults to '' (an empty string).
+ *
+ * @see taxonomy_menu()
+ * @see taxonomy_field_widget_info()
  */
 function taxonomy_autocomplete($field_name, $tags_typed = '') {
   $field = field_info_field($field_name);

Modified: branches/upstream/current-7/modules/taxonomy/taxonomy.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/taxonomy/taxonomy.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.test (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.test Sun Feb  5 17:53:08 2012
@@ -410,6 +410,60 @@
     // Delete an invalid term. Should not throw any notices.
     taxonomy_term_delete(42);
   }
+
+  /**
+   * Test a taxonomy with terms that have multiple parents of different depths.
+   */
+  function testTaxonomyVocabularyTree() {
+    // Create a new vocabulary with 6 terms.
+    $vocabulary = $this->createVocabulary();
+    $term = array();
+    for ($i = 0; $i < 6; $i++) {
+      $term[$i] = $this->createTerm($vocabulary);
+    }
+
+    // $term[2] is a child of 1 and 5.
+    $term[2]->parent = array($term[1]->tid, $term[5]->tid);
+    taxonomy_term_save($term[2]);
+    // $term[3] is a child of 2.
+    $term[3]->parent = array($term[2]->tid);
+    taxonomy_term_save($term[3]);
+    // $term[5] is a child of 4.
+    $term[5]->parent = array($term[4]->tid);
+    taxonomy_term_save($term[5]);
+
+    /**
+     * Expected tree:
+     * term[0] | depth: 0
+     * term[1] | depth: 0
+     * -- term[2] | depth: 1
+     * ---- term[3] | depth: 2
+     * term[4] | depth: 0
+     * -- term[5] | depth: 1
+     * ---- term[2] | depth: 2
+     * ------ term[3] | depth: 3
+     */
+
+    // Count $term[1] parents with $max_depth = 1.
+    $tree = taxonomy_get_tree($vocabulary->vid, $term[1]->tid, 1);
+    $this->assertEqual(1, count($tree), 'We have one parent with depth 1.');
+
+    // Count all vocabulary tree elements.
+    $tree = taxonomy_get_tree($vocabulary->vid);
+    $this->assertEqual(8, count($tree), 'We have all vocabulary tree elements.');
+
+    // Count elements in every tree depth.
+    foreach($tree as $element) {
+      if (!isset($depth_count[$element->depth])) {
+        $depth_count[$element->depth] = 0;
+      }
+      $depth_count[$element->depth]++;
+    }
+    $this->assertEqual(3, $depth_count[0], 'Three elements in taxonomy tree depth 0.');
+    $this->assertEqual(2, $depth_count[1], 'Two elements in taxonomy tree depth 1.');
+    $this->assertEqual(2, $depth_count[2], 'Two elements in taxonomy tree depth 2.');
+    $this->assertEqual(1, $depth_count[3], 'One element in taxonomy tree depth 3.');
+   }
 }
 
 /**
@@ -579,9 +633,9 @@
     $instance['bundle'] = 'page';
     field_create_instance($instance);
     $terms = array(
-      $this->randomName(),
-      $this->randomName() . ', ' . $this->randomName(),
-      $this->randomName(),
+      'term1' => $this->randomName(),
+      'term2' => $this->randomName() . ', ' . $this->randomName(),
+      'term3' => $this->randomName(),
     );
 
     $edit = array();
@@ -611,33 +665,37 @@
     }
 
     // Get the created terms.
-    list($term1, $term2, $term3) = array_values(taxonomy_term_load_multiple(FALSE));
+    $term_objects = array();
+    foreach ($terms as $key => $term) {
+      $term_objects[$key] = taxonomy_get_term_by_name($term);
+      $term_objects[$key] = reset($term_objects[$key]);
+    }
 
     // Delete term 1.
-    $this->drupalPost('taxonomy/term/' . $term1->tid . '/edit', array(), t('Delete'));
+    $this->drupalPost('taxonomy/term/' . $term_objects['term1']->tid . '/edit', array(), t('Delete'));
     $this->drupalPost(NULL, NULL, t('Delete'));
-    $term_names = array($term2->name, $term3->name);
+    $term_names = array($term_objects['term2']->name, $term_objects['term3']->name);
 
     // Get the node.
     $node = $this->drupalGetNodeByTitle($edit["title"]);
     $this->drupalGet('node/' . $node->nid);
 
     foreach ($term_names as $term_name) {
-      $this->assertText($term_name, t('The term %name appears on the node page after one term %deleted was deleted', array('%name' => $term_name, '%deleted' => $term1->name)));
-    }
-    $this->assertNoText($term1->name, t('The deleted term %name does not appear on the node page.', array('%name' => $term1->name)));
-
-    // Test autocomplete on term 2 - it contains a comma, so expect the key to
-    // be quoted.
-    $input = substr($term2->name, 0, 3);
+      $this->assertText($term_name, t('The term %name appears on the node page after one term %deleted was deleted', array('%name' => $term_name, '%deleted' => $term_objects['term1']->name)));
+    }
+    $this->assertNoText($term_objects['term1']->name, t('The deleted term %name does not appear on the node page.', array('%name' => $term_objects['term1']->name)));
+
+    // Test autocomplete on term 2, which contains a comma.
+    // The term will be quoted, and the " will be encoded in unicode (\u0022).
+    $input = substr($term_objects['term2']->name, 0, 3);
     $this->drupalGet('taxonomy/autocomplete/taxonomy_' . $this->vocabulary->machine_name . '/' . $input);
-    $this->assertRaw('{"\"' . $term2->name . '\"":"' . $term2->name . '"}', t('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term2->name)));
+    $this->assertRaw('{"\u0022' . $term_objects['term2']->name . '\u0022":"' . $term_objects['term2']->name . '"}', t('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term2']->name)));
 
     // Test autocomplete on term 3 - it is alphanumeric only, so no extra
     // quoting.
-    $input = substr($term3->name, 0, 3);
+    $input = substr($term_objects['term3']->name, 0, 3);
     $this->drupalGet('taxonomy/autocomplete/taxonomy_' . $this->vocabulary->machine_name . '/' . $input);
-    $this->assertRaw('{"' . $term3->name . '":"' . $term3->name . '"}', t('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term3->name)));
+    $this->assertRaw('{"' . $term_objects['term3']->name . '":"' . $term_objects['term3']->name . '"}', t('Autocomplete returns term %term_name after typing the first 3 letters.', array('%term_name' => $term_objects['term3']->name)));
   }
 
   /**
@@ -698,6 +756,10 @@
 
     // Check that the term feed page is working.
     $this->drupalGet('taxonomy/term/' . $term->tid . '/feed');
+
+    // Check that the term edit page does not try to interpret additional path
+    // components as arguments for taxonomy_form_term().
+    $this->drupalGet('taxonomy/term/' . $term->tid . '/edit/' . $this->randomName());
 
     // Delete the term.
     $this->drupalPost('taxonomy/term/' . $term->tid . '/edit', array(), t('Delete'));
@@ -829,6 +891,223 @@
 }
 
 /**
+ * Tests the hook implementations that maintain the taxonomy index.
+ */
+class TaxonomyTermIndexTestCase extends TaxonomyWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Taxonomy term index',
+      'description' => 'Tests the hook implementations that maintain the taxonomy index.',
+      'group' => 'Taxonomy',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('taxonomy');
+
+    // Create an administrative user.
+    $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access'));
+    $this->drupalLogin($this->admin_user);
+
+    // Create a vocabulary and add two term reference fields to article nodes.
+    $this->vocabulary = $this->createVocabulary();
+
+    $this->field_name_1 = drupal_strtolower($this->randomName());
+    $this->field_1 = array(
+      'field_name' => $this->field_name_1,
+      'type' => 'taxonomy_term_reference',
+      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
+      'settings' => array(
+        'allowed_values' => array(
+          array(
+            'vocabulary' => $this->vocabulary->machine_name,
+            'parent' => 0,
+          ),
+        ),
+      ),
+    );
+    field_create_field($this->field_1);
+    $this->instance_1 = array(
+      'field_name' => $this->field_name_1,
+      'bundle' => 'article',
+      'entity_type' => 'node',
+      'widget' => array(
+        'type' => 'options_select',
+      ),
+      'display' => array(
+        'default' => array(
+          'type' => 'taxonomy_term_reference_link',
+        ),
+      ),
+    );
+    field_create_instance($this->instance_1);
+
+    $this->field_name_2 = drupal_strtolower($this->randomName());
+    $this->field_2 = array(
+      'field_name' => $this->field_name_2,
+      'type' => 'taxonomy_term_reference',
+      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
+      'settings' => array(
+        'allowed_values' => array(
+          array(
+            'vocabulary' => $this->vocabulary->machine_name,
+            'parent' => 0,
+          ),
+        ),
+      ),
+    );
+    field_create_field($this->field_2);
+    $this->instance_2 = array(
+      'field_name' => $this->field_name_2,
+      'bundle' => 'article',
+      'entity_type' => 'node',
+      'widget' => array(
+        'type' => 'options_select',
+      ),
+      'display' => array(
+        'default' => array(
+          'type' => 'taxonomy_term_reference_link',
+        ),
+      ),
+    );
+    field_create_instance($this->instance_2);
+  }
+
+  /**
+   * Tests that the taxonomy index is maintained properly.
+   */
+  function testTaxonomyIndex() {
+    // Create terms in the vocabulary.
+    $term_1 = $this->createTerm($this->vocabulary);
+    $term_2 = $this->createTerm($this->vocabulary);
+
+    // Post an article.
+    $edit = array();
+    $langcode = LANGUAGE_NONE;
+    $edit["title"] = $this->randomName();
+    $edit["body[$langcode][0][value]"] = $this->randomName();
+    $edit["{$this->field_name_1}[$langcode][]"] = $term_1->tid;
+    $edit["{$this->field_name_2}[$langcode][]"] = $term_1->tid;
+    $this->drupalPost('node/add/article', $edit, t('Save'));
+
+    // Check that the term is indexed, and only once.
+    $node = $this->drupalGetNodeByTitle($edit["title"]);
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_1->tid,
+    ))->fetchField();
+    $this->assertEqual(1, $index_count, t('Term 1 is indexed once.'));
+
+    // Update the article to change one term.
+    $edit["{$this->field_name_1}[$langcode][]"] = $term_2->tid;
+    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+
+    // Check that both terms are indexed.
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_1->tid,
+    ))->fetchField();
+    $this->assertEqual(1, $index_count, t('Term 1 is indexed.'));
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_2->tid,
+    ))->fetchField();
+    $this->assertEqual(1, $index_count, t('Term 2 is indexed.'));
+
+    // Update the article to change another term.
+    $edit["{$this->field_name_2}[$langcode][]"] = $term_2->tid;
+    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+
+    // Check that only one term is indexed.
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_1->tid,
+    ))->fetchField();
+    $this->assertEqual(0, $index_count, t('Term 1 is not indexed.'));
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_2->tid,
+    ))->fetchField();
+    $this->assertEqual(1, $index_count, t('Term 2 is indexed once.'));
+
+    // Redo the above tests without interface.
+    $update_node = array(
+      'nid' => $node->nid,
+      'vid' => $node->vid,
+      'uid' => $node->uid,
+      'type' => $node->type,
+      'title' => $this->randomName(),
+    );
+
+    // Update the article with no term changed.
+    $updated_node = (object) $update_node;
+    node_save($updated_node);
+
+    // Check that the index was not changed.
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_1->tid,
+    ))->fetchField();
+    $this->assertEqual(0, $index_count, t('Term 1 is not indexed.'));
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_2->tid,
+    ))->fetchField();
+    $this->assertEqual(1, $index_count, t('Term 2 is indexed once.'));
+
+    // Update the article to change one term.
+    $update_node[$this->field_name_1][$langcode] = array(array('tid' => $term_1->tid));
+    $updated_node = (object) $update_node;
+    node_save($updated_node);
+
+    // Check that both terms are indexed.
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_1->tid,
+    ))->fetchField();
+    $this->assertEqual(1, $index_count, t('Term 1 is indexed.'));
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_2->tid,
+    ))->fetchField();
+    $this->assertEqual(1, $index_count, t('Term 2 is indexed.'));
+
+    // Update the article to change another term.
+    $update_node[$this->field_name_2][$langcode] = array(array('tid' => $term_1->tid));
+    $updated_node = (object) $update_node;
+    node_save($updated_node);
+
+    // Check that only one term is indexed.
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_1->tid,
+    ))->fetchField();
+    $this->assertEqual(1, $index_count, t('Term 1 is indexed once.'));
+    $index_count = db_query('SELECT COUNT(*) FROM {taxonomy_index} WHERE nid = :nid AND tid = :tid', array(
+      ':nid' => $node->nid,
+      ':tid' => $term_2->tid,
+    ))->fetchField();
+    $this->assertEqual(0, $index_count, t('Term 2 is not indexed.'));
+  }
+
+  /**
+   * Tests that there is a link to the parent term on the child term page.
+   */
+  function testTaxonomyTermHierarchyBreadcrumbs() {
+    // Create two taxonomy terms and set term2 as the parent of term1.
+    $term1 = $this->createTerm($this->vocabulary);
+    $term2 = $this->createTerm($this->vocabulary);
+    $term1->parent = array($term2->tid);
+    taxonomy_term_save($term1);
+
+    // Verify that the page breadcrumbs include a link to the parent term.
+    $this->drupalGet('taxonomy/term/' . $term1->tid);
+    $this->assertRaw(l($term2->name, 'taxonomy/term/' . $term2->tid), t('Parent term link is displayed when viewing the node.'));
+  }
+}
+
+/**
  * Test the taxonomy_term_load_multiple() function.
  */
 class TaxonomyLoadMultipleUnitTest extends TaxonomyWebTestCase {
@@ -1080,9 +1359,15 @@
     );
     field_update_field($this->field);
     // Change the machine name.
+    $old_name = $this->vocabulary->machine_name;
     $new_name = drupal_strtolower($this->randomName());
     $this->vocabulary->machine_name = $new_name;
     taxonomy_vocabulary_save($this->vocabulary);
+
+    // Check that entity bundles are properly updated.
+    $info = entity_get_info('taxonomy_term');
+    $this->assertFalse(isset($info['bundles'][$old_name]), t('The old bundle name does not appear in entity_get_info().'));
+    $this->assertTrue(isset($info['bundles'][$new_name]), t('The new bundle name appears in entity_get_info().'));
 
     // Check that the field instance is still attached to the vocabulary.
     $field = field_info_field($this->field_name);

Modified: branches/upstream/current-7/modules/toolbar/toolbar.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/toolbar/toolbar.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/toolbar/toolbar.info (original)
+++ branches/upstream/current-7/modules/toolbar/toolbar.info Sun Feb  5 17:53:08 2012
@@ -5,7 +5,7 @@
 version = VERSION
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/toolbar/toolbar.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/toolbar/toolbar.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/toolbar/toolbar.module (original)
+++ branches/upstream/current-7/modules/toolbar/toolbar.module Sun Feb  5 17:53:08 2012
@@ -82,6 +82,7 @@
  *   An associative array containing:
  *   - collapsed: A boolean value representing the toolbar drawer's visibility.
  *   - attributes: An associative array of HTML attributes.
+ *
  * @return
  *   An HTML string representing the element for toggling.
  *
@@ -175,7 +176,10 @@
 }
 
 /**
- * Build the admin menu as a structured array ready for drupal_render().
+ * Builds the admin menu as a structured array ready for drupal_render().
+ *
+ * @return
+ *   Array of links and settings relating to the admin menu.
  */
 function toolbar_view() {
   global $user;
@@ -272,7 +276,10 @@
 }
 
 /**
- * Get only the top level items below the 'admin' path.
+ * Gets only the top level items below the 'admin' path.
+ *
+ * @return
+ *   An array containing a menu tree of top level items below the 'admin' path.
  */
 function toolbar_get_menu_tree() {
   $tree = array();
@@ -289,10 +296,13 @@
 }
 
 /**
- * Generate a links array from a menu tree array.
+ * Generates a links array from a menu tree array.
  *
  * Based on menu_navigation_links(). Adds path based IDs and icon placeholders
  * to the links.
+ *
+ * @return
+ *   An array of links as defined above.
  */
 function toolbar_menu_navigation_links($tree) {
   $links = array();
@@ -330,6 +340,9 @@
  * Useful when using a menu generated by menu_tree_all_data() which does
  * not set the 'in_active_trail' flag on items.
  *
+ * @return
+ *   TRUE when path is in the active trail, FALSE if not.
+ *
  * @todo
  *   Look at migrating to a menu system level function.
  */

Modified: branches/upstream/current-7/modules/tracker/tracker.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/tracker/tracker.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/tracker/tracker.info (original)
+++ branches/upstream/current-7/modules/tracker/tracker.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 files[] = tracker.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/tracker/tracker.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/tracker/tracker.test?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/tracker/tracker.test (original)
+++ branches/upstream/current-7/modules/tracker/tracker.test Sun Feb  5 17:53:08 2012
@@ -8,7 +8,6 @@
 class TrackerTest extends DrupalWebTestCase {
   protected $user;
   protected $other_user;
-  protected $new_node;
 
   public static function getInfo() {
     return array(

Modified: branches/upstream/current-7/modules/translation/tests/translation_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/translation/tests/translation_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/translation/tests/translation_test.info (original)
+++ branches/upstream/current-7/modules/translation/tests/translation_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/translation/translation.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/translation/translation.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/translation/translation.info (original)
+++ branches/upstream/current-7/modules/translation/translation.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 files[] = translation.test
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/trigger/tests/trigger_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/trigger/tests/trigger_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/tests/trigger_test.info (original)
+++ branches/upstream/current-7/modules/trigger/tests/trigger_test.info Sun Feb  5 17:53:08 2012
@@ -5,7 +5,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/trigger/trigger.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/trigger/trigger.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/trigger.info (original)
+++ branches/upstream/current-7/modules/trigger/trigger.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/structure/trigger
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/update/tests/aaa_update_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/tests/aaa_update_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/tests/aaa_update_test.info (original)
+++ branches/upstream/current-7/modules/update/tests/aaa_update_test.info Sun Feb  5 17:53:08 2012
@@ -5,7 +5,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/update/tests/bbb_update_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/tests/bbb_update_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/tests/bbb_update_test.info (original)
+++ branches/upstream/current-7/modules/update/tests/bbb_update_test.info Sun Feb  5 17:53:08 2012
@@ -5,7 +5,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/update/tests/ccc_update_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/tests/ccc_update_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/tests/ccc_update_test.info (original)
+++ branches/upstream/current-7/modules/update/tests/ccc_update_test.info Sun Feb  5 17:53:08 2012
@@ -5,7 +5,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Added: branches/upstream/current-7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info (added)
+++ branches/upstream/current-7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,10 @@
+name = Update test base theme
+description = Test theme which acts as a base theme for other test subthemes.
+core = 7.x
+hidden = TRUE
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Added: branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info (added)
+++ branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info Sun Feb  5 17:53:08 2012
@@ -1,0 +1,11 @@
+name = Update test subtheme
+description = Test theme which uses update_test_basetheme as the base theme.
+core = 7.x
+base theme = update_test_basetheme
+hidden = TRUE
+
+; Information added by drupal.org packaging script on 2012-02-01
+version = "7.12"
+project = "drupal"
+datestamp = "1328134560"
+

Modified: branches/upstream/current-7/modules/update/tests/update_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/tests/update_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/tests/update_test.info (original)
+++ branches/upstream/current-7/modules/update/tests/update_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/update/tests/update_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/tests/update_test.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/tests/update_test.module (original)
+++ branches/upstream/current-7/modules/update/tests/update_test.module Sun Feb  5 17:53:08 2012
@@ -1,4 +1,13 @@
 <?php
+
+/**
+ * Implements hook_system_theme_info().
+ */
+function update_test_system_theme_info() {
+  $themes['update_test_basetheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_basetheme/update_test_basetheme.info';
+  $themes['update_test_subtheme'] = drupal_get_path('module', 'update_test') . '/themes/update_test_subtheme/update_test_subtheme.info';
+  return $themes;
+}
 
 /**
  * Implements hook_menu().

Modified: branches/upstream/current-7/modules/update/update.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/update.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/update.info (original)
+++ branches/upstream/current-7/modules/update/update.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 configure = admin/reports/updates/settings
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/update/update.manager.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/update.manager.inc?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/update.manager.inc (original)
+++ branches/upstream/current-7/modules/update/update.manager.inc Sun Feb  5 17:53:08 2012
@@ -816,7 +816,7 @@
 
   // Check the cache and download the file if needed.
   $cache_directory = _update_manager_cache_directory();
-  $local = $cache_directory . '/' . basename($parsed_url['path']);
+  $local = $cache_directory . '/' . drupal_basename($parsed_url['path']);
 
   if (!file_exists($local) || update_delete_file_if_stale($local)) {
     return system_retrieve_file($url, $local, FALSE, FILE_EXISTS_REPLACE);

Modified: branches/upstream/current-7/modules/update/update.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/update.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/update.module (original)
+++ branches/upstream/current-7/modules/update/update.module Sun Feb  5 17:53:08 2012
@@ -695,14 +695,14 @@
   }
 
   if (empty($files)) {
-    $errors[] = t('%archive_file does not contain any .info files.', array('%archive_file' => basename($archive_file)));
+    $errors[] = t('%archive_file does not contain any .info files.', array('%archive_file' => drupal_basename($archive_file)));
   }
   elseif (!$compatible_project) {
     $errors[] = format_plural(
       count($incompatible),
       '%archive_file contains a version of %names that is not compatible with Drupal !version.',
       '%archive_file contains versions of modules or themes that are not compatible with Drupal !version: %names',
-      array('!version' => DRUPAL_CORE_COMPATIBILITY, '%archive_file' => basename($archive_file), '%names' => implode(', ', $incompatible))
+      array('!version' => DRUPAL_CORE_COMPATIBILITY, '%archive_file' => drupal_basename($archive_file), '%names' => implode(', ', $incompatible))
     );
   }
 

Modified: branches/upstream/current-7/modules/user/tests/user_form_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/user/tests/user_form_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/tests/user_form_test.info (original)
+++ branches/upstream/current-7/modules/user/tests/user_form_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/user/user.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/user/user.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.info (original)
+++ branches/upstream/current-7/modules/user/user.info Sun Feb  5 17:53:08 2012
@@ -10,7 +10,7 @@
 stylesheets[all][] = user.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/modules/user/user.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/user/user.install?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.install (original)
+++ branches/upstream/current-7/modules/user/user.install Sun Feb  5 17:53:08 2012
@@ -743,7 +743,7 @@
         // Create a file object.
         $file = new stdClass();
         $file->uri      = $user->picture;
-        $file->filename = basename($file->uri);
+        $file->filename = drupal_basename($file->uri);
         $file->filemime = file_get_mimetype($file->uri);
         $file->uid      = $user->uid;
         $file->status   = FILE_STATUS_PERMANENT;

Modified: branches/upstream/current-7/modules/user/user.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/user/user.js?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.js (original)
+++ branches/upstream/current-7/modules/user/user.js Sun Feb  5 17:53:08 2012
@@ -168,7 +168,7 @@
 
   // Assemble the final message.
   msg = translate.hasWeaknesses + '<ul><li>' + msg.join('</li><li>') + '</li></ul>';
-  return { strength: strength, message: msg, indicatorText: indicatorText }
+  return { strength: strength, message: msg, indicatorText: indicatorText };
 
 };
 

Modified: branches/upstream/current-7/modules/user/user.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/user/user.module?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.module (original)
+++ branches/upstream/current-7/modules/user/user.module Sun Feb  5 17:53:08 2012
@@ -3466,23 +3466,27 @@
  * @see drupal_mail()
  *
  * @param $op
- *  The operation being performed on the account. Possible values:
- *  'register_admin_created': Welcome message for user created by the admin
- *  'register_no_approval_required': Welcome message when user self-registers
- *  'register_pending_approval': Welcome message, user pending admin approval
- *  'password_reset': Password recovery request
- *  'status_activated': Account activated
- *  'status_blocked': Account blocked
- *  'cancel_confirm': Account cancellation request
- *  'status_canceled': Account canceled
+ *   The operation being performed on the account. Possible values:
+ *   - 'register_admin_created': Welcome message for user created by the admin.
+ *   - 'register_no_approval_required': Welcome message when user
+ *     self-registers.
+ *   - 'register_pending_approval': Welcome message, user pending admin
+ *     approval.
+ *   - 'password_reset': Password recovery request.
+ *   - 'status_activated': Account activated.
+ *   - 'status_blocked': Account blocked.
+ *   - 'cancel_confirm': Account cancellation request.
+ *   - 'status_canceled': Account canceled.
  *
  * @param $account
- *  The user object of the account being notified. Must contain at
- *  least the fields 'uid', 'name', and 'mail'.
+ *   The user object of the account being notified. Must contain at
+ *   least the fields 'uid', 'name', and 'mail'.
  * @param $language
- *  Optional language to use for the notification, overriding account language.
+ *   Optional language to use for the notification, overriding account language.
+ *
  * @return
- *  The return value from drupal_mail_system()->mail(), if ends up being called.
+ *   The return value from drupal_mail_system()->mail(), if ends up being
+ *   called.
  */
 function _user_mail_notify($op, $account, $language = NULL) {
   // By default, we always notify except for canceled and blocked.

Modified: branches/upstream/current-7/profiles/minimal/minimal.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/minimal/minimal.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/minimal/minimal.info (original)
+++ branches/upstream/current-7/profiles/minimal/minimal.info Sun Feb  5 17:53:08 2012
@@ -7,7 +7,7 @@
 files[] = minimal.profile
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/profiles/standard/standard.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/standard/standard.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/standard/standard.info (original)
+++ branches/upstream/current-7/profiles/standard/standard.info Sun Feb  5 17:53:08 2012
@@ -26,7 +26,7 @@
 files[] = standard.profile
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/profiles/standard/standard.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/standard/standard.install?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/standard/standard.install (original)
+++ branches/upstream/current-7/profiles/standard/standard.install Sun Feb  5 17:53:08 2012
@@ -65,7 +65,7 @@
   // Enable some standard blocks.
   $default_theme = variable_get('theme_default', 'bartik');
   $admin_theme = 'seven';
-  $values = array(
+  $blocks = array(
     array(
       'module' => 'system',
       'delta' => 'main',
@@ -188,8 +188,8 @@
     ),
   );
   $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
-  foreach ($values as $record) {
-    $query->values($record);
+  foreach ($blocks as $block) {
+    $query->values($block);
   }
   $query->execute();
 

Modified: branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info (original)
+++ branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info (original)
+++ branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.info Sun Feb  5 17:53:08 2012
@@ -9,7 +9,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/profiles/testing/testing.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/testing/testing.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/testing/testing.info (original)
+++ branches/upstream/current-7/profiles/testing/testing.info Sun Feb  5 17:53:08 2012
@@ -5,7 +5,7 @@
 hidden = TRUE
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Added: branches/upstream/current-7/scripts/dump-database-d7.sh
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/scripts/dump-database-d7.sh?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/scripts/dump-database-d7.sh (added)
+++ branches/upstream/current-7/scripts/dump-database-d7.sh Sun Feb  5 17:53:08 2012
@@ -1,0 +1,90 @@
+#!/usr/bin/env php
+<?php
+
+/**
+ * @file
+ * Dumps a Drupal 7 database into a PHP script to test the upgrade process.
+ *
+ * Run this script at the root of an existing Drupal 7 installation.
+ *
+ * The output of this script is a PHP script that can be run inside Drupal 7
+ * and recreates the Drupal 7 database as dumped. Transient data from cache,
+ * session, and watchdog tables are not recorded.
+ */
+
+// Define default settings.
+define('DRUPAL_ROOT', getcwd());
+$cmd = 'index.php';
+$_SERVER['HTTP_HOST']       = 'default';
+$_SERVER['REMOTE_ADDR']     = '127.0.0.1';
+$_SERVER['SERVER_SOFTWARE'] = NULL;
+$_SERVER['REQUEST_METHOD']  = 'GET';
+$_SERVER['QUERY_STRING']    = '';
+$_SERVER['PHP_SELF']        = $_SERVER['REQUEST_URI'] = '/';
+$_SERVER['HTTP_USER_AGENT'] = 'console';
+
+// Bootstrap Drupal.
+include_once './includes/bootstrap.inc';
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+
+// Include the utility drupal_var_export() function.
+include_once dirname(__FILE__) . '/../includes/utility.inc';
+
+// Output the PHP header.
+$output = <<<ENDOFHEADER
+<?php
+
+/**
+ * @file
+ * Filled installation of Drupal 7.0, for test purposes.
+ *
+ * This file was generated by the dump-database-d7.sh tool, from an
+ * installation of Drupal 7, filled with data using the generate-d7-content.sh
+ * tool. It has the following modules installed:
+
+ENDOFHEADER;
+
+foreach (module_list() as $module) {
+  $output .= " *  - $module\n";
+}
+$output .= " */\n\n";
+
+// Get the current schema, order it by table name.
+$schema = drupal_get_schema();
+ksort($schema);
+
+// Export all the tables in the schema.
+foreach ($schema as $table => $data) {
+  // Remove descriptions to save time and code.
+  unset($data['description']);
+  foreach ($data['fields'] as &$field) {
+    unset($field['description']);
+  }
+
+  // Dump the table structure.
+  $output .= "db_create_table('" . $table . "', " . drupal_var_export($data) . ");\n";
+
+  // Don't output values for those tables.
+  if (substr($table, 0, 5) == 'cache' || $table == 'sessions' || $table == 'watchdog') {
+    $output .= "\n";
+    continue;
+  }
+
+  // Prepare the export of values.
+  $result = db_query('SELECT * FROM {'. $table .'}', array(), array('fetch' => PDO::FETCH_ASSOC));
+  $insert = '';
+  foreach ($result as $record) {
+    $insert .= '->values('. drupal_var_export($record) .")\n";
+  }
+
+  // Dump the values if there are some.
+  if ($insert) {
+    $output .= "db_insert('". $table . "')->fields(". drupal_var_export(array_keys($data['fields'])) .")\n";
+    $output .= $insert;
+    $output .= "->execute();\n";
+  }
+
+  $output .= "\n";
+}
+
+print $output;

Added: branches/upstream/current-7/scripts/generate-d7-content.sh
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/scripts/generate-d7-content.sh?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/scripts/generate-d7-content.sh (added)
+++ branches/upstream/current-7/scripts/generate-d7-content.sh Sun Feb  5 17:53:08 2012
@@ -1,0 +1,321 @@
+#!/usr/bin/env php
+<?php
+
+/**
+ * @file
+ * Generates content for a Drupal 7 database to test the upgrade process.
+ *
+ * Run this script at the root of an existing Drupal 6 installation.
+ * Steps to use this generation script:
+ * - Install drupal 7.
+ * - Run this script from your Drupal ROOT directory.
+ * - Use the dump-database-d7.sh to generate the D7 file
+ *   modules/simpletest/tests/upgrade/database.filled.php
+ */
+
+// Define settings.
+$cmd = 'index.php';
+define('DRUPAL_ROOT', getcwd());
+$_SERVER['HTTP_HOST']       = 'default';
+$_SERVER['PHP_SELF']        = '/index.php';
+$_SERVER['REMOTE_ADDR']     = '127.0.0.1';
+$_SERVER['SERVER_SOFTWARE'] = NULL;
+$_SERVER['REQUEST_METHOD']  = 'GET';
+$_SERVER['QUERY_STRING']    = '';
+$_SERVER['PHP_SELF']        = $_SERVER['REQUEST_URI'] = '/';
+$_SERVER['HTTP_USER_AGENT'] = 'console';
+$modules_to_enable          = array('path', 'poll', 'taxonomy');
+
+// Bootstrap Drupal.
+include_once './includes/bootstrap.inc';
+drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+
+// Enable requested modules.
+require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
+include_once './modules/system/system.admin.inc';
+$form = system_modules();
+foreach ($modules_to_enable as $module) {
+  $form_state['values']['status'][$module] = TRUE;
+}
+$form_state['values']['disabled_modules'] = $form['disabled_modules'];
+system_modules_submit(NULL, $form_state);
+unset($form_state);
+
+// Run cron after installing.
+drupal_cron_run();
+
+// Create six users.
+$query = db_insert('users')->fields(array('uid', 'name', 'pass', 'mail', 'status', 'created', 'access'));
+for ($i = 0; $i < 6; $i++) {
+  $name = "test user $i";
+  $pass = md5("test PassW0rd $i !(.)");
+  $mail = "test$i at example.com";
+  $now = mktime(0, 0, 0, 1, $i + 1, 2010);
+  $query->values(array(db_next_id(), $name, user_hash_password($pass), $mail, 1, $now, $now));
+}
+$query->execute();
+
+// Create vocabularies and terms.
+
+if (module_exists('taxonomy')) {
+  $terms = array();
+
+  // All possible combinations of these vocabulary properties.
+  $hierarchy = array(0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2);
+  $multiple  = array(0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1);
+  $required  = array(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1);
+
+  $voc_id = 0;
+  $term_id = 0;
+  for ($i = 0; $i < 24; $i++) {
+    $vocabulary = new stdClass;
+    ++$voc_id;
+    $vocabulary->name = "vocabulary $voc_id (i=$i)";
+    $vocabulary->machine_name = 'vocabulary_' . $voc_id . '_' . $i;
+    $vocabulary->description = "description of ". $vocabulary->name;
+    $vocabulary->multiple = $multiple[$i % 12];
+    $vocabulary->required = $required[$i % 12];
+    $vocabulary->relations = 1;
+    $vocabulary->hierarchy = $hierarchy[$i % 12];
+    $vocabulary->weight = $i;
+    taxonomy_vocabulary_save($vocabulary);
+    $field = array(
+      'field_name' => 'taxonomy_'. $vocabulary->machine_name,
+      'module' => 'taxonomy',
+      'type' => 'taxonomy_term_reference',
+      'cardinality' => $vocabulary->multiple || $vocabulary->tags ? FIELD_CARDINALITY_UNLIMITED : 1,
+      'settings' => array(
+        'required' => $vocabulary->required ? TRUE : FALSE,
+        'allowed_values' => array(
+          array(
+            'vocabulary' => $vocabulary->machine_name,
+            'parent' => 0,
+          ),
+        ),
+      ),
+    );
+    field_create_field($field);
+    $node_types = $i > 11 ? array('page') : array_keys(node_type_get_types());
+    foreach ($node_types as $bundle) {
+      $instance = array(
+        'label' => $vocabulary->name,
+        'field_name' => $field['field_name'],
+        'bundle' => $bundle,
+        'entity_type' => 'node',
+        'settings' => array(),
+        'description' => $vocabulary->help,
+        'required' => $vocabulary->required,
+        'widget' => array(),
+        'display' => array(
+          'default' => array(
+            'type' => 'taxonomy_term_reference_link',
+            'weight' => 10,
+          ),
+          'teaser' => array(
+            'type' => 'taxonomy_term_reference_link',
+            'weight' => 10,
+          ),
+        ),
+      );
+      if ($vocabulary->tags) {
+        $instance['widget'] = array(
+          'type' => 'taxonomy_autocomplete',
+          'module' => 'taxonomy',
+          'settings' => array(
+            'size' => 60,
+            'autocomplete_path' => 'taxonomy/autocomplete',
+          ),
+        );
+      }
+      else {
+        $instance['widget'] = array(
+          'type' => 'select',
+          'module' => 'options',
+          'settings' => array(),
+        );
+      }
+      field_create_instance($instance);
+    }
+    $parents = array();
+    // Vocabularies without hierarchy get one term; single parent vocabularies
+    // get one parent and one child term. Multiple parent vocabularies get
+    // three terms: t0, t1, t2 where t0 is a parent of both t1 and t2.
+    for ($j = 0; $j < $vocabulary->hierarchy + 1; $j++) {
+      $term = new stdClass;
+      $term->vocabulary_machine_name = $vocabulary->machine_name;
+      // For multiple parent vocabularies, omit the t0-t1 relation, otherwise
+      // every parent in the vocabulary is a parent.
+      $term->parent = $vocabulary->hierarchy == 2 && i == 1 ? array() : $parents;
+      ++$term_id;
+      $term->name = "term $term_id of vocabulary $voc_id (j=$j)";
+      $term->description = 'description of ' . $term->name;
+      $term->format = 'filtered_html';
+      $term->weight = $i * 3 + $j;
+      taxonomy_term_save($term);
+      $terms[] = $term->tid;
+      $term_vocabs[$term->tid] = 'taxonomy_' . $vocabulary->machine_name;
+      $parents[] = $term->tid;
+    }
+  }
+}
+
+$node_id = 0;
+$revision_id = 0;
+module_load_include('inc', 'node', 'node.pages');
+for ($i = 0; $i < 24; $i++) {
+  $uid = intval($i / 8) + 3;
+  $user = user_load($uid);
+  $node = new stdClass();
+  $node->uid = $uid;
+  $node->type = $i < 12 ? 'page' : 'story';
+  $node->sticky = 0;
+  ++$node_id;
+  ++$revision_id;
+  $node->title = "node title $node_id rev $revision_id (i=$i)";
+  $node->language = LANGUAGE_NONE;
+  $body_text =  str_repeat("node body ($node->type) - $i", 100);
+  $node->body[$node->language][0]['value'] = $body_text;
+  $node->body[$node->language][0]['summary'] = text_summary($body_text);
+  $node->body[$node->language][0]['format'] = 'filtered_html';
+  $node->status = intval($i / 4) % 2;
+  $node->revision = $i < 12;
+  $node->promote = $i % 2;
+  $node->created = $now + $i * 86400;
+  $node->log = "added $i node";
+  // Make every term association different a little. For nodes with revisions,
+  // make the initial revision have a different set of terms than the
+  // newest revision.
+  $items = array();
+  if (module_exists('taxonomy')) {
+    if ($node->revision) {
+      $node_terms = array($terms[$i], $terms[47-$i]);
+    }
+    else {
+      $node_terms = $terms;
+      unset($node_terms[$i], $node_terms[47 - $i]);
+    }
+    foreach ($node_terms as $tid) {
+      $field_name = $term_vocabs[$tid];
+      $node->{$field_name}[LANGUAGE_NONE][] = array('tid' => $tid);
+    }
+  }
+  $node->path = array('alias' => "content/$node->created");
+  node_save($node);
+  if ($node->revision) {
+    $user = user_load($uid + 3);
+    ++$revision_id;
+    $node->title .= " rev2 $revision_id";
+    $body_text =  str_repeat("node revision body ($node->type) - $i", 100);
+    $node->body[$node->language][0]['value'] = $body_text;
+    $node->body[$node->language][0]['summary'] = text_summary($body_text);
+    $node->body[$node->language][0]['format'] = 'filtered_html';
+    $node->log = "added $i revision";
+    $node_terms = $terms;
+    unset($node_terms[$i], $node_terms[47 - $i]);
+    foreach ($node_terms as $tid) {
+      $field_name = $term_vocabs[$tid];
+      $node->{$field_name}[LANGUAGE_NONE][] = array('tid' => $tid);
+    }
+    node_save($node);
+  }
+}
+
+if (module_exists('poll')) {
+  // Create poll content.
+  for ($i = 0; $i < 12; $i++) {
+    $uid = intval($i / 4) + 3;
+    $user = user_load($uid);
+    $node = new stdClass();
+    $node->uid = $uid;
+    $node->type = 'poll';
+    $node->sticky = 0;
+    $node->title = "poll title $i";
+    $node->language = LANGUAGE_NONE;
+    $node->status = intval($i / 2) % 2;
+    $node->revision = 1;
+    $node->promote = $i % 2;
+    $node->created = REQUEST_TIME + $i * 43200;
+    $node->runtime = 0;
+    $node->active = 1;
+    $node->log = "added $i poll";
+    $node->path = array('alias' => "content/poll/$i");
+
+    $nbchoices = ($i % 4) + 2;
+    for ($c = 0; $c < $nbchoices; $c++) {
+      $node->choice[] = array('chtext' => "Choice $c for poll $i", 'chvotes' => 0, 'weight' => 0);
+    }
+    node_save($node);
+    $path = array(
+      'alias' => "content/poll/$i/results",
+      'source' => "node/$node->nid/results",
+    );
+    path_save($path);
+
+    // Add some votes.
+    $node = node_load($node->nid);
+    $choices = array_keys($node->choice);
+    $original_user = $GLOBALS['user'];
+    for ($v = 0; $v < ($i % 4); $v++) {
+      drupal_static_reset('ip_address');
+      $_SERVER['REMOTE_ADDR'] = "127.0.$v.1";
+      $GLOBALS['user'] = drupal_anonymous_user();// We should have already allowed anon to vote.
+      $c = $v % $nbchoices;
+      $form_state = array();
+      $form_state['values']['choice'] = $choices[$c];
+      $form_state['values']['op'] = t('Vote');
+      drupal_form_submit('poll_view_voting', $form_state, $node);
+    }
+  }
+}
+
+// Test that upgrade works even on a bundle whose parent module was disabled.
+// This is simulated by creating an existing content type and changing the
+// bundle to another type through direct database update queries.
+$node_type = 'broken';
+$uid = 6;
+$user = user_load($uid);
+$node = new stdClass();
+$node->uid = $uid;
+$node->type = 'article';
+$body_text = str_repeat("node body ($node_type) - 37", 100);
+$node->sticky = 0;
+$node->title = "node title 24";
+$node->language = LANGUAGE_NONE;
+$node->body[$node->language][0]['value'] = $body_text;
+$node->body[$node->language][0]['summary'] = text_summary($body_text);
+$node->body[$node->language][0]['format']  = 'filtered_html';
+$node->status = 1;
+$node->revision = 0;
+$node->promote = 0;
+$node->created = 1263769200;
+$node->log = "added a broken node";
+$node->path = array('alias' => "content/1263769200");
+node_save($node);
+db_update('node')
+  ->fields(array(
+    'type' => $node_type,
+  ))
+  ->condition('nid', $node->nid)
+  ->execute();
+if (db_table_exists('field_data_body')) {
+  db_update('field_data_body')
+    ->fields(array(
+      'bundle' => $node_type,
+    ))
+    ->condition('entity_id', $node->nid)
+    ->condition('entity_type', 'node')
+    ->execute();
+  db_update('field_revision_body')
+    ->fields(array(
+      'bundle' => $node_type,
+    ))
+    ->condition('entity_id', $node->nid)
+    ->condition('entity_type', 'node')
+    ->execute();
+}
+db_update('field_config_instance')
+  ->fields(array(
+    'bundle' => $node_type,
+  ))
+  ->condition('bundle', 'article')
+  ->execute();

Modified: branches/upstream/current-7/scripts/run-tests.sh
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/scripts/run-tests.sh?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/scripts/run-tests.sh (original)
+++ branches/upstream/current-7/scripts/run-tests.sh Sun Feb  5 17:53:08 2012
@@ -585,9 +585,8 @@
 
   if ($args['verbose']) {
     // Report results.
-    echo "Detailed test results:\n";
-    echo "----------------------\n";
-    echo "\n";
+    echo "Detailed test results\n";
+    echo "---------------------\n";
 
     $results = db_query("SELECT * FROM {simpletest} WHERE test_id = :test_id ORDER BY test_class, message_id", array(':test_id' => $test_id));
     $test_class = '';
@@ -597,6 +596,10 @@
           // Display test class every time results are for new test class.
           echo "\n\n---- $result->test_class ----\n\n\n";
           $test_class = $result->test_class;
+
+  // Print table header.
+  echo "Status    Group      Filename          Line Function                            \n";
+  echo "--------------------------------------------------------------------------------\n";
         }
 
         simpletest_script_format_result($result);
@@ -614,8 +617,8 @@
 function simpletest_script_format_result($result) {
   global $results_map, $color;
 
-  $summary = sprintf("%-10.10s %-10.10s %-30.30s %-5.5s %-20.20s\n",
-    $results_map[$result->status], $result->message_group, basename($result->file), $result->line, $result->caller);
+  $summary = sprintf("%-9.9s %-10.10s %-17.17s %4.4s %-35.35s\n",
+    $results_map[$result->status], $result->message_group, basename($result->file), $result->line, $result->function);
 
   simpletest_script_print($summary, simpletest_script_color_code($result->status));
 

Added: branches/upstream/current-7/scripts/test.script
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/scripts/test.script?rev=2257&op=file
==============================================================================
--- branches/upstream/current-7/scripts/test.script (added)
+++ branches/upstream/current-7/scripts/test.script Sun Feb  5 17:53:08 2012
@@ -1,0 +1,4 @@
+This file is for testing purposes only.
+
+It is used to test the functionality of drupal_get_filename().  See
+BootstrapGetFilenameTestCase::testDrupalGetFilename() for more information.

Modified: branches/upstream/current-7/sites/default/default.settings.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/sites/default/default.settings.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/sites/default/default.settings.php (original)
+++ branches/upstream/current-7/sites/default/default.settings.php Sun Feb  5 17:53:08 2012
@@ -152,6 +152,29 @@
  *   );
  * @endcode
  * NOTE: MySQL and SQLite's definition of a schema is a database.
+ *
+ * Advanced users can add or override initial commands to execute when
+ * connecting to the database server, as well as PDO connection settings. For
+ * example, to enable MySQL SELECT queries to exceed the max_join_size system
+ * variable, and to reduce the database connection timeout to 5 seconds:
+ *
+ * @code
+ * $databases['default']['default'] = array(
+ *   'init_commands' => array(
+ *     'big_selects' => 'SET SQL_BIG_SELECTS=1',
+ *   ),
+ *   'pdo' => array(
+ *     PDO::ATTR_TIMEOUT => 5,
+ *   ),
+ * );
+ * @endcode
+ *
+ * WARNING: These defaults are designed for database portability. Changing them
+ * may cause unexpected behavior, including potential data loss.
+ *
+ * @see DatabaseConnection_mysql::__construct
+ * @see DatabaseConnection_pgsql::__construct
+ * @see DatabaseConnection_sqlite::__construct
  *
  * Database configuration format:
  * @code

Modified: branches/upstream/current-7/themes/bartik/bartik.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/bartik/bartik.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/themes/bartik/bartik.info (original)
+++ branches/upstream/current-7/themes/bartik/bartik.info Sun Feb  5 17:53:08 2012
@@ -35,7 +35,7 @@
 
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/themes/bartik/css/style-rtl.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/bartik/css/style-rtl.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/themes/bartik/css/style-rtl.css (original)
+++ branches/upstream/current-7/themes/bartik/css/style-rtl.css Sun Feb  5 17:53:08 2012
@@ -96,6 +96,7 @@
   float: right;
 }
 .link-wrapper {
+  text-align: left;
   margin-right: 236px;
   margin-left: 0;
 }

Modified: branches/upstream/current-7/themes/garland/garland.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/garland/garland.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/themes/garland/garland.info (original)
+++ branches/upstream/current-7/themes/garland/garland.info Sun Feb  5 17:53:08 2012
@@ -8,7 +8,7 @@
 settings[garland_width] = fluid
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/themes/seven/maintenance-page.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/seven/maintenance-page.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/themes/seven/maintenance-page.tpl.php (original)
+++ branches/upstream/current-7/themes/seven/maintenance-page.tpl.php Sun Feb  5 17:53:08 2012
@@ -1,5 +1,4 @@
-<?php
-?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
   <head>

Modified: branches/upstream/current-7/themes/seven/page.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/seven/page.tpl.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/themes/seven/page.tpl.php (original)
+++ branches/upstream/current-7/themes/seven/page.tpl.php Sun Feb  5 17:53:08 2012
@@ -1,5 +1,4 @@
-<?php
-?>
+
   <div id="branding" class="clearfix">
     <?php print $breadcrumb; ?>
     <?php print render($title_prefix); ?>

Modified: branches/upstream/current-7/themes/seven/seven.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/seven/seven.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/themes/seven/seven.info (original)
+++ branches/upstream/current-7/themes/seven/seven.info Sun Feb  5 17:53:08 2012
@@ -14,7 +14,7 @@
 regions_hidden[] = sidebar_first
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/themes/seven/style.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/seven/style.css?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/themes/seven/style.css (original)
+++ branches/upstream/current-7/themes/seven/style.css Sun Feb  5 17:53:08 2012
@@ -835,6 +835,7 @@
 }
 body.in-maintenance #logo {
   margin-bottom: 1.5em;
+  max-width: 180px;
 }
 ol.task-list {
   margin-left: 0; /* LTR */
@@ -851,7 +852,6 @@
   color: #000;
 }
 ol.task-list li.done {
-  color: #393;
   background: transparent url(images/task-check.png) no-repeat 0 50%;
   color: green;
 }

Modified: branches/upstream/current-7/themes/stark/stark.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/stark/stark.info?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/themes/stark/stark.info (original)
+++ branches/upstream/current-7/themes/stark/stark.info Sun Feb  5 17:53:08 2012
@@ -6,7 +6,7 @@
 stylesheets[all][] = layout.css
 
 ; Information added by drupal.org packaging script on 2012-02-01
-version = "7.11"
+version = "7.12"
 project = "drupal"
-datestamp = "1328134274"
+datestamp = "1328134560"
 

Modified: branches/upstream/current-7/update.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/update.php?rev=2257&op=diff
==============================================================================
--- branches/upstream/current-7/update.php (original)
+++ branches/upstream/current-7/update.php Sun Feb  5 17:53:08 2012
@@ -108,6 +108,9 @@
     $form['links'] = array(
       '#markup' => theme('item_list', array('items' => update_helpful_links())),
     );
+
+    // No updates to run, so caches won't get flushed later.  Clear them now.
+    drupal_flush_all_caches();
   }
   else {
     $form['help'] = array(
@@ -245,7 +248,8 @@
   $output .= "<li>Install your new files in the appropriate location, as described in the handbook.</li>\n";
   $output .= "</ol>\n";
   $output .= "<p>When you have performed the steps above, you may proceed.</p>\n";
-  $output .= '<form method="post" action="update.php?op=selection&token=' . $token . '"><p><input type="submit" value="Continue" class="form-submit" /></p></form>';
+  $form_action = check_url(drupal_current_script_url(array('op' => 'selection', 'token' => $token)));
+  $output .= '<form method="post" action="' . $form_action . '"><p><input type="submit" value="Continue" class="form-submit" /></p></form>';
   $output .= "\n";
   return $output;
 }
@@ -316,20 +320,26 @@
 }
 
 /**
- * Check update requirements and report any errors.
- */
-function update_check_requirements() {
+ * Check update requirements and report any errors or (optionally) warnings.
+ *
+ * @param $skip_warnings
+ *   (optional) If set to TRUE, requirement warnings will be ignored, and a
+ *   report will only be issued if there are requirement errors. Defaults to
+ *   FALSE.
+ */
+function update_check_requirements($skip_warnings = FALSE) {
   // Check requirements of all loaded modules.
   $requirements = module_invoke_all('requirements', 'update');
   $requirements += update_extra_requirements();
   $severity = drupal_requirements_severity($requirements);
 
-  // If there are issues, report them.
-  if ($severity == REQUIREMENT_ERROR) {
+  // If there are errors, always display them. If there are only warnings, skip
+  // them if the caller has indicated they should be skipped.
+  if ($severity == REQUIREMENT_ERROR || ($severity == REQUIREMENT_WARNING && !$skip_warnings)) {
     update_task_list('requirements');
     drupal_set_title('Requirements problem');
     $status_report = theme('status_report', array('requirements' => $requirements));
-    $status_report .= 'Check the error messages and <a href="' . check_url(request_uri()) . '">try again</a>.';
+    $status_report .= 'Check the error messages and <a href="' . check_url(drupal_requirements_url($severity)) . '">try again</a>.';
     print theme('update_page', array('content' => $status_report));
     exit();
   }
@@ -385,8 +395,9 @@
   // Set up theme system for the maintenance page.
   drupal_maintenance_theme();
 
-  // Check the update requirements for Drupal.
-  update_check_requirements();
+  // Check the update requirements for Drupal. Only report on errors at this
+  // stage, since the real requirements check happens further down.
+  update_check_requirements(TRUE);
 
   // Redirect to the update information page if all requirements were met.
   install_goto('update.php?op=info');
@@ -418,8 +429,12 @@
 
   update_fix_compatibility();
 
-  // Check the update requirements for all modules.
-  update_check_requirements();
+  // Check the update requirements for all modules. If there are warnings, but
+  // no errors, skip reporting them if the user has provided a URL parameter
+  // acknowledging the warnings and indicating a desire to continue anyway. See
+  // drupal_requirements_url().
+  $skip_warnings = !empty($_GET['continue']);
+  update_check_requirements($skip_warnings);
 
   $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
   switch ($op) {
@@ -433,7 +448,12 @@
 
     case 'Apply pending updates':
       if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) {
-        update_batch($_POST['start'], $base_url . '/update.php?op=results', $base_url . '/update.php');
+        // Generate absolute URLs for the batch processing (using $base_root),
+        // since the batch API will pass them to url() which does not handle
+        // update.php correctly by default.
+        $batch_url = $base_root . drupal_current_script_url();
+        $redirect_url = $base_root . drupal_current_script_url(array('op' => 'results'));
+        update_batch($_POST['start'], $redirect_url, $batch_url);
         break;
       }
 




More information about the Pkg-drupal-commits mailing list