[Pkg-drupal-commits] r2263 - in /branches/upstream/current-7: ./ includes/ includes/database/ includes/database/mysql/ includes/database/pgsql/ includes/database/sqlite/ misc/ modules/aggregator/ modules/aggregator/tests/ modules/block/ modules/block/tests/ 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/theme/ 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/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/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/bartik/templates/ themes/garland/ themes/seven/ themes/stark/

luigi at users.alioth.debian.org luigi at users.alioth.debian.org
Thu May 10 18:20:19 UTC 2012


Author: luigi
Date: Thu May 10 18:20:18 2012
New Revision: 2263

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

Added:
    branches/upstream/current-7/modules/contextual/contextual.test
    branches/upstream/current-7/modules/simpletest/tests/pager.test
    branches/upstream/current-7/modules/simpletest/tests/path_test.info
    branches/upstream/current-7/modules/simpletest/tests/path_test.module
    branches/upstream/current-7/modules/simpletest/tests/theme_test.inc
    branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
    branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.field.database.php
    branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.trigger.database.php
    branches/upstream/current-7/modules/simpletest/tests/upgrade/update.field.test
    branches/upstream/current-7/modules/simpletest/tests/upgrade/update.trigger.test
    branches/upstream/current-7/modules/simpletest/tests/upgrade/update.user.test
    branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.trigger.test
    branches/upstream/current-7/modules/system/language.api.php
    branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.test
Modified:
    branches/upstream/current-7/CHANGELOG.txt
    branches/upstream/current-7/MAINTAINERS.txt
    branches/upstream/current-7/includes/bootstrap.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/mysql/schema.inc
    branches/upstream/current-7/includes/database/pgsql/database.inc
    branches/upstream/current-7/includes/database/pgsql/schema.inc
    branches/upstream/current-7/includes/database/query.inc
    branches/upstream/current-7/includes/database/schema.inc
    branches/upstream/current-7/includes/database/sqlite/database.inc
    branches/upstream/current-7/includes/date.inc
    branches/upstream/current-7/includes/entity.inc
    branches/upstream/current-7/includes/errors.inc
    branches/upstream/current-7/includes/file.inc
    branches/upstream/current-7/includes/form.inc
    branches/upstream/current-7/includes/graph.inc
    branches/upstream/current-7/includes/language.inc
    branches/upstream/current-7/includes/locale.inc
    branches/upstream/current-7/includes/menu.inc
    branches/upstream/current-7/includes/module.inc
    branches/upstream/current-7/includes/pager.inc
    branches/upstream/current-7/includes/path.inc
    branches/upstream/current-7/includes/registry.inc
    branches/upstream/current-7/includes/session.inc
    branches/upstream/current-7/includes/theme.inc
    branches/upstream/current-7/includes/unicode.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/misc/autocomplete.js
    branches/upstream/current-7/misc/machine-name.js
    branches/upstream/current-7/misc/states.js
    branches/upstream/current-7/misc/tabledrag.js
    branches/upstream/current-7/misc/tableheader.js
    branches/upstream/current-7/misc/tableselect.js
    branches/upstream/current-7/misc/vertical-tabs.css
    branches/upstream/current-7/misc/vertical-tabs.js
    branches/upstream/current-7/modules/aggregator/aggregator.info
    branches/upstream/current-7/modules/aggregator/aggregator.module
    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.api.php
    branches/upstream/current-7/modules/block/block.info
    branches/upstream/current-7/modules/block/block.js
    branches/upstream/current-7/modules/block/block.module
    branches/upstream/current-7/modules/block/block.test
    branches/upstream/current-7/modules/block/tests/block_test.info
    branches/upstream/current-7/modules/block/tests/themes/block_test_theme/block_test_theme.info
    branches/upstream/current-7/modules/blog/blog.info
    branches/upstream/current-7/modules/blog/blog.module
    branches/upstream/current-7/modules/book/book-all-books-block.tpl.php
    branches/upstream/current-7/modules/book/book-export-html.tpl.php
    branches/upstream/current-7/modules/book/book-navigation.tpl.php
    branches/upstream/current-7/modules/book/book-node-export-html.tpl.php
    branches/upstream/current-7/modules/book/book.admin.inc
    branches/upstream/current-7/modules/book/book.info
    branches/upstream/current-7/modules/book/book.install
    branches/upstream/current-7/modules/book/book.js
    branches/upstream/current-7/modules/book/book.module
    branches/upstream/current-7/modules/book/book.pages.inc
    branches/upstream/current-7/modules/color/color.info
    branches/upstream/current-7/modules/color/color.module
    branches/upstream/current-7/modules/comment/comment.info
    branches/upstream/current-7/modules/comment/comment.module
    branches/upstream/current-7/modules/comment/comment.test
    branches/upstream/current-7/modules/contact/contact.info
    branches/upstream/current-7/modules/contact/contact.module
    branches/upstream/current-7/modules/contextual/contextual.info
    branches/upstream/current-7/modules/contextual/contextual.module
    branches/upstream/current-7/modules/dashboard/dashboard-rtl.css
    branches/upstream/current-7/modules/dashboard/dashboard.api.php
    branches/upstream/current-7/modules/dashboard/dashboard.css
    branches/upstream/current-7/modules/dashboard/dashboard.info
    branches/upstream/current-7/modules/dashboard/dashboard.js
    branches/upstream/current-7/modules/dashboard/dashboard.module
    branches/upstream/current-7/modules/dashboard/dashboard.test
    branches/upstream/current-7/modules/dblog/dblog.info
    branches/upstream/current-7/modules/dblog/dblog.module
    branches/upstream/current-7/modules/dblog/dblog.test
    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.form.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.install
    branches/upstream/current-7/modules/field/field.module
    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/list.module
    branches/upstream/current-7/modules/field/modules/list/tests/list.test
    branches/upstream/current-7/modules/field/modules/list/tests/list_test.info
    branches/upstream/current-7/modules/field/modules/list/tests/list_test.module
    branches/upstream/current-7/modules/field/modules/number/number.info
    branches/upstream/current-7/modules/field/modules/number/number.module
    branches/upstream/current-7/modules/field/modules/number/number.test
    branches/upstream/current-7/modules/field/modules/options/options.api.php
    branches/upstream/current-7/modules/field/modules/options/options.info
    branches/upstream/current-7/modules/field/modules/options/options.module
    branches/upstream/current-7/modules/field/modules/options/options.test
    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.info
    branches/upstream/current-7/modules/field/theme/field.tpl.php
    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.info
    branches/upstream/current-7/modules/file/file.js
    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/filter/filter.js
    branches/upstream/current-7/modules/filter/filter.module
    branches/upstream/current-7/modules/filter/filter.test
    branches/upstream/current-7/modules/forum/forum.info
    branches/upstream/current-7/modules/forum/forum.install
    branches/upstream/current-7/modules/forum/forum.module
    branches/upstream/current-7/modules/forum/forum.test
    branches/upstream/current-7/modules/help/help.info
    branches/upstream/current-7/modules/help/help.module
    branches/upstream/current-7/modules/help/help.test
    branches/upstream/current-7/modules/image/image.admin.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.module
    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.admin.inc
    branches/upstream/current-7/modules/locale/locale.api.php
    branches/upstream/current-7/modules/locale/locale.info
    branches/upstream/current-7/modules/locale/locale.install
    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.module
    branches/upstream/current-7/modules/menu/menu.admin.inc
    branches/upstream/current-7/modules/menu/menu.info
    branches/upstream/current-7/modules/menu/menu.module
    branches/upstream/current-7/modules/node/content_types.inc
    branches/upstream/current-7/modules/node/node.admin.inc
    branches/upstream/current-7/modules/node/node.api.php
    branches/upstream/current-7/modules/node/node.info
    branches/upstream/current-7/modules/node/node.install
    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/openid.js
    branches/upstream/current-7/modules/openid/openid.module
    branches/upstream/current-7/modules/openid/openid.test
    branches/upstream/current-7/modules/openid/tests/openid_test.info
    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.admin.inc
    branches/upstream/current-7/modules/path/path.api.php
    branches/upstream/current-7/modules/path/path.info
    branches/upstream/current-7/modules/path/path.js
    branches/upstream/current-7/modules/path/path.module
    branches/upstream/current-7/modules/path/path.test
    branches/upstream/current-7/modules/php/php.info
    branches/upstream/current-7/modules/php/php.module
    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.js
    branches/upstream/current-7/modules/profile/profile.module
    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.admin.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/shortcut/shortcut.module
    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.js
    branches/upstream/current-7/modules/simpletest/simpletest.module
    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/actions_loop_test.module
    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/ajax_test.module
    branches/upstream/current-7/modules/simpletest/tests/batch_test.info
    branches/upstream/current-7/modules/simpletest/tests/cache.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_cron_helper.info
    branches/upstream/current-7/modules/simpletest/tests/database_test.info
    branches/upstream/current-7/modules/simpletest/tests/database_test.install
    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_crud_hook_test.info
    branches/upstream/current-7/modules/simpletest/tests/entity_query.test
    branches/upstream/current-7/modules/simpletest/tests/error.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/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
    branches/upstream/current-7/modules/simpletest/tests/image_test.info
    branches/upstream/current-7/modules/simpletest/tests/menu.test
    branches/upstream/current-7/modules/simpletest/tests/menu_test.info
    branches/upstream/current-7/modules/simpletest/tests/menu_test.module
    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
    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_incompatible_core_version_dependencies_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.info
    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_test.info
    branches/upstream/current-7/modules/simpletest/tests/system_test.info
    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/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_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/drupal-6.upload.database.php
    branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.test
    branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.upload.test
    branches/upstream/current-7/modules/simpletest/tests/url_alter_test.info
    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/syslog/syslog.info
    branches/upstream/current-7/modules/syslog/syslog.module
    branches/upstream/current-7/modules/syslog/syslog.test
    branches/upstream/current-7/modules/system/page.tpl.php
    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-rtl.css
    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.js
    branches/upstream/current-7/modules/system/system.module
    branches/upstream/current-7/modules/system/system.test
    branches/upstream/current-7/modules/taxonomy/taxonomy.info
    branches/upstream/current-7/modules/taxonomy/taxonomy.js
    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.js
    branches/upstream/current-7/modules/toolbar/toolbar.module
    branches/upstream/current-7/modules/tracker/tracker.info
    branches/upstream/current-7/modules/tracker/tracker.install
    branches/upstream/current-7/modules/tracker/tracker.module
    branches/upstream/current-7/modules/tracker/tracker.pages.inc
    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/translation/translation.module
    branches/upstream/current-7/modules/translation/translation.pages.inc
    branches/upstream/current-7/modules/translation/translation.test
    branches/upstream/current-7/modules/trigger/tests/trigger_test.info
    branches/upstream/current-7/modules/trigger/tests/trigger_test.module
    branches/upstream/current-7/modules/trigger/trigger.admin.inc
    branches/upstream/current-7/modules/trigger/trigger.info
    branches/upstream/current-7/modules/trigger/trigger.install
    branches/upstream/current-7/modules/trigger/trigger.module
    branches/upstream/current-7/modules/trigger/trigger.test
    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/themes/update_test_basetheme/update_test_basetheme.info
    branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info
    branches/upstream/current-7/modules/update/tests/update_test.info
    branches/upstream/current-7/modules/update/update.fetch.inc
    branches/upstream/current-7/modules/update/update.info
    branches/upstream/current-7/modules/update/update.module
    branches/upstream/current-7/modules/update/update.test
    branches/upstream/current-7/modules/user/tests/user_form_test.info
    branches/upstream/current-7/modules/user/user.admin.inc
    branches/upstream/current-7/modules/user/user.api.php
    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/modules/user/user.test
    branches/upstream/current-7/profiles/minimal/minimal.info
    branches/upstream/current-7/profiles/minimal/minimal.install
    branches/upstream/current-7/profiles/minimal/minimal.profile
    branches/upstream/current-7/profiles/standard/standard.info
    branches/upstream/current-7/profiles/standard/standard.install
    branches/upstream/current-7/profiles/standard/standard.profile
    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/profiles/testing/testing.install
    branches/upstream/current-7/profiles/testing/testing.profile
    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/bartik/template.php
    branches/upstream/current-7/themes/bartik/templates/page.tpl.php
    branches/upstream/current-7/themes/garland/garland.info
    branches/upstream/current-7/themes/garland/template.php
    branches/upstream/current-7/themes/seven/seven.info
    branches/upstream/current-7/themes/seven/vertical-tabs.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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/CHANGELOG.txt (original)
+++ branches/upstream/current-7/CHANGELOG.txt Thu May 10 18:20:18 2012
@@ -1,6 +1,57 @@
 
-Drupal 7.13 xxxx-xx-xx (development version)
-----------------------
+Drupal 7.14 2012-05-02
+----------------------
+- Fixed "integrity constraint" fatal errors when rebuilding registry.
+- Fixed custom logo and favicon functionality referencing incorrect paths.
+- Fixed DB Case Sensitivity: Allow BINARY attribute in MySQL.
+- Split field_bundle_settings out per bundle.
+- Improve UX for machine names for fields (UI change).
+- Fixed User pictures are not removed properly.
+- Fixed HTTPS sessions not working in all cases.
+- Fixed Regression: Required radios throw illegal choice error when none
+  selected.
+- Fixed allow autocompletion requests to include slashes.
+- Eliminate $user->cache and {session}.cache in favor of
+  $_SESSION['cache_expiration'][$bin] (Performance).
+- Fixed focus jumps to tab when pressing enter on a form element within tab.
+- Fixed race condition in locale() - duplicates in {locales_source}.
+- Fixed Missing "Default image" per field instance.
+- Quit clobbering people's work when they click the filter tips link
+- Form API #states: Fix conditionals to allow OR and XOR constructions.
+- Fixed Focus jumps to tab when pressing enter on a form element within tab.
+  (Accessibility)
+- Improved performance of node_access queries.
+- Fixed Fieldsets inside vertical tabs have no title and can't be collapsed.
+- Reduce size of cache_menu table (Performance).
+- Fixed unnecessary aggregation of CSS/JS (Performance).
+- Fixed taxonomy_autocomplete() produces SQL error for nonexistent field.
+- Fixed HTML filter is not run first by default, despite default weight.
+- Fixed Overlay does not work with prefixed URL paths.
+- Better debug info for field errors (string change).
+- Fixed Data corruption in comment IDs (results in broken threading on
+  PostgreSQL).
+- Fixed machine name not editable if every character is replaced.
+- Fixed user picture not appearing in comment preview (Markup change).
+- Added optional vid argument for taxonomy_get_term_by_name().
+- Fixed Invalid Unicode code range in PREG_CLASS_UNICODE_WORD_BOUNDARY fails
+  with PCRE 8.30.
+- Fixed {trigger_assignments()}.hook has only 32 characters, is too short.
+- Numerous fixes to run-tests.sh.
+- Fixed Tests in profiles/[name]/modules cannot be run and cannot use a
+  different profile for running tests.
+- Numerous JavaScript performance fixes.
+- Numerous documentation fixes.
+- Fixed All pager links have an 'active' CSS class.
+- Numerous upgrade path fixes; notably:
+  - system_update_7061() fails on inserting files with same name but different
+    case.
+  - system_update_7061() converts filepaths too aggressively.
+  - Trigger upgrade path: Node triggers removed when upgrading to 7-x from 6.25.
+
+
+Drupal 7.13 2012-05-02
+----------------------
+- Fixed security issues (Multiple vulnerabilities), see SA-CORE-2012-002.
 
 Drupal 7.12, 2012-02-01
 ----------------------

Modified: branches/upstream/current-7/MAINTAINERS.txt
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/MAINTAINERS.txt?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/MAINTAINERS.txt (original)
+++ branches/upstream/current-7/MAINTAINERS.txt Thu May 10 18:20:18 2012
@@ -59,8 +59,10 @@
 
 Database update system
 - Károly Négyesi 'chx' <http://drupal.org/user/9446>
+- Ashok Modi 'btmash' <http://drupal.org/user/60422>
 
 Entity system
+- Wolfgang Ziegler 'fago' <http://drupal.org/user/16747>
 - Nathaniel Catchpole 'catch' <http://drupal.org/user/35733>
 - Franz Heinzmann 'Frando' <http://drupal.org/user/21850>
 
@@ -83,7 +85,7 @@
 - David Rothstein 'David_Rothstein' <http://drupal.org/user/124982>
 
 JavaScript
-- ?
+- Théodore Biadala 'nod_' <http://drupal.org/user/598310>
 
 Language system
 - Francesco Placella 'plach' <http://drupal.org/user/183211>
@@ -130,7 +132,7 @@
 
 Accessibility
 - Everett Zufelt 'Everett Zufelt' <http://drupal.org/user/406552>
-- Brandon Bowersox 'brandonojc' <http://drupal.org/user/186415> 
+- Brandon Bowersox-Johnson 'bowersox' <http://drupal.org/user/186415>
 
 Documentation
 - Jennifer Hodgdon 'jhodgdon' <http://drupal.org/user/155601>
@@ -227,7 +229,7 @@
 - ?
 
 Poll module
-- ?
+- Andrei Mateescu 'amateescu' <http://drupal.org/user/729614>
 
 Profile module
 - ?
@@ -247,7 +249,7 @@
 - Károly Négyesi 'chx' <http://drupal.org/user/9446>
 
 Statistics module
-- Dave Reid 'davereid' <http://drupal.org/user/53892>
+- Tim Millwood 'timmillwood' <http://drupal.org/user/227849>
 
 Syslog module
 - Khalid Baheyeldin 'kbahey' <http://drupal.org/user/4063>

Modified: branches/upstream/current-7/includes/bootstrap.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/bootstrap.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/bootstrap.inc (original)
+++ branches/upstream/current-7/includes/bootstrap.inc Thu May 10 18:20:18 2012
@@ -8,7 +8,7 @@
 /**
  * The current system version.
  */
-define('VERSION', '7.12');
+define('VERSION', '7.14');
 
 /**
  * Core API compatibility.
@@ -68,32 +68,32 @@
 define('WATCHDOG_ALERT', 1);
 
 /**
- * Log message severity -- Critical: critical conditions.
+ * Log message severity -- Critical conditions.
  */
 define('WATCHDOG_CRITICAL', 2);
 
 /**
- * Log message severity -- Error: error conditions.
+ * Log message severity -- Error conditions.
  */
 define('WATCHDOG_ERROR', 3);
 
 /**
- * Log message severity -- Warning: warning conditions.
+ * Log message severity -- Warning conditions.
  */
 define('WATCHDOG_WARNING', 4);
 
 /**
- * Log message severity -- Notice: normal but significant condition.
+ * Log message severity -- Normal but significant conditions.
  */
 define('WATCHDOG_NOTICE', 5);
 
 /**
- * Log message severity -- Informational: informational messages.
+ * Log message severity -- Informational messages.
  */
 define('WATCHDOG_INFO', 6);
 
 /**
- * Log message severity -- Debug: debug-level messages.
+ * Log message severity -- Debug-level messages.
  */
 define('WATCHDOG_DEBUG', 7);
 
@@ -279,7 +279,7 @@
  * means that assigning an offset via arrayAccess will only apply while the
  * object is in scope and will not be written back to the persistent cache.
  * This follows a similar pattern to static vs. persistent caching in
- * procedural code. Extending classes may wish to alter this behaviour, for
+ * procedural code. Extending classes may wish to alter this behavior, for
  * example by overriding offsetSet() and adding an automatic call to persist().
  *
  * @see SchemaCache
@@ -966,7 +966,7 @@
  *   The default value to use if this variable has never been set.
  *
  * @return
- *   The value of the variable.
+ *   The value of the variable. Unserialization is taken care of as necessary.
  *
  * @see variable_del()
  * @see variable_set()
@@ -1691,8 +1691,16 @@
  *   NULL if message is already translated or not possible to
  *   translate.
  * @param $severity
- *   The severity of the message, as per RFC 3164. Possible values are
- *   WATCHDOG_ERROR, WATCHDOG_WARNING, etc.
+ *   The severity of the message; one of the following values as defined in
+ *   @link http://www.faqs.org/rfcs/rfc3164.html RFC 3164: @endlink
+ *   - WATCHDOG_EMERGENCY: Emergency, system is unusable.
+ *   - WATCHDOG_ALERT: Alert, action must be taken immediately.
+ *   - WATCHDOG_CRITICAL: Critical conditions.
+ *   - WATCHDOG_ERROR: Error conditions.
+ *   - WATCHDOG_WARNING: Warning conditions.
+ *   - WATCHDOG_NOTICE: (default) Normal but significant conditions.
+ *   - WATCHDOG_INFO: Informational messages.
+ *   - WATCHDOG_DEBUG: Debug-level messages.
  * @param $link
  *   A link to associate with the message.
  *
@@ -1708,6 +1716,9 @@
   // end up in an infinite loop. To avoid that, we implement a simple static semaphore.
   if (!$in_error_state && function_exists('module_implements')) {
     $in_error_state = TRUE;
+
+    // The user object may not exist in all conditions, so 0 is substituted if needed.
+    $user_uid = isset($user->uid) ? $user->uid : 0;
 
     // Prepare the fields to be logged
     $log_entry = array(
@@ -1717,6 +1728,7 @@
       'severity'    => $severity,
       'link'        => $link,
       'user'        => $user,
+      'uid'         => $user_uid,
       'request_uri' => $base_root . request_uri(),
       'referer'     => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '',
       'ip'          => ip_address(),
@@ -1913,7 +1925,7 @@
  */
 function drupal_random_bytes($count)  {
   // $random_state does not use drupal_static as it stores random bytes.
-  static $random_state, $bytes;
+  static $random_state, $bytes, $php_compatible;
   // Initialize on the first call. The contents of $_SERVER includes a mix of
   // user-specific and system information that varies a little with each page.
   if (!isset($random_state)) {
@@ -1925,6 +1937,11 @@
     $bytes = '';
   }
   if (strlen($bytes) < $count) {
+    // PHP versions prior 5.3.4 experienced openssl_random_pseudo_bytes()
+    // locking on Windows and rendered it unusable.
+    if (!isset($php_compatible)) {
+      $php_compatible = version_compare(PHP_VERSION, '5.3.4', '>=');
+    }
     // /dev/urandom is available on many *nix systems and is considered the
     // best commonly available pseudo-random source.
     if ($fh = @fopen('/dev/urandom', 'rb')) {
@@ -1933,6 +1950,11 @@
       // that much so as to speed any additional invocations.
       $bytes .= fread($fh, max(4096, $count));
       fclose($fh);
+    }
+    // openssl_random_pseudo_bytes() will find entropy in a system-dependent
+    // way.
+    elseif ($php_compatible && function_exists('openssl_random_pseudo_bytes')) {
+      $bytes .= openssl_random_pseudo_bytes($count - strlen($bytes));
     }
     // If /dev/urandom is not available or returns no bytes, this loop will
     // generate a good set of pseudo-random bytes on any system.
@@ -2428,7 +2450,8 @@
     }
   }
 
-  return FALSE;
+  $test_prefix = FALSE;
+  return $test_prefix;
 }
 
 /**
@@ -3069,11 +3092,30 @@
  * to be called, because it is already known that the list of files in the
  * {system} table matches those in the file system.
  *
+ * @return
+ *   TRUE if the registry was rebuilt, FALSE if another thread was rebuilding
+ *   in parallel and the current thread just waited for completion.
+ *
  * @see registry_rebuild()
  */
 function registry_update() {
+  // install_system_module() calls module_enable() which calls into this
+  // function during initial system installation, so the lock system is neither
+  // loaded nor does its storage exist yet.
+  $in_installer = drupal_installation_attempted();
+  if (!$in_installer && !lock_acquire(__FUNCTION__)) {
+    // Another request got the lock, wait for it to finish.
+    lock_wait(__FUNCTION__);
+    return FALSE;
+  }
+
   require_once DRUPAL_ROOT . '/includes/registry.inc';
   _registry_update();
+
+  if (!$in_installer) {
+    lock_release(__FUNCTION__);
+  }
+  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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/cache.inc (original)
+++ branches/upstream/current-7/includes/cache.inc Thu May 10 18:20:18 2012
@@ -379,11 +379,31 @@
    *   The bin being requested.
    */
   protected function garbageCollection() {
-    global $user;
-
-    // Garbage collection necessary when enforcing a minimum cache lifetime.
+    $cache_lifetime = variable_get('cache_lifetime', 0);
+
+    // Clean-up the per-user cache expiration session data, so that the session
+    // handler can properly clean-up the session data for anonymous users.
+    if (isset($_SESSION['cache_expiration'])) {
+      $expire = REQUEST_TIME - $cache_lifetime;
+      foreach ($_SESSION['cache_expiration'] as $bin => $timestamp) {
+        if ($timestamp < $expire) {
+          unset($_SESSION['cache_expiration'][$bin]);
+        }
+      }
+      if (!$_SESSION['cache_expiration']) {
+        unset($_SESSION['cache_expiration']);
+      }
+    }
+
+    // Garbage collection of temporary items is only necessary when enforcing
+    // a minimum cache lifetime.
+    if (!$cache_lifetime) {
+      return;
+    }
+    // When cache lifetime is in force, avoid running garbage collection too
+    // often since this will remove temporary cache items indiscriminately.
     $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
-    if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= REQUEST_TIME)) {
+    if ($cache_flush && ($cache_flush + $cache_lifetime <= REQUEST_TIME)) {
       // Reset the variable immediately to prevent a meltdown in heavy load situations.
       variable_set('cache_flush_' . $this->bin, 0);
       // Time to flush old cache data
@@ -413,17 +433,16 @@
     if (!isset($cache->data)) {
       return FALSE;
     }
-    // If enforcing a minimum cache lifetime, validate that the data is
-    // currently valid for this user before we return it by making sure the cache
-    // entry was created before the timestamp in the current session's cache
-    // timer. The cache variable is loaded into the $user object by _drupal_session_read()
-    // in session.inc. If the data is permanent or we're not enforcing a minimum
-    // cache lifetime always return the cached data.
-    if ($cache->expire != CACHE_PERMANENT && variable_get('cache_lifetime', 0) && $user->cache > $cache->created) {
-      // This cache data is too old and thus not valid for us, ignore it.
+    // If the cached data is temporary and subject to a per-user minimum
+    // lifetime, compare the cache entry timestamp with the user session
+    // cache_expiration timestamp. If the cache entry is too old, ignore it.
+    if ($cache->expire != CACHE_PERMANENT && variable_get('cache_lifetime', 0) && isset($_SESSION['cache_expiration'][$this->bin]) && $_SESSION['cache_expiration'][$this->bin] > $cache->created) {
+      // Ignore cache data that is too old and thus not valid for this user.
       return FALSE;
     }
 
+    // If the data is permanent or not subject to a minimum cache lifetime,
+    // unserialize and return the cached data.
     if ($cache->serialized) {
       $cache->data = unserialize($cache->data);
     }
@@ -468,11 +487,10 @@
 
     if (empty($cid)) {
       if (variable_get('cache_lifetime', 0)) {
-        // We store the time in the current user's $user->cache variable which
-        // will be saved into the sessions bin by _drupal_session_write(). We then
-        // simulate that the cache was flushed for this user by not returning
-        // cached data that was cached before the timestamp.
-        $user->cache = REQUEST_TIME;
+        // We store the time in the current user's session. We then simulate
+        // that the cache was flushed for this user by not returning cached
+        // data that was cached before the timestamp.
+        $_SESSION['cache_expiration'][$this->bin] = REQUEST_TIME;
 
         $cache_flush = variable_get('cache_flush_' . $this->bin, 0);
         if ($cache_flush == 0) {

Modified: branches/upstream/current-7/includes/common.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/common.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/common.inc (original)
+++ branches/upstream/current-7/includes/common.inc Thu May 10 18:20:18 2012
@@ -532,8 +532,8 @@
  * 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
- * sources, or URLs that link to external resources.
+ * system, such as via url(). It should not be used for URLs that come from
+ * external sources, or URLs that link to external resources.
  *
  * The returned array contains a 'path' that may be passed separately to url().
  * For example:
@@ -1734,7 +1734,8 @@
 
   // Get the plural index through the gettext formula.
   $index = (function_exists('locale_get_plural')) ? locale_get_plural($count, isset($options['langcode']) ? $options['langcode'] : NULL) : -1;
-  // Backwards compatibility.
+  // If the index cannot be computed, use the plural as a fallback (which
+  // allows for most flexiblity with the replaceable @count value).
   if ($index < 0) {
     return t($plural, $args, $options);
   }
@@ -2821,7 +2822,7 @@
  *   - 'group': A number identifying the group in which to add the stylesheet.
  *     Available constants are:
  *     - CSS_SYSTEM: Any system-layer CSS.
- *     - CSS_DEFAULT: Any module-layer CSS.
+ *     - CSS_DEFAULT: (default) Any module-layer CSS.
  *     - CSS_THEME: Any theme-layer CSS.
  *     The group number serves as a weight: the markup for loading a stylesheet
  *     within a lower weight group is output to the page before the markup for
@@ -2969,6 +2970,18 @@
   // Sort CSS items, so that they appear in the correct order.
   uasort($css, 'drupal_sort_css_js');
 
+  // Provide the page with information about the individual CSS files used,
+  // information not otherwise available when CSS aggregation is enabled. The
+  // setting is attached later in this function, but is set here, so that CSS
+  // files removed below are still considered "used" and prevented from being
+  // added in a later AJAX request.
+  // Skip if no files were added to the page or jQuery.extend() will overwrite
+  // the Drupal.settings.ajaxPageState.css object with an empty array.
+  if (!empty($css)) {
+    // Cast the array to an object to be on the safe side even if not empty.
+    $setting['ajaxPageState']['css'] = (object) array_fill_keys(array_keys($css), 1);
+  }
+
   // Remove the overridden CSS files. Later CSS files override former ones.
   $previous_item = array();
   foreach ($css as $key => $item) {
@@ -2989,10 +3002,9 @@
     '#items' => $css,
   );
 
-  // Provide the page with information about the individual CSS files used,
-  // information not otherwise available when CSS aggregation is enabled.
-  $setting['ajaxPageState']['css'] = array_fill_keys(array_keys($css), 1);
-  $styles['#attached']['js'][] = array('type' => 'setting', 'data' => $setting);
+  if (!empty($setting)) {
+    $styles['#attached']['js'][] = array('type' => 'setting', 'data' => $setting);
+  }
 
   return drupal_render($styles);
 }
@@ -3443,7 +3455,13 @@
   $data = '';
   $uri = '';
   $map = variable_get('drupal_css_cache_files', array());
-  $key = hash('sha256', serialize($css));
+  // Create a new array so that only the file names are used to create the hash.
+  // This prevents new aggregates from being created unnecessarily.
+  $css_data = array();
+  foreach ($css as $css_file) {
+    $css_data[] = $css_file['data'];
+  }
+  $key = hash('sha256', serialize($css_data));
   if (isset($map[$key])) {
     $uri = $map[$key];
   }
@@ -4804,7 +4822,13 @@
   $contents = '';
   $uri = '';
   $map = variable_get('drupal_js_cache_files', array());
-  $key = hash('sha256', serialize($files));
+  // Create a new array so that only the file names are used to create the hash.
+  // This prevents new aggregates from being created unnecessarily.
+  $js_data = array();
+  foreach ($files as $file) {
+    $js_data[] = $file['data'];
+  }
+  $key = hash('sha256', serialize($js_data));
   if (isset($map[$key])) {
     $uri = $map[$key];
   }
@@ -5219,8 +5243,6 @@
 function drupal_system_listing($mask, $directory, $key = 'name', $min_depth = 1) {
   $config = conf_path();
 
-  $profile = drupal_get_profile();
-
   $searchdir = array($directory);
   $files = array();
 
@@ -5228,8 +5250,24 @@
   // themes as organized by a distribution. It is pristine in the same way
   // that /modules is pristine for core; users should avoid changing anything
   // there in favor of sites/all or sites/<domain> directories.
-  if (file_exists("profiles/$profile/$directory")) {
-    $searchdir[] = "profiles/$profile/$directory";
+  $profiles = array();
+  $profile = drupal_get_profile();
+  // For SimpleTest to be able to test modules packaged together with a
+  // distribution we need to include the profile of the parent site (in which
+  // test runs are triggered).
+  if (drupal_valid_test_ua()) {
+    $testing_profile = variable_get('simpletest_parent_profile', FALSE);
+    if ($testing_profile && $testing_profile != $profile) {
+      $profiles[] = $testing_profile;
+    }
+  }
+  // In case both profile directories contain the same extension, the actual
+  // profile always has precedence.
+  $profiles[] = $profile;
+  foreach ($profiles as $profile) {
+    if (file_exists("profiles/$profile/$directory")) {
+      $searchdir[] = "profiles/$profile/$directory";
+    }
   }
 
   // Always search sites/all/* as well as the global directories.

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/database.inc (original)
+++ branches/upstream/current-7/includes/database/database.inc Thu May 10 18:20:18 2012
@@ -1430,9 +1430,6 @@
   /**
    * Gets the connection object for the specified database key and target.
    *
-   * Note: do not use the setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE) on the
-   * returned object because of http://bugs.php.net/bug.php?id=43139.
-   *
    * @param $target
    *   The database target name.
    * @param $key

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/mysql/database.inc (original)
+++ branches/upstream/current-7/includes/database/mysql/database.inc Thu May 10 18:20:18 2012
@@ -46,8 +46,6 @@
       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']);

Modified: branches/upstream/current-7/includes/database/mysql/schema.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/mysql/schema.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/mysql/schema.inc (original)
+++ branches/upstream/current-7/includes/database/mysql/schema.inc Thu May 10 18:20:18 2012
@@ -131,8 +131,13 @@
   protected function createFieldSql($name, $spec) {
     $sql = "`" . $name . "` " . $spec['mysql_type'];
 
-    if (in_array($spec['mysql_type'], array('VARCHAR', 'CHAR', 'TINYTEXT', 'MEDIUMTEXT', 'LONGTEXT', 'TEXT')) && isset($spec['length'])) {
-      $sql .= '(' . $spec['length'] . ')';
+    if (in_array($spec['mysql_type'], array('VARCHAR', 'CHAR', 'TINYTEXT', 'MEDIUMTEXT', 'LONGTEXT', 'TEXT'))) {
+      if (isset($spec['length'])) {
+        $sql .= '(' . $spec['length'] . ')';
+      }
+      if (!empty($spec['binary'])) {
+        $sql .= ' BINARY';
+      }
     }
     elseif (isset($spec['precision']) && isset($spec['scale'])) {
       $sql .= '(' . $spec['precision'] . ', ' . $spec['scale'] . ')';
@@ -381,7 +386,7 @@
     // Returns one row for each column in the index. Result is string or FALSE.
     // Details at http://dev.mysql.com/doc/refman/5.0/en/show-index.html
     $row = $this->connection->query('SHOW INDEX FROM {' . $table . "} WHERE key_name = '$name'")->fetchAssoc();
-    return isset($row['key_name']);
+    return isset($row['Key_name']);
   }
 
   public function addPrimaryKey($table, $fields) {

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/pgsql/database.inc (original)
+++ branches/upstream/current-7/includes/database/pgsql/database.inc Thu May 10 18:20:18 2012
@@ -62,8 +62,6 @@
       PDO::ATTR_EMULATE_PREPARES => TRUE,
       // Convert numeric values to strings when fetching.
       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']);
 

Modified: branches/upstream/current-7/includes/database/pgsql/schema.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/pgsql/schema.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/pgsql/schema.inc (original)
+++ branches/upstream/current-7/includes/database/pgsql/schema.inc Thu May 10 18:20:18 2012
@@ -328,9 +328,9 @@
     // rename them when renaming the table.
     $indexes = $this->connection->query('SELECT indexname FROM pg_indexes WHERE schemaname = :schema AND tablename = :table', array(':schema' => $old_schema, ':table' => $old_table_name));
     foreach ($indexes as $index) {
-      if (preg_match('/^' . preg_quote($old_full_name) . '_(.*)_idx$/', $index->indexname, $matches)) {
+      if (preg_match('/^' . preg_quote($old_full_name) . '_(.*)$/', $index->indexname, $matches)) {
         $index_name = $matches[1];
-        $this->connection->query('ALTER INDEX ' . $index->indexname . ' RENAME TO {' . $new_name . '}_' . $index_name . '_idx');
+        $this->connection->query('ALTER INDEX ' . $index->indexname . ' RENAME TO {' . $new_name . '}_' . $index_name);
       }
     }
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/query.inc (original)
+++ branches/upstream/current-7/includes/database/query.inc Thu May 10 18:20:18 2012
@@ -1898,7 +1898,7 @@
   function __clone() {
     $this->changed = TRUE;
     foreach ($this->conditions as $key => $condition) {
-      if ($condition['field'] instanceOf QueryConditionInterface) {
+      if ($key !== '#conjunction' && $condition['field'] instanceOf QueryConditionInterface) {
         $this->conditions[$key]['field'] = clone($condition['field']);
       }
     }

Modified: branches/upstream/current-7/includes/database/schema.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/database/schema.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/schema.inc (original)
+++ branches/upstream/current-7/includes/database/schema.inc Thu May 10 18:20:18 2012
@@ -76,8 +76,13 @@
  *       the precision (total number of significant digits) and scale
  *       (decimal digits right of the decimal point). Both values are
  *       mandatory. Ignored for other field types.
+ *     - 'binary': A boolean indicating that MySQL should force 'char',
+ *       'varchar' or 'text' fields to use case-sensitive binary collation.
+ *       This has no effect on other database types for which case sensitivity
+ *       is already the default behavior.
  *     All parameters apart from 'type' are optional except that type
- *     'numeric' columns must specify 'precision' and 'scale'.
+ *     'numeric' columns must specify 'precision' and 'scale', and type
+ *     'varchar' must specify the 'length' parameter.
  *  - 'primary key': An array of one or more key column specifiers (see below)
  *    that form the primary key.
  *  - 'unique keys': An associative array of unique keys ('keyname' =>

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/database/sqlite/database.inc (original)
+++ branches/upstream/current-7/includes/database/sqlite/database.inc Thu May 10 18:20:18 2012
@@ -37,7 +37,7 @@
   /**
    * All databases attached to the current database. This is used to allow
    * prefixes to be safely handled without locking the table
-   * 
+   *
    * @var array
    */
   protected $attachedDatabases = array();
@@ -46,10 +46,10 @@
    * Whether or not a table has been dropped this request: the destructor will
    * only try to get rid of unnecessary databases if there is potential of them
    * being empty.
-   * 
+   *
    * This variable is set to public because DatabaseSchema_sqlite needs to
    * access it. However, it should not be manually set.
-   * 
+   *
    * @var boolean
    */
   var $tableDropped = FALSE;
@@ -68,8 +68,6 @@
       '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,
     );

Modified: branches/upstream/current-7/includes/date.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/date.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/date.inc (original)
+++ branches/upstream/current-7/includes/date.inc Thu May 10 18:20:18 2012
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Initialize the list of date formats and their locales.
+ * Initializes the list of date formats and their locales.
  */
 
 /**

Modified: branches/upstream/current-7/includes/entity.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/entity.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/entity.inc (original)
+++ branches/upstream/current-7/includes/entity.inc Thu May 10 18:20:18 2012
@@ -468,7 +468,7 @@
    * @var array
    *
    * @see EntityFieldQuery::fieldLanguageCondition()
-   * @see EntityFieldQuery::fielDeltaCondition()
+   * @see EntityFieldQuery::fieldDeltaCondition()
    */
   public $fieldMetaConditions = array();
 
@@ -1106,12 +1106,13 @@
    * contains everything necessary for processing.
    *
    * @return
-   *   Either a number if count() was called or an array of associative
-   *   arrays of stub entities. The outer array keys are entity types, and the
-   *   inner array keys are the relevant ID. (In most this cases this will be
-   *   the entity ID. The only exception is when age=FIELD_LOAD_REVISION is used
-   *   and field conditions or sorts are present -- in this case, the key will
-   *   be the revision ID.) The inner array values are always stub entities, as
+   *   Either a number if count() was called or an array of associative arrays
+   *   of stub entities. The outer array keys are entity types, and the inner
+   *   array keys are the relevant ID. (In most cases this will be the entity
+   *   ID. The only exception is when age=FIELD_LOAD_REVISION is used and field
+   *   conditions or sorts are present -- in this case, the key will be the
+   *   revision ID.) The entity type will only exist in the outer array if
+   *   results were found. The inner array values are always stub entities, as
    *   returned by entity_create_stub_entity(). To traverse the returned array:
    *   @code
    *     foreach ($query->execute() as $entity_type => $entities) {
@@ -1121,7 +1122,9 @@
    *   the entities found:
    *   @code
    *     $result = $query->execute();
-   *     $entities = entity_load($my_type, array_keys($result[$my_type]));
+   *     if (!empty($result[$my_type])) {
+   *       $entities = entity_load($my_type, array_keys($result[$my_type]));
+   *     }
    *   @endcode
    */
   public function execute() {
@@ -1260,12 +1263,11 @@
   /**
    * Get the total number of results and initialize a pager for the query.
    *
-   * This query can be detected by checking for ($this->pager && $this->count),
-   * which allows a driver to return 0 from the count query and disable
-   * the pager.
+   * The pager can be disabled by either setting the pager limit to 0, or by
+   * setting this query to be a count query.
    */
   function initializePager() {
-    if ($this->pager && !$this->count) {
+    if ($this->pager && !empty($this->pager['limit']) && !$this->count) {
       $page = pager_find_page($this->pager['element']);
       $count_query = clone $this;
       $this->pager['total'] = $count_query->count()->execute();

Modified: branches/upstream/current-7/includes/errors.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/errors.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/errors.inc (original)
+++ branches/upstream/current-7/includes/errors.inc Thu May 10 18:20:18 2012
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Functions for error handling
+ * Functions for error handling.
  */
 
 /**
@@ -21,7 +21,8 @@
 define('ERROR_REPORTING_DISPLAY_ALL', 2);
 
 /**
- * Map PHP error constants to watchdog severity levels.
+ * Maps PHP error constants to watchdog severity levels.
+ *
  * The error constants are documented at
  * http://php.net/manual/en/errorfunc.constants.php
  *
@@ -52,7 +53,7 @@
 }
 
 /**
- * Custom PHP error handler.
+ * Provides custom PHP error handling.
  *
  * @param $error_level
  *   The level of the error raised.
@@ -63,7 +64,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_real($error_level, $message, $filename, $line, $context) {
   if ($error_level & error_reporting()) {
@@ -90,10 +92,11 @@
 }
 
 /**
- * Decode an exception, especially to retrive the correct caller.
+ * Decodes an exception and retrieves the correct caller.
  *
  * @param $exception
  *   The exception object that was thrown.
+ *
  * @return
  *   An error in the format expected by _drupal_log_error().
  */
@@ -136,7 +139,7 @@
 }
 
 /**
- * Render an error message for an exception without any possibility of a further exception occurring.
+ * Renders an exception error message without further exceptions.
  *
  * @param $exception
  *   The exception object that was thrown.
@@ -171,12 +174,12 @@
 }
 
 /**
- * Log a PHP error or exception, display an error page in fatal cases.
+ * Logs a PHP error or exception and displays an error page in fatal cases.
  *
  * @param $error
  *   An array with the following keys: %type, !message, %function, %file, %line
- *   and severity_level. All the parameters are plain-text, with the exception of
- *   !message, which needs to be a safe HTML string.
+ *   and severity_level. All the parameters are plain-text, with the exception
+ *   of !message, which needs to be a safe HTML string.
  * @param $fatal
  *   TRUE if the error is fatal.
  */
@@ -263,6 +266,7 @@
  *
  * @param $backtrace
  *   A standard PHP backtrace.
+ *
  * @return
  *   An associative array with keys 'file', 'line' and 'function'.
  */

Modified: branches/upstream/current-7/includes/file.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/file.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/file.inc (original)
+++ branches/upstream/current-7/includes/file.inc Thu May 10 18:20:18 2012
@@ -70,11 +70,7 @@
 define('FILE_STATUS_PERMANENT', 1);
 
 /**
- * Methods to manage a registry of stream wrappers.
- */
-
-/**
- * Drupal stream wrapper registry.
+ * Provides Drupal stream wrapper registry.
  *
  * A stream wrapper is an abstraction of a file system that allows Drupal to
  * use the same set of methods to access both local files and remote resources.
@@ -206,7 +202,7 @@
 }
 
 /**
- * Check that the scheme of a stream URI is valid.
+ * Checks that the scheme of a stream URI is valid.
  *
  * Confirms that there is a registered stream handler for the provided scheme
  * and that it is callable. This is useful if you want to confirm a valid
@@ -232,7 +228,7 @@
 
 
 /**
- * Returns the part of an URI after the schema.
+ * Returns the part of a URI after the schema.
  *
  * @param $uri
  *   A stream, referenced as "scheme://target".
@@ -252,7 +248,7 @@
 }
 
 /**
- * Get the default file stream implementation.
+ * Gets the default file stream implementation.
  *
  * @return
  *   'public', 'private' or any other file scheme defined as the default.
@@ -322,7 +318,7 @@
 }
 
 /**
- * Returns a reference to the stream wrapper class responsible for a given scheme.
+ * Returns a reference to the stream wrapper class responsible for a scheme.
  *
  * This helper method returns a stream instance using a scheme. That is, the
  * passed string does not contain a "://". For example, "public" is a scheme
@@ -357,7 +353,6 @@
  * Creates a web-accessible URL for a stream to an external or local file.
  *
  * Compatibility: normal paths and stream wrappers.
- * @see http://drupal.org/node/515192
  *
  * There are two kinds of local files:
  * - "managed files", i.e. those stored by a Drupal-compatible stream wrapper.
@@ -375,6 +370,8 @@
  *   If the provided string already contains a preceding 'http', 'https', or
  *   '/', nothing is done and the same string is returned. If a stream wrapper
  *   could not be found to generate an external URL, then FALSE is returned.
+ *
+ * @see http://drupal.org/node/515192
  */
 function file_create_url($uri) {
   // Allow the URI to be altered, e.g. to serve a file from a CDN or static
@@ -417,7 +414,7 @@
 }
 
 /**
- * Check that the directory exists and is writable.
+ * Checks that the directory exists and is writable.
  *
  * Directories need to have execute permissions to be considered a directory by
  * FTP servers, etc.
@@ -459,7 +456,7 @@
 }
 
 /**
- * If missing, create a .htaccess file in each Drupal files directory.
+ * Creates a .htaccess file in each Drupal files directory if it is missing.
  */
 function file_ensure_htaccess() {
   file_create_htaccess('public://', FALSE);
@@ -470,7 +467,7 @@
 }
 
 /**
- * Creates an .htaccess file in the given directory.
+ * Creates a .htaccess file in the given directory.
  *
  * @param $directory
  *   The directory.
@@ -526,25 +523,25 @@
  * @return
  *   An array of file objects, indexed by fid.
  *
+ * @todo Remove $conditions in Drupal 8.
+ *
  * @see hook_file_load()
  * @see file_load()
  * @see entity_load()
  * @see EntityFieldQuery
- *
- * @todo Remove $conditions in Drupal 8.
  */
 function file_load_multiple($fids = array(), $conditions = array()) {
   return entity_load('file', $fids, $conditions);
 }
 
 /**
- * Load a file object from the database.
+ * Loads a single file object from the database.
  *
  * @param $fid
  *   A file ID.
  *
  * @return
- *   A file object.
+ *   An object representing the file, or FALSE if the file was not found.
  *
  * @see hook_file_load()
  * @see file_load_multiple()
@@ -555,7 +552,7 @@
 }
 
 /**
- * Save a file object to the database.
+ * Saves a file object to the database.
  *
  * If the $file->fid is not set a new record will be added.
  *
@@ -797,7 +794,7 @@
 }
 
 /**
- * Determine whether the URI has a valid scheme for file API operations.
+ * Determines whether the URI has a valid scheme for file API operations.
  *
  * There must be a scheme and it must be a Drupal-provided scheme like
  * 'public', 'private', 'temporary', or an extension provided with
@@ -926,7 +923,7 @@
 }
 
 /**
- * Given a relative path, construct a URI into Drupal's default files location.
+ * Constructs a URI to Drupal's default files location given a relative path.
  */
 function file_build_uri($path) {
   $uri = file_default_scheme() . '://' . $path;
@@ -934,8 +931,7 @@
 }
 
 /**
- * Determines the destination path for a file depending on how replacement of
- * existing files should be handled.
+ * Determines the destination path for a file.
  *
  * @param $destination
  *   A string specifying the desired final URI or filepath.
@@ -972,7 +968,7 @@
 }
 
 /**
- * Move a file to a new location and update the file's database entry.
+ * Moves a file to a new location and update the file's database entry.
  *
  * Moving a file is performed by copying the file to the new location and then
  * deleting the original.
@@ -1052,8 +1048,7 @@
 }
 
 /**
- * Move a file to a new location without calling any hooks or making any
- * changes to the database.
+ * Moves a file to a new location without database changes or hook invocation.
  *
  * @param $source
  *   A string specifying the filepath or URI of the original file.
@@ -1082,7 +1077,7 @@
 }
 
 /**
- * Modify a filename as needed for security purposes.
+ * Modifies a filename as needed for security purposes.
  *
  * Munging a file name prevents unknown file extensions from masking exploit
  * files. When web servers such as Apache decide how to process a URL request,
@@ -1146,7 +1141,7 @@
 }
 
 /**
- * Undo the effect of file_munge_filename().
+ * Undoes the effect of file_munge_filename().
  *
  * @param $filename
  *   String with the filename to be unmunged.
@@ -1159,7 +1154,7 @@
 }
 
 /**
- * Create a full file path from a directory and filename.
+ * Creates a full file path from a directory and filename.
  *
  * If a file with the specified name already exists, an alternative will be
  * used.
@@ -1214,7 +1209,7 @@
 }
 
 /**
- * Delete a file and its database record.
+ * Deletes a file and its database record.
  *
  * If the $force parameter is not TRUE, file_usage_list() will be called to
  * determine if the file is being used by any modules. If the file is being
@@ -1269,8 +1264,7 @@
 }
 
 /**
- * Delete a file without calling any hooks or making any changes to the
- * database.
+ * Deletes a file without database changes or hook invocations.
  *
  * This function should be used when the file to be deleted does not have an
  * entry recorded in the files table.
@@ -1306,7 +1300,7 @@
 }
 
 /**
- * Recursively delete all files and directories in the specified filepath.
+ * Deletes all files and directories in the specified filepath recursively.
  *
  * If the specified path is a directory then the function will call itself
  * recursively to process the contents. Once the contents have been removed the
@@ -1344,7 +1338,7 @@
 }
 
 /**
- * Determine total disk space used by a single user or the whole filesystem.
+ * Determines total disk space used by a single user or the whole filesystem.
  *
  * @param $uid
  *   Optional. A user id, specifying NULL returns the total space used by all
@@ -1581,7 +1575,6 @@
  * or open_basedir are enabled, so this function fills that gap.
  *
  * Compatibility: normal paths and stream wrappers.
- * @see http://drupal.org/node/515192
  *
  * @param $filename
  *   The filename of the uploaded file.
@@ -1592,6 +1585,7 @@
  *   TRUE on success, or FALSE on failure.
  *
  * @see move_uploaded_file()
+ * @see http://drupal.org/node/515192
  * @ingroup php_wrappers
  */
 function drupal_move_uploaded_file($filename, $uri) {
@@ -1612,7 +1606,7 @@
 }
 
 /**
- * Check that a file meets the criteria specified by the validators.
+ * Checks that a file meets the criteria specified by the validators.
  *
  * After executing the validator callbacks specified hook_file_validate() will
  * also be called to allow other modules to report errors about the file.
@@ -1647,10 +1641,11 @@
 }
 
 /**
- * Check for files with names longer than we can store in the database.
+ * Checks for files with names longer than we can store in the database.
  *
  * @param $file
  *   A Drupal file object.
+ *
  * @return
  *   An array. If the file name is too long, it will contain an error message.
  */
@@ -1667,7 +1662,7 @@
 }
 
 /**
- * Check that the filename ends with an allowed extension.
+ * Checks that the filename ends with an allowed extension.
  *
  * @param $file
  *   A Drupal file object.
@@ -1691,7 +1686,7 @@
 }
 
 /**
- * Check that the file's size is below certain limits.
+ * Checks that the file's size is below certain limits.
  *
  * This check is not enforced for the user #1.
  *
@@ -1730,7 +1725,7 @@
 }
 
 /**
- * Check that the file is recognized by image_get_info() as an image.
+ * Checks that the file is recognized by image_get_info() as an image.
  *
  * @param $file
  *   A Drupal file object.
@@ -1752,7 +1747,7 @@
 }
 
 /**
- * Verify that image dimensions are within the specified maximum and minimum.
+ * Verifies that image dimensions are within the specified maximum and minimum.
  *
  * Non-image files will be ignored. If a image toolkit is available the image
  * will be scaled to fit within the desired maximum dimensions.
@@ -1810,7 +1805,7 @@
 }
 
 /**
- * Save a string to the specified destination and create a database file entry.
+ * Saves a file to the specified destination and creates a database entry.
  *
  * @param $data
  *   A string containing the contents of the file.
@@ -1874,7 +1869,7 @@
 }
 
 /**
- * Save a string to the specified destination without invoking file API.
+ * Saves a string to the specified destination without invoking file API.
  *
  * This function is identical to file_save_data() except the file will not be
  * saved to the {file_managed} table and none of the file_* hooks will be
@@ -1885,7 +1880,8 @@
  * @param $destination
  *   A string containing the destination location. This must be a stream wrapper
  *   URI. If no value is provided, a randomized name will be generated and the
- *   file will be saved using Drupal's default files scheme, usually "public://".
+ *   file will be saved using Drupal's default files scheme, usually
+ *   "public://".
  * @param $replace
  *   Replace behavior when the destination file already exists:
  *   - FILE_EXISTS_REPLACE - Replace the existing file.
@@ -1911,7 +1907,7 @@
 }
 
 /**
- * Transfer file using HTTP to client.
+ * Transfers a file to the client using HTTP.
  *
  * Pipes a file through Drupal to the client.
  *
@@ -1953,7 +1949,7 @@
  * exists but no modules responded drupal_access_denied() will be returned.
  * If the file does not exist drupal_not_found() will be returned.
  *
- * @see hook_file_download()
+ * @see system_menu()
  */
 function file_download() {
   // Merge remainder of arguments from GET['q'], into relative file path.
@@ -1971,7 +1967,9 @@
       $function = $module . '_file_download';
       $result = $function($uri);
       if ($result == -1) {
-        return drupal_access_denied();
+        // Throw away the headers received so far.
+        $headers = array();
+        break;
       }
       if (isset($result) && is_array($result)) {
         $headers = array_merge($headers, $result);
@@ -1980,9 +1978,12 @@
     if (count($headers)) {
       file_transfer($uri, $headers);
     }
-    return drupal_access_denied();
-  }
-  return drupal_not_found();
+    drupal_access_denied();
+  }
+  else {
+    drupal_not_found();
+  }
+  drupal_exit();
 }
 
 
@@ -2063,7 +2064,7 @@
 }
 
 /**
- * Determine the maximum file upload size by querying the PHP settings.
+ * Determines the maximum file upload size by querying the PHP settings.
  *
  * @return
  *   A file size limit in bytes based on the PHP upload_max_filesize and
@@ -2087,7 +2088,7 @@
 }
 
 /**
- * Determine an Internet Media Type, or MIME type from a filename.
+ * Determines an Internet Media Type or MIME type from a filename.
  *
  * @param $uri
  *   A string containing the URI, path, or filename.
@@ -2116,7 +2117,7 @@
 }
 
 /**
- * Set the permissions on a file or directory.
+ * Sets the permissions on a file or directory.
  *
  * This function will use the 'file_chmod_directory' and 'file_chmod_file'
  * variables for the default modes for directories and uploaded/generated
@@ -2222,10 +2223,11 @@
  *   The absolute local filesystem path (with no symbolic links), or FALSE on
  *   failure.
  *
+ * @todo This function is deprecated, and should be removed wherever possible.
+ *
  * @see DrupalStreamWrapperInterface::realpath()
  * @see http://php.net/manual/function.realpath.php
  * @ingroup php_wrappers
- * @todo: This function is deprecated, and should be removed wherever possible.
  */
 function drupal_realpath($uri) {
   // If this URI is a stream, pass it off to the appropriate stream wrapper.
@@ -2252,7 +2254,6 @@
  * PHP's dirname() as a fallback.
  *
  * Compatibility: normal paths and stream wrappers.
- * @see http://drupal.org/node/515192
  *
  * @param $uri
  *   A URI or path.
@@ -2261,6 +2262,7 @@
  *   A string containing the directory name.
  *
  * @see dirname()
+ * @see http://drupal.org/node/515192
  * @ingroup php_wrappers
  */
 function drupal_dirname($uri) {
@@ -2310,7 +2312,6 @@
  * is not provided, this function will make sure that Drupal's is used.
  *
  * Compatibility: normal paths and stream wrappers.
- * @see http://drupal.org/node/515192
  *
  * @param $uri
  *   A URI or pathname.
@@ -2325,6 +2326,7 @@
  *   Boolean TRUE on success, or FALSE on failure.
  *
  * @see mkdir()
+ * @see http://drupal.org/node/515192
  * @ingroup php_wrappers
  */
 function drupal_mkdir($uri, $mode = NULL, $recursive = FALSE, $context = NULL) {
@@ -2341,7 +2343,7 @@
 }
 
 /**
- * Remove a directory.
+ * Removes a directory.
  *
  * PHP's rmdir() is broken on Windows, as it can fail to remove a directory
  * when it has a read-only flag set.
@@ -2378,7 +2380,6 @@
  * given a filepath.
  *
  * Compatibility: normal paths and stream wrappers.
- * @see http://drupal.org/node/515192
  *
  * @param $directory
  *   The directory where the temporary filename will be created.
@@ -2390,6 +2391,7 @@
  *   The new temporary filename, or FALSE on failure.
  *
  * @see tempnam()
+ * @see http://drupal.org/node/515192
  * @ingroup php_wrappers
  */
 function drupal_tempnam($directory, $prefix) {
@@ -2412,7 +2414,7 @@
 }
 
 /**
- * Get the path of system-appropriate temporary directory.
+ * Gets the path of system-appropriate temporary directory.
  */
 function file_directory_temp() {
   $temporary_directory = variable_get('file_temporary_path', NULL);
@@ -2469,6 +2471,7 @@
  *
  * @param $file
  *   A file object.
+ *
  * @return
  *   An associative array of headers, as expected by file_transfer().
  */

Modified: branches/upstream/current-7/includes/form.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/form.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/form.inc (original)
+++ branches/upstream/current-7/includes/form.inc Thu May 10 18:20:18 2012
@@ -1,4 +1,8 @@
 <?php
+ /**
+ * @file
+ * Functions for form and batch generation and processing.
+ */
 
 /**
  * @defgroup forms Form builder functions
@@ -90,7 +94,11 @@
  */
 
 /**
- * Wrapper for drupal_build_form() for use when $form_state is not needed.
+ * Returns a renderable form array for a given form ID.
+ *
+ * This function should be used instead of drupal_build_form() when $form_state
+ * is not needed (i.e., when initially rendering the form) and is often
+ * used as a menu callback.
  *
  * @param $form_id
  *   The unique string identifying the desired form. If a function with that
@@ -98,7 +106,7 @@
  *   generate the same form (or very similar forms) using different $form_ids
  *   can implement hook_forms(), which maps different $form_id values to the
  *   proper form constructor function. Examples may be found in node_forms(),
- *   search_forms(), and user_forms().
+ *   and search_forms().
  * @param ...
  *   Any additional arguments are passed on to the functions called by
  *   drupal_get_form(), including the unique form constructor function. For
@@ -124,7 +132,7 @@
 }
 
 /**
- * Build and process a form based on a form id.
+ * Builds and process a form based on a form id.
  *
  * The form may also be retrieved from the cache if the form was built in a
  * previous page-load. The form is then passed on for processing, validation
@@ -136,7 +144,7 @@
  *   generate the same form (or very similar forms) using different $form_ids
  *   can implement hook_forms(), which maps different $form_id values to the
  *   proper form constructor function. Examples may be found in node_forms(),
- *   search_forms(), and user_forms().
+ *   and search_forms().
  * @param $form_state
  *   An array which stores information about the form. This is passed as a
  *   reference so that the caller can use it to examine what in the form changed
@@ -207,8 +215,8 @@
  *     validation functions and submit functions use this array for nearly all
  *     their decision making. (Note that
  *     @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7#tree #tree @endlink
- *     determines whether the values are a flat array or an array whose structure
- *     parallels the $form array.)
+ *     determines whether the values are a flat array or an array whose
+ *     structure parallels the $form array.)
  *   - input: The array of values as they were submitted by the user. These are
  *     raw and unvalidated, so should not be used without a thorough
  *     understanding of security implications. In almost all cases, code should
@@ -377,7 +385,7 @@
 }
 
 /**
- * Retrieve default values for the $form_state array.
+ * Retrieves default values for the $form_state array.
  */
 function form_state_defaults() {
   return array(
@@ -422,7 +430,7 @@
  *   Modules that need to generate the same form (or very similar forms)
  *   using different $form_ids can implement hook_forms(), which maps
  *   different $form_id values to the proper form constructor function. Examples
- *   may be found in node_forms(), search_forms(), and user_forms().
+ *   may be found in node_forms() and search_forms().
  * @param $form_state
  *   A keyed array containing the current state of the form.
  * @param $old_form
@@ -483,7 +491,7 @@
 }
 
 /**
- * Fetch a form from cache.
+ * Fetches a form from cache.
  */
 function form_get_cache($form_build_id, &$form_state) {
   if ($cached = cache_get('form_' . $form_build_id, 'cache_form')) {
@@ -514,7 +522,7 @@
 }
 
 /**
- * Store a form in the cache.
+ * Stores a form in the cache.
  */
 function form_set_cache($form_build_id, $form, $form_state) {
   // 6 hours cache life time for forms should be plenty.
@@ -564,7 +572,7 @@
 }
 
 /**
- * Loads an include file and makes sure it is loaded whenever the form is processed.
+ * Ensures an include file is loaded loaded whenever the form is processed.
  *
  * Example:
  * @code
@@ -628,7 +636,7 @@
  *   Modules that need to generate the same form (or very similar forms)
  *   using different $form_ids can implement hook_forms(), which maps
  *   different $form_id values to the proper form constructor function. Examples
- *   may be found in node_forms(), search_forms(), and user_forms().
+ *   may be found in node_forms() and search_forms().
  * @param $form_state
  *   A keyed array containing the current state of the form. Most important is
  *   the $form_state['values'] collection, a tree of data used to simulate the
@@ -930,9 +938,10 @@
 }
 
 /**
- * Prepares a structured form array by adding required elements,
- * executing any hook_form_alter functions, and optionally inserting
- * a validation token to prevent tampering.
+ * Prepares a structured form array.
+ *
+ * Adds required elements, executes any hook_form_alter functions, and
+ * optionally inserts a validation token to prevent tampering.
  *
  * @param $form_id
  *   A unique string identifying the form for validation, submission,
@@ -1060,8 +1069,7 @@
 
 
 /**
- * Validates user-submitted form data from the $form_state using
- * the validate functions defined in a structured form array.
+ * Validates user-submitted form data in the $form_state array.
  *
  * @param $form_id
  *   A unique string identifying the form for validation, submission,
@@ -1235,9 +1243,11 @@
 }
 
 /**
- * Performs validation on form elements. First ensures required fields are
- * completed, #maxlength is not exceeded, and selected options were in the
- * list of options given to the user. Then calls user-defined validators.
+ * Performs validation on form elements.
+ *
+ * First ensures required fields are completed, #maxlength is not exceeded, and
+ * selected options were in the list of options given to the user. Then calls
+ * user-defined validators.
  *
  * @param $elements
  *   An associative array containing the structure of the form.
@@ -1389,9 +1399,10 @@
 }
 
 /**
- * A helper function used to execute custom validation and submission
- * handlers for a given form. Button-specific handlers are checked
- * first. If none exist, the function falls back to form-level handlers.
+ * Executes custom validation and submission handlers for a given form.
+ *
+ * Button-specific handlers are checked first. If none exist, the function
+ * falls back to form-level handlers.
  *
  * @param $type
  *   The type of handler to execute. 'validate' or 'submit' are the
@@ -1513,8 +1524,6 @@
  * doing anything with that data that requires it to be valid, PHP errors
  * would be triggered if the input processing and validation steps were fully
  * skipped.
- * @see http://drupal.org/node/370537
- * @see http://drupal.org/node/763376
  *
  * @param $name
  *   The name of the form element. If the #parents property of your form
@@ -1530,6 +1539,9 @@
  * @return
  *   Return value is for internal use only. To get a list of errors, use
  *   form_get_errors() or form_get_error().
+ *
+ * @see http://drupal.org/node/370537
+ * @see http://drupal.org/node/763376
  */
 function form_set_error($name = NULL, $message = '', $limit_validation_errors = NULL) {
   $form = &drupal_static(__FUNCTION__, array());
@@ -1575,14 +1587,14 @@
 }
 
 /**
- * Clear all errors against all form elements made by form_set_error().
+ * Clears all errors against all form elements made by form_set_error().
  */
 function form_clear_error() {
   drupal_static_reset('form_set_error');
 }
 
 /**
- * Return an associative array of all errors.
+ * Returns an associative array of all errors.
  */
 function form_get_errors() {
   $form = form_set_error();
@@ -1610,16 +1622,18 @@
 }
 
 /**
- * Flag an element as having an error.
+ * Flags an element as having an error.
  */
 function form_error(&$element, $message = '') {
   form_set_error(implode('][', $element['#parents']), $message);
 }
 
 /**
- * Walk through the structured form array, adding any required properties to
- * each element and mapping the incoming input data to the proper elements.
- * Also, execute any #process handlers attached to a specific element.
+ * Builds and processes all elements in the structured form array.
+ *
+ * Adds any required properties to each element, maps the incoming input data
+ * to the proper elements, and executes any #process handlers attached to a
+ * specific element.
  *
  * This is one of the three primary functions that recursively iterates a form
  * array. This one does it for completing the form building process. The other
@@ -1891,8 +1905,7 @@
 }
 
 /**
- * Populate the #value and #name properties of input elements so they
- * can be processed and rendered.
+ * Adds the #name and #value properties of an input element before rendering.
  */
 function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
   if (!isset($element['#name'])) {
@@ -2031,7 +2044,7 @@
 }
 
 /**
- * Helper function to handle the convoluted logic of button click detection.
+ * Detects if an element triggered the form submission via Ajax.
  *
  * This detects button or non-button controls that trigger a form submission via
  * Ajax or some other scriptable environment. These environments can set the
@@ -2051,7 +2064,7 @@
 }
 
 /**
- * Helper function to handle the convoluted logic of button click detection.
+ * Determines if a given button triggered the form submission.
  *
  * This detects button controls that trigger a form submission by being clicked
  * and having the click processed by the browser rather than being captured by
@@ -2146,7 +2159,7 @@
 }
 
 /**
- * Helper function to determine the value for an image button form element.
+ * Determines the value for an image button form element.
  *
  * @param $form
  *   The form element whose value is being populated.
@@ -2155,6 +2168,7 @@
  *   the element's default value should be returned.
  * @param $form_state
  *   A keyed array containing the current state of the form.
+ *
  * @return
  *   The data that will appear in the $form_state['values'] collection
  *   for this element. Return nothing to use the default.
@@ -2193,13 +2207,14 @@
 }
 
 /**
- * Helper function to determine the value for a checkbox form element.
+ * Determines the value for a checkbox form element.
  *
  * @param $form
  *   The form element whose value is being populated.
-*  @param $input
+ * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
  *   for this element. Return nothing to use the default.
@@ -2233,13 +2248,14 @@
 }
 
 /**
- * Helper function to determine the value for a checkboxes form element.
+ * Determines the value for a checkboxes form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
  *   for this element. Return nothing to use the default.
@@ -2273,13 +2289,14 @@
 }
 
 /**
- * Helper function to determine the value for a tableselect form element.
+ * Determines the value for a tableselect form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
  *   for this element. Return nothing to use the default.
@@ -2308,14 +2325,56 @@
 }
 
 /**
- * Helper function to determine the value for a password_confirm form
- * element.
+ * Form value callback: Determines the value for a #type radios form element.
+ *
+ * @param $element
+ *   The form element whose value is being populated.
+ * @param $input
+ *   (optional) The incoming input to populate the form element. If FALSE, the
+ *   element's default value is returned. Defaults to FALSE.
+ *
+ * @return
+ *   The data that will appear in the $element_state['values'] collection for
+ *   this element.
+ */
+function form_type_radios_value(&$element, $input = FALSE) {
+  if ($input !== FALSE) {
+    // There may not be a submitted value for multiple radio buttons, if none of
+    // the options was checked by default. If there is no submitted input value
+    // for this element (NULL), _form_builder_handle_input_element()
+    // automatically attempts to use the #default_value (if set) or an empty
+    // string (''). However, an empty string would fail validation in
+    // _form_validate(), in case it is not contained in the list of allowed
+    // values in #options.
+    if (!isset($input)) {
+      // Signify a garbage value to disable the #default_value handling and take
+      // over NULL as #value.
+      $element['#has_garbage_value'] = TRUE;
+      // There was a user submission so validation is a must. If this element is
+      // #required, then an appropriate error message will be output. While an
+      // optional #type 'radios' does not necessarily make sense from a user
+      // interaction perspective, there may be use-cases for that and it is not
+      // the job of Form API to artificially limit possibilities.
+      $element['#needs_validation'] = TRUE;
+    }
+    // The value stays the same, but the flags above will ensure it is
+    // processed properly.
+    return $input;
+  }
+  elseif (isset($element['#default_value'])) {
+    return $element['#default_value'];
+  }
+}
+
+/**
+ * Determines the value for a password_confirm form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
  *   for this element. Return nothing to use the default.
@@ -2328,13 +2387,14 @@
 }
 
 /**
- * Helper function to determine the value for a select form element.
+ * Determines the value for a select form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
  *   for this element. Return nothing to use the default.
@@ -2368,13 +2428,14 @@
 }
 
 /**
- * Helper function to determine the value for a textfield form element.
+ * Determines the value for a textfield form element.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
  *   for this element. Return nothing to use the default.
@@ -2388,13 +2449,14 @@
 }
 
 /**
- * Helper function to determine the value for form's token value.
+ * Determines the value for form's token value.
  *
  * @param $element
  *   The form element whose value is being populated.
  * @param $input
  *   The incoming input to populate the form element. If this is FALSE,
  *   the element's default value should be returned.
+ *
  * @return
  *   The data that will appear in the $element_state['values'] collection
  *   for this element. Return nothing to use the default.
@@ -2406,7 +2468,7 @@
 }
 
 /**
- * Changes submitted form values in $form_state.
+ * Changes submitted form values during form validation.
  *
  * Use this function to change the submitted value of a form element in a form
  * validation function, so that the changed value persists in $form_state
@@ -2458,11 +2520,9 @@
 }
 
 /**
- * Helper function for form_options_flatten().
- *
- * Iterates over arrays which may share common values and produces a flat
- * array that has removed duplicate keys. Also handles cases where objects
- * are passed as array values.
+ * Iterates over an array and returns a flat array with duplicate keys removed.
+ *
+ * This function also handles cases where objects are passed as array values.
  */
 function _form_options_flatten($array) {
   $return = &drupal_static(__FUNCTION__);
@@ -2572,7 +2632,7 @@
 }
 
 /**
- * Converts a select form element's options array into an HTML.
+ * Converts a select form element's options array into HTML.
  *
  * @param $element
  *   An associative array containing the properties of the element.
@@ -2580,6 +2640,7 @@
  *   Mixed: Either an associative array of items to list as choices, or an
  *   object with an 'option' member that is an associative array. This
  *   parameter is only used internally and should not be passed.
+ *
  * @return
  *   An HTML string of options for the select form element.
  */
@@ -2616,8 +2677,7 @@
 }
 
 /**
- * Traverses a select element's #option array looking for any values
- * that hold the given key. Returns an array of indexes that match.
+ * Returns the indexes of a select element's options matching a given key.
  *
  * This function is useful if you need to modify the options that are
  * already in a form element; for example, to remove choices which are
@@ -2643,6 +2703,7 @@
  *   The select element to search.
  * @param $key
  *   The key to look for.
+ *
  * @return
  *   An array of indexes that match the given $key. Array will be
  *   empty if no elements were found. FALSE if optgroups were found.
@@ -2746,6 +2807,9 @@
   $attributes['class'] = 'form-radios';
   if (!empty($element['#attributes']['class'])) {
     $attributes['class'] .= ' ' . implode(' ', $element['#attributes']['class']);
+  }
+  if (isset($element['#attributes']['title'])) {
+    $attributes['title'] = $element['#attributes']['title'];
   }
   return '<div' . drupal_attributes($attributes) . '>' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
 }
@@ -2779,7 +2843,7 @@
 }
 
 /**
- * Validate password_confirm element.
+ * Validates a password_confirm element.
  */
 function password_confirm_validate($element, &$element_state) {
   $pass1 = trim($element['pass1']['#value']);
@@ -2830,7 +2894,7 @@
 }
 
 /**
- * Roll out a single date element.
+ * Expands a date element into year, month, and day select elements.
  */
 function form_process_date($element) {
   // Default to current date
@@ -2886,7 +2950,7 @@
 }
 
 /**
- * Validates the date type to stop dates like February 30, 2006.
+ * Validates the date type to prevent invalid dates (e.g., February 30, 2006).
  */
 function date_validate($element) {
   if (!checkdate($element['#value']['month'], $element['#value']['day'], $element['#value']['year'])) {
@@ -2916,7 +2980,7 @@
 }
 
 /**
- * If no default value is set for weight select boxes, use 0.
+ * Sets the value for a weight element, with zero as a default.
  */
 function weight_value(&$form) {
   if (isset($form['#default_value'])) {
@@ -2928,8 +2992,7 @@
 }
 
 /**
- * Roll out a single radios element to a list of radios,
- * using the options array as index.
+ * Expands a radios element into individual radio elements.
  */
 function form_process_radios($element) {
   if (count($element['#options']) > 0) {
@@ -2950,7 +3013,9 @@
         // The key is sanitized in drupal_attributes() during output from the
         // theme function.
         '#return_value' => $key,
-        '#default_value' => isset($element['#default_value']) ? $element['#default_value'] : NULL,
+        // Use default or FALSE. A value of FALSE means that the radio button is
+        // not 'checked'.
+        '#default_value' => isset($element['#default_value']) ? $element['#default_value'] : FALSE,
         '#attributes' => $element['#attributes'],
         '#parents' => $element['#parents'],
         '#id' => drupal_html_id('edit-' . implode('-', $parents_for_id)),
@@ -2969,7 +3034,7 @@
  *   An associative array containing:
  *   - element: An associative array containing the properties of the element.
  *     Properties used: #title, #value, #return_value, #description, #required,
- *     #attributes.
+ *     #attributes, #checked.
  *
  * @ingroup themeable
  */
@@ -3008,15 +3073,19 @@
   if (!empty($element['#attributes']['class'])) {
     $attributes['class'] = array_merge($attributes['class'], $element['#attributes']['class']);
   }
+  if (isset($element['#attributes']['title'])) {
+    $attributes['title'] = $element['#attributes']['title'];
+  }
   return '<div' . drupal_attributes($attributes) . '>' . (!empty($element['#children']) ? $element['#children'] : '') . '</div>';
 }
 
 /**
- * Add form_element theming to an element if title or description is set.
+ * Adds form element theming to an element if its title or description is set.
  *
  * This is used as a pre render function for checkboxes and radios.
  */
 function form_pre_render_conditional_form_element($element) {
+  $t = get_t();
   // Set the element's title attribute to show #title as a tooltip, if needed.
   if (isset($element['#title']) && $element['#title_display'] == 'attribute') {
     $element['#attributes']['title'] = $element['#title'];
@@ -3059,6 +3128,9 @@
   return $element;
 }
 
+/**
+ * Processes a checkboxes form element.
+ */
 function form_process_checkboxes($element) {
   $value = is_array($element['#value']) ? $element['#value'] : array();
   $element['#tree'] = TRUE;
@@ -3120,6 +3192,7 @@
  *   container.
  * @param $form_state
  *   The $form_state array for the form this element belongs to.
+ *
  * @return
  *   The processed element.
  */
@@ -3230,11 +3303,12 @@
 }
 
 /**
- * Create the correct amount of checkbox or radio elements to populate the table.
+ * Creates checkbox or radio elements to populate a tableselect table.
  *
  * @param $element
  *   An associative array containing the properties and children of the
  *   tableselect element.
+ *
  * @return
  *   The processed element.
  */
@@ -3244,7 +3318,7 @@
     $value = is_array($element['#value']) ? $element['#value'] : array();
   }
   else {
-    // Advanced selection behaviour make no sense for radios.
+    // Advanced selection behavior makes no sense for radios.
     $element['#js_select'] = FALSE;
   }
 
@@ -3328,6 +3402,9 @@
  *       different character, 'replace_pattern' needs to be set accordingly.
  *     - error: (optional) A custom form error message string to show, if the
  *       machine name contains disallowed characters.
+ *     - standalone: (optional) Whether the live preview should stay in its own
+ *       form element rather than in the suffix of the source element. Defaults
+ *       to FALSE.
  *   - #maxlength: (optional) Should be set to the maximum allowed length of the
  *     machine name. Defaults to 64.
  *   - #disabled: (optional) Should be set to TRUE in case an existing machine
@@ -3339,6 +3416,9 @@
     '#title' => t('Machine-readable name'),
     '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'),
     '#machine_name' => array(),
+    '#field_prefix' => '',
+    '#field_suffix' => '',
+    '#suffix' => '',
   );
   // A form element that only wants to set one #machine_name property (usually
   // 'source' only) would leave all other properties undefined, if the defaults
@@ -3349,6 +3429,9 @@
     'label' => t('Machine name'),
     'replace_pattern' => '[^a-z0-9_]+',
     'replace' => '_',
+    'standalone' => FALSE,
+    'field_prefix' => $element['#field_prefix'],
+    'field_suffix' => $element['#field_suffix'],
   );
 
   // By default, machine names are restricted to Latin alphanumeric characters.
@@ -3364,7 +3447,7 @@
   }
 
   // Retrieve the form element containing the human-readable name from the
-  // complete form in $form_state. By reference, because we need to append
+  // complete form in $form_state. By reference, because we may need to append
   // a #field_suffix that will hold the live preview.
   $key_exists = NULL;
   $source = drupal_array_get_nested_value($form_state['complete form'], $element['#machine_name']['source'], $key_exists);
@@ -3372,16 +3455,21 @@
     return $element;
   }
 
-  // Append a field suffix to the source form element, which will contain
-  // the live preview of the machine name.
   $suffix_id = $source['#id'] . '-machine-name-suffix';
-  $source += array('#field_suffix' => '');
-  $source['#field_suffix'] .= ' <small id="' . $suffix_id . '"> </small>';
-
-  $parents = array_merge($element['#machine_name']['source'], array('#field_suffix'));
-  drupal_array_set_nested_value($form_state['complete form'], $parents, $source['#field_suffix']);
-
   $element['#machine_name']['suffix'] = '#' . $suffix_id;
+
+  if ($element['#machine_name']['standalone']) {
+    $element['#suffix'] .= ' <small id="' . $suffix_id . '"> </small>';
+  }
+  else {
+    // Append a field suffix to the source form element, which will contain
+    // the live preview of the machine name.
+    $source += array('#field_suffix' => '');
+    $source['#field_suffix'] .= ' <small id="' . $suffix_id . '"> </small>';
+
+    $parents = array_merge($element['#machine_name']['source'], array('#field_suffix'));
+    drupal_array_set_nested_value($form_state['complete form'], $parents, $source['#field_suffix']);
+  }
 
   $js_settings = array(
     'type' => 'setting',
@@ -3398,7 +3486,7 @@
 }
 
 /**
- * Form element validation handler for #type 'machine_name'.
+ * Form element validation handler for machine_name elements.
  *
  * Note that #maxlength is validated by _form_validate() already.
  */
@@ -3436,8 +3524,7 @@
 }
 
 /**
- * Adds fieldsets to the specified group or adds group members to this
- * fieldset.
+ * Arranges fieldsets into groups.
  *
  * @param $element
  *   An associative array containing the properties and children of the
@@ -3445,6 +3532,7 @@
  *   child elements are taken over into $form_state.
  * @param $form_state
  *   The $form_state array for the form this fieldset belongs to.
+ *
  * @return
  *   The processed element.
  */
@@ -3548,6 +3636,7 @@
  *   fieldset.
  * @param $form_state
  *   The $form_state array for the form this vertical tab widget belongs to.
+ *
  * @return
  *   The processed element.
  */
@@ -3582,8 +3671,8 @@
  *
  * @param $variables
  *   An associative array containing:
- *   - element: An associative array containing the properties and children of the
- *     fieldset. Properties used: #children.
+ *   - element: An associative array containing the properties and children of
+ *     the fieldset. Properties used: #children.
  *
  * @ingroup themeable
  */
@@ -3792,7 +3881,7 @@
 }
 
 /**
- * Expand weight elements into selects.
+ * Expands a weight element into a select element.
  */
 function form_process_weight($element) {
   $element['#is_weight'] = TRUE;
@@ -3976,7 +4065,8 @@
  *
  * Form element labels include the #title and a #required marker. The label is
  * associated with the element itself by the element #id. Labels may appear
- * before or after elements, depending on theme_form_element() and #title_display.
+ * before or after elements, depending on theme_form_element() and
+ * #title_display.
  *
  * This function will not be called for elements with no labels, depending on
  * #title_display. For elements that have an empty #title and are not required,
@@ -4055,7 +4145,7 @@
 }
 
 /**
- * Helper form element validator: integer.
+ * Form element validation handler for integer elements.
  */
 function element_validate_integer($element, &$form_state) {
   $value = $element['#value'];
@@ -4065,7 +4155,7 @@
 }
 
 /**
- * Helper form element validator: integer > 0.
+ * Form element validation handler for integer elements that must be positive.
  */
 function element_validate_integer_positive($element, &$form_state) {
   $value = $element['#value'];
@@ -4075,7 +4165,7 @@
 }
 
 /**
- * Helper form element validator: number.
+ * Form element validation handler for number elements.
  */
 function element_validate_number($element, &$form_state) {
   $value = $element['#value'];
@@ -4091,7 +4181,7 @@
 /**
  * @defgroup batch Batch operations
  * @{
- * Create and process batch operations.
+ * Creates and processes batch operations.
  *
  * Functions allowing forms processing to be spread out over several page
  * requests, thus ensuring that the processing does not get interrupted
@@ -4200,13 +4290,24 @@
  */
 
 /**
- * Opens a new batch.
- *
- * @param $batch
- *   An array defining the batch. The following keys can be used -- only
- *   'operations' is required, and batch_init() provides default values for
- *   the messages.
- *   - 'operations': Array of function calls to be performed.
+ * Adds a new batch.
+ *
+ * Batch operations are added as new batch sets. Batch sets are used to spread
+ * processing (primarily, but not exclusively, forms processing) over several
+ * page requests. This helps to ensure that the processing is not interrupted
+ * due to PHP timeouts, while users are still able to receive feedback on the
+ * progress of the ongoing operations. Combining related operations into
+ * distinct batch sets provides clean code independence for each batch set,
+ * ensuring that two or more batches, submitted independently, can be processed
+ * without mutual interference. Each batch set may specify its own set of
+ * operations and results, produce its own UI messages, and trigger its own
+ * 'finished' callback. Batch sets are processed sequentially, with the progress
+ * bar starting afresh for each new set.
+ *
+ * @param $batch_definition
+ *   An associative array defining the batch, with the following elements (all
+ *   are optional except as noted):
+ *   - operations: (required) Array of function calls to be performed.
  *     Example:
  *     @code
  *     array(
@@ -4214,35 +4315,26 @@
  *       array('my_function_2', array($arg2_1, $arg2_2)),
  *     )
  *     @endcode
- *   - 'title': Title for the progress page. Only safe strings should be passed.
- *     Defaults to t('Processing').
- *   - 'init_message': Message displayed while the processing is initialized.
+ *   - title: A safe, translated string to use as the title for the progress
+ *     page. Defaults to t('Processing').
+ *   - init_message: Message displayed while the processing is initialized.
  *     Defaults to t('Initializing.').
- *   - 'progress_message': Message displayed while processing the batch.
- *     Available placeholders are @current, @remaining, @total, @percentage,
- *     @estimate and @elapsed. Defaults to t('Completed @current of @total.').
- *   - 'error_message': Message displayed if an error occurred while processing
+ *   - progress_message: Message displayed while processing the batch. Available
+ *     placeholders are @current, @remaining, @total, @percentage, @estimate and
+ *     @elapsed. Defaults to t('Completed @current of @total.').
+ *   - error_message: Message displayed if an error occurred while processing
  *     the batch. Defaults to t('An error has occurred.').
- *   - 'finished': Name of a function to be executed after the batch has
- *     completed. This should be used to perform any result massaging that
- *     may be needed, and possibly save data in $_SESSION for display after
- *     final page redirection.
- *   - 'file': Path to the file containing the definitions of the
- *     'operations' and 'finished' functions, for instance if they don't
- *     reside in the main .module file. The path should be relative to
- *     base_path(), and thus should be built using drupal_get_path().
- *   - 'css': Array of paths to CSS files to be used on the progress page.
- *   - 'url_options': options passed to url() when constructing redirect
- *     URLs for the batch.
- *
- * Operations are added as new batch sets. Batch sets are used to ensure
- * clean code independence, ensuring that several batches submitted by
- * different parts of the code (core / contrib modules) can be processed
- * correctly while not interfering or having to cope with each other. Each
- * batch set gets to specify his own UI messages, operates on its own set
- * of operations and results, and triggers its own 'finished' callback.
- * Batch sets are processed sequentially, with the progress bar starting
- * fresh for every new set.
+ *   - finished: Name of a function to be executed after the batch has
+ *     completed. This should be used to perform any result massaging that may
+ *     be needed, and possibly save data in $_SESSION for display after final
+ *     page redirection.
+ *   - file: Path to the file containing the definitions of the 'operations' and
+ *     'finished' functions, for instance if they don't reside in the main
+ *     .module file. The path should be relative to base_path(), and thus should
+ *     be built using drupal_get_path().
+ *   - css: Array of paths to CSS files to be used on the progress page.
+ *   - url_options: options passed to url() when constructing redirect URLs for
+ *     the batch.
  */
 function batch_set($batch_definition) {
   if ($batch_definition) {
@@ -4422,6 +4514,7 @@
  *   The batch array.
  * @param $set_id
  *   The id of the set to process.
+ *
  * @return
  *   The name and class of the queue are added by reference to the batch set.
  */
@@ -4451,6 +4544,7 @@
  *
  * @param $batch_set
  *   The batch set.
+ *
  * @return
  *   The queue object.
  */

Modified: branches/upstream/current-7/includes/graph.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/graph.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/graph.inc (original)
+++ branches/upstream/current-7/includes/graph.inc Thu May 10 18:20:18 2012
@@ -7,7 +7,7 @@
 
 
 /**
- * Perform a depth first sort on a directed acyclic graph.
+ * Performs a depth-first sort on a directed acyclic graph.
  *
  * @param $graph
  *   A three dimensional associated array, with the first keys being the names
@@ -72,7 +72,7 @@
 }
 
 /**
- * Helper function to perform a depth first sort.
+ * Performs a depth-first sort on a graph.
  *
  * @param $graph
  *   A three dimensional associated graph array.

Modified: branches/upstream/current-7/includes/language.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/language.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/language.inc (original)
+++ branches/upstream/current-7/includes/language.inc Thu May 10 18:20:18 2012
@@ -349,7 +349,10 @@
     $results[$provider_id] = isset($languages[$langcode]) ? $languages[$langcode] : FALSE;
   }
 
-  return $results[$provider_id];
+  // Since objects are resources we need to return a clone to prevent the
+  // provider cache to be unintentionally altered. The same providers might be
+  // used with different language types based on configuration.
+  return !empty($results[$provider_id]) ? clone($results[$provider_id]) : $results[$provider_id];
 }
 
 /**
@@ -380,15 +383,18 @@
   // first valid language found.
   $negotiation = variable_get("language_negotiation_$type", array());
 
-  foreach ($negotiation as $id => $provider) {
-    $language = language_provider_invoke($id, $provider);
+  foreach ($negotiation as $provider_id => $provider) {
+    $language = language_provider_invoke($provider_id, $provider);
     if ($language) {
+      $language->provider = $provider_id;
       return $language;
     }
   }
 
   // If no other language was found use the default one.
-  return language_default();
+  $language = language_default();
+  $language->provider = LANGUAGE_NEGOTIATION_DEFAULT;
+  return $language;
 }
 
 /**

Modified: branches/upstream/current-7/includes/locale.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/locale.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/locale.inc (original)
+++ branches/upstream/current-7/includes/locale.inc Thu May 10 18:20:18 2012
@@ -141,7 +141,7 @@
   //   language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
   // Samples: "hu, en-us;q=0.66, en;q=0.33", "hu,en-us;q=0.5"
   $browser_langcodes = array();
-  if (preg_match_all('@([a-zA-Z-]+|\*)(?:;q=([0-9.]+))?(?:$|\s*,\s*)@', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches, PREG_SET_ORDER)) {
+  if (preg_match_all('@(?<=[, ]|^)([a-zA-Z-]+|\*)(?:;q=([0-9.]+))?(?:$|\s*,\s*)@', trim($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches, PREG_SET_ORDER)) {
     foreach ($matches as $match) {
       // We can safely use strtolower() here, tags are ASCII.
       // RFC2616 mandates that the decimal part is no more than three digits,
@@ -430,8 +430,27 @@
       case LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN:
         if ($options['language']->domain) {
           // Ask for an absolute URL with our modified base_url.
+          global $is_https;
+          $url_scheme = ($is_https) ? 'https://' : 'http://';
           $options['absolute'] = TRUE;
-          $options['base_url'] = $options['language']->domain;
+
+          // Take the domain without ports or protocols so we can apply the
+          // protocol needed. The setting might include a protocol.
+          // This is changed in Drupal 8 but we need to keep backwards
+          // compatibility for Drupal 7.
+          $host = 'http://' . str_replace(array('http://', 'https://'), '', $options['language']->domain);
+          $host = parse_url($host, PHP_URL_HOST);
+
+          // Apply the appropriate protocol to the URL.
+          $options['base_url'] = $url_scheme . $host;
+          if (isset($options['https']) && variable_get('https', FALSE)) {
+            if ($options['https'] === TRUE) {
+              $options['base_url'] = str_replace('http://', 'https://', $options['base_url']);
+            }
+            elseif ($options['https'] === FALSE) {
+              $options['base_url'] = str_replace('https://', 'http://', $options['base_url']);
+            }
+          }
         }
         break;
 
@@ -978,22 +997,13 @@
           // data untouched or if we don't have an existing plural formula.
           $header = _locale_import_parse_header($value['msgstr']);
 
-          // Get the plural formula and update in database.
+          // Get and store the plural formula if available.
           if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->uri)) {
             list($nplurals, $plural) = $p;
             db_update('languages')
               ->fields(array(
                 'plurals' => $nplurals,
                 'formula' => $plural,
-              ))
-              ->condition('language', $lang)
-              ->execute();
-          }
-          else {
-            db_update('languages')
-              ->fields(array(
-                'plurals' => 0,
-                'formula' => '',
               ))
               ->condition('language', $lang)
               ->execute();

Modified: branches/upstream/current-7/includes/menu.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/menu.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/menu.inc (original)
+++ branches/upstream/current-7/includes/menu.inc Thu May 10 18:20:18 2012
@@ -321,7 +321,14 @@
   $ancestors = array();
   $length =  $number_parts - 1;
   $end = (1 << $number_parts) - 1;
-  $masks = variable_get('menu_masks', array());
+  $masks = variable_get('menu_masks');
+  // If the optimized menu_masks array is not available use brute force to get
+  // the correct $ancestors and $placeholders returned. Do not use this as the
+  // default value of the menu_masks variable to avoid building such a big
+  // array.
+  if (!$masks) {
+    $masks = range(511, 1);
+  }
   // Only examine patterns that actually exist as router items (the masks).
   foreach ($masks as $i) {
     if ($i > $end) {
@@ -452,18 +459,10 @@
     }
     $original_map = arg(NULL, $path);
 
-    // Since there is no limit to the length of $path, use a hash to keep it
-    // short yet unique.
-    $cid = 'menu_item:' . hash('sha256', $path);
-    if ($cached = cache_get($cid, 'cache_menu')) {
-      $router_item = $cached->data;
-    }
-    else {
-      $parts = array_slice($original_map, 0, MENU_MAX_PARTS);
-      $ancestors = menu_get_ancestors($parts);
-      $router_item = db_query_range('SELECT * FROM {menu_router} WHERE path IN (:ancestors) ORDER BY fit DESC', 0, 1, array(':ancestors' => $ancestors))->fetchAssoc();
-      cache_set($cid, $router_item, 'cache_menu');
-    }
+    $parts = array_slice($original_map, 0, MENU_MAX_PARTS);
+    $ancestors = menu_get_ancestors($parts);
+    $router_item = db_query_range('SELECT * FROM {menu_router} WHERE path IN (:ancestors) ORDER BY fit DESC', 0, 1, array(':ancestors' => $ancestors))->fetchAssoc();
+
     if ($router_item) {
       // Allow modules to alter the router item before it is translated and
       // checked for access.
@@ -2152,7 +2151,7 @@
   $links = array();
   // Performance: In case a previous invocation for the same parent path did not
   // return any links, we immediately return here.
-  if (isset($path_empty[$parent_path])) {
+  if (isset($path_empty[$parent_path]) && strpos($parent_path, '%') !== FALSE) {
     return $links;
   }
   // Construct the item-specific parent path.
@@ -2321,6 +2320,9 @@
  */
 function menu_set_active_item($path) {
   $_GET['q'] = $path;
+  // Since the active item has changed, the active menu trail may also be out
+  // of date.
+  drupal_static_reset('menu_set_active_trail');
 }
 
 /**
@@ -2406,7 +2408,7 @@
     // appending either the preferred link or the menu router item for the
     // current page. Exclude it if we are on the front page.
     $last = end($trail);
-    if ($last['href'] != $preferred_link['href'] && !drupal_is_front_page()) {
+    if ($preferred_link && $last['href'] != $preferred_link['href'] && !drupal_is_front_page()) {
       $trail[] = $preferred_link;
     }
   }
@@ -3149,10 +3151,10 @@
   }
   // If every value in $existing_item is the same in the $item, there is no
   // reason to run the update queries or clear the caches. We use
-  // array_intersect_assoc() with the $item as the first parameter because
+  // array_intersect_key() with the $item as the first parameter because
   // $item may have additional keys left over from building a router entry.
   // The intersect removes the extra keys, allowing a meaningful comparison.
-  if (!$existing_item || (array_intersect_assoc($item, $existing_item)) != $existing_item) {
+  if (!$existing_item || (array_intersect_key($item, $existing_item) != $existing_item)) {
     db_update('menu_links')
       ->fields(array(
         'menu_name' => $item['menu_name'],

Modified: branches/upstream/current-7/includes/module.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/module.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/module.inc (original)
+++ branches/upstream/current-7/includes/module.inc Thu May 10 18:20:18 2012
@@ -425,6 +425,8 @@
       registry_update();
       // Refresh the schema to include it.
       drupal_get_schema(NULL, TRUE);
+      // Update the theme registry to include it.
+      drupal_theme_rebuild();
       // Clear entity cache.
       entity_info_cache_clear();
 
@@ -546,6 +548,8 @@
     // Update the registry to remove the newly-disabled module.
     registry_update();
     _system_update_bootstrap_status();
+    // Update the theme registry to remove the newly-disabled module.
+    drupal_theme_rebuild();
   }
 
   // If there remains no more node_access module, rebuilding will be

Modified: branches/upstream/current-7/includes/pager.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/pager.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/pager.inc (original)
+++ branches/upstream/current-7/includes/pager.inc Thu May 10 18:20:18 2012
@@ -630,7 +630,13 @@
     }
   }
 
-  return l($text, $_GET['q'], array('attributes' => $attributes, 'query' => $query));
+  // @todo l() cannot be used here, since it adds an 'active' class based on the
+  //   path only (which is always the current path for pager links). Apparently,
+  //   none of the pager links is active at any time - but it should still be
+  //   possible to use l() here.
+  // @see http://drupal.org/node/1410574
+  $attributes['href'] = url($_GET['q'], array('query' => $query));
+  return '<a' . drupal_attributes($attributes) . '>' . check_plain($text) . '</a>';
 }
 
 /**

Modified: branches/upstream/current-7/includes/path.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/path.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/path.inc (original)
+++ branches/upstream/current-7/includes/path.inc Thu May 10 18:20:18 2012
@@ -431,21 +431,27 @@
  *   - language: (optional) The language of the alias.
  */
 function path_save(&$path) {
-  $path += array('pid' => NULL, 'language' => LANGUAGE_NONE);
-
-  // Insert or update the alias.
-  $status = drupal_write_record('url_alias', $path, (!empty($path['pid']) ? 'pid' : array()));
-
-  // Verify that a record was written.
-  if ($status) {
-    if ($status === SAVED_NEW) {
-      module_invoke_all('path_insert', $path);
-    }
-    else {
-      module_invoke_all('path_update', $path);
-    }
-    drupal_clear_path_cache($path['source']);
-  }
+  $path += array('language' => LANGUAGE_NONE);
+
+  // Load the stored alias, if any.
+  if (!empty($path['pid']) && !isset($path['original'])) {
+    $path['original'] = path_load($path['pid']);
+  }
+
+  if (empty($path['pid'])) {
+    drupal_write_record('url_alias', $path);
+    module_invoke_all('path_insert', $path);
+  }
+  else {
+    drupal_write_record('url_alias', $path, array('pid'));
+    module_invoke_all('path_update', $path);
+  }
+
+  // Clear internal properties.
+  unset($path['original']);
+
+  // Clear the static alias cache.
+  drupal_clear_path_cache($path['source']);
 }
 
 /**

Modified: branches/upstream/current-7/includes/registry.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/registry.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/registry.inc (original)
+++ branches/upstream/current-7/includes/registry.inc Thu May 10 18:20:18 2012
@@ -131,10 +131,6 @@
     if (file_exists($filename)) {
       $hash = hash_file('sha256', $filename);
       if (empty($file['hash']) || $file['hash'] != $hash) {
-        // Delete registry entries for this file, so we can insert the new resources.
-        db_delete('registry')
-          ->condition('filename', $filename)
-          ->execute();
         $file['hash'] = $hash;
         $parsed_files[$filename] = $file;
       }
@@ -156,9 +152,9 @@
  * Parse a file and save its function and class listings.
  *
  * @param $filename
- *  Name of the file we are going to parse.
+ *   Name of the file we are going to parse.
  * @param $contents
- *  Contents of the file we are going to parse as a string.
+ *   Contents of the file we are going to parse as a string.
  * @param $module
  *   (optional) Name of the module this file belongs to.
  * @param $weight
@@ -166,17 +162,25 @@
  */
 function _registry_parse_file($filename, $contents, $module = '', $weight = 0) {
   if (preg_match_all('/^\s*(?:abstract|final)?\s*(class|interface)\s+([a-zA-Z0-9_]+)/m', $contents, $matches)) {
-    $query = db_insert('registry')->fields(array('name', 'type', 'filename', 'module', 'weight'));
     foreach ($matches[2] as $key => $name) {
-      $query->values(array(
-        'name' => $name,
-        'type' => $matches[1][$key],
-        'filename' => $filename,
-        'module' => $module,
-        'weight' => $weight,
-      ));
+      db_merge('registry')
+        ->key(array(
+          'name' => $name,
+          'type' => $matches[1][$key],
+        ))
+        ->fields(array(
+          'filename' => $filename,
+          'module' => $module,
+          'weight' => $weight,
+        ))
+        ->execute();
     }
-    $query->execute();
+    // Delete any resources for this file where the name is not in the list
+    // we just merged in.
+    db_delete('registry')
+      ->condition('filename', $filename)
+      ->condition('name', $matches[2], 'NOT IN')
+      ->execute();
   }
 }
 

Modified: branches/upstream/current-7/includes/session.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/session.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/session.inc (original)
+++ branches/upstream/current-7/includes/session.inc Thu May 10 18:20:18 2012
@@ -172,7 +172,7 @@
 
     // For performance reasons, do not update the sessions table, unless
     // $_SESSION has changed or more than 180 has passed since the last update.
-    if ($is_changed || REQUEST_TIME - $user->timestamp > variable_get('session_write_interval', 180)) {
+    if ($is_changed || !isset($user->timestamp) || REQUEST_TIME - $user->timestamp > variable_get('session_write_interval', 180)) {
       // Either ssid or sid or both will be added from $key below.
       $fields = array(
         'uid' => $user->uid,
@@ -199,6 +199,9 @@
           }
         }
       }
+      elseif (variable_get('https', FALSE)) {
+        unset($key['ssid']);
+      }
 
       db_merge('sessions')
         ->key($key)
@@ -255,11 +258,17 @@
     // we lazily start sessions at the end of this request, and some
     // processes (like drupal_get_token()) needs to know the future
     // session ID in advance.
+    $GLOBALS['lazy_session'] = TRUE;
     $user = drupal_anonymous_user();
     // Less random sessions (which are much faster to generate) are used for
     // anonymous users than are generated in drupal_session_regenerate() when
     // a user becomes authenticated.
     session_id(drupal_hash_base64(uniqid(mt_rand(), TRUE)));
+    if ($is_https && variable_get('https', FALSE)) {
+      $insecure_session_name = substr(session_name(), 1);
+      $session_id = drupal_hash_base64(uniqid(mt_rand(), TRUE));
+      $_COOKIE[$insecure_session_name] = $session_id;
+    }
   }
   date_default_timezone_set(drupal_get_user_timezone());
 }
@@ -291,7 +300,7 @@
  * If an anonymous user already have an empty session, destroy it.
  */
 function drupal_session_commit() {
-  global $user;
+  global $user, $is_https;
 
   if (!drupal_save_session()) {
     // We don't have anything to do if we are not allowed to save the session.
@@ -310,6 +319,12 @@
     // started.
     if (!drupal_session_started()) {
       drupal_session_start();
+      if ($is_https && variable_get('https', FALSE)) {
+        $insecure_session_name = substr(session_name(), 1);
+        $params = session_get_cookie_params();
+        $expire = $params['lifetime'] ? REQUEST_TIME + $params['lifetime'] : 0;
+        setcookie($insecure_session_name, $_COOKIE[$insecure_session_name], $expire, $params['path'], $params['domain'], FALSE, $params['httponly']);
+      }
     }
     // Write the session data.
     session_write_close();
@@ -336,7 +351,7 @@
   global $user, $is_https;
   if ($is_https && variable_get('https', FALSE)) {
     $insecure_session_name = substr(session_name(), 1);
-    if (isset($_COOKIE[$insecure_session_name])) {
+    if (!isset($GLOBALS['lazy_session']) && isset($_COOKIE[$insecure_session_name])) {
       $old_insecure_session_id = $_COOKIE[$insecure_session_name];
     }
     $params = session_get_cookie_params();
@@ -416,7 +431,10 @@
   // Unset the session cookies.
   _drupal_session_delete_cookie(session_name());
   if ($is_https) {
-    _drupal_session_delete_cookie(substr(session_name(), 1), TRUE);
+    _drupal_session_delete_cookie(substr(session_name(), 1), FALSE);
+  }
+  elseif (variable_get('https', FALSE)) {
+    _drupal_session_delete_cookie('S' . session_name(), TRUE);
   }
 }
 
@@ -425,13 +443,17 @@
  *
  * @param $name
  *   Name of session cookie to delete.
- * @param $force_insecure
- *   Force cookie to be insecure.
- */
-function _drupal_session_delete_cookie($name, $force_insecure = FALSE) {
-  if (isset($_COOKIE[$name])) {
+ * @param boolean $secure
+ *   Force the secure value of the cookie.
+ */
+function _drupal_session_delete_cookie($name, $secure = NULL) {
+  global $is_https;
+  if (isset($_COOKIE[$name]) || (!$is_https && $secure === TRUE)) {
     $params = session_get_cookie_params();
-    setcookie($name, '', REQUEST_TIME - 3600, $params['path'], $params['domain'], !$force_insecure && $params['secure'], $params['httponly']);
+    if ($secure !== NULL) {
+      $params['secure'] = $secure;
+    }
+    setcookie($name, '', REQUEST_TIME - 3600, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
     unset($_COOKIE[$name]);
   }
 }

Modified: branches/upstream/current-7/includes/theme.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/theme.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/theme.inc (original)
+++ branches/upstream/current-7/includes/theme.inc Thu May 10 18:20:18 2012
@@ -252,7 +252,20 @@
  *   class.
  */
 function theme_get_registry($complete = TRUE) {
-  static $theme_registry = array();
+  // Use the advanced drupal_static() pattern, since this is called very often.
+  static $drupal_static_fast;
+  if (!isset($drupal_static_fast)) {
+    $drupal_static_fast['registry'] = &drupal_static('theme_get_registry');
+  }
+  $theme_registry = &$drupal_static_fast['registry'];
+
+  // Initialize the theme, if this is called early in the bootstrap, or after
+  // static variables have been reset.
+  if (!is_array($theme_registry)) {
+    drupal_theme_initialize();
+    $theme_registry = array();
+  }
+
   $key = (int) $complete;
 
   if (!isset($theme_registry[$key])) {
@@ -335,6 +348,7 @@
  * to add more theme hooks.
  */
 function drupal_theme_rebuild() {
+  drupal_static_reset('theme_get_registry');
   cache_clear_all('theme_registry', 'cache', TRUE);
 }
 
@@ -899,8 +913,6 @@
  * @see themeable
  */
 function theme($hook, $variables = array()) {
-  static $hooks = NULL;
-
   // If called before all modules are loaded, we do not necessarily have a full
   // theme registry to work with, and therefore cannot process the theme
   // request properly. See also _theme_load_registry().
@@ -908,10 +920,7 @@
     throw new Exception(t('theme() may not be called until all modules are loaded.'));
   }
 
-  if (!isset($hooks)) {
-    drupal_theme_initialize();
-    $hooks = theme_get_registry(FALSE);
-  }
+  $hooks = theme_get_registry(FALSE);
 
   // If an array of hook candidates were passed, use the first one that has an
   // implementation.
@@ -991,6 +1000,13 @@
   if (isset($info['base hook'])) {
     $base_hook = $info['base hook'];
     $base_hook_info = $hooks[$base_hook];
+    // Include files required by the base hook, since its variable processors
+    // might reside there.
+    if (!empty($base_hook_info['includes'])) {
+      foreach ($base_hook_info['includes'] as $include_file) {
+        include_once DRUPAL_ROOT . '/' . $include_file;
+      }
+    }
     if (isset($base_hook_info['preprocess functions']) || isset($base_hook_info['process functions'])) {
       $variables['theme_hook_suggestion'] = $hook;
       $hook = $base_hook;
@@ -1960,8 +1976,11 @@
   $type = $variables['type'];
   $attributes = $variables['attributes'];
 
+  // Only output the list container and title, if there are any list items.
+  // Check to see whether the block title exists before adding a header.
+  // Empty headers are not semantic and present accessibility challenges.
   $output = '<div class="item-list">';
-  if (isset($title)) {
+  if (isset($title) && $title !== '') {
     $output .= '<h3>' . $title . '</h3>';
   }
 

Modified: branches/upstream/current-7/includes/unicode.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/unicode.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/unicode.inc (original)
+++ branches/upstream/current-7/includes/unicode.inc Thu May 10 18:20:18 2012
@@ -73,7 +73,7 @@
   '\x{A836}-\x{A839}\x{A874}-\x{A877}\x{A8CE}-\x{A8CF}\x{A8F8}-\x{A8FA}' .
   '\x{A92E}-\x{A92F}\x{A95F}\x{A9C1}-\x{A9CD}\x{A9DE}-\x{A9DF}' .
   '\x{AA5C}-\x{AA5F}\x{AA77}-\x{AA79}\x{AADE}-\x{AADF}\x{ABEB}' .
-  '\x{D800}-\x{F8FF}\x{FB29}\x{FD3E}-\x{FD3F}\x{FDFC}-\x{FDFD}' .
+  '\x{E000}-\x{F8FF}\x{FB29}\x{FD3E}-\x{FD3F}\x{FDFC}-\x{FDFD}' .
   '\x{FE10}-\x{FE19}\x{FE30}-\x{FE6B}\x{FEFF}-\x{FF0F}\x{FF1A}-\x{FF20}' .
   '\x{FF3B}-\x{FF40}\x{FF5B}-\x{FF65}\x{FFE0}-\x{FFFD}');
 

Modified: branches/upstream/current-7/includes/update.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/update.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/update.inc (original)
+++ branches/upstream/current-7/includes/update.inc Thu May 10 18:20:18 2012
@@ -410,15 +410,18 @@
     // Initialize batch update information.
     $sandbox['progress'] = 0;
     $sandbox['last_user_processed'] = -1;
-    $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE data IS NOT NULL")->fetchField();
+    $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE data LIKE :block", array(
+        ':block' => '%' . db_like(serialize('block')) . '%',
+      ))
+      ->fetchField();
   }
   // Now do the batch update of the user-specific block visibility settings.
   $limit = 100;
   $result = db_select('users', 'u')
     ->fields('u', array('uid', 'data'))
     ->condition('uid', $sandbox['last_user_processed'], '>')
+    ->condition('data', '%' . db_like(serialize('block')) . '%', 'LIKE')
     ->orderBy('uid', 'ASC')
-    ->where('data IS NOT NULL')
     ->range(0, $limit)
     ->execute();
   foreach ($result as $row) {
@@ -814,9 +817,6 @@
       'php' => DRUPAL_MINIMUM_PHP,
       'files' => array(),
     );
-
-    // The install profile is always required.
-    $file->info['required'] = TRUE;
 
     $values = array(
       'filename' => $filename,

Modified: branches/upstream/current-7/includes/updater.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/updater.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/updater.inc (original)
+++ branches/upstream/current-7/includes/updater.inc Thu May 10 18:20:18 2012
@@ -330,7 +330,7 @@
           }
           catch (FileTransferException $e) {
             $message = t($e->getMessage(), $e->arguments);
-            $throw_message = t('Unable to create %directory due to the following: %reason', array('%directory' => $install_location, '%reason' => $message));
+            $throw_message = t('Unable to create %directory due to the following: %reason', array('%directory' => $directory, '%reason' => $message));
             throw new UpdaterException($throw_message);
           }
         }

Modified: branches/upstream/current-7/includes/utility.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/includes/utility.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/includes/utility.inc (original)
+++ branches/upstream/current-7/includes/utility.inc Thu May 10 18:20:18 2012
@@ -51,7 +51,7 @@
     // 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);
+    $output = '(object) ' . drupal_var_export((array) $var, $prefix);
   }
   else {
     $output = var_export($var, TRUE);

Modified: branches/upstream/current-7/misc/autocomplete.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/autocomplete.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/misc/autocomplete.js (original)
+++ branches/upstream/current-7/misc/autocomplete.js Thu May 10 18:20:18 2012
@@ -32,7 +32,7 @@
 Drupal.autocompleteSubmit = function () {
   return $('#autocomplete').each(function () {
     this.owner.hidePopup();
-  }).size() == 0;
+  }).length == 0;
 };
 
 /**
@@ -123,7 +123,7 @@
   }
   else if (this.popup) {
     var lis = $('li', this.popup);
-    if (lis.size() > 0) {
+    if (lis.length > 0) {
       this.highlight(lis.get(0));
     }
   }
@@ -227,7 +227,7 @@
 
   // Show popup with matches, if any.
   if (this.popup) {
-    if (ul.children().size()) {
+    if (ul.children().length) {
       $(this.popup).empty().append(ul).show();
       $(this.ariaLive).html(Drupal.t('Autocomplete popup'));
     }
@@ -287,10 +287,11 @@
   this.timer = setTimeout(function () {
     db.owner.setStatus('begin');
 
-    // Ajax GET request for autocompletion.
+    // Ajax GET request for autocompletion. We use Drupal.encodePath instead of
+    // encodeURIComponent to allow autocomplete search terms to contain slashes.
     $.ajax({
       type: 'GET',
-      url: db.uri + '/' + encodeURIComponent(searchString),
+      url: db.uri + '/' + Drupal.encodePath(searchString),
       dataType: 'json',
       success: function (matches) {
         if (typeof matches.status == 'undefined' || matches.status != 0) {

Modified: branches/upstream/current-7/misc/machine-name.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/machine-name.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/misc/machine-name.js (original)
+++ branches/upstream/current-7/misc/machine-name.js Thu May 10 18:20:18 2012
@@ -19,6 +19,10 @@
    *     disallowed characters in the machine name; e.g., '[^a-z0-9]+'.
    *   - replace: A character to replace disallowed characters with; e.g., '_'
    *     or '-'.
+   *   - standalone: Whether the preview should stay in its own element rather
+   *     than the suffix of the source element.
+   *   - field_prefix: The #field_prefix of the form element.
+   *   - field_suffix: The #field_suffix of the form element.
    */
   attach: function (context, settings) {
     var self = this;
@@ -26,7 +30,7 @@
       var $source = $(source_id, context).addClass('machine-name-source');
       var $target = $(options.target, context).addClass('machine-name-target');
       var $suffix = $(options.suffix, context);
-      var $wrapper = $target.parents('.form-item:first');
+      var $wrapper = $target.closest('.form-item');
       // All elements have to exist.
       if (!$source.length || !$target.length || !$suffix.length || !$wrapper.length) {
         return;
@@ -49,10 +53,12 @@
         var machine = self.transliterate($source.val(), options);
       }
       // Append the machine name preview to the source field.
-      var $preview = $('<span class="machine-name-value">' + machine + '</span>');
-      $suffix.empty()
-        .append(' ').append('<span class="machine-name-label">' + options.label + ':</span>')
-        .append(' ').append($preview);
+      var $preview = $('<span class="machine-name-value">' + options.field_prefix + Drupal.checkPlain(machine) + options.field_suffix + '</span>');
+      $suffix.empty();
+      if (options.label) {
+        $suffix.append(' ').append('<span class="machine-name-label">' + options.label + ':</span>');
+      }
+      $suffix.append(' ').append($preview);
 
       // If the machine name cannot be edited, stop further processing.
       if ($target.is(':disabled')) {
@@ -77,9 +83,11 @@
         $source.bind('keyup.machineName change.machineName', function () {
           machine = self.transliterate($(this).val(), options);
           // Set the machine name to the transliterated value.
-          if (machine != options.replace && machine != '') {
-            $target.val(machine);
-            $preview.text(machine);
+          if (machine != '') {
+            if (machine != options.replace) {
+              $target.val(machine);
+              $preview.html(options.field_prefix + Drupal.checkPlain(machine) + options.field_suffix);
+            }
             $suffix.show();
           }
           else {

Modified: branches/upstream/current-7/misc/states.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/states.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/misc/states.js (original)
+++ branches/upstream/current-7/misc/states.js Thu May 10 18:20:18 2012
@@ -21,7 +21,7 @@
         new states.Dependent({
           element: $(selector),
           state: states.State.sanitize(state),
-          dependees: settings.states[selector][state]
+          constraints: settings.states[selector][state]
         });
       }
     }
@@ -40,12 +40,14 @@
  *   Object with the following keys (all of which are required):
  *   - element: A jQuery object of the dependent element
  *   - state: A State object describing the state that is dependent
- *   - dependees: An object with dependency specifications. Lists all elements
- *     that this element depends on.
+ *   - constraints: An object with dependency specifications. Lists all elements
+ *     that this element depends on. It can be nested and can contain arbitrary
+ *     AND and OR clauses.
  */
 states.Dependent = function (args) {
-  $.extend(this, { values: {}, oldValue: undefined }, args);
-
+  $.extend(this, { values: {}, oldValue: null }, args);
+
+  this.dependees = this.getDependees();
   for (var selector in this.dependees) {
     this.initializeDependee(selector, this.dependees[selector]);
   }
@@ -69,7 +71,7 @@
     // as a string before applying the strict comparison in compare(). Otherwise
     // numeric keys in the form's #states array fail to match string values
     // returned from jQuery's val().
-    return (value.constructor.name === 'String') ? compare(String(reference), value) : compare(reference, value);
+    return (typeof value === 'string') ? compare(reference.toString(), value) : compare(reference, value);
   }
 };
 
@@ -84,26 +86,33 @@
    *   dependee's compliance status.
    */
   initializeDependee: function (selector, dependeeStates) {
-    var self = this;
+    var state;
 
     // Cache for the states of this dependee.
-    self.values[selector] = {};
-
-    $.each(dependeeStates, function (state, value) {
-      state = states.State.sanitize(state);
-
-      // Initialize the value of this state.
-      self.values[selector][state.pristine] = undefined;
-
-      // Monitor state changes of the specified state for this dependee.
-      $(selector).bind('state:' + state, function (e) {
-        var complies = self.compare(value, e.value);
-        self.update(selector, state, complies);
-      });
-
-      // Make sure the event we just bound ourselves to is actually fired.
-      new states.Trigger({ selector: selector, state: state });
-    });
+    this.values[selector] = {};
+
+    for (var i in dependeeStates) {
+      if (dependeeStates.hasOwnProperty(i)) {
+        state = dependeeStates[i];
+        // Make sure we're not initializing this selector/state combination twice.
+        if ($.inArray(state, dependeeStates) === -1) {
+          continue;
+        }
+
+        state = states.State.sanitize(state);
+
+        // Initialize the value of this state.
+        this.values[selector][state.name] = null;
+
+        // Monitor state changes of the specified state for this dependee.
+        $(selector).bind('state:' + state, $.proxy(function (e) {
+          this.update(selector, state, e.value);
+        }, this));
+
+        // Make sure the event we just bound ourselves to is actually fired.
+        new states.Trigger({ selector: selector, state: state });
+      }
+    }
   },
 
   /**
@@ -111,12 +120,16 @@
    *
    * @param reference
    *   The value used for reference.
-   * @param value
-   *   The value to compare with the reference value.
+   * @param selector
+   *   CSS selector describing the dependee.
+   * @param state
+   *   A State object describing the dependee's updated state.
+   *
    * @return
-   *   true, undefined or false.
-   */
-  compare: function (reference, value) {
+   *   true or false.
+   */
+  compare: function (reference, selector, state) {
+    var value = this.values[selector][state.name];
     if (reference.constructor.name in states.Dependent.comparisons) {
       // Use a custom compare function for certain reference value types.
       return states.Dependent.comparisons[reference.constructor.name](reference, value);
@@ -139,8 +152,8 @@
    */
   update: function (selector, state, value) {
     // Only act when the 'new' value is actually new.
-    if (value !== this.values[selector][state.pristine]) {
-      this.values[selector][state.pristine] = value;
+    if (value !== this.values[selector][state.name]) {
+      this.values[selector][state.name] = value;
       this.reevaluate();
     }
   },
@@ -149,16 +162,8 @@
    * Triggers change events in case a state changed.
    */
   reevaluate: function () {
-    var value = undefined;
-
-    // Merge all individual values to find out whether this dependee complies.
-    for (var selector in this.values) {
-      for (var state in this.values[selector]) {
-        state = states.State.sanitize(state);
-        var complies = this.values[selector][state.pristine];
-        value = ternary(value, invert(complies, state.invert));
-      }
-    }
+    // Check whether any constraint for this dependent state is satisifed.
+    var value = this.verifyConstraints(this.constraints);
 
     // Only invoke a state change event when the value actually changed.
     if (value !== this.oldValue) {
@@ -173,6 +178,124 @@
       // infinite loops.
       this.element.trigger({ type: 'state:' + this.state, value: value, trigger: true });
     }
+  },
+
+  /**
+   * Evaluates child constraints to determine if a constraint is satisfied.
+   *
+   * @param constraints
+   *   A constraint object or an array of constraints.
+   * @param selector
+   *   The selector for these constraints. If undefined, there isn't yet a
+   *   selector that these constraints apply to. In that case, the keys of the
+   *   object are interpreted as the selector if encountered.
+   *
+   * @return
+   *   true or false, depending on whether these constraints are satisfied.
+   */
+  verifyConstraints: function(constraints, selector) {
+    var result;
+    if ($.isArray(constraints)) {
+      // This constraint is an array (OR or XOR).
+      var hasXor = $.inArray('xor', constraints) === -1;
+      for (var i = 0, len = constraints.length; i < len; i++) {
+        if (constraints[i] != 'xor') {
+          var constraint = this.checkConstraints(constraints[i], selector, i);
+          // Return if this is OR and we have a satisfied constraint or if this
+          // is XOR and we have a second satisfied constraint.
+          if (constraint && (hasXor || result)) {
+            return hasXor;
+          }
+          result = result || constraint;
+        }
+      }
+    }
+    // Make sure we don't try to iterate over things other than objects. This
+    // shouldn't normally occur, but in case the condition definition is bogus,
+    // we don't want to end up with an infinite loop.
+    else if ($.isPlainObject(constraints)) {
+      // This constraint is an object (AND).
+      for (var n in constraints) {
+        if (constraints.hasOwnProperty(n)) {
+          result = ternary(result, this.checkConstraints(constraints[n], selector, n));
+          // False and anything else will evaluate to false, so return when any
+          // false condition is found.
+          if (result === false) { return false; }
+        }
+      }
+    }
+    return result;
+  },
+
+  /**
+   * Checks whether the value matches the requirements for this constraint.
+   *
+   * @param value
+   *   Either the value of a state or an array/object of constraints. In the
+   *   latter case, resolving the constraint continues.
+   * @param selector
+   *   The selector for this constraint. If undefined, there isn't yet a
+   *   selector that this constraint applies to. In that case, the state key is
+   *   propagates to a selector and resolving continues.
+   * @param state
+   *   The state to check for this constraint. If undefined, resolving
+   *   continues.
+   *   If both selector and state aren't undefined and valid non-numeric
+   *   strings, a lookup for the actual value of that selector's state is
+   *   performed. This parameter is not a State object but a pristine state
+   *   string.
+   *
+   * @return
+   *   true or false, depending on whether this constraint is satisfied.
+   */
+  checkConstraints: function(value, selector, state) {
+    // Normalize the last parameter. If it's non-numeric, we treat it either as
+    // a selector (in case there isn't one yet) or as a trigger/state.
+    if (typeof state !== 'string' || (/[0-9]/).test(state[0])) {
+      state = null;
+    }
+    else if (typeof selector === 'undefined') {
+      // Propagate the state to the selector when there isn't one yet.
+      selector = state;
+      state = null;
+    }
+
+    if (state !== null) {
+      // constraints is the actual constraints of an element to check for.
+      state = states.State.sanitize(state);
+      return invert(this.compare(value, selector, state), state.invert);
+    }
+    else {
+      // Resolve this constraint as an AND/OR operator.
+      return this.verifyConstraints(value, selector);
+    }
+  },
+
+  /**
+   * Gathers information about all required triggers.
+   */
+  getDependees: function() {
+    var cache = {};
+    // Swivel the lookup function so that we can record all available selector-
+    // state combinations for initialization.
+    var _compare = this.compare;
+    this.compare = function(reference, selector, state) {
+      (cache[selector] || (cache[selector] = [])).push(state.name);
+      // Return nothing (=== undefined) so that the constraint loops are not
+      // broken.
+    };
+
+    // This call doesn't actually verify anything but uses the resolving
+    // mechanism to go through the constraints array, trying to look up each
+    // value. Since we swivelled the compare function, this comparison returns
+    // undefined and lookup continues until the very end. Instead of lookup up
+    // the value, we record that combination of selector and state so that we
+    // can initialize all triggers.
+    this.verifyConstraints(this.constraints);
+    // Restore the original function.
+    this.compare = _compare;
+
+    return cache;
   }
 };
 
@@ -192,7 +315,6 @@
 
 states.Trigger.prototype = {
   initialize: function () {
-    var self = this;
     var trigger = states.Trigger.states[this.state];
 
     if (typeof trigger == 'function') {
@@ -200,9 +322,11 @@
       trigger.call(window, this.element);
     }
     else {
-      $.each(trigger, function (event, valueFn) {
-        self.defaultTrigger(event, valueFn);
-      });
+      for (var event in trigger) {
+        if (trigger.hasOwnProperty(event)) {
+          this.defaultTrigger(event, trigger[event]);
+        }
+      }
     }
 
     // Mark this trigger as initialized for this element.
@@ -210,23 +334,22 @@
   },
 
   defaultTrigger: function (event, valueFn) {
-    var self = this;
     var oldValue = valueFn.call(this.element);
 
     // Attach the event callback.
-    this.element.bind(event, function (e) {
-      var value = valueFn.call(self.element, e);
+    this.element.bind(event, $.proxy(function (e) {
+      var value = valueFn.call(this.element, e);
       // Only trigger the event if the value has actually changed.
       if (oldValue !== value) {
-        self.element.trigger({ type: 'state:' + self.state, value: value, oldValue: oldValue });
+        this.element.trigger({ type: 'state:' + this.state, value: value, oldValue: oldValue });
         oldValue = value;
       }
-    });
-
-    states.postponed.push(function () {
+    }, this));
+
+    states.postponed.push($.proxy(function () {
       // Trigger the event once for initialization purposes.
-      self.element.trigger({ type: 'state:' + self.state, value: oldValue, oldValue: undefined });
-    });
+      this.element.trigger({ type: 'state:' + this.state, value: oldValue, oldValue: null });
+    }, this));
   }
 };
 
@@ -275,7 +398,7 @@
 
   collapsed: {
     'collapsed': function(e) {
-      return (e !== undefined && 'value' in e) ? e.value : this.is('.collapsed');
+      return (typeof e !== 'undefined' && 'value' in e) ? e.value : this.is('.collapsed');
     }
   }
 };
@@ -307,7 +430,7 @@
 };
 
 /**
- * Create a new State object by sanitizing the passed value.
+ * Creates a new State object by sanitizing the passed value.
  */
 states.State.sanitize = function (state) {
   if (state instanceof states.State) {
@@ -352,72 +475,69 @@
  * bubble up to these handlers. We use this system so that themes and modules
  * can override these state change handlers for particular parts of a page.
  */
-{
-  $(document).bind('state:disabled', function(e) {
-    // Only act when this change was triggered by a dependency and not by the
-    // element monitoring itself.
-    if (e.trigger) {
-      $(e.target)
-        .attr('disabled', e.value)
-        .filter('.form-element')
-          .closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'addClass' : 'removeClass']('form-disabled');
-
-      // Note: WebKit nightlies don't reflect that change correctly.
-      // See https://bugs.webkit.org/show_bug.cgi?id=23789
-    }
-  });
-
-  $(document).bind('state:required', function(e) {
-    if (e.trigger) {
-      if (e.value) {
-        $(e.target).closest('.form-item, .form-wrapper').find('label').append('<span class="form-required">*</span>');
-      }
-      else {
-        $(e.target).closest('.form-item, .form-wrapper').find('label .form-required').remove();
-      }
-    }
-  });
-
-  $(document).bind('state:visible', function(e) {
-    if (e.trigger) {
-      $(e.target).closest('.form-item, .form-submit, .form-wrapper')[e.value ? 'show' : 'hide']();
-    }
-  });
-
-  $(document).bind('state:checked', function(e) {
-    if (e.trigger) {
-      $(e.target).attr('checked', e.value);
-    }
-  });
-
-  $(document).bind('state:collapsed', function(e) {
-    if (e.trigger) {
-      if ($(e.target).is('.collapsed') !== e.value) {
-        $('> legend a', e.target).click();
-      }
-    }
-  });
-}
+$(document).bind('state:disabled', function(e) {
+  // Only act when this change was triggered by a dependency and not by the
+  // element monitoring itself.
+  if (e.trigger) {
+    $(e.target)
+      .attr('disabled', e.value)
+      .filter('.form-element')
+        .closest('.form-item, .form-submit, .form-wrapper').toggleClass('form-disabled', e.value);
+
+    // Note: WebKit nightlies don't reflect that change correctly.
+    // See https://bugs.webkit.org/show_bug.cgi?id=23789
+  }
+});
+
+$(document).bind('state:required', function(e) {
+  if (e.trigger) {
+    if (e.value) {
+      $(e.target).closest('.form-item, .form-wrapper').find('label').append('<span class="form-required">*</span>');
+    }
+    else {
+      $(e.target).closest('.form-item, .form-wrapper').find('label .form-required').remove();
+    }
+  }
+});
+
+$(document).bind('state:visible', function(e) {
+  if (e.trigger) {
+      $(e.target).closest('.form-item, .form-submit, .form-wrapper').toggle(e.value);
+  }
+});
+
+$(document).bind('state:checked', function(e) {
+  if (e.trigger) {
+    $(e.target).attr('checked', e.value);
+  }
+});
+
+$(document).bind('state:collapsed', function(e) {
+  if (e.trigger) {
+    if ($(e.target).is('.collapsed') !== e.value) {
+      $('> legend a', e.target).click();
+    }
+  }
+});
 
 /**
  * These are helper functions implementing addition "operators" and don't
  * implement any logic that is particular to states.
  */
-{
-  // Bitwise AND with a third undefined state.
-  function ternary (a, b) {
-    return a === undefined ? b : (b === undefined ? a : a && b);
-  };
-
-  // Inverts a (if it's not undefined) when invert is true.
-  function invert (a, invert) {
-    return (invert && a !== undefined) ? !a : a;
-  };
-
-  // Compares two values while ignoring undefined values.
-  function compare (a, b) {
-    return (a === b) ? (a === undefined ? a : true) : (a === undefined || b === undefined);
-  }
+
+// Bitwise AND with a third undefined state.
+function ternary (a, b) {
+  return typeof a === 'undefined' ? b : (typeof b === 'undefined' ? a : a && b);
 }
 
+// Inverts a (if it's not undefined) when invert is true.
+function invert (a, invert) {
+  return (invert && typeof a !== 'undefined') ? !a : a;
+}
+
+// Compares two values while ignoring undefined values.
+function compare (a, b) {
+  return (a === b) ? (typeof a === 'undefined' ? a : true) : (typeof a === 'undefined' || typeof b === 'undefined');
+}
+
 })(jQuery);

Modified: branches/upstream/current-7/misc/tabledrag.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/tabledrag.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/misc/tabledrag.js (original)
+++ branches/upstream/current-7/misc/tabledrag.js Thu May 10 18:20:18 2012
@@ -123,9 +123,9 @@
     // Find the first field in this group.
     for (var d in this.tableSettings[group]) {
       var field = $('.' + this.tableSettings[group][d].target + ':first', this.table);
-      if (field.size() && this.tableSettings[group][d].hidden) {
+      if (field.length && this.tableSettings[group][d].hidden) {
         var hidden = this.tableSettings[group][d].hidden;
-        var cell = field.parents('td:first');
+        var cell = field.closest('td');
         break;
       }
     }
@@ -201,6 +201,8 @@
     // The cookie expires in one year.
     expires: 365
   });
+  // Trigger an event to allow other scripts to react to this display change.
+  $('table.tabledrag-processed').trigger('columnschange', 'hide');
 };
 
 /**
@@ -224,6 +226,8 @@
     // The cookie expires in one year.
     expires: 365
   });
+  // Trigger an event to allow other scripts to react to this display change.
+  $('table.tabledrag-processed').trigger('columnschange', 'show');
 };
 
 /**
@@ -256,7 +260,7 @@
   if ($('td:first .indentation:last', item).length) {
     $('td:first .indentation:last', item).after(handle);
     // Update the total width of indentation in this entire table.
-    self.indentCount = Math.max($('.indentation', item).size(), self.indentCount);
+    self.indentCount = Math.max($('.indentation', item).length, self.indentCount);
   }
   else {
     $('td:first', item).prepend(handle);
@@ -362,7 +366,7 @@
           if ($(item).is('.tabledrag-root')) {
             // Swap with the previous top-level row.
             var groupHeight = 0;
-            while (previousRow && $('.indentation', previousRow).size()) {
+            while (previousRow && $('.indentation', previousRow).length) {
               previousRow = $(previousRow).prev('tr').get(0);
               groupHeight += $(previousRow).is(':hidden') ? 0 : previousRow.offsetHeight;
             }
@@ -402,12 +406,12 @@
           if ($(item).is('.tabledrag-root')) {
             // Swap with the next group (necessarily a top-level one).
             var groupHeight = 0;
-            nextGroup = new self.row(nextRow, 'keyboard', self.indentEnabled, self.maxDepth, false);
+            var nextGroup = new self.row(nextRow, 'keyboard', self.indentEnabled, self.maxDepth, false);
             if (nextGroup) {
               $(nextGroup.group).each(function () {
                 groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight;
               });
-              nextGroupRow = $(nextGroup.group).filter(':last').get(0);
+              var nextGroupRow = $(nextGroup.group).filter(':last').get(0);
               self.rowObject.swap('after', nextGroupRow);
               // No need to check for indentation, 0 is the only valid one.
               window.scrollBy(0, parseInt(groupHeight, 10));
@@ -688,7 +692,7 @@
     var sourceRow = changedRow;
     if ($(previousRow).is('.draggable') && $('.' + group, previousRow).length) {
       if (this.indentEnabled) {
-        if ($('.indentations', previousRow).size() == $('.indentations', changedRow)) {
+        if ($('.indentations', previousRow).length == $('.indentations', changedRow)) {
           sourceRow = previousRow;
         }
       }
@@ -698,7 +702,7 @@
     }
     else if ($(nextRow).is('.draggable') && $('.' + group, nextRow).length) {
       if (this.indentEnabled) {
-        if ($('.indentations', nextRow).size() == $('.indentations', changedRow)) {
+        if ($('.indentations', nextRow).length == $('.indentations', changedRow)) {
           sourceRow = nextRow;
         }
       }
@@ -754,7 +758,7 @@
     switch (rowSettings.action) {
       case 'depth':
         // Get the depth of the target row.
-        targetElement.value = $('.indentation', $(sourceElement).parents('tr:first')).size();
+        targetElement.value = $('.indentation', $(sourceElement).closest('tr')).length;
         break;
       case 'match':
         // Update the value.
@@ -884,20 +888,20 @@
   this.element = tableRow;
   this.method = method;
   this.group = [tableRow];
-  this.groupDepth = $('.indentation', tableRow).size();
+  this.groupDepth = $('.indentation', tableRow).length;
   this.changed = false;
-  this.table = $(tableRow).parents('table:first').get(0);
+  this.table = $(tableRow).closest('table').get(0);
   this.indentEnabled = indentEnabled;
   this.maxDepth = maxDepth;
   this.direction = ''; // Direction the row is being moved.
 
   if (this.indentEnabled) {
-    this.indents = $('.indentation', tableRow).size();
+    this.indents = $('.indentation', tableRow).length;
     this.children = this.findChildren(addClasses);
     this.group = $.merge(this.group, this.children);
     // Find the depth of this entire group.
     for (var n = 0; n < this.group.length; n++) {
-      this.groupDepth = Math.max($('.indentation', this.group[n]).size(), this.groupDepth);
+      this.groupDepth = Math.max($('.indentation', this.group[n]).length, this.groupDepth);
     }
   }
 };
@@ -1009,7 +1013,7 @@
 
   // Minimum indentation:
   // Do not orphan the next row.
-  minIndent = nextRow ? $('.indentation', nextRow).size() : 0;
+  minIndent = nextRow ? $('.indentation', nextRow).length : 0;
 
   // Maximum indentation:
   if (!prevRow || $(prevRow).is(':not(.draggable)') || $(this.element).is('.tabledrag-root')) {
@@ -1021,7 +1025,7 @@
   }
   else {
     // Do not go deeper than as a child of the previous row.
-    maxIndent = $('.indentation', prevRow).size() + ($(prevRow).is('.tabledrag-leaf') ? 0 : 1);
+    maxIndent = $('.indentation', prevRow).length + ($(prevRow).is('.tabledrag-leaf') ? 0 : 1);
     // Limit by the maximum allowed depth for the table.
     if (this.maxDepth) {
       maxIndent = Math.min(maxIndent, this.maxDepth - (this.groupDepth - this.indents));
@@ -1042,8 +1046,8 @@
 Drupal.tableDrag.prototype.row.prototype.indent = function (indentDiff) {
   // Determine the valid indentations interval if not available yet.
   if (!this.interval) {
-    prevRow = $(this.element).prev('tr').get(0);
-    nextRow = $(this.group).filter(':last').next('tr').get(0);
+    var prevRow = $(this.element).prev('tr').get(0);
+    var nextRow = $(this.group).filter(':last').next('tr').get(0);
     this.interval = this.validIndentInterval(prevRow, nextRow);
   }
 

Modified: branches/upstream/current-7/misc/tableheader.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/tableheader.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/misc/tableheader.js (original)
+++ branches/upstream/current-7/misc/tableheader.js Thu May 10 18:20:18 2012
@@ -27,6 +27,14 @@
   this.originalTable = $(table);
   this.originalHeader = $(table).children('thead');
   this.originalHeaderCells = this.originalHeader.find('> tr > th');
+  this.displayWeight = null;
+
+  // React to columns change to avoid making checks in the scroll callback.
+  this.originalTable.bind('columnschange', function (e, display) {
+    // This will force header size to be calculated on scroll.
+    self.widthCalculated = (self.displayWeight !== null && self.displayWeight === display);
+    self.displayWeight = display;
+  });
 
   // Clone the table header so it inherits original jQuery properties. Hide
   // the table to avoid a flash of the header clone upon page load.
@@ -95,15 +103,29 @@
   // visible or when forced.
   if (this.stickyVisible && (calculateWidth || !this.widthCalculated)) {
     this.widthCalculated = true;
+    var $that = null;
+    var $stickyCell = null;
+    var display = null;
+    var cellWidth = null;
     // Resize header and its cell widths.
-    this.stickyHeaderCells.each(function (index) {
-      var cellWidth = self.originalHeaderCells.eq(index).css('width');
-      // Exception for IE7.
-      if (cellWidth == 'auto') {
-        cellWidth = self.originalHeaderCells.get(index).clientWidth + 'px';
+    // Only apply width to visible table cells. This prevents the header from
+    // displaying incorrectly when the sticky header is no longer visible.
+    for (var i = 0, il = this.originalHeaderCells.length; i < il; i += 1) {
+      $that = $(this.originalHeaderCells[i]);
+      $stickyCell = this.stickyHeaderCells.eq($that.index());
+      display = $that.css('display');
+      if (display !== 'none') {
+        cellWidth = $that.css('width');
+        // Exception for IE7.
+        if (cellWidth === 'auto') {
+          cellWidth = $that[0].clientWidth + 'px';
+        }
+        $stickyCell.css({'width': cellWidth, 'display': display});
       }
-      $(this).css('width', cellWidth);
-    });
+      else {
+        $stickyCell.css('display', 'none');
+      }
+    }
     this.stickyTable.css('width', this.originalTable.css('width'));
   }
 };

Modified: branches/upstream/current-7/misc/tableselect.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/tableselect.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/misc/tableselect.js (original)
+++ branches/upstream/current-7/misc/tableselect.js Thu May 10 18:20:18 2012
@@ -2,13 +2,14 @@
 
 Drupal.behaviors.tableSelect = {
   attach: function (context, settings) {
-    $('table:has(th.select-all)', context).once('table-select', Drupal.tableSelect);
+    // Select the inner-most table in case of nested tables.
+    $('th.select-all', context).closest('table').once('table-select', Drupal.tableSelect);
   }
 };
 
 Drupal.tableSelect = function () {
   // Do not add a "Select all" checkbox if there are no rows with checkboxes in the table
-  if ($('td input:checkbox', this).size() == 0) {
+  if ($('td input:checkbox', this).length == 0) {
     return;
   }
 
@@ -29,7 +30,7 @@
       checkboxes.each(function () {
         this.checked = event.target.checked;
         // Either add or remove the selected class based on the state of the check all checkbox.
-        $(this).parents('tr:first')[ this.checked ? 'addClass' : 'removeClass' ]('selected');
+        $(this).closest('tr').toggleClass('selected', this.checked);
       });
       // Update the title and the state of the check all box.
       updateSelectAll(event.target.checked);
@@ -39,14 +40,14 @@
   // For each of the checkboxes within the table that are not disabled.
   checkboxes = $('td input:checkbox:enabled', table).click(function (e) {
     // Either add or remove the selected class based on the state of the check all checkbox.
-    $(this).parents('tr:first')[ this.checked ? 'addClass' : 'removeClass' ]('selected');
+    $(this).closest('tr').toggleClass('selected', this.checked);
 
     // If this is a shift click, we need to highlight everything in the range.
     // Also make sure that we are actually checking checkboxes over a range and
     // that a checkbox has been checked or unchecked before.
     if (e.shiftKey && lastChecked && lastChecked != e.target) {
       // We use the checkbox's parent TR to do our range searching.
-      Drupal.tableSelectRange($(e.target).parents('tr')[0], $(lastChecked).parents('tr')[0], e.target.checked);
+      Drupal.tableSelectRange($(e.target).closest('tr')[0], $(lastChecked).closest('tr')[0], e.target.checked);
     }
 
     // If all checkboxes are checked, make sure the select-all one is checked too, otherwise keep unchecked.
@@ -69,7 +70,7 @@
     }
 
     // Either add or remove the selected class based on the state of the target checkbox.
-    $(i)[ state ? 'addClass' : 'removeClass' ]('selected');
+    $(i).toggleClass('selected', state);
     $('input:checkbox', i).each(function () {
       this.checked = state;
     });

Modified: branches/upstream/current-7/misc/vertical-tabs.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/vertical-tabs.css?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/misc/vertical-tabs.css (original)
+++ branches/upstream/current-7/misc/vertical-tabs.css Thu May 10 18:20:18 2012
@@ -19,8 +19,11 @@
   padding: 0 1em;
   border: 0;
 }
-.vertical-tabs legend {
+fieldset.vertical-tabs-pane legend {
   display: none;
+}
+fieldset.vertical-tabs-pane fieldset legend {
+  display: block;
 }
 
 /* Layout of each tab */

Modified: branches/upstream/current-7/misc/vertical-tabs.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/misc/vertical-tabs.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/misc/vertical-tabs.js (original)
+++ branches/upstream/current-7/misc/vertical-tabs.js Thu May 10 18:20:18 2012
@@ -88,16 +88,6 @@
       self.focus();
       // Set focus on the first input field of the visible fieldset/tab pane.
       $("fieldset.vertical-tabs-pane :input:visible:enabled:first").focus();
-      return false;
-    }
-  });
-
-  // Pressing the Enter key lets you leave the tab again.
-  this.fieldset.keydown(function(event) {
-    // Enter key should not trigger inside <textarea> to allow for multi-line entries.
-    if (event.keyCode == 13 && event.target.nodeName != "TEXTAREA") {
-      // Set focus on the selected tab button again.
-      $(".vertical-tab-button.selected a").focus();
       return false;
     }
   });

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.info (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 configure = admin/config/services/aggregator/settings
 stylesheets[all][] = aggregator.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.module (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.module Thu May 10 18:20:18 2012
@@ -18,7 +18,7 @@
     case 'admin/help#aggregator':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Aggregator module is an on-site syndicator and news reader that gathers and displays fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines in feeds, using a number of standardized XML-based formats. For more information, see the online handbook entry for <a href="@aggregator-module">Aggregator module</a>.', array('@aggregator-module' => 'http://drupal.org/handbook/modules/aggregator', '@aggregator' => url('aggregator'))) . '</p>';
+      $output .= '<p>' . t('The Aggregator module is an on-site syndicator and news reader that gathers and displays fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines in feeds, using a number of standardized XML-based formats. For more information, see the online handbook entry for <a href="@aggregator-module">Aggregator module</a>.', array('@aggregator-module' => 'http://drupal.org/documentation/modules/aggregator', '@aggregator' => url('aggregator'))) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Viewing feeds') . '</dt>';
@@ -397,6 +397,7 @@
   if (user_access('access news feeds')) {
     $block = array();
     list($type, $id) = explode('-', $delta);
+    $result = FALSE;
     switch ($type) {
       case 'feed':
         if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) {
@@ -414,9 +415,12 @@
         }
         break;
     }
+
     $items = array();
-    foreach ($result as $item) {
-      $items[] = theme('aggregator_block_item', array('item' => $item));
+    if (!empty($result)) {
+      foreach ($result as $item) {
+        $items[] = theme('aggregator_block_item', array('item' => $item));
+      }
     }
 
     // Only display the block if there are items to show.

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/aggregator.test (original)
+++ branches/upstream/current-7/modules/aggregator/aggregator.test Thu May 10 18:20:18 2012
@@ -848,6 +848,16 @@
     $this->drupalGet($href);
     $correct_titles = $this->xpath('//h1[normalize-space(text())=:title]', array(':title' => $feed->title));
     $this->assertFalse(empty($correct_titles), t('Aggregator feed page is available and has the correct title.'));
+
+    // Set the number of news items to 0 to test that the block does not show
+    // up.
+    $feed->block = 0;
+    aggregator_save_feed((array) $feed);
+    // It is nescessary to flush the cache after saving the number of items.
+    drupal_flush_all_caches();
+    // Check that the block is no longer displayed.
+    $this->drupalGet('node');
+    $this->assertNoText(t($block['title']), 'Feed block is not displayed on the page when number of items is set to 0.');
   }
 
   /**

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/aggregator/tests/aggregator_test.info (original)
+++ branches/upstream/current-7/modules/aggregator/tests/aggregator_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/block/block.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/block.api.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.api.php (original)
+++ branches/upstream/current-7/modules/block/block.api.php Thu May 10 18:20:18 2012
@@ -20,11 +20,11 @@
  * identifier referred to as "delta" (the array key in the return value). Delta
  * values only need to be unique within your module, and they are used in the
  * following ways:
- * - Passed into the other block hooks in your module as an argument to
- *   identify the block being configured or viewed.
+ * - Passed into the other block hooks in your module as an argument to identify
+ *   the block being configured or viewed.
  * - Used to construct the default HTML ID of "block-MODULE-DELTA" applied to
- *   each block when it is rendered (which can then be used for CSS styling or
- *   JavaScript programming).
+ *   each block when it is rendered. This ID may then be used for CSS styling or
+ *   JavaScript programming.
  * - Used to define a theming template suggestion of block__MODULE__DELTA, for
  *   advanced theming possibilities.
  * - Used by other modules to identify your block in hook_block_info_alter() and
@@ -39,43 +39,43 @@
  *   An associative array whose keys define the delta for each block and whose
  *   values contain the block descriptions. Each block description is itself an
  *   associative array, with the following key-value pairs:
- *   - 'info': (required) The human-readable administrative name of the block.
- *     This is used to identify the block on administration screens, and
- *     is not displayed to non-administrative users.
- *   - 'cache': (optional) A bitmask describing what kind of caching is
+ *   - info: (required) The human-readable administrative name of the block.
+ *     This is used to identify the block on administration screens, and is not
+ *     displayed to non-administrative users.
+ *   - cache: (optional) A bitmask describing what kind of caching is
  *     appropriate for the block. Drupal provides the following bitmask
  *     constants for defining cache granularity:
  *     - DRUPAL_CACHE_PER_ROLE (default): The block can change depending on the
  *       roles the user viewing the page belongs to.
  *     - DRUPAL_CACHE_PER_USER: The block can change depending on the user
- *       viewing the page. This setting can be resource-consuming for sites
- *       with large number of users, and should only be used when
+ *       viewing the page. This setting can be resource-consuming for sites with
+ *       large number of users, and should only be used when
  *       DRUPAL_CACHE_PER_ROLE is not sufficient.
- *     - DRUPAL_CACHE_PER_PAGE: The block can change depending on the page
- *       being viewed.
- *     - DRUPAL_CACHE_GLOBAL: The block is the same for every user on every
- *       page where it is visible.
+ *     - DRUPAL_CACHE_PER_PAGE: The block can change depending on the page being
+ *       viewed.
+ *     - DRUPAL_CACHE_GLOBAL: The block is the same for every user on every page
+ *       where it is visible.
  *     - DRUPAL_NO_CACHE: The block should not get cached.
- *   - 'properties': (optional) Array of additional metadata to add to the
- *     block. Common properties include:
- *     - 'administrative': Boolean which categorizes this block as usable in
- *       an administrative context. This might include blocks which help an
- *       administrator approve/deny comments, or view recently created
- *       user accounts.
- *   - 'weight': (optional) Initial value for the ordering weight of this block.
+ *   - properties: (optional) Array of additional metadata to add to the block.
+ *     Common properties include:
+ *     - administrative: Boolean that categorizes this block as usable in an
+ *       administrative context. This might include blocks that help an
+ *       administrator approve/deny comments, or view recently created user
+ *       accounts.
+ *   - weight: (optional) Initial value for the ordering weight of this block.
  *     Most modules do not provide an initial value, and any value provided can
  *     be modified by a user on the block configuration screen.
- *   - 'status': (optional) Initial value for block enabled status. (1 =
- *     enabled, 0 = disabled). Most modules do not provide an initial value,
- *     and any value provided can be modified by a user on the block
- *     configuration screen.
- *   - 'region': (optional) Initial value for theme region within which this
- *     block is set. Most modules do not provide an initial value, and
- *     any value provided can be modified by a user on the block configuration
- *     screen. Note: If you set a region that isn't available in the currently
- *     enabled theme, the block will be disabled.
- *   - 'visibility': (optional) Initial value for the visibility flag, which
- *     tells how to interpret the 'pages' value. Possible values are:
+ *   - status: (optional) Initial value for block enabled status. (1 = enabled,
+ *     0 = disabled). Most modules do not provide an initial value, and any
+ *     value provided can be modified by a user on the block configuration
+ *     screen.
+ *   - region: (optional) Initial value for theme region within which this
+ *     block is set. Most modules do not provide an initial value, and any value
+ *     provided can be modified by a user on the block configuration screen.
+ *     Note: If you set a region that isn't available in the currently enabled
+ *     theme, the block will be disabled.
+ *   - visibility: (optional) Initial value for the visibility flag, which tells
+ *     how to interpret the 'pages' value. Possible values are:
  *     - BLOCK_VISIBILITY_NOTLISTED: Show on all pages except listed pages.
  *       'pages' lists the paths where the block should not be shown.
  *     - BLOCK_VISIBILITY_LISTED: Show only on listed pages. 'pages' lists the
@@ -85,7 +85,14 @@
  *     Most modules do not provide an initial value for 'visibility' or 'pages',
  *     and any value provided can be modified by a user on the block
  *     configuration screen.
- *   - 'pages': (optional) See 'visibility' above.
+ *   - pages: (optional) See 'visibility' above. A string that contains one or
+ *     more page paths separated by '\n', '\r', or '\r\n' when 'visibility' is
+ *     set to BLOCK_VISIBILITY_NOTLISTED or BLOCK_VISIBILITY_LISTED, or custom
+ *     PHP code when 'visibility' is set to BLOCK_VISIBILITY_PHP. Paths may use
+ *     '*' as a wildcard (matching any number of characters); '<front>'
+ *     designates the site's front page. For BLOCK_VISIBILITY_PHP, the PHP
+ *     code's return value should be TRUE if the block is to be made visible or
+ *     FALSE if the block should not be visible.
  *
  * For a detailed usage example, see block_example.module.
  *

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.info (original)
+++ branches/upstream/current-7/modules/block/block.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = block.test
 configure = admin/structure/block
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/block/block.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/block/block.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.js (original)
+++ branches/upstream/current-7/modules/block/block.js Thu May 10 18:20:18 2012
@@ -113,28 +113,12 @@
     $('select.block-region-select', context).once('block-region-select', function () {
       $(this).change(function (event) {
         // Make our new row and select field.
-        var row = $(this).parents('tr:first');
+        var row = $(this).closest('tr');
         var select = $(this);
         tableDrag.rowObject = new tableDrag.row(row);
 
-        // Find the correct region and insert the row as the first in the region.
-        $('tr.region-message', table).each(function () {
-          if ($(this).is('.region-' + select[0].value + '-message')) {
-            // Add the new row and remove the old one.
-            $(this).after(row);
-            // Manually update weights and restripe.
-            tableDrag.updateFields(row.get(0));
-            tableDrag.rowObject.changed = true;
-            if (tableDrag.oldRowElement) {
-              $(tableDrag.oldRowElement).removeClass('drag-previous');
-            }
-            tableDrag.oldRowElement = row.get(0);
-            tableDrag.restripeTable();
-            tableDrag.rowObject.markChanged();
-            tableDrag.oldRowElement = row;
-            $(row).addClass('drag-previous');
-          }
-        });
+        // Find the correct region and insert the row as the last in the region.
+        table.find('.region-' + select[0].value + '-message').nextUntil('.region-message').last().before(row);
 
         // Modify empty regions with added or removed fields.
         checkEmptyRegions(table, row);
@@ -153,7 +137,7 @@
           }
         }
         // This region has become empty.
-        if ($(this).next('tr').is(':not(.draggable)') || $(this).next('tr').size() == 0) {
+        if ($(this).next('tr').is(':not(.draggable)') || $(this).next('tr').length == 0) {
           $(this).removeClass('region-populated').addClass('region-empty');
         }
         // This region has become populated.

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.module (original)
+++ branches/upstream/current-7/modules/block/block.module Thu May 10 18:20:18 2012
@@ -48,11 +48,11 @@
     case 'admin/help#block':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Block module allows you to create boxes of content, which are rendered into an area, or region, of one or more pages of a website. The core Seven administration theme, for example, implements the regions "Content", "Help", "Dashboard main", and "Dashboard sidebar", and a block may appear in any one of these regions. The <a href="@blocks">Blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. For more information, see the online handbook entry for <a href="@block">Block module</a>.', array('@block' => 'http://drupal.org/handbook/modules/block/', '@blocks' => url('admin/structure/block'))) . '</p>';
+      $output .= '<p>' . t('The Block module allows you to create boxes of content, which are rendered into an area, or region, of one or more pages of a website. The core Seven administration theme, for example, implements the regions "Content", "Help", "Dashboard main", and "Dashboard sidebar", and a block may appear in any one of these regions. The <a href="@blocks">Blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. For more information, see the online handbook entry for <a href="@block">Block module</a>.', array('@block' => 'http://drupal.org/documentation/modules/block/', '@blocks' => url('admin/structure/block'))) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Positioning content') . '</dt>';
-      $output .= '<dd>' . t('When working with blocks, remember that all themes do <em>not</em> implement the same regions, or display regions in the same way. Blocks are positioned on a per-theme basis. Users with the <em>Administer blocks</em> permission can disable blocks. Disabled blocks are listed on the <a href="@blocks">Blocks administration page</a>, but are not displayed in any region.', array('@block' => 'http://drupal.org/handbook/modules/block/', '@blocks' => url('admin/structure/block'))) . '</dd>';
+      $output .= '<dd>' . t('When working with blocks, remember that all themes do <em>not</em> implement the same regions, or display regions in the same way. Blocks are positioned on a per-theme basis. Users with the <em>Administer blocks</em> permission can disable blocks. Disabled blocks are listed on the <a href="@blocks">Blocks administration page</a>, but are not displayed in any region.', array('@block' => 'http://drupal.org/documentation/modules/block/', '@blocks' => url('admin/structure/block'))) . '</dd>';
       $output .= '<dt>' . t('Controlling visibility') . '</dt>';
       $output .= '<dd>' . t('Blocks can be configured to be visible only on certain pages, only to users of certain roles, or only on pages displaying certain <a href="@content-type">content types</a>. Administrators can also allow specific blocks to be enabled or disabled by users when they edit their <a href="@user">My account</a> page. Some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.', array('@content-type' => url('admin/structure/types'), '@user' => url('user'))) . '</dd>';
       $output .= '<dt>' . t('Creating custom blocks') . '</dt>';
@@ -432,10 +432,10 @@
       if (!isset($block['weight'])) {
         $block['weight'] = 0;
       }
-      if (!empty($block['region']) && $block['region'] != BLOCK_REGION_NONE && !isset($regions[$block['region']])) {
+      if (!empty($block['region']) && $block['region'] != BLOCK_REGION_NONE && !isset($regions[$block['region']]) && $block['status'] == 1) {
         drupal_set_message(t('The block %info was assigned to the invalid region %region and has been disabled.', array('%info' => $block['info'], '%region' => $block['region'])), 'warning');
         // Disabled modules are moved into the BLOCK_REGION_NONE later so no
-        // need to move the bock to another region.
+        // need to move the block to another region.
         $block['status'] = 0;
       }
       // Set region to none if not enabled and make sure status is set.
@@ -836,17 +836,18 @@
  *   An array of visible blocks as expected by drupal_render().
  */
 function _block_render_blocks($region_blocks) {
+  // Block caching is not compatible with node access modules. We also
+  // preserve the submission of forms in blocks, by fetching from cache only
+  // if the request method is 'GET' (or 'HEAD').
+  $cacheable = !count(module_implements('node_grants')) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD');
   foreach ($region_blocks as $key => $block) {
     // Render the block content if it has not been created already.
     if (!isset($block->content)) {
       // Erase the block from the static array - we'll put it back if it has
       // content.
       unset($region_blocks[$key]);
-      // Try fetching the block from cache. Block caching is not compatible
-      // with node_access modules. We also preserve the submission of forms in
-      // blocks, by fetching from cache only if the request method is 'GET'
-      // (or 'HEAD').
-      if (!count(module_implements('node_grants')) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) {
+      // Try fetching the block from cache.
+      if ($cacheable && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) {
         $array = $cache->data;
       }
       else {

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/block.test (original)
+++ branches/upstream/current-7/modules/block/block.test Thu May 10 18:20:18 2012
@@ -791,3 +791,69 @@
     $this->assertText('Search form', t('Block was displayed on the front page.'));
   }
 }
+
+/**
+ * Tests that a block assigned to an invalid region triggers the warning.
+ */
+class BlockInvalidRegionTestCase extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Blocks in invalid regions',
+      'description' => 'Checks that an active block assigned to a non-existing region triggers the warning message and is disabled.',
+      'group' => 'Block',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('block', 'block_test'));
+    // Create an admin user.
+    $admin_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages'));
+    $this->drupalLogin($admin_user);
+  }
+
+  /**
+   * Tests that blocks assigned to invalid regions work correctly.
+   */
+  function testBlockInInvalidRegion() {
+    // Enable a test block in the default theme and place it in an invalid region.
+    db_merge('block')
+      ->key(array(
+        'module' => 'block_test',
+        'delta' => 'test_html_id',
+        'theme' => variable_get('theme_default', 'stark'),
+      ))
+      ->fields(array(
+        'status' => 1,
+        'region' => 'invalid_region',
+        'cache' => DRUPAL_NO_CACHE,
+      ))
+      ->execute();
+
+    $warning_message = t('The block %info was assigned to the invalid region %region and has been disabled.', array('%info' => t('Test block html id'), '%region' => 'invalid_region'));
+
+    // Clearing the cache should disable the test block placed in the invalid region.
+    $this->drupalPost('admin/config/development/performance', array(), 'Clear all caches');
+    $this->assertRaw($warning_message, 'Enabled block was in the invalid region and has been disabled.');
+
+    // Clear the cache to check if the warning message is not triggered.
+    $this->drupalPost('admin/config/development/performance', array(), 'Clear all caches');
+    $this->assertNoRaw($warning_message, 'Disabled block in the invalid region will not trigger the warning.');
+
+    // Place disabled test block in the invalid region of the default theme.
+    db_merge('block')
+      ->key(array(
+        'module' => 'block_test',
+        'delta' => 'test_html_id',
+        'theme' => variable_get('theme_default', 'stark'),
+      ))
+      ->fields(array(
+        'region' => 'invalid_region',
+        'cache' => DRUPAL_NO_CACHE,
+      ))
+      ->execute();
+
+    // Clear the cache to check if the warning message is not triggered.
+    $this->drupalPost('admin/config/development/performance', array(), 'Clear all caches');
+    $this->assertNoRaw($warning_message, 'Disabled block in the invalid region will not trigger the warning.');
+  }
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/tests/block_test.info (original)
+++ branches/upstream/current-7/modules/block/tests/block_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/block/tests/themes/block_test_theme/block_test_theme.info (original)
+++ branches/upstream/current-7/modules/block/tests/themes/block_test_theme/block_test_theme.info Thu May 10 18:20:18 2012
@@ -13,8 +13,8 @@
 regions[highlighted] = Highlighted
 regions[help] = Help
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/blog/blog.info (original)
+++ branches/upstream/current-7/modules/blog/blog.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 files[] = blog.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/blog/blog.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/blog/blog.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/blog/blog.module (original)
+++ branches/upstream/current-7/modules/blog/blog.module Thu May 10 18:20:18 2012
@@ -40,7 +40,7 @@
   switch ($path) {
     case 'admin/help#blog':
       $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t("The Blog module allows registered users to maintain an online journal, or <em>blog</em>. Blogs are made up of individual <em>blog entries</em>. By default, the blog entries are displayed by creation time in descending order, with comments enabled, and are promoted to the site's front page. For more information, see the online handbook entry for <a href='@blog'>Blog module</a>.", array('@blog' => 'http://drupal.org/handbook/modules/blog/')) . '</p>';
+      $output .= '<p>' . t("The Blog module allows registered users to maintain an online journal, or <em>blog</em>. Blogs are made up of individual <em>blog entries</em>. By default, the blog entries are displayed by creation time in descending order, with comments enabled, and are promoted to the site's front page. For more information, see the online handbook entry for <a href='@blog'>Blog module</a>.", array('@blog' => 'http://drupal.org/documentation/modules/blog/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Single-user blogs') . '</dt>';

Modified: branches/upstream/current-7/modules/book/book-all-books-block.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book-all-books-block.tpl.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book-all-books-block.tpl.php (original)
+++ branches/upstream/current-7/modules/book/book-all-books-block.tpl.php Thu May 10 18:20:18 2012
@@ -3,12 +3,17 @@
 /**
  * @file
  * Default theme implementation for rendering book outlines within a block.
- * This template is used only when the block is configured to "show block on
- * all pages" which presents Multiple independent books on all pages.
+ *
+ * This template is used only when the block is configured to "show block on all
+ * pages", which presents multiple independent books on all pages.
  *
  * Available variables:
  * - $book_menus: Array of book outlines keyed to the parent book ID. Call
  *   render() on each to print it as an unordered list.
+ *
+ * @see template_preprocess_book_all_books_block()
+ *
+ * @ingroup themeable
  */
 ?>
 <?php foreach ($book_menus as $book_id => $menu): ?>

Modified: branches/upstream/current-7/modules/book/book-export-html.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book-export-html.tpl.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book-export-html.tpl.php (original)
+++ branches/upstream/current-7/modules/book/book-export-html.tpl.php Thu May 10 18:20:18 2012
@@ -14,10 +14,12 @@
  *   book-node-export-html.tpl.php.
  *
  * @see template_preprocess_book_export_html()
+ *
+ * @ingroup themeable
  */
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language; ?>" xml:lang="<?php print $language->language; ?>">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language; ?>" xml:lang="<?php print $language->language; ?>" dir="<?php print $dir; ?>">
   <head>
     <title><?php print $title; ?></title>
     <?php print $head; ?>

Modified: branches/upstream/current-7/modules/book/book-navigation.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book-navigation.tpl.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book-navigation.tpl.php (original)
+++ branches/upstream/current-7/modules/book/book-navigation.tpl.php Thu May 10 18:20:18 2012
@@ -2,14 +2,15 @@
 
 /**
  * @file
- * Default theme implementation to navigate books. Presented under nodes that
- * are a part of book outlines.
+ * Default theme implementation to navigate books.
+ *
+ * Presented under nodes that are a part of book outlines.
  *
  * Available variables:
- * - $tree: The immediate children of the current node rendered as an
- *   unordered list.
- * - $current_depth: Depth of the current node within the book outline.
- *   Provided for context.
+ * - $tree: The immediate children of the current node rendered as an unordered
+ *   list.
+ * - $current_depth: Depth of the current node within the book outline. Provided
+ *   for context.
  * - $prev_url: URL to the previous node.
  * - $prev_title: Title of the previous node.
  * - $parent_url: URL to the parent node.
@@ -19,14 +20,16 @@
  * - $next_title: Title of the next node.
  * - $has_links: Flags TRUE whenever the previous, parent or next data has a
  *   value.
- * - $book_id: The book ID of the current outline being viewed. Same as the
- *   node ID containing the entire outline. Provided for context.
- * - $book_url: The book/node URL of the current outline being viewed.
- *   Provided as an option. Not used by default.
+ * - $book_id: The book ID of the current outline being viewed. Same as the node
+ *   ID containing the entire outline. Provided for context.
+ * - $book_url: The book/node URL of the current outline being viewed. Provided
+ *   as an option. Not used by default.
  * - $book_title: The book/node title of the current outline being viewed.
  *   Provided as an option. Not used by default.
  *
  * @see template_preprocess_book_navigation()
+ *
+ * @ingroup themeable
  */
 ?>
 <?php if ($tree || $has_links): ?>

Modified: branches/upstream/current-7/modules/book/book-node-export-html.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book-node-export-html.tpl.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book-node-export-html.tpl.php (original)
+++ branches/upstream/current-7/modules/book/book-node-export-html.tpl.php Thu May 10 18:20:18 2012
@@ -2,8 +2,7 @@
 
 /**
  * @file
- * Default theme implementation for rendering a single node in a printer
- * friendly outline.
+ * Default theme implementation for a single node in a printer-friendly outline.
  *
  * @see book-node-export-html.tpl.php
  * Where it is collected and printed out.
@@ -15,6 +14,8 @@
  * - $children: All the child nodes recursively rendered through this file.
  *
  * @see template_preprocess_book_node_export_html()
+ *
+ * @ingroup themeable
  */
 ?>
 <div id="node-<?php print $node->nid; ?>" class="section-<?php print $depth; ?>">

Modified: branches/upstream/current-7/modules/book/book.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book.admin.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book.admin.inc (original)
+++ branches/upstream/current-7/modules/book/book.admin.inc Thu May 10 18:20:18 2012
@@ -22,7 +22,7 @@
 }
 
 /**
- * Builds and returns the book settings form.
+ * Form constructor for the book settings form.
  *
  * @see book_admin_settings_validate()
  *
@@ -52,9 +52,7 @@
 }
 
 /**
- * Validate the book settings form.
- *
- * @see book_admin_settings()
+ * Form validation handler for book_admin_settings().
  */
 function book_admin_settings_validate($form, &$form_state) {
   $child_type = $form_state['values']['book_child_type'];
@@ -64,11 +62,16 @@
 }
 
 /**
- * Build the form to administrate the hierarchy of a single book.
+ * Form constructor for administering a single book's hierarchy.
  *
  * @see book_admin_edit_submit()
  *
- * @ingroup forms.
+ * @param $node
+ *   The node of the top-level page in the book.
+ *
+ * @see book_admin_edit_validate()
+ * @see book_admin_edit_submit()
+ * @ingroup forms
  */
 function book_admin_edit($form, $form_state, $node) {
   drupal_set_title($node->title);
@@ -83,9 +86,11 @@
 }
 
 /**
- * Check that the book has not been changed while using the form.
- *
- * @see book_admin_edit()
+ * Form validation handler for book_admin_edit().
+ *
+ * Checks that the book has not been changed while using the form.
+ *
+ * @see book_admin_edit_submit()
  */
 function book_admin_edit_validate($form, &$form_state) {
   if ($form_state['values']['tree_hash'] != $form_state['values']['tree_current_hash']) {
@@ -94,12 +99,12 @@
 }
 
 /**
- * Handle submission of the book administrative page form.
+ * Form submission handler for book_admin_edit().
  *
  * This function takes care to save parent menu items before their children.
  * Saving menu items in the incorrect order can break the menu tree.
  *
- * @see book_admin_edit()
+ * @see book_admin_edit_validate()
  * @see menu_overview_form_submit()
  */
 function book_admin_edit_submit($form, &$form_state) {
@@ -139,7 +144,12 @@
 }
 
 /**
- * Build the table portion of the form for the book administration page.
+ * Builds the table portion of the form for the book administration page.
+ *
+ * @param $node
+ *   The node of the top-level page in the book.
+ * @param $form
+ *   The form that is being modified.
  *
  * @see book_admin_edit()
  */
@@ -169,7 +179,15 @@
 }
 
 /**
- * Recursive helper to build the main table in the book administration page form.
+ * Helps build the main table in the book administration page form.
+ *
+ * @param $tree
+ *   A subtree of the book menu hierarchy.
+ * @param $form
+ *   The form that is being modified.
+ *
+ * @return
+ *   The form that is being modified.
  *
  * @see book_admin_edit()
  */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book.info (original)
+++ branches/upstream/current-7/modules/book/book.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 configure = admin/content/book/settings
 stylesheets[all][] = book.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/book/book.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book.install (original)
+++ branches/upstream/current-7/modules/book/book.install Thu May 10 18:20:18 2012
@@ -28,6 +28,9 @@
   menu_cache_clear_all();
 }
 
+/**
+ * Creates the book content type.
+ */
 function _book_install_type_create() {
   // Create an additional node type.
   $book_node_type = array(

Modified: branches/upstream/current-7/modules/book/book.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book.js (original)
+++ branches/upstream/current-7/modules/book/book.js Thu May 10 18:20:18 2012
@@ -1,10 +1,10 @@
-
 (function ($) {
 
 Drupal.behaviors.bookFieldsetSummaries = {
   attach: function (context) {
-    $('fieldset.book-form', context).drupalSetSummary(function (context) {
-      var val = $('.form-item-book-bid select').val();
+    $('fieldset.book-outline-form', context).drupalSetSummary(function (context) {
+      var $select = $('.form-item-book-bid select');
+      var val = $select.val();
 
       if (val === '0') {
         return Drupal.t('Not in book');
@@ -13,7 +13,7 @@
         return Drupal.t('New book');
       }
       else {
-        return Drupal.checkPlain($('.form-item-book-bid select :selected').text());
+        return Drupal.checkPlain($select.find(':selected').text());
       }
     });
   }

Modified: branches/upstream/current-7/modules/book/book.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book.module (original)
+++ branches/upstream/current-7/modules/book/book.module Thu May 10 18:20:18 2012
@@ -12,7 +12,7 @@
   switch ($path) {
     case 'admin/help#book':
       $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Book module is used for creating structured, multi-page content, such as site resource guides, manuals, and wikis. It allows you to create content that has chapters, sections, subsections, or any similarly-tiered structure. For more information, see the online handbook entry for <a href="@book">Book module</a>.', array('@book' => 'http://drupal.org/handbook/modules/book/')) . '</p>';
+      $output .= '<p>' . t('The Book module is used for creating structured, multi-page content, such as site resource guides, manuals, and wikis. It allows you to create content that has chapters, sections, subsections, or any similarly-tiered structure. For more information, see the online handbook entry for <a href="@book">Book module</a>.', array('@book' => 'http://drupal.org/documentation/modules/book/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Adding and managing book content') . '</dt>';
@@ -84,7 +84,12 @@
 }
 
 /**
- * Inject links into $node as needed.
+ * Adds relevant book links to the node's links.
+ *
+ * @param $node
+ *   The book page node to add links to.
+ * @param $view_mode
+ *   The view mode of the node.
  */
 function book_node_view_link($node, $view_mode) {
   $links = array();
@@ -190,14 +195,22 @@
 }
 
 /**
- * Menu item access callback - determine if the outline tab is accessible.
+ * Access callback: Determines if the outline tab is accessible.
+ *
+ * @param $node
+ *   The node whose outline tab is to be viewed.
  */
 function _book_outline_access($node) {
   return user_access('administer book outlines') && node_access('view', $node);
 }
 
 /**
- * Menu item access callback - determine if the user can remove nodes from the outline.
+ * Access callback: Determines if the user can remove nodes from the outline.
+ *
+ * @param $node
+ *   The node to remove from the outline.
+ *
+ * @see book_menu()
  */
 function _book_outline_remove_access($node) {
   return isset($node->book) && ($node->book['bid'] != $node->nid) && _book_outline_access($node);
@@ -347,6 +360,9 @@
  *
  * This list may be used for generating a list of all the books, or for building
  * the options for a form select.
+ *
+ * @return
+ *   An array of all books.
  */
 function book_get_books() {
   $all_books = &drupal_static(__FUNCTION__);
@@ -381,7 +397,7 @@
 }
 
 /**
- * Implements hook_form_BASE_FORM_ID_alter().
+ * Implements hook_form_BASE_FORM_ID_alter() for node_form().
  *
  * Adds the book fieldset to the node form.
  *
@@ -412,7 +428,7 @@
 }
 
 /**
- * Submit handler to change a node's book.
+ * Form submission handler for node_form().
  *
  * This handler is run when JavaScript is disabled. It triggers the form to
  * rebuild so that the "Parent item" options are changed to reflect the newly
@@ -421,6 +437,7 @@
  * book_form_update() Ajax callback instead.
  *
  * @see book_form_update()
+ * @see book_form_node_form_alter()
  */
 function book_pick_book_nojs_submit($form, &$form_state) {
   $form_state['node']->book = $form_state['values']['book'];
@@ -428,11 +445,17 @@
 }
 
 /**
- * Build the parent selection form element for the node form or outline tab.
+ * Builds the parent selection form element for the node form or outline tab.
  *
  * This function is also called when generating a new set of options during the
- * Ajax callback, so an array is returned that can be used to replace an existing
- * form element.
+ * Ajax callback, so an array is returned that can be used to replace an
+ * existing form element.
+ *
+ * @param $book_link
+ *   A fully loaded menu link that is part of the book hierarchy.
+ *
+ * @return
+ *   A parent selection form element.
  */
 function _book_parent_select($book_link) {
   if (variable_get('menu_override_parent_selector', FALSE)) {
@@ -475,7 +498,10 @@
 }
 
 /**
- * Build the common elements of the book form for the node and outline forms.
+ * Builds the common elements of the book form for the node and outline forms.
+ *
+ * @param $node
+ *   The node whose form is being viewed.
  */
 function _book_add_form_elements(&$form, &$form_state, $node) {
   // If the form is being processed during the Ajax callback of our book bid
@@ -573,10 +599,17 @@
 }
 
 /**
- * Common helper function to handles additions and updates to the book outline.
- *
- * Performs all additions and updates to the book outline through node addition,
- * node editing, node deletion, or the outline tab.
+ * Handles additions and updates to the book outline.
+ *
+ * This common helper function performs all additions and updates to the book
+ * outline through node addition, node editing, node deletion, or the outline
+ * tab.
+ *
+ * @param $node
+ *   The node that is being saved, added, deleted, or moved.
+ *
+ * @return
+ *   TRUE if the menu link was saved; FALSE otherwise.
  */
 function _book_update_outline($node) {
   if (empty($node->book['bid'])) {
@@ -639,7 +672,7 @@
 }
 
 /**
- * Update the bid for a page and its children when it is moved to a new book.
+ * Updates the book ID of a page and its children when it moves to a new book.
  *
  * @param $book_link
  *   A fully loaded menu link that is part of the book hierarchy.
@@ -661,16 +694,17 @@
 }
 
 /**
- * Get the book menu tree for a page, and return it as a linear array.
+ * Gets the book menu tree for a page and returns it as a linear array.
  *
  * @param $book_link
  *   A fully loaded menu link that is part of the book hierarchy.
+ *
  * @return
  *   A linear array of menu links in the order that the links are shown in the
  *   menu, so the previous and next pages are the elements before and after the
- *   element corresponding to $node. The children of $node (if any) will come
- *   immediately after it in the array, and links will only be fetched as deep
- *   as one level deeper than $book_link.
+ *   element corresponding to the current node. The children of the current node
+ *   (if any) will come immediately after it in the array, and links will only
+ *   be fetched as deep as one level deeper than $book_link.
  */
 function book_get_flat_menu($book_link) {
   $flat = &drupal_static(__FUNCTION__, array());
@@ -686,7 +720,14 @@
 }
 
 /**
- * Recursive helper function for book_get_flat_menu().
+ * Recursively converts a tree of menu links to a flat array.
+ *
+ * @param $tree
+ *   A tree of menu links in an array.
+ * @param $flat
+ *   A flat array of the menu links from $tree.
+ *
+ * @see book_get_flat_menu().
  */
 function _book_flatten_menu($tree, &$flat) {
   foreach ($tree as $data) {
@@ -701,6 +742,13 @@
 
 /**
  * Fetches the menu link for the previous page of the book.
+ *
+ * @param $book_link
+ *   A fully loaded menu link that is part of the book hierarchy.
+ *
+ * @return
+ *   A fully loaded menu link for the page before the one represented in
+ *   $book_link.
  */
 function book_prev($book_link) {
   // If the parent is zero, we are at the start of a book.
@@ -736,6 +784,13 @@
 
 /**
  * Fetches the menu link for the next page of the book.
+ *
+ * @param $book_link
+ *   A fully loaded menu link that is part of the book hierarchy.
+ *
+ * @return
+ *   A fully loaded menu link for the page after the one represented in
+ *   $book_link.
  */
 function book_next($book_link) {
   $flat = book_get_flat_menu($book_link);
@@ -751,7 +806,13 @@
 }
 
 /**
- * Format the menu links for the child pages of the current page.
+ * Formats the menu links for the child pages of the current page.
+ *
+ * @param $book_link
+ *   A fully loaded menu link that is part of the book hierarchy.
+ *
+ * @return
+ *   HTML for the links to the child pages of the current page.
  */
 function book_children($book_link) {
   $flat = book_get_flat_menu($book_link);
@@ -780,7 +841,13 @@
 }
 
 /**
- * Generate the corresponding menu name from a book ID.
+ * Generates the corresponding menu name from a book ID.
+ *
+ * @param $bid
+ *   The book ID for which to make a menu name.
+ *
+ * @return
+ *   The menu name.
  */
 function book_menu_name($bid) {
   return 'book-toc-' . $bid;
@@ -820,7 +887,7 @@
 /**
  * Implements hook_page_alter().
  *
- * Add the book menu to the list of menus used to build the active trail when
+ * Adds the book menu to the list of menus used to build the active trail when
  * viewing a book page.
  */
 function book_page_alter(&$page) {
@@ -936,14 +1003,24 @@
 }
 
 /**
- * Find the depth limit for items in the parent select.
+ * Finds the depth limit for items in the parent select.
+ *
+ * @param $book_link
+ *   A fully loaded menu link that is part of the book hierarchy.
+ *
+ * @return
+ *   The depth limit for items in the parent select.
  */
 function _book_parent_depth_limit($book_link) {
   return MENU_MAX_DEPTH - 1 - (($book_link['mlid'] && $book_link['has_children']) ? menu_link_children_relative_depth($book_link) : 0);
 }
 
 /**
- * Form altering function for the confirm form for a single node deletion.
+ * Implements hook_form_FORM_ID_alter() for node_delete_confirm().
+ *
+ * Alters the confirm form for a single node deletion.
+ *
+ * @see node_delete_confirm()
  */
 function book_form_node_delete_confirm_alter(&$form, $form_state) {
   $node = node_load($form['nid']['#value']);
@@ -957,23 +1034,29 @@
 }
 
 /**
- * Return an array with default values for a book link.
+ * Returns an array with default values for a book page's menu link.
+ *
+ * @param $nid
+ *   The ID of the node whose menu link is being created.
+ *
+ * @return
+ *   The default values for the menu link.
  */
 function _book_link_defaults($nid) {
   return array('original_bid' => 0, 'menu_name' => '', 'nid' => $nid, 'bid' => 0, 'router_path' => 'node/%', 'plid' => 0, 'mlid' => 0, 'has_children' => 0, 'weight' => 0, 'module' => 'book', 'options' => array());
 }
 
 /**
- * Process variables for book-all-books-block.tpl.php.
- *
- * The $variables array contains the following arguments:
- * - $book_menus
- *
- * All non-renderable elements are removed so that the template has full
- * access to the structured data but can also simply iterate over all
- * elements and render them (as in the default template).
- *
- * @see book-navigation.tpl.php
+ * Processes variables for book-all-books-block.tpl.php.
+ *
+ * All non-renderable elements are removed so that the template has full access
+ * to the structured data but can also simply iterate over all elements and
+ * render them (as in the default template).
+ *
+ * The $variables array contains the following elements:
+ * - book_menus
+ *
+ * @see book-all-books-block.tpl.php
  */
 function template_preprocess_book_all_books_block(&$variables) {
   // Remove all non-renderable elements.
@@ -985,10 +1068,10 @@
 }
 
 /**
- * Process variables for book-navigation.tpl.php.
- *
- * The $variables array contains the following arguments:
- * - $book_link
+ * Processes variables for book-navigation.tpl.php.
+ *
+ * The $variables array contains the following elements:
+ * - book_link
  *
  * @see book-navigation.tpl.php
  */
@@ -1045,13 +1128,13 @@
 /**
  * Recursively processes and formats menu items for book_toc().
  *
- * This helper function recursively modifies the $toc array for each item in
- * $tree, ignoring items in the exclude array or at a depth greater than the
- * limit.  Truncates titles over thirty characters and appends an indentation
- * string incremented by depth.
+ * This helper function recursively modifies the table of contents array for
+ * each item in the menu tree, ignoring items in the exclude array or at a depth
+ * greater than the limit. Truncates titles over thirty characters and appends
+ * an indentation string incremented by depth.
  *
  * @param $tree
- *   The data structure of the book's menu tree.  Includes hidden links.
+ *   The data structure of the book's menu tree. Includes hidden links.
  * @param $indent
  *   A string appended to each menu item title. Increments by '--' per depth
  *   level.
@@ -1059,8 +1142,8 @@
  *   Reference to the table of contents array. This is modified in place, so the
  *   function does not have a return value.
  * @param $exclude
- *   Optional array of mlid values. Any link whose mlid is in this array will be
- *   excluded (along with its children).
+ *   Optional array of menu link ID values. Any link whose menu link ID is in
+ *   this array will be excluded (along with its children).
  * @param $depth_limit
  *   Any link deeper than this value will be excluded (along with its children).
  */
@@ -1088,10 +1171,12 @@
  * @param $depth_limit
  *   Any link deeper than this value will be excluded (along with its children).
  * @param $exclude
- *   Optional array of mlid values. Any link whose mlid is in this array
- *   will be excluded (along with its children).
- * @return
- *   An array of mlid, title pairs for use as options for selecting a book page.
+ *   Optional array of menu link ID values. Any link whose menu link ID is in
+ *   this array will be excluded (along with its children).
+ *
+ * @return
+ *   An array of (menu link ID, title) pairs for use as options for selecting a
+ *   book page.
  */
 function book_toc($bid, $depth_limit, $exclude = array()) {
   $tree = menu_tree_all_data(book_menu_name($bid));
@@ -1102,12 +1187,12 @@
 }
 
 /**
- * Process variables for book-export-html.tpl.php.
- *
- * The $variables array contains the following arguments:
- * - $title
- * - $contents
- * - $depth
+ * Processes variables for book-export-html.tpl.php.
+ *
+ * The $variables array contains the following elements:
+ * - title
+ * - contents
+ * - depth
  *
  * @see book-export-html.tpl.php
  */
@@ -1119,19 +1204,20 @@
   $variables['language'] = $language;
   $variables['language_rtl'] = ($language->direction == LANGUAGE_RTL);
   $variables['head'] = drupal_get_html_head();
-}
-
-/**
- * Traverse the book tree to build printable or exportable output.
- *
- * During the traversal, the $visit_func() callback is applied to each
- * node, and is called recursively for each child of the node (in weight,
- * title order).
+  $variables['dir'] = $language->direction ? 'rtl' : 'ltr';
+}
+
+/**
+ * Traverses the book tree to build printable or exportable output.
+ *
+ * During the traversal, the $visit_func() callback is applied to each node and
+ * is called recursively for each child of the node (in weight, title order).
  *
  * @param $tree
  *   A subtree of the book menu hierarchy, rooted at the current page.
  * @param $visit_func
  *   A function callback to be called upon visiting a node in the tree.
+ *
  * @return
  *   The output generated in visiting each node.
  */
@@ -1163,14 +1249,15 @@
 /**
  * Generates printer-friendly HTML for a node.
  *
- * @see book_export_traverse()
- *
  * @param $node
  *   The node that will be output.
  * @param $children
  *   All the rendered child nodes within the current node.
+ *
  * @return
  *   The HTML generated for the given node.
+ *
+ * @see book_export_traverse()
  */
 function book_node_export($node, $children = '') {
   $build = node_view($node, 'print');
@@ -1182,11 +1269,11 @@
 }
 
 /**
- * Process variables for book-node-export-html.tpl.php.
- *
- * The $variables array contains the following arguments:
- * - $node
- * - $children
+ * Processes variables for book-node-export-html.tpl.php.
+ *
+ * The $variables array contains the following elements:
+ * - node
+ * - children
  *
  * @see book-node-export-html.tpl.php
  */
@@ -1206,8 +1293,8 @@
 /**
  * Implements hook_node_type_update().
  *
- * Update book module's persistent variables if the machine-readable name of a
- * node type is changed.
+ * Updates the Book module's persistent variables if the machine-readable name
+ * of a node type is changed.
  */
 function book_node_type_update($type) {
   if (!empty($type->old_type) && $type->old_type != $type->type) {
@@ -1229,9 +1316,18 @@
 }
 
 /**
+ * Gets a book menu link by its menu link ID.
+ *
  * Like menu_link_load(), but adds additional data from the {book} table.
  *
  * Do not call when loading a node, since this function may call node_load().
+ *
+ * @param $mlid
+ *   The menu link ID of the menu item.
+ *
+ * @return
+ *   A menu link, with the link translated for rendering and data added from the
+ *   {book} table.
  */
 function book_link_load($mlid) {
   if ($item = db_query("SELECT * FROM {menu_links} ml INNER JOIN {book} b ON b.mlid = ml.mlid LEFT JOIN {menu_router} m ON m.path = ml.router_path WHERE ml.mlid = :mlid", array(
@@ -1245,13 +1341,15 @@
 }
 
 /**
- * Get the data representing a subtree of the book hierarchy.
+ * Gets the data representing a subtree of the book hierarchy.
  *
  * The root of the subtree will be the link passed as a parameter, so the
- * returned tree will contain this item and all its descendents in the menu tree.
+ * returned tree will contain this item and all its descendents in the menu
+ * tree.
  *
  * @param $link
  *   A fully loaded menu link.
+ *
  * @return
  *   An subtree of menu links in an array, in the order they should be rendered.
  */

Modified: branches/upstream/current-7/modules/book/book.pages.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/book/book.pages.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/book/book.pages.inc (original)
+++ branches/upstream/current-7/modules/book/book.pages.inc Thu May 10 18:20:18 2012
@@ -6,7 +6,7 @@
  */
 
 /**
- * Menu callback; prints a listing of all books.
+ * Menu callback: Prints a listing of all books.
  */
 function book_render() {
   $book_list = array();
@@ -18,25 +18,24 @@
 }
 
 /**
- * Menu callback; Generates various representation of a book page and its children.
- *
- * The function delegates the generation of output to helper functions.
- * The function name is derived by prepending 'book_export_' to the
- * given output type. So, e.g., a type of 'html' results in a call to
- * the function book_export_html().
+ * Menu callback; Generates representations of a book page and its children.
+ *
+ * The function delegates the generation of output to helper functions. The
+ * function name is derived by prepending 'book_export_' to the given output
+ * type. So, e.g., a type of 'html' results in a call to the function
+ * book_export_html().
  *
  * @param $type
- *   A string encoding the type of output requested. The following
- *   types are currently supported in book module:
- *
- *   - html: HTML (printer friendly output)
- *
+ *   A string encoding the type of output requested. The following types are
+ *   currently supported in book module:
+ *   - html: Printer-friendly HTML.
  *   Other types may be supported in contributed modules.
  * @param $nid
  *   An integer representing the node id (nid) of the node to export
+ *
  * @return
- *   A string representing the node and its children in the book hierarchy
- *   in a format determined by the $type parameter.
+ *   A string representing the node and its children in the book hierarchy in a
+ *   format determined by the $type parameter.
  */
 function book_export($type, $nid) {
   $type = drupal_strtolower($type);
@@ -53,18 +52,18 @@
 }
 
 /**
- * This function is called by book_export() to generate HTML for export.
- *
- * The given node is /embedded to its absolute depth in a top level
- * section/. For example, a child node with depth 2 in the hierarchy
- * is contained in (otherwise empty) <div> elements
- * corresponding to depth 0 and depth 1. This is intended to support
- * WYSIWYG output - e.g., level 3 sections always look like level 3
- * sections, no matter their depth relative to the node selected to be
- * exported as printer-friendly HTML.
+ * Generates HTML for export when invoked by book_export().
+ *
+ * The given node is embedded to its absolute depth in a top level section. For
+ * example, a child node with depth 2 in the hierarchy is contained in
+ * (otherwise empty) <div> elements corresponding to depth 0 and depth 1.
+ * This is intended to support WYSIWYG output - e.g., level 3 sections always
+ * look like level 3 sections, no matter their depth relative to the node
+ * selected to be exported as printer-friendly HTML.
  *
  * @param $nid
  *   An integer representing the node id (nid) of the node to export.
+ *
  * @return
  *   A string containing HTML representing the node and its children in
  *   the book hierarchy.
@@ -88,7 +87,10 @@
 }
 
 /**
- * Menu callback; show the outline form for a single node.
+ * Menu callback: Shows the outline form for a single node.
+ *
+ * @param $node
+ *   The book node for which to show the outline.
  */
 function book_outline($node) {
   drupal_set_title($node->title);
@@ -96,11 +98,15 @@
 }
 
 /**
- * Build the form to handle all book outline operations via the outline tab.
+ * Form constructor for the book outline form.
+ *
+ * Allows handling of all book outline operations via the outline tab.
+ *
+ * @param $node
+ *   The book node for which to show the outline.
  *
  * @see book_outline_form_submit()
  * @see book_remove_button_submit()
- *
  * @ingroup forms
  */
 function book_outline_form($form, &$form_state, $node) {
@@ -140,18 +146,20 @@
 }
 
 /**
- * Button submit function to redirect to removal confirm form.
- *
- * @see book_outline_form()
+ * Form submission handler for book_outline_form().
+ *
+ * Redirects to removal confirmation form.
+ *
+ * @see book_outline_form_submit()
  */
 function book_remove_button_submit($form, &$form_state) {
   $form_state['redirect'] = 'node/' . $form['#node']->nid . '/outline/remove';
 }
 
 /**
- * Handles book outline form submissions from the outline tab.
- *
- * @see book_outline_form()
+ * Form submission handler for book_outline_form().
+ *
+ * @see book_remove_button_submit()
  */
 function book_outline_form_submit($form, &$form_state) {
   $node = $form['#node'];
@@ -181,10 +189,12 @@
 }
 
 /**
- * Menu callback; builds a form to confirm removal of a node from the book.
+ * Form constructor to confirm removal of a node from a book.
+ *
+ * @param $node
+ *   The node to delete.
  *
  * @see book_remove_form_submit()
- *
  * @ingroup forms
  */
 function book_remove_form($form, &$form_state, $node) {
@@ -202,9 +212,7 @@
 }
 
 /**
- * Confirm form submit function to remove a node from the book.
- *
- * @see book_remove_form()
+ * Form submission handler for book_remove_form().
  */
 function book_remove_form_submit($form, &$form_state) {
   $node = $form['#node'];

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/color.info (original)
+++ branches/upstream/current-7/modules/color/color.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 files[] = color.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/color/color.module (original)
+++ branches/upstream/current-7/modules/color/color.module Thu May 10 18:20:18 2012
@@ -11,7 +11,7 @@
   switch ($path) {
     case 'admin/help#color':
       $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Color module allows users with the <em>Administer site configuration</em> permission to quickly and easily change the color scheme of themes that have been built to be compatible with it. For more information, see the online handbook entry for <a href="@color">Color module</a>.', array('@color' => 'http://drupal.org/handbook/modules/color')) . '</p>';
+      $output .= '<p>' . t('The Color module allows users with the <em>Administer site configuration</em> permission to quickly and easily change the color scheme of themes that have been built to be compatible with it. For more information, see the online handbook entry for <a href="@color">Color module</a>.', array('@color' => 'http://drupal.org/documentation/modules/color')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Changing colors') . '</dt>';

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/comment/comment.info (original)
+++ branches/upstream/current-7/modules/comment/comment.info Thu May 10 18:20:18 2012
@@ -9,8 +9,8 @@
 configure = admin/content/comment
 stylesheets[all][] = comment.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/comment/comment.module (original)
+++ branches/upstream/current-7/modules/comment/comment.module Thu May 10 18:20:18 2012
@@ -76,7 +76,7 @@
   switch ($path) {
     case 'admin/help#comment':
       $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Comment module allows users to comment on site content, set commenting defaults and permissions, and moderate comments. For more information, see the online handbook entry for <a href="@comment">Comment module</a>.', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) . '</p>';
+      $output .= '<p>' . t('The Comment module allows users to comment on site content, set commenting defaults and permissions, and moderate comments. For more information, see the online handbook entry for <a href="@comment">Comment module</a>.', array('@comment' => 'http://drupal.org/documentation/modules/comment/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Default and custom settings') . '</dt>';
@@ -1499,8 +1499,11 @@
         $max = db_query('SELECT MAX(thread) FROM {comment} WHERE nid = :nid', array(':nid' => $comment->nid))->fetchField();
         // Strip the "/" from the end of the thread.
         $max = rtrim($max, '/');
+        // We need to get the value at the correct depth.
+        $parts = explode('.', $max);
+        $firstsegment = $parts[0];
         // Finally, build the thread field for this new comment.
-        $thread = int2vancode(vancode2int($max) + 1) . '/';
+        $thread = int2vancode(vancode2int($firstsegment) + 1) . '/';
       }
       else {
         // This is a comment with a parent comment, so increase the part of the
@@ -2062,6 +2065,9 @@
     if (!empty($account->uid)) {
       $comment->uid = $account->uid;
       $comment->name = check_plain($account->name);
+      $comment->signature = $account->signature;
+      $comment->signature_format = $account->signature_format;
+      $comment->picture = $account->picture;
     }
     elseif (empty($comment->name)) {
       $comment->name = variable_get('anonymous', t('Anonymous'));

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/comment/comment.test (original)
+++ branches/upstream/current-7/modules/comment/comment.test Thu May 10 18:20:18 2012
@@ -956,8 +956,18 @@
     $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.'));
     $this->drupalLogout();
 
-    // As web user, fill in node creation form and preview node.
+    // Login as web user and add a signature and a user picture.
     $this->drupalLogin($this->web_user);
+    variable_set('user_signatures', 1);
+    variable_set('user_pictures', 1);
+    $test_signature = $this->randomName();
+    $edit['signature[value]'] = '<a href="http://example.com/">' . $test_signature. '</a>';
+    $edit['signature[format]'] = 'filtered_html';
+    $image = current($this->drupalGetTestFiles('image'));
+    $edit['files[picture_upload]'] = drupal_realpath($image->uri);
+    $this->drupalPost('user/' . $this->web_user->uid . '/edit', $edit, t('Save'));
+
+    // As the web user, fill in the comment form and preview the comment.
     $edit = array();
     $edit['subject'] = $this->randomName(8);
     $edit['comment_body[' . $langcode . '][0][value]'] = $this->randomName(16);
@@ -971,6 +981,12 @@
     // Check that the title and body fields are displayed with the correct values.
     $this->assertFieldByName('subject', $edit['subject'], t('Subject field displayed.'));
     $this->assertFieldByName('comment_body[' . $langcode . '][0][value]', $edit['comment_body[' . $langcode . '][0][value]'], t('Comment field displayed.'));
+
+    // Check that the signature is displaying with the correct text format.
+    $this->assertLink($test_signature);
+
+    // Check that the user picture is displayed.
+    $this->assertFieldByXPath("//div[contains(@class, 'comment-preview')]//div[contains(@class, 'user-picture')]//img", NULL, 'User picture displayed.');
   }
 
   /**
@@ -2085,3 +2101,98 @@
     $this->drupalPost('node/' . $this->node->nid, $edit, t('Save'));
   }
 }
+
+/**
+ * Tests comment threading.
+ */
+class CommentThreadingTestCase extends CommentHelperCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Comment Threading',
+      'description' => 'Test to make sure the comment number increments properly.',
+      'group' => 'Comment',
+    );
+  }
+
+  /**
+   * Tests the comment threading.
+   */
+  function testCommentThreading() {
+    $langcode = LANGUAGE_NONE;
+    // Set comments to have a subject with preview disabled.
+    $this->drupalLogin($this->admin_user);
+    $this->setCommentPreview(DRUPAL_DISABLED);
+    $this->setCommentForm(TRUE);
+    $this->setCommentSubject(TRUE);
+    $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, t('Comment paging changed.'));
+    $this->drupalLogout();
+
+    // Create a node.
+    $this->drupalLogin($this->web_user);
+    $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'uid' => $this->web_user->uid));
+
+    // Post comment #1.
+    $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), 'Comment #1. Comment found.');
+    $this->assertEqual($comment_loaded->thread, '01/');
+
+    // Reply to comment #1 creating comment #2.
+    $this->drupalLogin($this->web_user);
+    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+    $reply = $this->postComment(NULL, $this->randomName(), '', TRUE);
+    $reply_loaded = comment_load($reply->id);
+    $this->assertTrue($this->commentExists($reply, TRUE), 'Comment #2. Reply found.');
+    $this->assertEqual($reply_loaded->thread, '01.00/');
+
+    // Reply to comment #2 creating comment #3.
+    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $reply->id);
+    $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
+    $reply_loaded = comment_load($reply->id);
+    $this->assertTrue($this->commentExists($reply, TRUE), 'Comment #3. Second reply found.');
+    $this->assertEqual($reply_loaded->thread, '01.00.00/');
+
+    // Reply to comment #1 creating comment #4.
+    $this->drupalLogin($this->web_user);
+    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+    $reply = $this->postComment(NULL, $this->randomName(), '', TRUE);
+    $reply_loaded = comment_load($reply->id);
+    $this->assertTrue($this->commentExists($comment), 'Comment #4. Third reply found.');
+    $this->assertEqual($reply_loaded->thread, '01.01/');
+
+    // Post comment #2 overall comment #5.
+    $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), 'Comment #5. Second comment found.');
+    $this->assertEqual($comment_loaded->thread, '02/');
+
+    // Reply to comment #5 creating comment #6.
+    $this->drupalLogin($this->web_user);
+    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+    $reply = $this->postComment(NULL, $this->randomName(), '', TRUE);
+    $reply_loaded = comment_load($reply->id);
+    $this->assertTrue($this->commentExists($reply, TRUE), 'Comment #6. Reply found.');
+    $this->assertEqual($reply_loaded->thread, '02.00/');
+
+    // Reply to comment #6 creating comment #7.
+    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $reply->id);
+    $reply = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
+    $reply_loaded = comment_load($reply->id);
+    $this->assertTrue($this->commentExists($reply, TRUE), 'Comment #7. Second reply found.');
+    $this->assertEqual($reply_loaded->thread, '02.00.00/');
+
+    // Reply to comment #5 creating comment #8.
+    $this->drupalLogin($this->web_user);
+    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+    $reply = $this->postComment(NULL, $this->randomName(), '', TRUE);
+    $reply_loaded = comment_load($reply->id);
+    $this->assertTrue($this->commentExists($comment), 'Comment #8. Third reply found.');
+    $this->assertEqual($reply_loaded->thread, '02.01/');
+  }
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contact/contact.info (original)
+++ branches/upstream/current-7/modules/contact/contact.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = contact.test
 configure = admin/structure/contact
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contact/contact.module (original)
+++ branches/upstream/current-7/modules/contact/contact.module Thu May 10 18:20:18 2012
@@ -13,7 +13,7 @@
     case 'admin/help#contact':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Contact module allows visitors to contact site administrators and other users. Users specify a subject, write their message, and can have a copy of their message sent to their own e-mail address. For more information, see the online handbook entry for <a href="@contact">Contact module</a>.', array('@contact' => 'http://drupal.org/handbook/modules/contact/')) . '</p>';
+      $output .= '<p>' . t('The Contact module allows visitors to contact site administrators and other users. Users specify a subject, write their message, and can have a copy of their message sent to their own e-mail address. For more information, see the online handbook entry for <a href="@contact">Contact module</a>.', array('@contact' => 'http://drupal.org/documentation/modules/contact/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('User contact forms') . '</dt>';

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contextual/contextual.info (original)
+++ branches/upstream/current-7/modules/contextual/contextual.info Thu May 10 18:20:18 2012
@@ -3,9 +3,10 @@
 package = Core
 version = VERSION
 core = 7.x
+files[] = contextual.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/contextual/contextual.module (original)
+++ branches/upstream/current-7/modules/contextual/contextual.module Thu May 10 18:20:18 2012
@@ -13,7 +13,7 @@
     case 'admin/help#contextual':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Contextual links module displays links related to regions of pages on your site to users with <em>access contextual links</em> permission. For more information, see the online handbook entry for <a href="@contextual">Contextual links module</a>.', array('@contextual' => 'http://drupal.org/handbook/modules/contextual')) . '</p>';
+      $output .= '<p>' . t('The Contextual links module displays links related to regions of pages on your site to users with <em>access contextual links</em> permission. For more information, see the online handbook entry for <a href="@contextual">Contextual links module</a>.', array('@contextual' => 'http://drupal.org/documentation/modules/contextual')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Displaying contextual links') . '</dt>';

Added: branches/upstream/current-7/modules/contextual/contextual.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/contextual/contextual.test?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/contextual/contextual.test (added)
+++ branches/upstream/current-7/modules/contextual/contextual.test Thu May 10 18:20:18 2012
@@ -1,0 +1,49 @@
+<?php
+
+/**
+ * @file
+ * Tests for contextual.module.
+ */
+
+/**
+ * Tests accessible links after inaccessible links on dynamic context.
+ */
+class ContextualDynamicContextTestCase extends DrupalWebTestCase {
+  protected $profile = 'testing';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Contextual links on node lists',
+      'description' => 'Tests if contextual links are showing on the front page depending on permissions.',
+      'group' => 'Contextual',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('contextual', 'node'));
+    $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
+    $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
+    $web_user = $this->drupalCreateUser(array('access content', 'access contextual links', 'edit any article content'));
+    $this->drupalLogin($web_user);
+  }
+
+  /**
+   * Tests contextual links on node lists with different permissions.
+   */
+  function testNodeLinks() {
+    // Create three nodes in the following order:
+    // - An article, which should be user-editable.
+    // - A page, which should not be user-editable.
+    // - A second article, which should also be user-editable.
+    $node1 = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
+    $node2 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 1));
+    $node3 = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1));
+
+    // Now, on the front page, all article nodes should have contextual edit
+    // links. The page node in between should not.
+    $this->drupalGet('node');
+    $this->assertRaw('node/' . $node1->nid . '/edit', 'Edit link for oldest article node showing.');
+    $this->assertNoRaw('node/' . $node2->nid . '/edit', 'No edit link for page nodes.');
+    $this->assertRaw('node/' . $node3->nid . '/edit', 'Edit link for most recent article node showing.');
+  }
+}

Modified: branches/upstream/current-7/modules/dashboard/dashboard-rtl.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dashboard/dashboard-rtl.css?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dashboard/dashboard-rtl.css (original)
+++ branches/upstream/current-7/modules/dashboard/dashboard-rtl.css Thu May 10 18:20:18 2012
@@ -1,3 +1,8 @@
+/**
+ * @file
+ * Right-to-left specific stylesheet for the Dashboard module.
+ */
+
 #dashboard div.dashboard-region {
   float: right;
 }

Modified: branches/upstream/current-7/modules/dashboard/dashboard.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dashboard/dashboard.api.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dashboard/dashboard.api.php (original)
+++ branches/upstream/current-7/modules/dashboard/dashboard.api.php Thu May 10 18:20:18 2012
@@ -11,7 +11,7 @@
  */
 
 /**
- * Adds regions to the dashboard.
+ * Add regions to the dashboard.
  *
  * @return
  *   An array whose keys are the names of the dashboard regions and whose

Modified: branches/upstream/current-7/modules/dashboard/dashboard.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dashboard/dashboard.css?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dashboard/dashboard.css (original)
+++ branches/upstream/current-7/modules/dashboard/dashboard.css Thu May 10 18:20:18 2012
@@ -1,3 +1,7 @@
+/**
+ * @file
+ * Stylesheet for the Dashboard module.
+ */
 
 #dashboard div.dashboard-region {
   float: left;

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dashboard/dashboard.info (original)
+++ branches/upstream/current-7/modules/dashboard/dashboard.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 dependencies[] = block
 configure = admin/dashboard/customize
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/dashboard/dashboard.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dashboard/dashboard.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dashboard/dashboard.js (original)
+++ branches/upstream/current-7/modules/dashboard/dashboard.js Thu May 10 18:20:18 2012
@@ -1,7 +1,12 @@
+/**
+ * @file
+ * Attaches behaviors for the Dashboard module.
+ */
+
 (function ($) {
 
 /**
- * Implementation of Drupal.behaviors for dashboard.
+ * Implements Drupal.behaviors for the Dashboard module.
  */
 Drupal.behaviors.dashboard = {
     attach: function (context, settings) {
@@ -39,7 +44,7 @@
   },
 
   /**
-   * Enter "customize" mode by displaying disabled blocks.
+   * Enters "customize" mode by displaying disabled blocks.
    */
   enterCustomizeMode: function () {
     $('#dashboard').addClass('customize-mode customize-inactive');
@@ -51,7 +56,7 @@
   },
 
   /**
-   * Exit "customize" mode by simply forcing a page refresh.
+   * Exits "customize" mode by simply forcing a page refresh.
    */
   exitCustomizeMode: function () {
     $('#dashboard').removeClass('customize-mode customize-inactive');
@@ -60,7 +65,7 @@
   },
 
   /**
-   * Helper for enterCustomizeMode; sets up drag-and-drop and close button.
+   * Sets up the drag-and-drop behavior and the 'close' button.
    */
   setupDrawer: function () {
     $('div.customize .canvas-content input').click(Drupal.behaviors.dashboard.exitCustomizeMode);
@@ -84,7 +89,7 @@
   },
 
   /**
-   * While dragging, make the block appear as a disabled block
+   * Makes the block appear as a disabled block while dragging.
    *
    * This function is called on the jQuery UI Sortable "start" event.
    *
@@ -104,8 +109,7 @@
   },
 
   /**
-   * While dragging, adapt block's width to the width of the region it is moved
-   * into.
+   * Adapts block's width to the region it is moved into while dragging.
    *
    * This function is called on the jQuery UI Sortable "over" event.
    *
@@ -127,8 +131,7 @@
   },
 
   /**
-   * While dragging, adapt block's position to stay connected with the position
-   * of the mouse pointer.
+   * Adapts a block's position to stay connected with the mouse pointer.
    *
    * This function is called on the jQuery UI Sortable "sort" event.
    *
@@ -146,7 +149,7 @@
   },
 
   /**
-   * Send block order to the server, and expand previously disabled blocks.
+   * Sends block order to the server, and expand previously disabled blocks.
    *
    * This function is called on the jQuery UI Sortable "update" event.
    *
@@ -198,8 +201,10 @@
   },
 
   /**
-   * Return the current order of the blocks in each of the sortable regions,
-   * in query string format.
+   * Returns the current order of the blocks in each of the sortable regions.
+   *
+   * @return
+   *   The current order of the blocks, in query string format.
    */
   getOrder: function () {
     var order = [];

Modified: branches/upstream/current-7/modules/dashboard/dashboard.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dashboard/dashboard.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dashboard/dashboard.module (original)
+++ branches/upstream/current-7/modules/dashboard/dashboard.module Thu May 10 18:20:18 2012
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * Provides a dashboard page in the administrative interface.
+ */
 
 /**
  * Implements hook_help().
@@ -8,7 +12,7 @@
     case 'admin/help#dashboard':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Dashboard module provides a <a href="@dashboard">Dashboard page</a> in the administrative interface for organizing administrative tasks and navigation, and tracking information within your site. The Dashboard page contains blocks, which you can add to and arrange using the drag-and-drop interface that appears when you click on the <em>Customize dashboard</em> link. Within this interface, blocks that are not primarily used for site administration do not appear by default, but can be added via the <em>Add other blocks</em> link. For more information, see the online handbook entry for <a href="@handbook">Dashboard module</a>.', array('@handbook' => 'http://drupal.org/handbook/modules/dashboard', '@dashboard' => url('admin/dashboard'))) . '</p>';
+      $output .= '<p>' . t('The Dashboard module provides a <a href="@dashboard">Dashboard page</a> in the administrative interface for organizing administrative tasks and navigation, and tracking information within your site. The Dashboard page contains blocks, which you can add to and arrange using the drag-and-drop interface that appears when you click on the <em>Customize dashboard</em> link. Within this interface, blocks that are not primarily used for site administration do not appear by default, but can be added via the <em>Add other blocks</em> link. For more information, see the online handbook entry for <a href="@handbook">Dashboard module</a>.', array('@handbook' => 'http://drupal.org/documentation/modules/dashboard', '@dashboard' => url('admin/dashboard'))) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Tracking user activity') . '</dt>';
@@ -263,7 +267,7 @@
 }
 
 /**
- * Dashboard page callback.
+ * Page callback: Displays the dashboard.
  *
  * @param $launch_customize
  *   Whether to launch in customization mode right away. TRUE or FALSE.
@@ -298,7 +302,7 @@
 }
 
 /**
- * Menu page callback: builds the page for administering dashboard blocks.
+ * Page callback: Builds the page for administering dashboard blocks.
  *
  * This page reuses the Block module's administration form but limits editing
  * to blocks that are available to appear on the dashboard.
@@ -454,7 +458,7 @@
 }
 
 /**
- * Return an array of dashboard region descriptions, keyed by region name.
+ * Returns an array of dashboard region descriptions, keyed by region name.
  */
 function dashboard_region_descriptions() {
   $regions = module_invoke_all('dashboard_regions');
@@ -463,7 +467,7 @@
 }
 
 /**
- * Return an array of dashboard region names.
+ * Returns an array of dashboard region names.
  */
 function dashboard_regions() {
   $regions = &drupal_static(__FUNCTION__);
@@ -485,7 +489,7 @@
 }
 
 /**
- * Ajax callback to show disabled blocks in the dashboard customization mode.
+ * Ajax callback: Shows disabled blocks in the dashboard customization mode.
  */
 function dashboard_show_disabled() {
   global $theme_key;
@@ -506,7 +510,7 @@
 }
 
 /**
- * Ajax callback to display the rendered contents of a specific block.
+ * Ajax callback: Displays the rendered contents of a specific block.
  *
  * @param $module
  *   The block's module name.
@@ -534,7 +538,7 @@
 }
 
 /**
- * Set the new weight of each region according to the drag-and-drop order.
+ * Sets the new weight of each region according to the drag-and-drop order.
  */
 function dashboard_update() {
   drupal_theme_initialize();
@@ -631,7 +635,7 @@
 }
 
 /**
- * Returns HTML for a set of disabled blocks, for display in dashboard customization mode.
+ * Returns HTML for disabled blocks, for use in dashboard customization mode.
  *
  * @param $variables
  *   An associative array containing:
@@ -653,7 +657,7 @@
 }
 
 /**
- * Returns HTML for a disabled block, for display in dashboard customization mode.
+ * Returns HTML for disabled blocks, for use in dashboard customization mode.
  *
  * @param $variables
  *   An associative array containing:

Modified: branches/upstream/current-7/modules/dashboard/dashboard.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dashboard/dashboard.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dashboard/dashboard.test (original)
+++ branches/upstream/current-7/modules/dashboard/dashboard.test Thu May 10 18:20:18 2012
@@ -5,6 +5,9 @@
  * Tests for dashboard.module.
  */
 
+/**
+ * Tests the Dashboard module blocks.
+ */
 class DashboardBlocksTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
@@ -33,7 +36,7 @@
   }
 
   /**
-   * Test adding a block to the dashboard and checking access to it.
+   * Tests adding a block to the dashboard and checking access to it.
    */
   function testDashboardAccess() {
     // Add a new custom block to a dashboard region.
@@ -58,7 +61,7 @@
   }
 
   /**
-   * Test that dashboard regions are displayed or hidden properly.
+   * Tests that dashboard regions are displayed or hidden properly.
    */
   function testDashboardRegions() {
     $dashboard_regions = dashboard_region_descriptions();
@@ -80,8 +83,7 @@
   }
 
   /**
-   * Test that the dashboard module can be disabled and enabled again,
-   * retaining its blocks.
+   * Tests that the dashboard module can be re-enabled, retaining its blocks.
    */
   function testDisableEnable() {
     // Add a new custom block to a dashboard region.
@@ -113,8 +115,7 @@
   }
 
   /**
-   * Test that defining a block with ['properties']['administrative'] = TRUE
-   * adds it as an available block for the dashboard.
+   * Tests that administrative blocks are available for the dashboard.
    */
   function testBlockAvailability() {
     // Test "Recent comments", which should be available (defined as

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dblog/dblog.info (original)
+++ branches/upstream/current-7/modules/dblog/dblog.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 files[] = dblog.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/dblog/dblog.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dblog/dblog.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dblog/dblog.module (original)
+++ branches/upstream/current-7/modules/dblog/dblog.module Thu May 10 18:20:18 2012
@@ -19,7 +19,7 @@
     case 'admin/help#dblog':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Database logging module logs system events in the Drupal database. For more information, see the online handbook entry for the <a href="@dblog">Database logging module</a>.', array('@dblog' => 'http://drupal.org/handbook/modules/dblog')) . '</p>';
+      $output .= '<p>' . t('The Database logging module logs system events in the Drupal database. For more information, see the online handbook entry for the <a href="@dblog">Database logging module</a>.', array('@dblog' => 'http://drupal.org/documentation/modules/dblog')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Monitoring your site') . '</dt>';
@@ -138,12 +138,9 @@
  * Note some values may be truncated for database column size restrictions.
  */
 function dblog_watchdog(array $log_entry) {
-  // The user object may not exist in all conditions, so 0 is substituted if needed.
-  $user_uid = isset($log_entry['user']->uid) ? $log_entry['user']->uid : 0;
-
   Database::getConnection('default', 'default')->insert('watchdog')
     ->fields(array(
-      'uid' => $user_uid,
+      'uid' => $log_entry['uid'],
       'type' => substr($log_entry['type'], 0, 64),
       'message' => $log_entry['message'],
       'variables' => serialize($log_entry['variables']),

Modified: branches/upstream/current-7/modules/dblog/dblog.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/dblog/dblog.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/dblog/dblog.test (original)
+++ branches/upstream/current-7/modules/dblog/dblog.test Thu May 10 18:20:18 2012
@@ -105,6 +105,7 @@
       'severity'    => $severity,
       'link'        => NULL,
       'user'        => $this->big_user,
+      'uid'         => isset($this->big_user->uid) ? $this->big_user->uid : 0,
       'request_uri' => $base_root . request_uri(),
       'referer'     => $_SERVER['HTTP_REFERER'],
       'ip'          => ip_address(),
@@ -387,6 +388,7 @@
       'severity'    => WATCHDOG_NOTICE,
       'link'        => NULL,
       'user'        => $this->big_user,
+      'uid'         => isset($this->big_user->uid) ? $this->big_user->uid : 0,
       'request_uri' => $base_root . request_uri(),
       'referer'     => $_SERVER['HTTP_REFERER'],
       'ip'          => ip_address(),

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.api.php (original)
+++ branches/upstream/current-7/modules/field/field.api.php Thu May 10 18:20:18 2012
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * @ingroup hooks
+ * @addtogroup hooks
  * @{
  */
 
@@ -83,35 +83,19 @@
 /**
  * @defgroup field_types Field Types API
  * @{
- * Define field types, widget types, display formatter types, storage types.
- *
- * The bulk of the Field Types API are related to field types. A field type
- * represents a particular type of data (integer, string, date, etc.) that
- * can be attached to a fieldable entity. hook_field_info() defines the basic
- * properties of a field type, and a variety of other field hooks are called by
- * the Field Attach API to perform field-type-specific actions.
- *
- * @see hook_field_info()
- * @see hook_field_info_alter()
- * @see hook_field_schema()
- * @see hook_field_load()
- * @see hook_field_validate()
- * @see hook_field_presave()
- * @see hook_field_insert()
- * @see hook_field_update()
- * @see hook_field_delete()
- * @see hook_field_delete_revision()
- * @see hook_field_prepare_view()
- * @see hook_field_is_empty()
+ * Define field types.
+ *
+ * In the Field API, each field has a type, which determines what kind of data
+ * (integer, string, date, etc.) the field can hold, which settings it provides,
+ * and so on. The data type(s) accepted by a field are defined in
+ * hook_field_schema(); other basic properties of a field are defined in
+ * hook_field_info(). The other hooks below are called by the Field Attach API
+ * to perform field-type-specific actions.
  *
  * The Field Types API also defines two kinds of pluggable handlers: widgets
- * and formatters, which specify how the field appears in edit forms and in
- * displayed entities. Widgets and formatters can be implemented by a field-type
- * module for its own field types, or by a third-party module to extend the
- * behavior of existing field types.
- *
- * @see hook_field_widget_info()
- * @see hook_field_formatter_info()
+ * and formatters. @link field_widget Widgets @endlink specify how the field
+ * appears in edit forms, while @link field_formatter formatters @endlink
+ * specify how the field appears in displayed entities.
  *
  * A third kind of pluggable handlers, storage backends, is defined by the
  * @link field_storage Field Storage API @endlink.
@@ -442,9 +426,14 @@
 }
 
 /**
- * Define custom insert behavior for this module's field types.
- *
- * Invoked from field_attach_insert().
+ * Define custom insert behavior for this module's field data.
+ *
+ * This hook is invoked from field_attach_insert() on the module that defines a
+ * field, during the process of inserting an entity object (node, taxonomy term,
+ * etc.). It is invoked just before the data for this field on the particular
+ * entity object is inserted into field storage. Only field modules that are
+ * storing or tracking information outside the standard field storage mechanism
+ * need to implement this hook.
  *
  * @param $entity_type
  *   The type of $entity.
@@ -458,6 +447,9 @@
  *   The language associated with $items.
  * @param $items
  *   $entity->{$field['field_name']}[$langcode], or an empty array if unset.
+ *
+ * @see hook_field_update()
+ * @see hook_field_delete()
  */
 function hook_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
   if (variable_get('taxonomy_maintain_index_table', TRUE) && $field['storage']['type'] == 'field_sql_storage' && $entity_type == 'node' && $entity->status) {
@@ -475,9 +467,14 @@
 }
 
 /**
- * Define custom update behavior for this module's field types.
- *
- * Invoked from field_attach_update().
+ * Define custom update behavior for this module's field data.
+ *
+ * This hook is invoked from field_attach_update() on the module that defines a
+ * field, during the process of updating an entity object (node, taxonomy term,
+ * etc.). It is invoked just before the data for this field on the particular
+ * entity object is updated into field storage. Only field modules that are
+ * storing or tracking information outside the standard field storage mechanism
+ * need to implement this hook.
  *
  * @param $entity_type
  *   The type of $entity.
@@ -491,6 +488,9 @@
  *   The language associated with $items.
  * @param $items
  *   $entity->{$field['field_name']}[$langcode], or an empty array if unset.
+ *
+ * @see hook_field_insert()
+ * @see hook_field_delete()
  */
 function hook_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') {
@@ -556,10 +556,14 @@
 }
 
 /**
- * Define custom delete behavior for this module's field types.
- *
- * This hook is invoked just before the data is deleted from field storage
- * in field_attach_delete().
+ * Define custom delete behavior for this module's field data.
+ *
+ * This hook is invoked from field_attach_delete() on the module that defines a
+ * field, during the process of deleting an entity object (node, taxonomy term,
+ * etc.). It is invoked just before the data for this field on the particular
+ * entity object is deleted from field storage. Only field modules that are
+ * storing or tracking information outside the standard field storage mechanism
+ * need to implement this hook.
  *
  * @param $entity_type
  *   The type of $entity.
@@ -573,6 +577,9 @@
  *   The language associated with $items.
  * @param $items
  *   $entity->{$field['field_name']}[$langcode], or an empty array if unset.
+ *
+ * @see hook_field_insert()
+ * @see hook_field_update()
  */
 function hook_field_delete($entity_type, $entity, $field, $instance, $langcode, &$items) {
   list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
@@ -583,7 +590,7 @@
     // be counted in hook_file_references().
     $item['file_field_type'] = $entity_type;
     $item['file_field_id'] = $id;
-    file_field_delete_file($item, $field);
+    file_field_delete_file($item, $field, $entity_type, $id);
   }
 }
 
@@ -608,10 +615,11 @@
  *   $entity->{$field['field_name']}[$langcode], or an empty array if unset.
  */
 function hook_field_delete_revision($entity_type, $entity, $field, $instance, $langcode, &$items) {
+  list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
   foreach ($items as $delta => $item) {
     // For hook_file_references, remember that this file is being deleted.
     $item['file_field_name'] = $field['field_name'];
-    if (file_field_delete_file($item, $field)) {
+    if (file_field_delete_file($item, $field, $entity_type, $id)) {
       $items[$delta] = NULL;
     }
   }
@@ -668,11 +676,33 @@
 }
 
 /**
+ * @} End of "defgroup field_types"
+ */
+
+/**
+ * @defgroup field_widget Field Widget API
+ * @{
+ * Define Field API widget types.
+ *
+ * Field API widgets specify how fields are displayed in edit forms. Fields of a
+ * given @link field_types field type @endlink may be edited using more than one
+ * widget. In this case, the Field UI module allows the site builder to choose
+ * which widget to use. Widget types are defined by implementing
+ * hook_field_widget_info().
+ *
+ * Widgets are
+ * @link http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html Form API @endlink
+ * elements with additional processing capabilities. Widget hooks are typically
+ * called by the Field Attach API during the creation of the field form
+ * structure with field_attach_form().
+ *
+ * @see field
+ * @see field_types
+ * @see field_formatter
+ */
+
+/**
  * Expose Field API widget types.
- *
- * Widgets are Form API elements with additional processing capabilities.
- * Widget hooks are typically called by the Field Attach API during the
- * creation of the field form structure with field_attach_form().
  *
  * @return
  *   An array describing the widget types implemented by the module.
@@ -852,17 +882,16 @@
  * @param $context
  *   An associative array containing the following key-value pairs, matching the
  *   arguments received by hook_field_widget_form():
- *   - "form": The form structure where widgets are being attached to. This
- *     might be a full form structure, or a sub-element of a larger form.
- *   - "field": The field structure.
- *   - "instance": The field instance structure.
- *   - "langcode": The language associated with $items.
- *   - "items": Array of default values for this field.
- *   - "delta": The order of this item in the array of subelements (0, 1, 2,
- *     etc).
+ *   - form: The form structure to which widgets are being attached. This may be
+ *     a full form structure, or a sub-element of a larger form.
+ *   - field: The field structure.
+ *   - instance: The field instance structure.
+ *   - langcode: The language associated with $items.
+ *   - items: Array of default values for this field.
+ *   - delta: The order of this item in the array of subelements (0, 1, 2, etc).
  *
  * @see hook_field_widget_form()
- * @see hook_field_widget_WIDGET_TYPE_form_alter
+ * @see hook_field_widget_WIDGET_TYPE_form_alter()
  */
 function hook_field_widget_form_alter(&$element, &$form_state, $context) {
   // Add a css class to widget form elements for all fields of type mytype.
@@ -928,6 +957,29 @@
   form_error($element['value'], $error['message']);
 }
 
+
+/**
+ * @} End of "defgroup field_widget"
+ */
+
+
+/**
+ * @defgroup field_formatter Field Formatter API
+ * @{
+ * Define Field API formatter types.
+ *
+ * Field API formatters specify how fields are displayed when the entity to
+ * which the field is attached is displayed. Fields of a given
+ * @link field_types field type @endlink may be displayed using more than one
+ * formatter. In this case, the Field UI module allows the site builder to
+ * choose which formatter to use. Field formatters are defined by implementing
+ * hook_field_formatter_info().
+ *
+ * @see field
+ * @see field_types
+ * @see field_widget
+ */
+
 /**
  * Expose Field API formatter types.
  *
@@ -1146,7 +1198,7 @@
 }
 
 /**
- * @} End of "ingroup field_type"
+ * @} End of "defgroup field_formatter"
  */
 
 /**
@@ -1502,7 +1554,7 @@
 }
 
 /**
- * @} End of "ingroup field_attach"
+ * @} End of "defgroup field_attach"
  */
 
 /**
@@ -2623,5 +2675,5 @@
 }
 
 /**
- * @} End of "ingroup hooks"
- */
+ * @} End of "addtogroup 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.attach.inc (original)
+++ branches/upstream/current-7/modules/field/field.attach.inc Thu May 10 18:20:18 2012
@@ -73,7 +73,7 @@
  * @{
  * Operate on Field API data attached to Drupal entities.
  *
- * Field Attach API functions load, store, display, generate Form API
+ * Field Attach API functions load, store, display, generate Field API
  * structures, and perform a variety of other functions for field data attached
  * to individual entities.
  *
@@ -1321,12 +1321,9 @@
   field_cache_clear();
 
   // Update bundle settings.
-  $settings = variable_get('field_bundle_settings', array());
-  if (isset($settings[$entity_type][$bundle_old])) {
-    $settings[$entity_type][$bundle_new] = $settings[$entity_type][$bundle_old];
-    unset($settings[$entity_type][$bundle_old]);
-    variable_set('field_bundle_settings', $settings);
-  }
+  $settings = variable_get('field_bundle_settings_' . $entity_type . '__' . $bundle_old, array());
+  variable_set('field_bundle_settings_' . $entity_type . '__' . $bundle_new, $settings);
+  variable_del('field_bundle_settings_' . $entity_type . '__' . $bundle_old);
 
   // Let other modules act on renaming the bundle.
   module_invoke_all('field_attach_rename_bundle', $entity_type, $bundle_old, $bundle_new);
@@ -1360,11 +1357,7 @@
   field_cache_clear();
 
   // Clear bundle display settings.
-  $settings = variable_get('field_bundle_settings', array());
-  if (isset($settings[$entity_type][$bundle])) {
-    unset($settings[$entity_type][$bundle]);
-    variable_set('field_bundle_settings', $settings);
-  }
+  variable_del('field_bundle_settings_' . $entity_type . '__' . $bundle);
 
   // Let other modules act on deleting the bundle.
   module_invoke_all('field_attach_delete_bundle', $entity_type, $bundle, $instances);

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.crud.inc (original)
+++ branches/upstream/current-7/modules/field/field.crud.inc Thu May 10 18:20:18 2012
@@ -835,11 +835,12 @@
 /**
  * Purges a batch of deleted Field API data, instances, or fields.
  *
- * This function will purge deleted field data on up to a specified maximum
- * number of entities and then return. If a deleted field instance with no
- * remaining data records is found, the instance itself will be purged.
- * If a deleted field with no remaining field instances is found, the field
- * itself will be purged.
+ * This function will purge deleted field data in batches. The batch size
+ * is defined as an argument to the function, and once each batch is finished,
+ * it continues with the next batch until all have completed. If a deleted field
+ * instance with no remaining data records is found, the instance itself will
+ * be purged. If a deleted field with no remaining field instances is found, the
+ * field itself will be purged.
  *
  * @param $batch_size
  *   The maximum number of field data records to purge before returning.

Modified: branches/upstream/current-7/modules/field/field.form.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.form.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.form.inc (original)
+++ branches/upstream/current-7/modules/field/field.form.inc Thu May 10 18:20:18 2012
@@ -53,6 +53,8 @@
     // If field module handles multiple values for this form element, and we
     // are displaying an individual element, process the multiple value form.
     if (!isset($get_delta) && field_behaviors_widget('multiple values', $instance) == FIELD_BEHAVIOR_DEFAULT) {
+      // Store the entity in the form.
+      $form['#entity'] = $entity;
       $elements = field_multiple_value_form($field, $instance, $langcode, $items, $form, $form_state);
     }
     // If the widget is handling multiple values (e.g Options), or if we are
@@ -63,6 +65,7 @@
       $function = $instance['widget']['module'] . '_field_widget_form';
       if (function_exists($function)) {
         $element = array(
+          '#entity' => $entity,
           '#entity_type' => $instance['entity_type'],
           '#bundle' => $instance['bundle'],
           '#field_name' => $field_name,
@@ -176,6 +179,7 @@
       $multiple = $field['cardinality'] > 1 || $field['cardinality'] == FIELD_CARDINALITY_UNLIMITED;
       $element = array(
         '#entity_type' => $instance['entity_type'],
+        '#entity' => $form['#entity'],
         '#bundle' => $instance['bundle'],
         '#field_name' => $field_name,
         '#language' => $langcode,

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.info (original)
+++ branches/upstream/current-7/modules/field/field.info Thu May 10 18:20:18 2012
@@ -10,8 +10,8 @@
 required = TRUE
 stylesheets[all][] = theme/field.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.info.inc (original)
+++ branches/upstream/current-7/modules/field/field.info.inc Thu May 10 18:20:18 2012
@@ -680,16 +680,16 @@
  */
 function field_info_instances($entity_type = NULL, $bundle_name = NULL) {
   $info = _field_info_collate_fields();
-  if (!isset($entity_type)) {
+
+  if (isset($entity_type) && isset($bundle_name)) {
+    return isset($info['instances'][$entity_type][$bundle_name]) ? $info['instances'][$entity_type][$bundle_name] : array();
+  }
+  elseif (isset($entity_type)) {
+    return isset($info['instances'][$entity_type]) ? $info['instances'][$entity_type] : array();
+  }
+  else {
     return $info['instances'];
   }
-  if (!isset($bundle_name)) {
-    return $info['instances'][$entity_type];
-  }
-  if (isset($info['instances'][$entity_type][$bundle_name])) {
-    return $info['instances'][$entity_type][$bundle_name];
-  }
-  return array();
 }
 
 /**

Modified: branches/upstream/current-7/modules/field/field.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.install (original)
+++ branches/upstream/current-7/modules/field/field.install Thu May 10 18:20:18 2012
@@ -99,14 +99,13 @@
     'primary key' => array('id'),
     'indexes' => array(
       'field_name' => array('field_name'),
-      // Used by field_read_fields().
+      // Used by field_sync_field_status().
       'active' => array('active'),
       'storage_active' => array('storage_active'),
       'deleted' => array('deleted'),
       // Used by field_modules_disabled().
       'module' => array('module'),
       'storage_module' => array('storage_module'),
-      // Used by field_associate_fields().
       'type' => array('type'),
       'storage_type' => array('storage_type'),
     ),
@@ -437,3 +436,27 @@
 /**
  * @} End of "addtogroup updates-6.x-to-7.x"
  */
+
+/**
+ * @addtogroup updates-7.x-extra
+ * @{
+ */
+
+/**
+ * Split the all-inclusive field_bundle_settings variable per bundle.
+ */
+function field_update_7002() {
+  $settings = variable_get('field_bundle_settings', array());
+  if ($settings) {
+    foreach ($settings as $entity_type => $entity_type_settings) {
+      foreach ($entity_type_settings as $bundle => $bundle_settings) {
+        variable_set('field_bundle_settings_' . $entity_type . '__' . $bundle, $bundle_settings);
+      }
+    }
+    variable_del('field_bundle_settings');
+  }
+}
+
+/**
+ * @} End of "addtogroup updates-7.x-extra"
+ */

Modified: branches/upstream/current-7/modules/field/field.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/field.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/field.module (original)
+++ branches/upstream/current-7/modules/field/field.module Thu May 10 18:20:18 2012
@@ -60,166 +60,136 @@
  * Field definitions are represented as an array of key/value pairs.
  *
  * array $field:
- * - id (integer, read-only)
- *     The primary identifier of the field. It is assigned automatically
- *     by field_create_field().
- * - field_name (string)
- *     The name of the field. Each field name is unique within Field API.
- *     When a field is attached to an entity, the field's data is stored
- *     in $entity->$field_name. Maximum length is 32 characters.
- * - type (string)
- *     The type of the field, such as 'text' or 'image'. Field types
- *     are defined by modules that implement hook_field_info().
- * - entity_types (array)
- *     The array of entity types that can hold instances of this field. If
- *     empty or not specified, the field can have instances in any entity type.
- * - cardinality (integer)
- *     The number of values the field can hold. Legal values are any
- *     positive integer or FIELD_CARDINALITY_UNLIMITED.
- * - translatable (integer)
- *     Whether the field is translatable.
- * - locked (integer)
- *     Whether or not the field is available for editing. If TRUE, users can't
- *     change field settings or create new instances of the field in the UI.
- *     Defaults to FALSE.
- * - module (string, read-only)
- *     The name of the module that implements the field type.
- * - active (integer, read-only)
- *     TRUE if the module that implements the field type is currently
- *     enabled, FALSE otherwise.
- * - deleted (integer, read-only)
- *     TRUE if this field has been deleted, FALSE otherwise. Deleted
- *     fields are ignored by the Field Attach API. This property exists
- *     because fields can be marked for deletion but only actually
- *     destroyed by a separate garbage-collection process.
- * - columns (array, read-only).
- *     An array of the Field API columns used to store each value of
- *     this field. The column list may depend on field settings; it is
- *     not constant per field type. Field API column specifications are
- *     exactly like Schema API column specifications but, depending on
- *     the field storage module in use, the name of the column may not
- *     represent an actual column in an SQL database.
- * - indexes (array).
- *     An array of indexes on data columns, using the same definition format
- *     as Schema API index specifications. Only columns that appear in the
- *     'columns' setting are allowed. Note that field types can specify
- *     default indexes, which can be modified or added to when
- *     creating a field.
+ * - id (integer, read-only): The primary identifier of the field. It is
+ *   assigned automatically by field_create_field().
+ * - field_name (string): The name of the field. Each field name is unique
+ *   within Field API. When a field is attached to an entity, the field's data
+ *   is stored in $entity->$field_name. Maximum length is 32 characters.
+ * - type (string): The type of the field, such as 'text' or 'image'. Field
+ *   types are defined by modules that implement hook_field_info().
+ * - entity_types (array): The array of entity types that can hold instances
+ *   of this field. If empty or not specified, the field can have instances
+ *   in any entity type.
+ * - cardinality (integer): The number of values the field can hold. Legal
+ *   values are any positive integer or FIELD_CARDINALITY_UNLIMITED.
+ * - translatable (integer): Whether the field is translatable.
+ * - locked (integer): Whether or not the field is available for editing. If
+ *   TRUE, users can't change field settings or create new instances of the
+ *   field in the UI. Defaults to FALSE.
+ * - module (string, read-only): The name of the module that implements the
+ *   field type.
+ * - active (integer, read-only): TRUE if the module that implements the field
+ *   type is currently enabled, FALSE otherwise.
+ * - deleted (integer, read-only): TRUE if this field has been deleted, FALSE
+ *   otherwise. Deleted fields are ignored by the Field Attach API. This
+ *   property exists because fields can be marked for deletion but only
+ *   actually destroyed by a separate garbage-collection process.
+ * - columns (array, read-only): An array of the Field API columns used to
+ *   store each value of this field. The column list may depend on field
+ *   settings; it is not constant per field type. Field API column
+ *   specifications are exactly like Schema API column specifications but,
+ *   depending on the field storage module in use, the name of the column may
+ *   not represent an actual column in an SQL database.
+ * - indexes (array): An array of indexes on data columns, using the same
+ *   definition format as Schema API index specifications. Only columns that
+ *   appear in the 'columns' setting are allowed. Note that field types can
+ *   specify default indexes, which can be modified or added to when
+ *   creating a field.
  * - foreign keys: (optional) An associative array of relations, using the same
- *   structure as the 'foreign keys' definition of hook_schema(). Note, however,
- *   that the field data is not necessarily stored in SQL. Also, the possible
- *   usage is limited, as you cannot specify another field as related, only
- *   existing SQL tables, such as filter formats.
- * - settings (array)
- *     A sub-array of key/value pairs of field-type-specific settings. Each
- *     field type module defines and documents its own field settings.
- * - storage (array)
- *     A sub-array of key/value pairs identifying the storage backend to use for
- *     the for the field.
- *     - type (string)
- *         The storage backend used by the field. Storage backends are defined
- *         by modules that implement hook_field_storage_info().
- *     - module (string, read-only)
- *         The name of the module that implements the storage backend.
- *     - active (integer, read-only)
- *         TRUE if the module that implements the storage backend is currently
- *         enabled, FALSE otherwise.
- *     - settings (array)
- *         A sub-array of key/value pairs of settings. Each storage backend
- *         defines and documents its own settings.
+ *   structure as the 'foreign keys' definition of hook_schema(). Note,
+ *   however, that the field data is not necessarily stored in SQL. Also, the
+ *   possible usage is limited, as you cannot specify another field as
+ *   related, only existing SQL tables, such as filter formats.
+ * - settings (array): A sub-array of key/value pairs of field-type-specific
+ *   settings. Each field type module defines and documents its own field
+ *   settings.
+ * - storage (array): A sub-array of key/value pairs identifying the storage
+ *   backend to use for the for the field:
+ *   - type (string): The storage backend used by the field. Storage backends
+ *     are defined by modules that implement hook_field_storage_info().
+ *   - module (string, read-only): The name of the module that implements the
+ *     storage backend.
+ *   - active (integer, read-only): TRUE if the module that implements the
+ *     storage backend is currently enabled, FALSE otherwise.
+ *   - settings (array): A sub-array of key/value pairs of settings. Each
+ *     storage backend defines and documents its own settings.
  *
  * Field instance definitions are represented as an array of key/value pairs.
  *
  * array $instance:
- * - id (integer, read-only)
- *     The primary identifier of this field instance. It is assigned
- *     automatically by field_create_instance().
- * - field_id (integer, read-only)
- *     The foreign key of the field attached to the bundle by this instance.
- *     It is populated automatically by field_create_instance().
- * - field_name (string)
- *     The name of the field attached to the bundle by this instance.
- * - entity_type (string)
- *     The name of the entity type the instance is attached to.
- * - bundle (string)
- *     The name of the bundle that the field is attached to.
- * - label (string)
- *     A human-readable label for the field when used with this
- *     bundle. For example, the label will be the title of Form API
- *     elements for this instance.
- * - description (string)
- *     A human-readable description for the field when used with this
- *     bundle. For example, the description will be the help text of
- *     Form API elements for this instance.
- * - required (integer)
- *     TRUE if a value for this field is required when used with this
- *     bundle, FALSE otherwise. Currently, required-ness is only enforced
- *     during Form API operations, not by field_attach_load(),
- *     field_attach_insert(), or field_attach_update().
- * - default_value_function (string)
- *     The name of the function, if any, that will provide a default value.
- * - default_value (array)
- *     If default_value_function is not set, then fixed values can be provided.
- * - deleted (integer, read-only)
- *     TRUE if this instance has been deleted, FALSE otherwise.
- *     Deleted instances are ignored by the Field Attach API.
- *     This property exists because instances can be marked for deletion but
- *     only actually destroyed by a separate garbage-collection process.
- * - settings (array)
- *     A sub-array of key/value pairs of field-type-specific instance
- *     settings. Each field type module defines and documents its own
- *     instance settings.
- * - widget (array)
- *     A sub-array of key/value pairs identifying the Form API input widget
- *     for the field when used by this bundle.
- *     - type (string)
- *         The type of the widget, such as text_textfield. Widget types
- *         are defined by modules that implement hook_field_widget_info().
- *     - settings (array)
- *         A sub-array of key/value pairs of widget-type-specific settings.
- *         Each field widget type module defines and documents its own
- *         widget settings.
- *     - weight (float)
- *         The weight of the widget relative to the other elements in entity
- *         edit forms.
- *     - module (string, read-only)
- *         The name of the module that implements the widget type.
- * - display (array)
- *     A sub-array of key/value pairs identifying the way field values should
- *     be displayed in each of the entity type's view modes, plus the 'default'
- *     mode. For each view mode, Field UI lets site administrators define
- *     whether they want to use a dedicated set of display options or the
- *     'default' options to reduce the number of displays to maintain as they
- *     add new fields. For nodes, on a fresh install, only the 'teaser' view
- *     mode is configured to use custom display options, all other view modes
- *     defined use the 'default' options by default. When programmatically
- *     adding field instances on nodes, it is therefore recommended to at least
- *     specify display options for 'default' and 'teaser'.
- *     - default (array)
- *         A sub-array of key/value pairs describing the display options to be
- *         used when the field is being displayed in view modes that are not
- *         configured to use dedicated display options.
- *         - label (string)
- *             Position of the label. 'inline', 'above' and 'hidden' are the
- *             values recognized by the default 'field' theme implementation.
- *         - type (string)
- *             The type of the display formatter, or 'hidden' for no display.
- *         - settings (array)
- *             A sub-array of key/value pairs of display options specific to
- *             the formatter.
- *        - weight (float)
- *            The weight of the field relative to the other entity components
- *            displayed in this view mode.
- *         - module (string, read-only)
- *             The name of the module which implements the display formatter.
- *     - some_mode
- *         A sub-array of key/value pairs describing the display options to be
- *         used when the field is being displayed in the 'some_mode' view mode.
- *         Those options will only be actually applied at run time if the view
- *         mode is not configured to use default settings for this bundle.
- *         - ...
- *     - other_mode
- *        - ...
+ * - id (integer, read-only): The primary identifier of this field instance.
+ *   It is assigned automatically by field_create_instance().
+ * - field_id (integer, read-only): The foreign key of the field attached to
+ *   the bundle by this instance. It is populated automatically by
+ *   field_create_instance().
+ * - field_name (string): The name of the field attached to the bundle by this
+ *   instance.
+ * - entity_type (string): The name of the entity type the instance is attached
+ *   to.
+ * - bundle (string): The name of the bundle that the field is attached to.
+ * - label (string): A human-readable label for the field when used with this
+ *   bundle. For example, the label will be the title of Form API elements
+ *   for this instance.
+ * - description (string): A human-readable description for the field when
+ *   used with this bundle. For example, the description will be the help
+ *   text of Form API elements for this instance.
+ * - required (integer): TRUE if a value for this field is required when used
+ *   with this bundle, FALSE otherwise. Currently, required-ness is only
+ *   enforced during Form API operations, not by field_attach_load(),
+ *   field_attach_insert(), or field_attach_update().
+ * - default_value_function (string): The name of the function, if any, that
+ *   will provide a default value.
+ * - default_value (array): If default_value_function is not set, then fixed
+ *   values can be provided.
+ * - deleted (integer, read-only): TRUE if this instance has been deleted,
+ *   FALSE otherwise. Deleted instances are ignored by the Field Attach API.
+ *   This property exists because instances can be marked for deletion but
+ *   only actually destroyed by a separate garbage-collection process.
+ * - settings (array): A sub-array of key/value pairs of field-type-specific
+ *   instance settings. Each field type module defines and documents its own
+ *   instance settings.
+ * - widget (array): A sub-array of key/value pairs identifying the Form API
+ *   input widget for the field when used by this bundle:
+ *   - type (string): The type of the widget, such as text_textfield. Widget
+ *     types are defined by modules that implement hook_field_widget_info().
+ *   - settings (array): A sub-array of key/value pairs of
+ *     widget-type-specific settings. Each field widget type module defines
+ *     and documents its own widget settings.
+ *   - weight (float): The weight of the widget relative to the other elements
+ *     in entity edit forms.
+ *   - module (string, read-only): The name of the module that implements the
+ *     widget type.
+ * - display (array): A sub-array of key/value pairs identifying the way field
+ *   values should be displayed in each of the entity type's view modes, plus
+ *   the 'default' mode. For each view mode, Field UI lets site administrators
+ *   define whether they want to use a dedicated set of display options or the
+ *   'default' options to reduce the number of displays to maintain as they
+ *   add new fields. For nodes, on a fresh install, only the 'teaser' view
+ *   mode is configured to use custom display options, all other view modes
+ *   defined use the 'default' options by default. When programmatically
+ *   adding field instances on nodes, it is therefore recommended to at least
+ *   specify display options for 'default' and 'teaser':
+ *   - default (array): A sub-array of key/value pairs describing the display
+ *     options to be used when the field is being displayed in view modes
+ *     that are not configured to use dedicated display options:
+ *     - label (string): Position of the label. 'inline', 'above' and
+ *       'hidden' are the values recognized by the default 'field' theme
+ *       implementation.
+ *     - type (string): The type of the display formatter, or 'hidden' for
+ *       no display.
+ *     - settings (array): A sub-array of key/value pairs of display
+ *       options specific to the formatter.
+ *     - weight (float): The weight of the field relative to the other entity
+ *       components displayed in this view mode.
+ *     - module (string, read-only): The name of the module which implements
+ *       the display formatter.
+ *   - some_mode: A sub-array of key/value pairs describing the display
+ *     options to be used when the field is being displayed in the 'some_mode'
+ *     view mode. Those options will only be actually applied at run time if
+ *     the view mode is not configured to use default settings for this bundle:
+ *     - ...
+ *   - other_mode:
+ *     - ...
  *
  * The (default) render arrays produced for field instances are documented at
  * field_attach_view().
@@ -316,7 +286,7 @@
     case 'admin/help#field':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Field module allows custom data fields to be defined for <em>entity</em> types (entities include content items, comments, user accounts, and taxonomy terms). The Field module takes care of storing, loading, editing, and rendering field data. Most users will not interact with the Field module directly, but will instead use the <a href="@field-ui-help">Field UI module</a> user interface. Module developers can use the Field API to make new entity types "fieldable" and thus allow fields to be attached to them. For more information, see the online handbook entry for <a href="@field">Field module</a>.', array('@field-ui-help' => url('admin/help/field_ui'), '@field' => 'http://drupal.org/handbook/modules/field')) . '</p>';
+      $output .= '<p>' . t('The Field module allows custom data fields to be defined for <em>entity</em> types (entities include content items, comments, user accounts, and taxonomy terms). The Field module takes care of storing, loading, editing, and rendering field data. Most users will not interact with the Field module directly, but will instead use the <a href="@field-ui-help">Field UI module</a> user interface. Module developers can use the Field API to make new entity types "fieldable" and thus allow fields to be attached to them. For more information, see the online handbook entry for <a href="@field">Field module</a>.', array('@field-ui-help' => url('admin/help/field_ui'), '@field' => 'http://drupal.org/documentation/modules/field')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Enabling field types') . '</dt>';
@@ -362,11 +332,12 @@
 
 /**
  * Implements hook_cron().
- *
- * Purges some deleted Field API data, if any exists.
  */
 function field_cron() {
+  // Refresh the 'active' status of fields.
   field_sync_field_status();
+
+  // Do a pass of purging on deleted Field API data, if any exists.
   $limit = variable_get('field_purge_batch_size', 10);
   field_purge_batch($limit);
 }
@@ -423,8 +394,27 @@
  * Implements hook_flush_caches().
  */
 function field_flush_caches() {
+  // Refresh the 'active' status of fields.
   field_sync_field_status();
+
+  // Request a flush of our cache table.
   return array('cache_field');
+}
+
+/**
+ * Implements hook_modules_enabled().
+ */
+function field_modules_enabled($modules) {
+  // Refresh the 'active' status of fields.
+  field_sync_field_status();
+}
+
+/**
+ * Implements hook_modules_disabled().
+ */
+function field_modules_disabled($modules) {
+  // Refresh the 'active' status of fields.
+  field_sync_field_status();
 }
 
 /**
@@ -460,18 +450,18 @@
 function field_associate_fields($module) {
   // Associate field types.
   $field_types = (array) module_invoke($module, 'field_info');
-  foreach ($field_types as $name => $field_info) {
+  if ($field_types) {
     db_update('field_config')
       ->fields(array('module' => $module, 'active' => 1))
-      ->condition('type', $name)
+      ->condition('type', array_keys($field_types))
       ->execute();
   }
   // Associate storage backends.
   $storage_types = (array) module_invoke($module, 'field_storage_info');
-  foreach ($storage_types as $name => $storage_info) {
+  if ($storage_types) {
     db_update('field_config')
       ->fields(array('storage_module' => $module, 'storage_active' => 1))
-      ->condition('storage_type', $name)
+      ->condition('storage_type', array_keys($storage_types))
       ->execute();
   }
 }
@@ -613,16 +603,12 @@
  *   If no $settings are passed, the current settings are returned.
  */
 function field_bundle_settings($entity_type, $bundle, $settings = NULL) {
-  $stored_settings = variable_get('field_bundle_settings', array());
-
   if (isset($settings)) {
-    $stored_settings[$entity_type][$bundle] = $settings;
-
-    variable_set('field_bundle_settings', $stored_settings);
+    variable_set('field_bundle_settings_' . $entity_type . '__' . $bundle, $settings);
     field_info_cache_clear();
   }
   else {
-    $settings = isset($stored_settings[$entity_type][$bundle]) ? $stored_settings[$entity_type][$bundle] : array();
+    $settings = variable_get('field_bundle_settings_' . $entity_type . '__' . $bundle, array());
     $settings += array(
       'view_modes' => array(),
       'extra_fields' => array(),
@@ -994,16 +980,18 @@
  *
  * @param $op
  *   The operation to be performed. Possible values:
- *   - "edit"
- *   - "view"
+ *   - 'edit'
+ *   - 'view'
  * @param $field
- *   The field on which the operation is to be performed.
+ *   The full field structure array for the field on which the operation is to
+ *   be performed. See field_info_field().
  * @param $entity_type
  *   The type of $entity; e.g., 'node' or 'user'.
  * @param $entity
  *   (optional) The entity for the operation.
  * @param $account
  *   (optional) The account to check, if not given use currently logged in user.
+ *
  * @return
  *   TRUE if the operation is allowed;
  *   FALSE if the operation is denied.

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=2263&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 Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 files[] = field_sql_storage.test
 required = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/list/list.info (original)
+++ branches/upstream/current-7/modules/field/modules/list/list.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 dependencies[] = options
 files[] = tests/list.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/field/modules/list/list.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/list/list.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/list/list.module (original)
+++ branches/upstream/current-7/modules/field/modules/list/list.module Thu May 10 18:20:18 2012
@@ -221,24 +221,39 @@
  *
  * @param $field
  *   The field definition.
+ * @param $instance
+ *   (optional) A field instance array. Defaults to NULL.
+ * @param $entity_type
+ *   (optional) The type of entity; e.g. 'node' or 'user'. Defaults to NULL.
+ * @param $entity
+ *   (optional) The entity object. Defaults to NULL.
  *
  * @return
  *   The array of allowed values. Keys of the array are the raw stored values
  *   (number or text), values of the array are the display labels.
  */
-function list_allowed_values($field) {
+function list_allowed_values($field, $instance = NULL, $entity_type = NULL, $entity = NULL) {
   $allowed_values = &drupal_static(__FUNCTION__, array());
 
   if (!isset($allowed_values[$field['id']])) {
     $function = $field['settings']['allowed_values_function'];
+    // If $cacheable is FALSE, then the allowed values are not statically
+    // cached. See list_test_dynamic_values_callback() for an example of
+    // generating dynamic and uncached values.
+    $cacheable = TRUE;
     if (!empty($function) && function_exists($function)) {
-      $values = $function($field);
+      $values = $function($field, $instance, $entity_type, $entity, $cacheable);
     }
     else {
       $values = $field['settings']['allowed_values'];
     }
 
-    $allowed_values[$field['id']] = $values;
+    if ($cacheable) {
+      $allowed_values[$field['id']] = $values;
+    }
+    else {
+      return $values;
+    }
   }
 
   return $allowed_values[$field['id']];
@@ -345,7 +360,7 @@
     // Forbid any update that removes allowed values with actual data.
     $lost_keys = array_diff(array_keys($prior_field['settings']['allowed_values']), array_keys($field['settings']['allowed_values']));
     if (_list_values_in_use($field, $lost_keys)) {
-      throw new FieldUpdateForbiddenException(t('Cannot update a list field to not include keys with existing data.'));
+      throw new FieldUpdateForbiddenException(t('A list field (@field_name) with existing data cannot have its keys changed.', array('@field_name' => $field['field_name'])));
     }
   }
 }
@@ -373,7 +388,7 @@
  * - 'list_illegal_value': The value is not part of the list of allowed values.
  */
 function list_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
-  $allowed_values = list_allowed_values($field);
+  $allowed_values = list_allowed_values($field, $instance, $entity_type, $entity);
   foreach ($items as $delta => $item) {
     if (!empty($item['value'])) {
       if (!empty($allowed_values) && !isset($allowed_values[$item['value']])) {
@@ -419,8 +434,8 @@
 /**
  * Implements hook_options_list().
  */
-function list_options_list($field) {
-  return list_allowed_values($field);
+function list_options_list($field, $instance, $entity_type, $entity) {
+  return list_allowed_values($field, $instance, $entity_type, $entity);
 }
 
 /**
@@ -447,7 +462,7 @@
 
   switch ($display['type']) {
     case 'list_default':
-      $allowed_values = list_allowed_values($field);
+      $allowed_values = list_allowed_values($field, $instance, $entity_type, $entity);
       foreach ($items as $delta => $item) {
         if (isset($allowed_values[$item['value']])) {
           $output = field_filter_xss($allowed_values[$item['value']]);

Modified: branches/upstream/current-7/modules/field/modules/list/tests/list.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/list/tests/list.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/list/tests/list.test (original)
+++ branches/upstream/current-7/modules/field/modules/list/tests/list.test Thu May 10 18:20:18 2012
@@ -110,6 +110,89 @@
     $this->assertTrue(!empty($form[$this->field_name][$langcode][1]), t('Option 1 exists'));
     $this->assertTrue(!empty($form[$this->field_name][$langcode][2]), t('Option 2 exists'));
     $this->assertTrue(!empty($form[$this->field_name][$langcode][3]), t('Option 3 exists'));
+  }
+}
+
+/**
+ * Sets up a List field for testing allowed values functions.
+ */
+class ListDynamicValuesTestCase extends FieldTestCase {
+  function setUp() {
+    parent::setUp(array('list', 'field_test', 'list_test'));
+
+    $this->field_name = 'test_list';
+    $this->field = array(
+      'field_name' => $this->field_name,
+      'type' => 'list_text',
+      'cardinality' => 1,
+      'settings' => array(
+        'allowed_values_function' => 'list_test_dynamic_values_callback',
+      ),
+    );
+    $this->field = field_create_field($this->field);
+
+    $this->instance = array(
+      'field_name' => $this->field_name,
+      'entity_type' => 'test_entity',
+      'bundle' => 'test_bundle',
+      'required' => TRUE,
+      'widget' => array(
+        'type' => 'options_select',
+      ),
+    );
+    $this->instance = field_create_instance($this->instance);
+    $this->test = array(
+      'id' => mt_rand(1, 10),
+      // Make sure this does not equal the ID so that
+      // list_test_dynamic_values_callback() always returns 4 values.
+      'vid' => mt_rand(20, 30),
+      'bundle' => 'test_bundle',
+      'label' => $this->randomName(),
+    );
+    $this->entity = call_user_func_array('field_test_create_stub_entity', $this->test);
+  }
+}
+
+/**
+ * Tests the List field allowed values function.
+ */
+class ListDynamicValuesValidationTestCase extends ListDynamicValuesTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'List field dynamic values',
+      'description' => 'Test the List field allowed values function.',
+      'group' => 'Field types',
+    );
+  }
+
+  /**
+   * Test that allowed values function gets the entity.
+   */
+  function testDynamicAllowedValues() {
+    // Verify that the test passes against every value we had.
+    foreach ($this->test as $key => $value) {
+      $this->entity->test_list[LANGUAGE_NONE][0]['value'] = $value;
+      try {
+        field_attach_validate('test_entity', $this->entity);
+        $this->pass("$key should pass");
+      }
+      catch (FieldValidationException $e) {
+        // This will display as an exception, no need for a separate error.
+        throw($e);
+      }
+    }
+    // Now verify that the test does not pass against anything else.
+    foreach ($this->test as $key => $value) {
+      $this->entity->test_list[LANGUAGE_NONE][0]['value'] = is_numeric($value) ? (100 - $value) : ('X' . $value);
+      $pass = FALSE;
+      try {
+        field_attach_validate('test_entity', $this->entity);
+      }
+      catch (FieldValidationException $e) {
+        $pass = TRUE;
+      }
+      $this->assertTrue($pass, $key . ' should not pass');
+    }
   }
 }
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/field/modules/list/tests/list_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/list/tests/list_test.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/list/tests/list_test.module (original)
+++ branches/upstream/current-7/modules/field/modules/list/tests/list_test.module Thu May 10 18:20:18 2012
@@ -21,3 +21,12 @@
 
   return $values;
 }
+
+/**
+ * An entity-bound allowed values callback.
+ */
+function list_test_dynamic_values_callback($field, $instance, $entity_type, $entity, &$cacheable) {
+  $cacheable = FALSE;
+  // We need the values of the entity as keys.
+  return drupal_map_assoc(array_merge(array($entity->ftlabel), entity_extract_ids($entity_type, $entity)));
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/number/number.info (original)
+++ branches/upstream/current-7/modules/field/modules/number/number.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 dependencies[] = field
 files[] = number.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/field/modules/number/number.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/number/number.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/number/number.module (original)
+++ branches/upstream/current-7/modules/field/modules/number/number.module Thu May 10 18:20:18 2012
@@ -377,12 +377,12 @@
     switch ($type) {
       case 'float':
       case 'decimal':
-        $regexp = '@[^-0-9\\' . $field['settings']['decimal_separator'] . ']@';
+        $regexp = '@([^-0-9\\' . $field['settings']['decimal_separator'] . '])|(.-)@';
         $message = t('Only numbers and the decimal separator (@separator) allowed in %field.', array('%field' => $instance['label'], '@separator' => $field['settings']['decimal_separator']));
         break;
 
       case 'integer':
-        $regexp = '@[^-0-9]@';
+        $regexp = '@([^-0-9])|(.-)@';
         $message = t('Only numbers are allowed in %field.', array('%field' => $instance['label']));
         break;
     }

Modified: branches/upstream/current-7/modules/field/modules/number/number.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/number/number.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/number/number.test (original)
+++ branches/upstream/current-7/modules/field/modules/number/number.test Thu May 10 18:20:18 2012
@@ -92,6 +92,28 @@
         t('Correctly failed to save decimal value with more than one decimal point.')
       );
     }
+
+    // Try to create entries with minus sign not in the first position.
+    $wrong_entries = array(
+      '3-3',
+      '4-',
+      '1.3-',
+      '1.2-4',
+      '-10-10',
+    );
+
+    foreach ($wrong_entries as $wrong_entry) {
+      $this->drupalGet('test-entity/add/test-bundle');
+      $edit = array(
+        "{$this->field['field_name']}[$langcode][0][value]" => $wrong_entry,
+      );
+      $this->drupalPost(NULL, $edit, t('Save'));
+      $this->assertText(
+        t('Only numbers and the decimal separator (@separator) allowed in ',
+          array('@separator' => $this->field['settings']['decimal_separator'])),
+        'Correctly failed to save decimal value with minus sign in the wrong position.'
+      );
+    }
   }
 
   /**

Modified: branches/upstream/current-7/modules/field/modules/options/options.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/options/options.api.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/options/options.api.php (original)
+++ branches/upstream/current-7/modules/field/modules/options/options.api.php Thu May 10 18:20:18 2012
@@ -20,6 +20,11 @@
  *   $instance parameter in contexts where no specific instance can be targeted.
  *   It is recommended to only use instance level properties to filter out
  *   values from a list defined by field level properties.
+ * @param $entity_type
+ *   The entity type the field is attached to.
+ * @param $entity
+ *   The entity object the field is attached to, or NULL if no entity
+ *   exists (e.g. in field settings page).
  *
  * @return
  *   The array of options for the field. Array keys are the values to be
@@ -30,7 +35,7 @@
  *   widget. The HTML tags defined in _field_filter_xss_allowed_tags() are
  *   allowed, other tags will be filtered.
  */
-function hook_options_list($field, $instance = NULL) {
+function hook_options_list($field, $instance, $entity_type, $entity) {
   // Sample structure.
   $options = array(
     0 => t('Zero'),

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/options/options.info (original)
+++ branches/upstream/current-7/modules/field/modules/options/options.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 dependencies[] = field
 files[] = options.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/field/modules/options/options.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/options/options.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/options/options.module (original)
+++ branches/upstream/current-7/modules/field/modules/options/options.module Thu May 10 18:20:18 2012
@@ -79,8 +79,11 @@
   $has_value = isset($items[0][$value_key]);
   $properties = _options_properties($type, $multiple, $required, $has_value);
 
+  $entity_type = $element['#entity_type'];
+  $entity = $element['#entity'];
+
   // Prepare the list of options.
-  $options = _options_get_options($field, $instance, $properties);
+  $options = _options_get_options($field, $instance, $properties, $entity_type, $entity);
 
   // Put current field values in shape.
   $default_value = _options_storage_to_form($items, $options, $value_key, $properties);
@@ -102,10 +105,18 @@
         reset($options);
         $default_value = array(key($options));
       }
+
+      // If this is a single-value field, take the first default value, or
+      // default to NULL so that the form element is properly recognized as
+      // not having a default value.
+      if (!$multiple) {
+        $default_value = $default_value ? reset($default_value) : NULL;
+      }
+
       $element += array(
         '#type' => $multiple ? 'checkboxes' : 'radios',
         // Radio buttons need a scalar value.
-        '#default_value' => $multiple ? $default_value : reset($default_value),
+        '#default_value' => $default_value,
         '#options' => $options,
       );
       break;
@@ -200,7 +211,7 @@
         if (!$required) {
           $properties['empty_option'] = 'option_none';
         }
-        else if (!$has_value) {
+        elseif (!$has_value) {
           $properties['empty_option'] = 'option_select';
         }
       }
@@ -229,9 +240,9 @@
 /**
  * Collects the options for a field.
  */
-function _options_get_options($field, $instance, $properties) {
+function _options_get_options($field, $instance, $properties, $entity_type, $entity) {
   // Get the list of options.
-  $options = (array) module_invoke($field['module'], 'options_list', $field, $instance);
+  $options = (array) module_invoke($field['module'], 'options_list', $field, $instance, $entity_type, $entity);
 
   // Sanitize the options.
   _options_prepare_options($options, $properties);

Modified: branches/upstream/current-7/modules/field/modules/options/options.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/modules/options/options.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/options/options.test (original)
+++ branches/upstream/current-7/modules/field/modules/options/options.test Thu May 10 18:20:18 2012
@@ -516,3 +516,38 @@
   }
 }
 
+/**
+ * Test an options select on a list field with a dynamic allowed values function.
+ */
+class OptionsSelectDynamicValuesTestCase extends ListDynamicValuesTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Options select dynamic values',
+      'description' => 'Test an options select on a list field with a dynamic allowed values function.',
+      'group' => 'Field types',
+    );
+  }
+
+  /**
+   * Tests the 'options_select' widget (single select).
+   */
+  function testSelectListDynamic() {
+    // Create an entity.
+    $this->entity->is_new = TRUE;
+    field_test_entity_save($this->entity);
+    // Create a web user.
+    $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content'));
+    $this->drupalLogin($web_user);
+
+    // Display form.
+    $this->drupalGet('test-entity/manage/' . $this->entity->ftid . '/edit');
+    $options = $this->xpath('//select[@id="edit-test-list-und"]/option');
+    $this->assertEqual(count($options), count($this->test) + 1);
+    foreach ($options as $option) {
+      $value = (string) $option['value'];
+      if ($value != '_none') {
+        $this->assertTrue(array_search($value, $this->test));
+      }
+    }
+  }
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/modules/text/text.info (original)
+++ branches/upstream/current-7/modules/field/modules/text/text.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 files[] = text.test
 required = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/tests/field.test (original)
+++ branches/upstream/current-7/modules/field/tests/field.test Thu May 10 18:20:18 2012
@@ -1079,11 +1079,14 @@
     }
 
     // Verify that no unexpected instances exist.
+    $instances = field_info_instances('test_entity');
+    $expected = array('test_bundle' => array());
+    $this->assertIdentical($instances, $expected, "field_info_instances('test_entity') returns " . var_export($expected, TRUE) . '.');
+    $instances = field_info_instances('test_entity', 'test_bundle');
+    $this->assertIdentical($instances, array(), "field_info_instances('test_entity', 'test_bundle') returns an empty array.");
+
+    // Create a field, verify it shows up.
     $core_fields = field_info_fields();
-    $instances = field_info_instances('test_entity', 'test_bundle');
-    $this->assertTrue(empty($instances), t('With no instances, info bundles is empty.'));
-
-    // Create a field, verify it shows up.
     $field = array(
       'field_name' => drupal_strtolower($this->randomName()),
       'type' => 'test_field',
@@ -1119,6 +1122,25 @@
     $instances = field_info_instances('test_entity', $instance['bundle']);
     $this->assertEqual(count($instances), 1, t('One instance shows up in info when attached to a bundle.'));
     $this->assertTrue($instance < $instances[$instance['field_name']], t('Instance appears in info correctly'));
+
+    // Test a valid entity type but an invalid bundle.
+    $instances = field_info_instances('test_entity', 'invalid_bundle');
+    $this->assertIdentical($instances, array(), "field_info_instances('test_entity', 'invalid_bundle') returns an empty array.");
+
+    // Test invalid entity type and bundle.
+    $instances = field_info_instances('invalid_entity', $instance['bundle']);
+    $this->assertIdentical($instances, array(), "field_info_instances('invalid_entity', 'test_bundle') returns an empty array.");
+
+    // Test invalid entity type, no bundle provided.
+    $instances = field_info_instances('invalid_entity');
+    $this->assertIdentical($instances, array(), "field_info_instances('invalid_entity') returns an empty array.");
+
+    // Test with an entity type that has no bundles.
+    $instances = field_info_instances('user');
+    $expected = array('user' => array());
+    $this->assertIdentical($instances, $expected, "field_info_instances('user') returns " . var_export($expected, TRUE) . '.');
+    $instances = field_info_instances('user', 'user');
+    $this->assertIdentical($instances, array(), "field_info_instances('user', 'user') returns an empty array.");
   }
 
   /**
@@ -1458,6 +1480,51 @@
     // Re-submit: check that the field can be emptied.
 
     // Test with several multiple fields in a form
+  }
+
+  /**
+   * Tests widget handling of multiple required radios.
+   */
+  function testFieldFormMultivalueWithRequiredRadio() {
+    // Create a multivalue test field.
+    $this->field = $this->field_unlimited;
+    $this->field_name = $this->field['field_name'];
+    $this->instance['field_name'] = $this->field_name;
+    field_create_field($this->field);
+    field_create_instance($this->instance);
+    $langcode = LANGUAGE_NONE;
+
+    // Add a required radio field.
+    field_create_field(array(
+      'field_name' => 'required_radio_test',
+      'type' => 'list_text',
+      'settings' => array(
+        'allowed_values' => array('yes' => 'yes', 'no' => 'no'),
+      ),
+    ));
+    field_create_instance(array(
+      'field_name' => 'required_radio_test',
+      'entity_type' => 'test_entity',
+      'bundle' => 'test_bundle',
+      'required' => TRUE,
+      'widget' => array(
+        'type' => 'options_buttons',
+      ),
+    ));
+
+    // Display creation form.
+    $this->drupalGet('test-entity/add/test-bundle');
+
+    // Press the 'Add more' button.
+    $this->drupalPost(NULL, array(), t('Add another item'));
+
+    // Verify that no error is thrown by the radio element.
+    $this->assertNoFieldByXpath('//div[contains(@class, "error")]', FALSE, 'No error message is displayed.');
+
+    // Verify that the widget is added.
+    $this->assertFieldByName("{$this->field_name}[$langcode][0][value]", '', 'Widget 1 is displayed');
+    $this->assertFieldByName("{$this->field_name}[$langcode][1][value]", '', 'New widget is displayed');
+    $this->assertNoField("{$this->field_name}[$langcode][2][value]", 'No extraneous widget is displayed');
   }
 
   function testFieldFormJSAddMore() {
@@ -2357,7 +2424,6 @@
     $this->assertTrue($field_definition <= $field, t('The field was properly read.'));
 
     module_disable($modules, FALSE);
-    drupal_flush_all_caches();
 
     $fields = field_read_fields(array('field_name' => $field_name), array('include_inactive' => TRUE));
     $this->assertTrue(isset($fields[$field_name]) && $field_definition < $field, t('The field is properly read when explicitly fetching inactive fields.'));
@@ -2370,7 +2436,6 @@
 
       $module = array_shift($modules);
       module_enable(array($module), FALSE);
-      drupal_flush_all_caches();
     }
 
     // Check that the field is active again after all modules have been

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/tests/field_test.info (original)
+++ branches/upstream/current-7/modules/field/tests/field_test.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/field/theme/field.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/field/theme/field.tpl.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field/theme/field.tpl.php (original)
+++ branches/upstream/current-7/modules/field/theme/field.tpl.php Thu May 10 18:20:18 2012
@@ -48,7 +48,7 @@
 After copying this file to your theme's folder and customizing it, remove this
 HTML comment.
 -->
-<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
+<div class="<?php print $classes; ?>"<?php print $attributes; ?>>
   <?php if (!$label_hidden): ?>
     <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>: </div>
   <?php endif; ?>

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=2263&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 Thu May 10 18:20:18 2012
@@ -280,8 +280,8 @@
  *
  * Allows fields and pseudo-fields to be re-ordered.
  *
- * @see field_ui_overview_form_validate().
- * @see field_ui_overview_form_submit().
+ * @see field_ui_field_overview_form_validate()
+ * @see field_ui_field_overview_form_submit()
  * @ingroup forms
  */
 function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle) {
@@ -316,7 +316,7 @@
       t('Label'),
       t('Weight'),
       t('Parent'),
-      t('Name'),
+      t('Machine name'),
       t('Field'),
       t('Widget'),
       array('data' => t('Operations'), 'colspan' => 2),
@@ -498,16 +498,24 @@
         ),
       ),
       'field_name' => array(
-        '#type' => 'textfield',
+        '#type' => 'machine_name',
         '#title' => t('New field name'),
         '#title_display' => 'invisible',
         // This field should stay LTR even for RTL languages.
         '#field_prefix' => '<span dir="ltr">field_',
         '#field_suffix' => '</span>‎',
-        '#attributes' => array('dir'=>'ltr'),
-        '#size' => 10,
-        '#description' => t('Field name (a-z, 0-9, _)'),
+        '#size' => 15,
+        '#description' => t('A unique machine-readable name containing letters, numbers, and underscores.'),
+        // 32 characters minus the 'field_' prefix.
+        '#maxlength' => 26,
         '#prefix' => '<div class="add-new-placeholder"> </div>',
+        '#machine_name' => array(
+          'source' => array('fields', $name, 'label'),
+          'exists' => '_field_ui_field_name_exists',
+          'standalone' => TRUE,
+          'label' => '',
+        ),
+        '#required' => FALSE,
       ),
       'type' => array(
         '#type' => 'select',
@@ -540,8 +548,19 @@
   }
 
   // Additional row: add existing field.
-  $existing_field_options = field_ui_existing_field_options($entity_type, $bundle);
-  if ($existing_field_options && $widget_type_options) {
+  $existing_fields = field_ui_existing_field_options($entity_type, $bundle);
+  if ($existing_fields && $widget_type_options) {
+    // Build list of options.
+    $existing_field_options = array();
+    foreach ($existing_fields as $field_name => $info) {
+      $text = t('@type: @field (@label)', array(
+        '@type' => $info['type_label'],
+        '@label' => $info['label'],
+        '@field' => $info['field'],
+      ));
+      $existing_field_options[$field_name] = truncate_utf8($text, 80, FALSE, TRUE);
+    }
+    asort($existing_field_options);
     $name = '_add_existing_field';
     $table[$name] = array(
       '#attributes' => array('class' => array('draggable', 'tabledrag-leaf', 'add-new')),
@@ -617,10 +636,8 @@
 
   // Add settings for the update selects behavior.
   $js_fields = array();
-  foreach ($existing_field_options as $field_name => $fields) {
-    $field = field_info_field($field_name);
-    $instance = field_info_instance($form['#entity_type'], $field_name, $form['#bundle']);
-    $js_fields[$field_name] = array('label' => $instance['label'], 'type' => $field['type'], 'widget' => $instance['widget']['type']);
+  foreach ($existing_fields as $field_name => $info) {
+    $js_fields[$field_name] = array('label' => $info['label'], 'type' => $info['type'], 'widget' => $info['widget_type']);
   }
 
   $form['#attached']['js'][] = array(
@@ -669,25 +686,8 @@
       $field_name = $field['field_name'];
 
       // Add the 'field_' prefix.
-      if (substr($field_name, 0, 6) != 'field_') {
-        $field_name = 'field_' . $field_name;
-        form_set_value($form['fields']['_add_new_field']['field_name'], $field_name, $form_state);
-      }
-
-      // Invalid field name.
-      if (!preg_match('!^field_[a-z0-9_]+$!', $field_name)) {
-        form_set_error('fields][_add_new_field][field_name', t('Add new field: the field name %field_name is invalid. The name must include only lowercase unaccentuated letters, numbers, and underscores.', array('%field_name' => $field_name)));
-      }
-      if (strlen($field_name) > 32) {
-        form_set_error('fields][_add_new_field][field_name', t("Add new field: the field name %field_name is too long. The name is limited to 32 characters, including the 'field_' prefix.", array('%field_name' => $field_name)));
-      }
-
-      // Field name already exists. We need to check inactive fields as well, so
-      // we can't use field_info_fields().
-      $fields = field_read_fields(array('field_name' => $field_name), array('include_inactive' => TRUE));
-      if ($fields) {
-        form_set_error('fields][_add_new_field][field_name', t('Add new field: the field name %field_name already exists.', array('%field_name' => $field_name)));
-      }
+      $field_name = 'field_' . $field_name;
+      form_set_value($form['fields']['_add_new_field']['field_name'], $field_name, $form_state);
     }
 
     // Missing field type.
@@ -707,6 +707,24 @@
       }
     }
   }
+}
+
+/**
+ * Render API callback: Checks if a field machine name is taken.
+ *
+ * @param $value
+ *   The machine name, not prefixed with 'field_'.
+ *
+ * @return
+ *   Whether or not the field machine name is taken.
+ */
+function _field_ui_field_name_exists($value) {
+  // Prefix with 'field_'.
+  $field_name = 'field_' . $value;
+
+  // We need to check inactive fields as well, so we can't use
+  // field_info_fields().
+  return (bool) field_read_fields(array('field_name' => $field_name), array('include_inactive' => TRUE));
 }
 
 /**
@@ -1502,7 +1520,7 @@
  * Returns an array of existing fields to be added to a bundle.
  */
 function field_ui_existing_field_options($entity_type, $bundle) {
-  $options = array();
+  $info = array();
   $field_types = field_info_field_types();
 
   foreach (field_info_instances() as $existing_entity_type => $bundles) {
@@ -1521,19 +1539,19 @@
             && !field_info_instance($entity_type, $field['field_name'], $bundle)
             && (empty($field['entity_types']) || in_array($entity_type, $field['entity_types']))
             && empty($field_types[$field['type']]['no_ui'])) {
-            $text = t('@type: @field (@label)', array(
-              '@type' => $field_types[$field['type']]['label'],
-              '@label' => t($instance['label']), '@field' => $instance['field_name'],
-            ));
-            $options[$instance['field_name']] = (drupal_strlen($text) > 80 ? truncate_utf8($text, 77) . '...' : $text);
+            $info[$instance['field_name']] = array(
+              'type' => $field['type'],
+              'type_label' => $field_types[$field['type']]['label'],
+              'field' => $field['field_name'],
+              'label' => t($instance['label']),
+              'widget_type' => $instance['widget']['type'],
+            );
           }
         }
       }
     }
   }
-  // Sort the list by field name.
-  asort($options);
-  return $options;
+  return $info;
 }
 
 /**
@@ -1705,7 +1723,7 @@
 /**
  * Form constructor for removing a field instance from a bundle.
  *
- * @see field_ui_delete_form_submit()
+ * @see field_ui_field_delete_form_submit()
  * @ingroup forms
  */
 function field_ui_field_delete_form($form, &$form_state, $instance) {

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=2263&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 Thu May 10 18:20:18 2012
@@ -6,7 +6,7 @@
  */
 
 /**
- * @ingroup field_ui_field_type
+ * @addtogroup field_types
  * @{
  */
 
@@ -200,5 +200,5 @@
 }
 
 /**
- * @} End of "ingroup field_ui_field_type"
- */
+ * @} End of "addtogroup field_types"
+ */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.css (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.css Thu May 10 18:20:18 2012
@@ -12,6 +12,10 @@
 }
 table.field-ui-overview tr.add-new .description {
   margin-bottom: 0;
+  max-width: 250px;
+}
+table.field-ui-overview tr.add-new .form-type-machine-name .description {
+  white-space: normal;
 }
 table.field-ui-overview tr.add-new .add-new-placeholder {
   font-weight: bold;
@@ -28,6 +32,10 @@
 }
 table.field-ui-overview tr.region-add-new-title {
   display: none;
+}
+table.field-ui-overview tr.add-new td {
+  vertical-align: top;
+  white-space: nowrap;
 }
 
 /* 'Manage display' overview */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.info (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 dependencies[] = field
 files[] = field_ui.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.js (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.js Thu May 10 18:20:18 2012
@@ -28,7 +28,7 @@
 
     // 'Field type' select updates its 'Widget' select.
     $('.field-type-select', table).each(function () {
-      this.targetSelect = $('.widget-type-select', $(this).parents('tr').eq(0));
+      this.targetSelect = $('.widget-type-select', $(this).closest('tr'));
 
       $(this).bind('change keyup', function () {
         var selectedFieldType = this.options[this.selectedIndex].value;
@@ -43,8 +43,13 @@
 
     // 'Existing field' select updates its 'Widget' select and 'Label' textfield.
     $('.field-select', table).each(function () {
-      this.targetSelect = $('.widget-type-select', $(this).parents('tr').eq(0));
-      this.targetTextfield = $('.label-textfield', $(this).parents('tr').eq(0));
+      this.targetSelect = $('.widget-type-select', $(this).closest('tr'));
+      this.targetTextfield = $('.label-textfield', $(this).closest('tr'));
+      this.targetTextfield
+        .data('field_ui_edited', false)
+        .bind('keyup', function (e) {
+          $(this).data('field_ui_edited', $(this).val() != '');
+        });
 
       $(this).bind('change keyup', function (e, updateText) {
         var updateText = (typeof updateText == 'undefined' ? true : updateText);
@@ -54,8 +59,10 @@
         var options = (selectedFieldType && (selectedFieldType in widgetTypes) ? widgetTypes[selectedFieldType] : []);
         this.targetSelect.fieldUIPopulateOptions(options, selectedFieldWidget);
 
-        if (updateText) {
-          $(this.targetTextfield).attr('value', (selectedField in fields ? fields[selectedField].label : ''));
+        // Only overwrite the "Label" input if it has not been manually
+        // changed, or if it is empty.
+        if (updateText && !this.targetTextfield.data('field_ui_edited')) {
+          this.targetTextfield.val(selectedField in fields ? fields[selectedField].label : '');
         }
       });
 
@@ -133,7 +140,7 @@
    */
   onChange: function () {
     var $trigger = $(this);
-    var row = $trigger.parents('tr:first').get(0);
+    var row = $trigger.closest('tr').get(0);
     var rowHandler = $(row).data('fieldUIRowHandler');
 
     var refreshRows = {};

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.module (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.module Thu May 10 18:20:18 2012
@@ -12,7 +12,7 @@
     case 'admin/help#field_ui':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Field UI module provides an administrative user interface (UI) for attaching and managing fields. Fields can be defined at the content-type level for content items and comments, at the vocabulary level for taxonomy terms, and at the site level for user accounts. Other modules may also enable fields to be defined for their data. Field types (text, image, number, etc.) are defined by modules, and collected and managed by the <a href="@field">Field module</a>. For more information, see the online handbook entry for <a href="@field_ui" target="_blank">Field UI module</a>.', array('@field' => url('admin/help/field'), '@field_ui' => 'http://drupal.org/handbook/modules/field-ui')) . '</p>';
+      $output .= '<p>' . t('The Field UI module provides an administrative user interface (UI) for attaching and managing fields. Fields can be defined at the content-type level for content items and comments, at the vocabulary level for taxonomy terms, and at the site level for user accounts. Other modules may also enable fields to be defined for their data. Field types (text, image, number, etc.) are defined by modules, and collected and managed by the <a href="@field">Field module</a>. For more information, see the online handbook entry for <a href="@field_ui" target="_blank">Field UI module</a>.', array('@field' => url('admin/help/field'), '@field_ui' => 'http://drupal.org/documentation/modules/field-ui')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Planning fields') . '</dt>';

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/field_ui/field_ui.test (original)
+++ branches/upstream/current-7/modules/field_ui/field_ui.test Thu May 10 18:20:18 2012
@@ -172,7 +172,7 @@
     // Check all table columns.
     $table_headers = array(
       t('Label'),
-      t('Name'),
+      t('Machine name'),
       t('Field'),
       t('Widget'),
       t('Operations'),
@@ -338,7 +338,7 @@
     $bundle_path1 = 'admin/structure/types/manage/' . $this->hyphen_type;
     $edit1 = array(
       'fields[_add_new_field][label]' => $this->field_label,
-      'fields[_add_new_field][field_name]' => $this->field_name,
+      'fields[_add_new_field][field_name]' => $this->field_name_input,
     );
     $this->fieldUIAddNewField($bundle_path1, $edit1);
 
@@ -426,6 +426,25 @@
 
     $this->drupalGet('admin/structure/types/manage/' . $hyphen_type2 . '/fields');
   }
+
+  /**
+   * Tests that a duplicate field name is caught by validation.
+   */
+  function testDuplicateFieldName() {
+    // field_tags already exists, so we're expecting an error when trying to
+    // create a new field with the same name.
+    $edit = array(
+      'fields[_add_new_field][field_name]' => 'tags',
+      'fields[_add_new_field][label]' => $this->randomName(),
+      'fields[_add_new_field][type]' => 'taxonomy_term_reference',
+      'fields[_add_new_field][widget_type]' => 'options_select',
+    );
+    $url = 'admin/structure/types/manage/' . $this->hyphen_type . '/fields';
+    $this->drupalPost($url, $edit, t('Save'));
+
+    $this->assertText(t('The machine-readable name is already in use. It must be unique.'));
+    $this->assertUrl($url, array(), 'Stayed on the same page.');
+  }
 }
 
 /**
@@ -454,7 +473,7 @@
     // Create a field, and a node with some data for the field.
     $edit = array(
       'fields[_add_new_field][label]' => 'Test field',
-      'fields[_add_new_field][field_name]' => 'field_test',
+      'fields[_add_new_field][field_name]' => 'test',
     );
     $this->fieldUIAddNewField($manage_fields, $edit);
 
@@ -499,7 +518,7 @@
     // Create a field, and a node with some data for the field.
     $edit = array(
       'fields[_add_new_field][label]' => 'Test field',
-      'fields[_add_new_field][field_name]' => 'field_test',
+      'fields[_add_new_field][field_name]' => 'test',
     );
     $this->fieldUIAddNewField('admin/structure/types/manage/' . $this->hyphen_type, $edit);
     // For this test, use a formatter setting value that is an integer unlikely

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/file.info (original)
+++ branches/upstream/current-7/modules/file/file.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 dependencies[] = field
 files[] = tests/file.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/file/file.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/file/file.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/file.js (original)
+++ branches/upstream/current-7/modules/file/file.js Thu May 10 18:20:18 2012
@@ -1,4 +1,3 @@
-
 /**
  * @file
  * Provides JavaScript additions to the managed file field type.
@@ -77,7 +76,7 @@
           '%filename': this.value,
           '%extensions': extensionPattern.replace(/\|/g, ', ')
         });
-        $(this).parents('div.form-managed-file').prepend('<div class="messages error file-upload-js-error">' + error + '</div>');
+        $(this).closest('div.form-managed-file').prepend('<div class="messages error file-upload-js-error">' + error + '</div>');
         this.value = '';
         return false;
       }
@@ -96,8 +95,8 @@
 
     // Check if we're working with an "Upload" button.
     var $enabledFields = [];
-    if ($(this).parents('div.form-managed-file').size() > 0) {
-      $enabledFields = $(this).parents('div.form-managed-file').find('input.form-file');
+    if ($(this).closest('div.form-managed-file').length > 0) {
+      $enabledFields = $(this).closest('div.form-managed-file').find('input.form-file');
     }
 
     // Temporarily disable upload fields other than the one we're currently
@@ -119,8 +118,8 @@
    */
   progressBar: function (event) {
     var clickedButton = this;
-    var $progressId = $(clickedButton).parents('div.form-managed-file').find('input.file-progress');
-    if ($progressId.size()) {
+    var $progressId = $(clickedButton).closest('div.form-managed-file').find('input.file-progress');
+    if ($progressId.length) {
       var originalName = $progressId.attr('name');
 
       // Replace the name with the required identifier.
@@ -133,7 +132,7 @@
     }
     // Show the progress bar if the upload takes longer than half a second.
     setTimeout(function () {
-      $(clickedButton).parents('div.form-managed-file').find('div.ajax-progress-bar').slideDown();
+      $(clickedButton).closest('div.form-managed-file').find('div.ajax-progress-bar').slideDown();
     }, 500);
   },
   /**

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/file.module (original)
+++ branches/upstream/current-7/modules/file/file.module Thu May 10 18:20:18 2012
@@ -16,7 +16,7 @@
     case 'admin/help#file':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The File module defines a <em>File</em> field type for the Field module, which lets you manage and validate uploaded files attached to content on your site (see the <a href="@field-help">Field module help page</a> for more information about fields). For more information, see the online handbook entry for <a href="@file">File module</a>.', array('@field-help' => url('admin/help/field'), '@file' => 'http://drupal.org/handbook/modules/file')) . '</p>';
+      $output .= '<p>' . t('The File module defines a <em>File</em> field type for the Field module, which lets you manage and validate uploaded files attached to content on your site (see the <a href="@field-help">Field module help page</a> for more information about fields). For more information, see the online handbook entry for <a href="@file">File module</a>.', array('@field-help' => url('admin/help/field'), '@file' => 'http://drupal.org/documentation/modules/file')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Attaching files to content') . '</dt>';
@@ -72,6 +72,7 @@
     '#progress_message' => NULL,
     '#upload_validators' => array(),
     '#upload_location' => NULL,
+    '#size' => 22,
     '#extended' => FALSE,
     '#attached' => array(
       'css' => array($file_path . '/file.css'),
@@ -442,7 +443,7 @@
     '#type' => 'file',
     '#title' => t('Choose a file'),
     '#title_display' => 'invisible',
-    '#size' => 22,
+    '#size' => $element['#size'],
     '#theme_wrappers' => array(),
     '#weight' => -10,
   );

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/file/tests/file.test (original)
+++ branches/upstream/current-7/modules/file/tests/file.test Thu May 10 18:20:18 2012
@@ -239,6 +239,10 @@
    * Tests the managed_file element type.
    */
   function testManagedFile() {
+    // Check that $element['#size'] is passed to the child upload element.
+    $this->drupalGet('file/test');
+    $this->assertFieldByXpath('//input[@name="files[nested_file]" and @size="13"]', NULL, 'The custom #size attribute is passed to the child upload element.');
+
     // Perform the tests with all permutations of $form['#tree'] and
     // $element['#extended'].
     foreach (array(0, 1) as $tree) {

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -36,6 +36,7 @@
     '#upload_location' => 'public://test',
     '#progress_message' => t('Please wait...'),
     '#extended' => (bool) $extended,
+    '#size' => 13,
   );
   if ($default_fid) {
     $form['nested']['file']['#default_value'] = $extended ? array('fid' => $default_fid) : $default_fid;

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/filter/filter.info (original)
+++ branches/upstream/current-7/modules/filter/filter.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 required = TRUE
 configure = admin/config/content/formats
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/filter/filter.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/filter/filter.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/filter/filter.js (original)
+++ branches/upstream/current-7/modules/filter/filter.js Thu May 10 18:20:18 2012
@@ -7,9 +7,9 @@
   attach: function (context) {
     $('.filter-guidelines', context).once('filter-guidelines')
       .find(':header').hide()
-      .parents('.filter-wrapper').find('select.filter-list')
+      .closest('.filter-wrapper').find('select.filter-list')
       .bind('change', function () {
-        $(this).parents('.filter-wrapper')
+        $(this).closest('.filter-wrapper')
           .find('.filter-guidelines-item').hide()
           .siblings('.filter-guidelines-' + this.value).show();
       })

Modified: branches/upstream/current-7/modules/filter/filter.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/filter/filter.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/filter/filter.module (original)
+++ branches/upstream/current-7/modules/filter/filter.module Thu May 10 18:20:18 2012
@@ -13,7 +13,7 @@
     case 'admin/help#filter':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Filter module allows administrators to configure text formats. A text format defines the HTML tags, codes, and other input allowed in content and comments, and is a key feature in guarding against potentially damaging input from malicious users. For more information, see the online handbook entry for <a href="@filter">Filter module</a>.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) . '</p>';
+      $output .= '<p>' . t('The Filter module allows administrators to configure text formats. A text format defines the HTML tags, codes, and other input allowed in content and comments, and is a key feature in guarding against potentially damaging input from malicious users. For more information, see the online handbook entry for <a href="@filter">Filter module</a>.', array('@filter' => 'http://drupal.org/documentation/modules/filter/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Configuring text formats') . '</dt>';
@@ -215,9 +215,11 @@
   }
   $filter_info = filter_get_filters();
   foreach ($filter_info as $name => $filter) {
-    // Add new filters without weight to the bottom.
+    // If the format does not specify an explicit weight for a filter, assign
+    // a default weight, either defined in hook_filter_info(), or the default of
+    // 0 by filter_get_filters()
     if (!isset($format->filters[$name]['weight'])) {
-      $format->filters[$name]['weight'] = 10;
+      $format->filters[$name]['weight'] = $filter['weight'];
     }
     $format->filters[$name]['status'] = isset($format->filters[$name]['status']) ? $format->filters[$name]['status'] : 0;
     $format->filters[$name]['module'] = $filter['module'];
@@ -1107,8 +1109,15 @@
       // See drupal_get_js().  This code is more or less duplicated there.
       $embed_prefix = "\n<!--{$comment_start}--><![CDATA[{$comment_start} ><!--{$comment_end}\n";
       $embed_suffix = "\n{$comment_start}--><!]]>{$comment_end}\n";
+
+      // Prevent invalid cdata escaping as this would throw a DOM error.
+      // This is the same behavior as found in libxml2.
+      // Related W3C standard: http://www.w3.org/TR/REC-xml/#dt-cdsection
+      // Fix explanation: http://en.wikipedia.org/wiki/CDATA#Nesting
+      $data = str_replace(']]>', ']]]]><![CDATA[>', $node->data);
+
       $fragment = $dom_document->createDocumentFragment();
-      $fragment->appendXML($embed_prefix . $node->data . $embed_suffix);
+      $fragment->appendXML($embed_prefix . $data . $embed_suffix);
       $dom_element->appendChild($fragment);
       $dom_element->removeChild($node);
     }
@@ -1121,7 +1130,7 @@
  * @ingroup themeable
  */
 function theme_filter_tips_more_info() {
-  return '<p>' . l(t('More information about text formats'), 'filter/tips') . '</p>';
+  return '<p>' . l(t('More information about text formats'), 'filter/tips', array('attributes' => array('target' => '_blank'))) . '</p>';
 }
 
 /**
@@ -1351,6 +1360,7 @@
     '#maxlength' => 4,
     '#field_suffix' => t('characters'),
     '#description' => t('URLs longer than this number of characters will be truncated to prevent long strings that break formatting. The link itself will be retained; just the text portion of the link will be truncated.'),
+    '#element_validate' => array('element_validate_integer_positive'),
   );
   return $settings;
 }
@@ -1409,7 +1419,7 @@
   $tasks['_filter_url_parse_full_links'] = $pattern;
 
   // Match e-mail addresses.
-  $url_pattern = "[A-Za-z0-9._-]+@(?:$domain)";
+  $url_pattern = "[A-Za-z0-9._-]{1,254}@(?:$domain)";
   $pattern = "`($url_pattern)`";
   $tasks['_filter_url_parse_email_links'] = $pattern;
 

Modified: branches/upstream/current-7/modules/filter/filter.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/filter/filter.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/filter/filter.test (original)
+++ branches/upstream/current-7/modules/filter/filter.test Thu May 10 18:20:18 2012
@@ -398,6 +398,18 @@
     $this->drupalPost('admin/config/content/formats/' . $filtered, $edit, t('Save configuration'));
     $this->assertFieldByName('filters[' . $second_filter . '][weight]', $edit['filters[' . $second_filter . '][weight]'], t('Changes reverted.'));
     $this->assertFieldByName('filters[' . $first_filter . '][weight]', $edit['filters[' . $first_filter . '][weight]'], t('Changes reverted.'));
+  }
+
+  /**
+   * Tests the URL filter settings form is properly validated.
+   */
+  function testUrlFilterAdmin() {
+    // The form does not save with an invalid filter URL length.
+    $edit = array(
+      'filters[filter_url][settings][filter_url_length]' => $this->randomName(4),
+    );
+    $this->drupalPost('admin/config/content/formats/filtered_html', $edit, t('Save configuration'));
+    $this->assertNoRaw(t('The text format %format has been updated.', array('%format' => 'Filtered HTML')));
   }
 }
 
@@ -1637,6 +1649,79 @@
  /* Styling */ body {color:red}
 /*--><!]]>*/
 </style></p>', t('HTML corrector -- CDATA added to a style element.'));
+
+    $filtered_data = _filter_htmlcorrector('<p><style>
+/*<![CDATA[*/
+/* Styling */
+body {color:red}
+/*]]>*/
+</style></p>');
+    $this->assertEqual($filtered_data, '<p><style>
+<!--/*--><![CDATA[/* ><!--*/
+
+/*<![CDATA[*/
+/* Styling */
+body {color:red}
+/*]]]]><![CDATA[>*/
+
+/*--><!]]>*/
+</style></p>',
+      t('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '/*<![CDATA[*/'))
+    );
+
+    $filtered_data = _filter_htmlcorrector('<p><style>
+  <!--/*--><![CDATA[/* ><!--*/
+  /* Styling */
+  body {color:red}
+  /*--><!]]>*/
+</style></p>');
+    $this->assertEqual($filtered_data, '<p><style>
+<!--/*--><![CDATA[/* ><!--*/
+
+  <!--/*--><![CDATA[/* ><!--*/
+  /* Styling */
+  body {color:red}
+  /*--><!]]]]><![CDATA[>*/
+
+/*--><!]]>*/
+</style></p>',
+      t('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '<!--/*--><![CDATA[/* ><!--*/'))
+    );
+
+    $filtered_data = _filter_htmlcorrector('<p><script type="text/javascript">
+<!--//--><![CDATA[// ><!--
+  alert("test");
+//--><!]]>
+</script></p>');
+    $this->assertEqual($filtered_data, '<p><script type="text/javascript">
+<!--//--><![CDATA[// ><!--
+
+<!--//--><![CDATA[// ><!--
+  alert("test");
+//--><!]]]]><![CDATA[>
+
+//--><!]]>
+</script></p>',
+      t('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '<!--//--><![CDATA[// ><!--'))
+    );
+
+    $filtered_data = _filter_htmlcorrector('<p><script type="text/javascript">
+// <![CDATA[
+  alert("test");
+// ]]>
+</script></p>');
+    $this->assertEqual($filtered_data, '<p><script type="text/javascript">
+<!--//--><![CDATA[// ><!--
+
+// <![CDATA[
+  alert("test");
+// ]]]]><![CDATA[>
+
+//--><!]]>
+</script></p>',
+      t('HTML corrector -- Existing cdata section @pattern_name properly escaped', array('@pattern_name' => '// <![CDATA['))
+    );
+
   }
 
   /**
@@ -1750,3 +1835,61 @@
   }
 }
 
+/**
+ * Tests filter settings.
+ */
+class FilterSettingsTestCase extends DrupalWebTestCase {
+  protected $profile = 'testing';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Filter settings',
+      'description' => 'Tests filter settings.',
+      'group' => 'Filter',
+    );
+  }
+
+  /**
+   * Tests explicit and implicit default settings for filters.
+   */
+  function testFilterDefaults() {
+    $filter_info = filter_filter_info();
+    $filters = array_fill_keys(array_keys($filter_info), array());
+
+    // Create text format using filter default settings.
+    $filter_defaults_format = (object) array(
+      'format' => 'filter_defaults',
+      'name' => 'Filter defaults',
+      'filters' => $filters,
+    );
+    filter_format_save($filter_defaults_format);
+
+    // Verify that default weights defined in hook_filter_info() were applied.
+    $saved_settings = array();
+    foreach ($filter_defaults_format->filters as $name => $settings) {
+      $expected_weight = (isset($filter_info[$name]['weight']) ? $filter_info[$name]['weight'] : 0);
+      $this->assertEqual($settings['weight'], $expected_weight, format_string('@name filter weight %saved equals %default', array(
+        '@name' => $name,
+        '%saved' => $settings['weight'],
+        '%default' => $expected_weight,
+      )));
+      $saved_settings[$name]['weight'] = $expected_weight;
+    }
+
+    // Re-save the text format.
+    filter_format_save($filter_defaults_format);
+    // Reload it from scratch.
+    filter_formats_reset();
+    $filter_defaults_format = filter_format_load($filter_defaults_format->format);
+    $filter_defaults_format->filters = filter_list_format($filter_defaults_format->format);
+
+    // Verify that saved filter settings have not been changed.
+    foreach ($filter_defaults_format->filters as $name => $settings) {
+      $this->assertEqual($settings->weight, $saved_settings[$name]['weight'], format_string('@name filter weight %saved equals %previous', array(
+        '@name' => $name,
+        '%saved' => $settings->weight,
+        '%previous' => $saved_settings[$name]['weight'],
+      )));
+    }
+  }
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/forum/forum.info (original)
+++ branches/upstream/current-7/modules/forum/forum.info Thu May 10 18:20:18 2012
@@ -9,8 +9,8 @@
 configure = admin/structure/forum
 stylesheets[all][] = forum.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/forum/forum.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/forum/forum.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/forum/forum.install (original)
+++ branches/upstream/current-7/modules/forum/forum.install Thu May 10 18:20:18 2012
@@ -442,3 +442,16 @@
 /**
  * @} End of "addtogroup updates-7.x-extra"
  */
+
+/**
+ * Update {form_index} so that only published nodes are indexed.
+ */
+function forum_update_7011() {
+  $select = db_select('node', 'n')
+    ->fields('n', array('nid'))
+    ->condition('status', 0 );
+
+  db_delete('forum_index')
+    ->condition('nid', $select, 'IN')
+    ->execute();
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/forum/forum.module (original)
+++ branches/upstream/current-7/modules/forum/forum.module Thu May 10 18:20:18 2012
@@ -23,7 +23,7 @@
       $output .= '</ul>';
       $output .= '</ul>';
       $output .= '</ul>';
-      $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@forum">Forum module</a>.', array('@forum' => 'http://drupal.org/handbook/modules/forum')) . '</p>';
+      $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@forum">Forum module</a>.', array('@forum' => 'http://drupal.org/documentation/modules/forum')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Setting up forum structure') . '</dt>';
@@ -468,10 +468,10 @@
 /**
  * Implements hook_taxonomy_term_delete().
  */
-function forum_taxonomy_term_delete($tid) {
+function forum_taxonomy_term_delete($term) {
   // For containers, remove the tid from the forum_containers variable.
   $containers = variable_get('forum_containers', array());
-  $key = array_search($tid, $containers);
+  $key = array_search($term->tid, $containers);
   if ($key !== FALSE) {
     unset($containers[$key]);
   }
@@ -545,56 +545,81 @@
 function forum_field_storage_pre_update($entity_type, $entity, &$skip_fields) {
   $first_call = &drupal_static(__FUNCTION__, array());
 
-  if ($entity_type == 'node' && $entity->status && _forum_node_check_node_type($entity)) {
-    // 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;
+  if ($entity_type == 'node' && _forum_node_check_node_type($entity)) {
+
+    // If the node is published, update the forum index.
+    if ($entity->status) {
+
+      // 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('forum_index')->condition('nid', $entity->nid)->execute();
+      }
+      $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);
+    }
+
+    // When a forum node is unpublished, remove it from the forum_index table.
+    else {
       db_delete('forum_index')->condition('nid', $entity->nid)->execute();
     }
-    $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);
-  }
-}
-
-/**
- * Implements hook_form_alter().
- */
-function forum_form_alter(&$form, $form_state, $form_id) {
+
+  }
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter() for taxonomy_form_vocabulary().
+ */
+function forum_form_taxonomy_form_vocabulary_alter(&$form, &$form_state, $form_id) {
   $vid = variable_get('forum_nav_vocabulary', 0);
   if (isset($form['vid']['#value']) && $form['vid']['#value'] == $vid) {
-    // Hide critical options from forum vocabulary.
-    if ($form_id == 'taxonomy_form_vocabulary') {
-      $form['help_forum_vocab'] = array(
-        '#markup' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'),
-        '#weight' => -1,
-      );
-      $form['hierarchy'] = array('#type' => 'value', '#value' => 1);
-      $form['delete']['#access'] = FALSE;
-    }
+    $form['help_forum_vocab'] = array(
+      '#markup' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'),
+      '#weight' => -1,
+    );
+    // Forum's vocabulary always has single hierarchy. Forums and containers
+    // have only one parent or no parent for root items. By default this value
+    // is 0.
+    $form['hierarchy']['#value'] = 1;
+    // Do not allow to delete forum's vocabulary.
+    $form['actions']['delete']['#access'] = FALSE;
+  }
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter() for taxonomy_form_term().
+ */
+function forum_form_taxonomy_form_term_alter(&$form, &$form_state, $form_id) {
+   $vid = variable_get('forum_nav_vocabulary', 0);
+   if (isset($form['vid']['#value']) && $form['vid']['#value'] == $vid) {
     // Hide multiple parents select from forum terms.
-    elseif ($form_id == 'taxonomy_form_term') {
-      $form['advanced']['parent']['#access'] = FALSE;
-    }
-  }
-  if (!empty($form['#node_edit_form']) && isset($form['taxonomy_forums'])) {
+    $form['relations']['parent']['#access'] = FALSE;
+  }
+}
+
+/**
+ * Implements hook_form_BASE_FORM_ID_alter() for node_form().
+ */
+function forum_form_node_form_alter(&$form, &$form_state, $form_id) {
+  if (isset($form['taxonomy_forums'])) {
     $langcode = $form['taxonomy_forums']['#language'];
     // Make the vocabulary required for 'real' forum-nodes.
     $form['taxonomy_forums'][$langcode]['#required'] = TRUE;
@@ -773,7 +798,7 @@
     $query->addExpression('SUM(ncs.comment_count)', 'comment_count');
     $counts = $query
       ->fields('f', array('tid'))
-      ->condition('status', 1)
+      ->condition('n.status', 1)
       ->groupBy('tid')
       ->addTag('node_access')
       ->execute()

Modified: branches/upstream/current-7/modules/forum/forum.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/forum/forum.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/forum/forum.test (original)
+++ branches/upstream/current-7/modules/forum/forum.test Thu May 10 18:20:18 2012
@@ -242,10 +242,31 @@
     // Save forum overview.
     $this->drupalPost('admin/structure/forum/', array(), t('Save'));
     $this->assertRaw(t('The configuration options have been saved.'));
-    // Delete this second form.
+    // Delete this second forum.
     $this->deleteForum($this->delete_forum['tid']);
     // Create forum at the top (root) level.
     $this->root_forum = $this->createForum('forum');
+
+    // Test vocabulary form alterations.
+    $this->drupalGet('admin/structure/taxonomy/forums/edit');
+    $this->assertFieldByName('op', t('Save'), 'Save button found.');
+    $this->assertNoFieldByName('op', t('Delete'), 'Delete button not found.');
+
+    // Test term edit form alterations.
+    $this->drupalGet('taxonomy/term/' . $this->container['tid'] . '/edit');
+    // Test parent field been hidden by forum module.
+    $this->assertNoField('parent[]', 'Parent field not found.');
+
+    // Test tags vocabulary form is not affected.
+    $this->drupalGet('admin/structure/taxonomy/tags/edit');
+    $this->assertFieldByName('op', t('Save'), 'Save button found.');
+    $this->assertFieldByName('op', t('Delete'), 'Delete button found.');
+    // Test tags vocabulary term form is not affected.
+    $this->drupalGet('admin/structure/taxonomy/tags/add');
+    $this->assertField('parent[]', 'Parent field found.');
+    // Test relations fieldset exists.
+    $relations_fieldset = $this->xpath("//fieldset[@id='edit-relations']");
+    $this->assertTrue(isset($relations_fieldset[0]), 'Relations fieldset element found.');
   }
 
   /**
@@ -341,6 +362,11 @@
     // Assert that the forum no longer exists.
     $this->drupalGet('forum/' . $tid);
     $this->assertResponse(404, 'The forum was not found');
+
+    // Assert that the associated term has been removed from the
+    // forum_containers variable.
+    $containers = variable_get('forum_containers', array());
+    $this->assertFalse(in_array($tid, $containers), 'The forum_containers variable has been updated.');
   }
 
   /**
@@ -548,3 +574,65 @@
     }
   }
 }
+
+/**
+ * Tests the forum index listing.
+ */
+class ForumIndexTestCase extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Forum index',
+      'description' => 'Tests the forum index listing.',
+      'group' => 'Forum',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('taxonomy', 'comment', 'forum');
+
+    // Create a test user.
+    $web_user = $this->drupalCreateUser(array('create forum content', 'edit own forum content', 'edit any forum content', 'administer nodes'));
+    $this->drupalLogin($web_user);
+  }
+
+  /**
+   * Tests the forum index for published and unpublished nodes.
+   */
+  function testForumIndexStatus() {
+
+    $langcode = LANGUAGE_NONE;
+
+    // The forum ID to use.
+    $tid = 1;
+
+    // Create a test node.
+    $title = $this->randomName(20);
+    $edit = array(
+      "title" => $title,
+      "body[$langcode][0][value]" => $this->randomName(200),
+    );
+
+    // Create the forum topic, preselecting the forum ID via a URL parameter.
+    $this->drupalPost('node/add/forum/' . $tid, $edit, t('Save'));
+
+    // Check that the node exists in the database.
+    $node = $this->drupalGetNodeByTitle($title);
+    $this->assertTrue(!empty($node), 'New forum node found in database.');
+
+    // Verify that the node appears on the index.
+    $this->drupalGet('forum/' . $tid);
+    $this->assertText($title, 'Published forum topic appears on index.');
+
+    // Unpublish the node.
+    $edit = array(
+      'status' => FALSE,
+    );
+    $this->drupalPost("node/{$node->nid}/edit", $edit, t('Save'));
+    $this->assertText(t('Access denied'), 'Unpublished node is no longer accessible.');
+
+    // Verify that the node no longer appears on the index.
+    $this->drupalGet('forum/' . $tid);
+    $this->assertNoText($title, 'Unpublished forum topic no longer appears on index.');
+  }
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/help/help.info (original)
+++ branches/upstream/current-7/modules/help/help.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 files[] = help.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/help/help.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/help/help.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/help/help.module (original)
+++ branches/upstream/current-7/modules/help/help.module Thu May 10 18:20:18 2012
@@ -45,12 +45,12 @@
       $output .= '<li>' . t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.', array('@themes' => url('admin/appearance'), '@download_themes' => 'http://drupal.org/project/themes')) . '</li>';
       $output .= '<li>' . t('<strong>Start posting content</strong> Finally, you can <a href="@content">add new content</a> for your website.', array('@content' => url('node/add'))) . '</li>';
       $output .= '</ol>';
-      $output .= '<p>' . t('For more information, refer to the specific topics listed in the next section or to the <a href="@handbook">online Drupal handbooks</a>. You may also post at the <a href="@forum">Drupal forum</a> or view the wide range of <a href="@support">other support options</a> available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/handbooks', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) . '</p>';
+      $output .= '<p>' . t('For more information, refer to the specific topics listed in the next section or to the <a href="@handbook">online Drupal handbooks</a>. You may also post at the <a href="@forum">Drupal forum</a> or view the wide range of <a href="@support">other support options</a> available.', array('@help' => url('admin/help'), '@handbook' => 'http://drupal.org/documentation', '@forum' => 'http://drupal.org/forum', '@support' => 'http://drupal.org/support')) . '</p>';
       return $output;
     case 'admin/help#help':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Help module provides <a href="@help-page">Help reference pages</a> and context-sensitive advice to guide you through the use and configuration of modules. It is a starting point for the online <a href="@handbook">Drupal handbooks</a>. The handbooks contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the online handbook entry for the <a href="@help">Help module</a>.', array('@help' => 'http://drupal.org/handbook/modules/help/', '@handbook' => 'http://drupal.org/handbook', '@help-page' => url('admin/help'))) . '</p>';
+      $output .= '<p>' . t('The Help module provides <a href="@help-page">Help reference pages</a> and context-sensitive advice to guide you through the use and configuration of modules. It is a starting point for the online <a href="@handbook">Drupal handbooks</a>. The handbooks contain more extensive and up-to-date information, are annotated with user-contributed comments, and serve as the definitive reference point for all Drupal documentation. For more information, see the online handbook entry for the <a href="@help">Help module</a>.', array('@help' => 'http://drupal.org/documentation/modules/help/', '@handbook' => 'http://drupal.org/documentation', '@help-page' => url('admin/help'))) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Providing a help reference') . '</dt>';

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/help/help.test (original)
+++ branches/upstream/current-7/modules/help/help.test Thu May 10 18:20:18 2012
@@ -55,7 +55,7 @@
     $this->assertRaw(drupal_get_path('module', 'help') . '/help.css', t('The help.css file is present in the HTML.'));
 
     // Verify that introductory help text exists, goes for 100% module coverage.
-    $this->assertRaw(t('For more information, refer to the specific topics listed in the next section or to the <a href="@drupal">online Drupal handbooks</a>.', array('@drupal' => 'http://drupal.org/handbooks')), 'Help intro text correctly appears.');
+    $this->assertRaw(t('For more information, refer to the specific topics listed in the next section or to the <a href="@drupal">online Drupal handbooks</a>.', array('@drupal' => 'http://drupal.org/documentation')), 'Help intro text correctly appears.');
 
     // Verify that help topics text appears.
     $this->assertRaw('<h2>' . t('Help topics') . '</h2><p>' . t('Help is available on the following items:') . '</p>', t('Help topics text correctly appears.'));

Modified: branches/upstream/current-7/modules/image/image.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/image/image.admin.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.admin.inc (original)
+++ branches/upstream/current-7/modules/image/image.admin.inc Thu May 10 18:20:18 2012
@@ -342,7 +342,7 @@
  * Submit handler to convert an overridden style to its default.
  */
 function image_style_revert_form_submit($form, &$form_state) {
-  drupal_set_message(t('The %style style has been revert to its defaults.', array('%style' => $form_state['image_style']['name'])));
+  drupal_set_message(t('The %style style has been reverted to its defaults.', array('%style' => $form_state['image_style']['name'])));
   image_default_style_revert($form_state['image_style']);
   $form_state['redirect'] = 'admin/config/media/image-styles';
 }

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.field.inc (original)
+++ branches/upstream/current-7/modules/image/image.field.inc Thu May 10 18:20:18 2012
@@ -25,6 +25,7 @@
         'title_field' => 0,
         'max_resolution' => '',
         'min_resolution' => '',
+        'default_image' => 0,
       ),
       'default_widget' => 'image_image',
       'default_formatter' => 'image',
@@ -152,6 +153,15 @@
     '#weight' => 11,
   );
 
+  // Add the default image to the instance.
+  $form['default_image'] = array(
+    '#title' => t('Default image'),
+    '#type' => 'managed_file',
+    '#description' => t("If no image is uploaded, this image will be shown on display and will override the field's default image."),
+    '#default_value' => $settings['default_image'],
+    '#upload_location' => $field['settings']['uri_scheme'] . '://default_images/',
+  );
+
   return $form;
 }
 
@@ -191,8 +201,19 @@
 function image_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {
   // If there are no files specified at all, use the default.
   foreach ($entities as $id => $entity) {
-    if (empty($items[$id]) && $field['settings']['default_image']) {
-      if ($file = file_load($field['settings']['default_image'])) {
+    if (empty($items[$id])) {
+      $fid = 0;
+      // Use the default for the instance if one is available.
+      if ($instances[$id]['settings']['default_image']) {
+        $fid = $instances[$id]['settings']['default_image'];
+      }
+      // Otherwise, use the default for the field.
+      elseif ($field['settings']['default_image']) {
+        $fid = $field['settings']['default_image'];
+      }
+
+      // Add the default image if one is found.
+      if ($fid && ($file = file_load($fid))) {
         $items[$id][0] = (array) $file + array(
           'is_default' => TRUE,
           'alt' => '',
@@ -568,7 +589,8 @@
  *
  * @param $variables
  *   An associative array containing:
- *   - item: An array of image data.
+ *   - item: Associative array of image data, which may include "uri", "alt",
+ *     "width", "height", "title" and "attributes".
  *   - image_style: An optional image style.
  *   - path: An array containing the link 'path' and link 'options'.
  *
@@ -580,6 +602,10 @@
     'path' => $item['uri'],
     'alt' => $item['alt'],
   );
+
+  if (isset($item['attributes'])) {
+    $image['attributes'] = $item['attributes'];
+  }
 
   if (isset($item['width']) && isset($item['height'])) {
     $image['width'] = $item['width'];

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.info (original)
+++ branches/upstream/current-7/modules/image/image.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 files[] = image.test
 configure = admin/config/media/image-styles
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.install (original)
+++ branches/upstream/current-7/modules/image/image.install Thu May 10 18:20:18 2012
@@ -151,6 +151,18 @@
       ),
     ),
   );
+}
+
+/**
+ * Implements hook_update_dependencies().
+ */
+function image_update_dependencies() {
+  $dependencies['image'][7002] = array(
+    // Image update 7002 uses field API functions, so must run after
+    // Field API has been enabled.
+    'system' => 7020,
+  );
+  return $dependencies;
 }
 
 /**

Modified: branches/upstream/current-7/modules/image/image.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/image/image.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.module (original)
+++ branches/upstream/current-7/modules/image/image.module Thu May 10 18:20:18 2012
@@ -41,7 +41,7 @@
     case 'admin/help#image':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Image module allows you to manipulate images on your website. It exposes a setting for using the <em>Image toolkit</em>, allows you to configure <em>Image styles</em> that can be used for resizing or adjusting images on display, and provides an <em>Image</em> field for attaching images to content. For more information, see the online handbook entry for <a href="@image">Image module</a>.', array('@image' => 'http://drupal.org/handbook/modules/image')) . '</p>';
+      $output .= '<p>' . t('The Image module allows you to manipulate images on your website. It exposes a setting for using the <em>Image toolkit</em>, allows you to configure <em>Image styles</em> that can be used for resizing or adjusting images on display, and provides an <em>Image</em> field for attaching images to content. For more information, see the online handbook entry for <a href="@image">Image module</a>.', array('@image' => 'http://drupal.org/documentation/modules/image')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Manipulating images') . '</dt>';
@@ -297,12 +297,9 @@
           // Send headers describing the image's size, and MIME-type...
           'Content-Type' => $info['mime_type'],
           'Content-Length' => $info['file_size'],
-          // ...and allow the file to be cached for two weeks (matching the
-          // value we/ use for the mod_expires settings in .htaccess) and
-          // ensure that caching proxies do not share the image with other
-          // users.
-          'Expires' => gmdate(DATE_RFC1123, REQUEST_TIME + 1209600),
-          'Cache-Control' => 'max-age=1209600, private, must-revalidate',
+          // By not explicitly setting them here, this uses normal Drupal
+          // Expires, Cache-Control and ETag headers to prevent proxy or
+          // browser caching of private images.
         );
       }
     }
@@ -326,7 +323,7 @@
  */
 function image_file_move($file, $source) {
   // Delete any image derivatives at the original image path.
-  image_path_flush($file->uri);
+  image_path_flush($source->uri);
 }
 
 /**
@@ -467,6 +464,73 @@
 }
 
 /**
+ * Implements hook_field_delete_instance().
+ */
+function image_field_delete_instance($instance) {
+  // Only act on image fields.
+  $field = field_read_field($instance['field_name']);
+  if ($field['type'] != 'image') {
+    return;
+  }
+
+  // The value of a managed_file element can be an array if the #extended
+  // property is set to TRUE.
+  $fid = $instance['settings']['default_image'];
+  if (is_array($fid)) {
+    $fid = $fid['fid'];
+  }
+
+  // Remove the default image when the instance is deleted.
+  if ($fid && ($file = file_load($fid))) {
+    file_usage_delete($file, 'image', 'default_image', $instance['id']);
+  }
+}
+
+/**
+ * Implements hook_field_update_instance().
+ */
+function image_field_update_instance($instance, $prior_instance) {
+  // Only act on image fields.
+  $field = field_read_field($instance['field_name']);
+  if ($field['type'] != 'image') {
+    return;
+  }
+
+  // The value of a managed_file element can be an array if the #extended
+  // property is set to TRUE.
+  $fid_new = $instance['settings']['default_image'];
+  if (is_array($fid_new)) {
+    $fid_new = $fid_new['fid'];
+  }
+  $fid_old = $prior_instance['settings']['default_image'];
+  if (is_array($fid_old)) {
+    $fid_old = $fid_old['fid'];
+  }
+
+  // If the old and new files do not match, update the default accordingly.
+  $file_new = $fid_new ? file_load($fid_new) : FALSE;
+  if ($fid_new != $fid_old) {
+    // Save the new file, if present.
+    if ($file_new) {
+      $file_new->status = FILE_STATUS_PERMANENT;
+      file_save($file_new);
+      file_usage_add($file_new, 'image', 'default_image', $instance['id']);
+    }
+    // Delete the old file, if present.
+    if ($fid_old && ($file_old = file_load($fid_old))) {
+      file_usage_delete($file_old, 'image', 'default_image', $instance['id']);
+    }
+  }
+
+  // If the upload destination changed, then move the file.
+  if ($file_new && (file_uri_scheme($file_new->uri) != $field['settings']['uri_scheme'])) {
+    $directory = $field['settings']['uri_scheme'] . '://default_images/';
+    file_prepare_directory($directory, FILE_CREATE_DIRECTORY);
+    file_move($file_new, $directory . $file_new->filename);
+  }
+}
+
+/**
  * Clear cached versions of a specific file in all styles.
  *
  * @param $path
@@ -682,7 +746,10 @@
   if ($include_empty && !empty($styles)) {
     $options[''] = t('<none>');
   }
-  $options = array_merge($options, drupal_map_assoc(array_keys($styles)));
+  // Use the array concatenation operator '+' here instead of array_merge(),
+  // because the latter loses the datatype of the array keys, turning
+  // associative string keys into numeric ones without warning.
+  $options = $options + drupal_map_assoc(array_keys($styles));
   if (empty($options)) {
     $options[''] = t('No defined styles');
   }
@@ -1171,7 +1238,9 @@
  *   - style_name: The name of the style to be used to alter the original image.
  *   - path: The path of the image file relative to the Drupal files directory.
  *     This function does not work with images outside the files directory nor
- *     with remotely hosted images.
+ *     with remotely hosted images. This should be in a format such as
+ *     'images/image.jpg', or using a stream wrapper such as
+ *     'public://images/image.jpg'.
  *   - width: The width of the source image (if known).
  *   - height: The height of the source image (if known).
  *   - alt: The alternative text for text-based browsers.

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/image/image.test (original)
+++ branches/upstream/current-7/modules/image/image.test Thu May 10 18:20:18 2012
@@ -105,7 +105,7 @@
 /**
  * Tests the functions for generating paths and URLs for image styles.
  */
-class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
+class ImageStylesPathAndUrlTestCase extends DrupalWebTestCase {
   protected $style_name;
   protected $image_info;
   protected $image_filepath;
@@ -209,7 +209,22 @@
     $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], t('Expected Content-Type was reported.'));
     $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], t('Expected Content-Length was reported.'));
     if ($scheme == 'private') {
+      $this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', t('Expires header was sent.'));
+      $this->assertEqual($this->drupalGetHeader('Cache-Control'), 'no-cache, must-revalidate, post-check=0, pre-check=0', t('Cache-Control header was set to prevent caching.'));
       $this->assertEqual($this->drupalGetHeader('X-Image-Owned-By'), 'image_module_test', t('Expected custom header has been added.'));
+      // Verify access is denied to private image styles.
+      $this->drupalLogout();
+      $this->drupalGet($generate_url);
+      $this->assertResponse(403, t('Confirmed that access is denied for the private image style.') );
+      // Verify that images are not appended to the response. Currently this test only uses PNG images.
+      if (strpos($generate_url, '.png') === FALSE ) {
+        $this->fail( t('Confirming that private image styles are not appended require PNG file.') );
+      }
+      else {
+        // Check for PNG-Signature (cf. http://www.libpng.org/pub/png/book/chapter08.html#png.ch08.div.2) in the
+        // response body.
+        $this->assertNoRaw( chr(137) . chr(80) . chr(78) . chr(71) . chr(13) . chr(10) . chr(26) . chr(10), t('No PNG signature found in the response body.') );
+      }
     }
   }
 }
@@ -352,6 +367,21 @@
    */
   function getImageCount($style) {
     return count(file_scan_directory('public://styles/' . $style['name'], '/.*/'));
+  }
+
+  /**
+   * Test creating an image style with a numeric name and ensuring it can be
+   * applied to an image.
+   */
+  function testNumericStyleName() {
+    $style_name = rand();
+    $edit = array(
+      'name' => $style_name,
+    );
+    $this->drupalPost('admin/config/media/image-styles/add', $edit, t('Create new style'));
+    $this->assertRaw(t('Style %name was created.', array('%name' => $style_name)), t('Image style successfully created.'));
+    $options = image_style_options();
+    $this->assertTrue(array_key_exists($style_name, $options), t('Array key %key exists.', array('%key' => $style_name)));
   }
 
   /**
@@ -587,7 +617,8 @@
 
     // Create an image field that uses the new style.
     $field_name = strtolower($this->randomName(10));
-    $instance = $this->createImageField($field_name, 'article');
+    $this->createImageField($field_name, 'article');
+    $instance = field_info_instance('node', $field_name, 'article');
     $instance['display']['default']['type'] = 'image';
     $instance['display']['default']['settings']['image_style'] = $style_name;
     field_update_instance($instance);
@@ -805,6 +836,23 @@
       '%max' => $schema['fields'][$field_name .'_title']['length'],
       '%length' => $test_size,
     )));
+  }
+
+  /**
+   * Test passing attributes into the image field formatters.
+   */
+  function testImageFieldFormatterAttributes() {
+    $image = theme('image_formatter', array(
+      'item' => array(
+        'uri' => 'http://example.com/example.png',
+        'attributes' => array(
+          'data-image-field-formatter' => 'testFound',
+        ),
+        'alt' => t('Image field formatter attribute test.'),
+        'title' => t('Image field formatter'),
+      ),
+    ));
+    $this->assertTrue(stripos($image, 'testFound') > 0, t('Image field formatters can have attributes.'));
   }
 
   /**
@@ -934,7 +982,7 @@
 /**
  * Tests that images have correct dimensions when styled.
  */
-class ImageDimensionsUnitTest extends DrupalWebTestCase {
+class ImageDimensionsTestCase extends DrupalWebTestCase {
 
   public static function getInfo() {
     return array(
@@ -1289,3 +1337,232 @@
     }
   }
 }
+
+/**
+ * Tests default image settings.
+ */
+class ImageFieldDefaultImagesTestCase extends ImageFieldTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Image field default images tests',
+      'description' => 'Tests setting up default images both to the field and field instance.',
+      'group' => 'Image',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('field_ui'));
+  }
+
+  /**
+   * Tests CRUD for fields and fields instances with default images.
+   */
+  function testDefaultImages() {
+    // Create files to use as the default images.
+    $files = $this->drupalGetTestFiles('image');
+    $default_images = array();
+    foreach (array('field', 'instance', 'instance2', 'field_new', 'instance_new') as $image_target) {
+      $file = array_pop($files);
+      $file = file_save($file);
+      $default_images[$image_target] = $file;
+    }
+
+    // Create an image field and add an instance to the article content type.
+    $field_name = strtolower($this->randomName());
+    $field_settings = array(
+      'default_image' => $default_images['field']->fid,
+    );
+    $instance_settings = array(
+      'default_image' => $default_images['instance']->fid,
+    );
+    $widget_settings = array(
+      'preview_image_style' => 'medium',
+    );
+    $this->createImageField($field_name, 'article', $field_settings, $instance_settings, $widget_settings);
+    $field = field_info_field($field_name);
+    $instance = field_info_instance('node', $field_name, 'article');
+
+    // Add another instance with another default image to the page content type.
+    $instance2 = array_merge($instance, array(
+      'bundle' => 'page',
+      'settings' => array(
+        'default_image' => $default_images['instance2']->fid,
+      ),
+    ));
+    field_create_instance($instance2);
+    $instance2 = field_info_instance('node', $field_name, 'page');
+
+
+    // Confirm the defaults are present on the article field admin form.
+    $this->drupalGet("admin/structure/types/manage/article/fields/$field_name");
+    $this->assertFieldByXpath(
+      '//input[@name="field[settings][default_image][fid]"]',
+      $default_images['field']->fid,
+      format_string(
+        'Article image field default equals expected file ID of @fid.',
+        array('@fid' => $default_images['field']->fid)
+      )
+    );
+    $this->assertFieldByXpath(
+      '//input[@name="instance[settings][default_image][fid]"]',
+      $default_images['instance']->fid,
+      format_string(
+        'Article image field instance default equals expected file ID of @fid.',
+        array('@fid' => $default_images['instance']->fid)
+      )
+    );
+
+    // Confirm the defaults are present on the page field admin form.
+    $this->drupalGet("admin/structure/types/manage/page/fields/$field_name");
+    $this->assertFieldByXpath(
+      '//input[@name="field[settings][default_image][fid]"]',
+      $default_images['field']->fid,
+      format_string(
+        'Page image field default equals expected file ID of @fid.',
+        array('@fid' => $default_images['field']->fid)
+      )
+    );
+    $this->assertFieldByXpath(
+      '//input[@name="instance[settings][default_image][fid]"]',
+      $default_images['instance2']->fid,
+      format_string(
+        'Page image field instance default equals expected file ID of @fid.',
+        array('@fid' => $default_images['instance2']->fid)
+      )
+    );
+
+    // Confirm that the image default is shown for a new article node.
+    $article = $this->drupalCreateNode(array('type' => 'article'));
+    $article_built = node_view($article);
+    $this->assertEqual(
+      $article_built[$field_name]['#items'][0]['fid'],
+      $default_images['instance']->fid,
+      format_string(
+        'A new article node without an image has the expected default image file ID of @fid.',
+        array('@fid' => $default_images['instance']->fid)
+      )
+    );
+
+    // Confirm that the image default is shown for a new page node.
+    $page = $this->drupalCreateNode(array('type' => 'page'));
+    $page_built = node_view($page);
+    $this->assertEqual(
+      $page_built[$field_name]['#items'][0]['fid'],
+      $default_images['instance2']->fid,
+      format_string(
+        'A new page node without an image has the expected default image file ID of @fid.',
+        array('@fid' => $default_images['instance2']->fid)
+      )
+    );
+
+    // Upload a new default for the field.
+    $field['settings']['default_image'] = $default_images['field_new']->fid;
+    field_update_field($field);
+
+    // Confirm that the new field default is used on the article admin form.
+    $this->drupalGet("admin/structure/types/manage/article/fields/$field_name");
+    $this->assertFieldByXpath(
+      '//input[@name="field[settings][default_image][fid]"]',
+      $default_images['field_new']->fid,
+      format_string(
+        'Updated image field default equals expected file ID of @fid.',
+        array('@fid' => $default_images['field_new']->fid)
+      )
+    );
+
+    // Reload the nodes and confirm the field instance defaults are used.
+    $article_built = node_view($article = node_load($article->nid, NULL, $reset = TRUE));
+    $page_built = node_view($page = node_load($page->nid, NULL, $reset = TRUE));
+    $this->assertEqual(
+      $article_built[$field_name]['#items'][0]['fid'],
+      $default_images['instance']->fid,
+      format_string(
+        'An existing article node without an image has the expected default image file ID of @fid.',
+        array('@fid' => $default_images['instance']->fid)
+      )
+    );
+    $this->assertEqual(
+      $page_built[$field_name]['#items'][0]['fid'],
+      $default_images['instance2']->fid,
+      format_string(
+        'An existing page node without an image has the expected default image file ID of @fid.',
+        array('@fid' => $default_images['instance2']->fid)
+      )
+    );
+
+    // Upload a new default for the article's field instance.
+    $instance['settings']['default_image'] = $default_images['instance_new']->fid;
+    field_update_instance($instance);
+
+    // Confirm the new field instance default is used on the article field
+    // admin form.
+    $this->drupalGet("admin/structure/types/manage/article/fields/$field_name");
+    $this->assertFieldByXpath(
+      '//input[@name="instance[settings][default_image][fid]"]',
+      $default_images['instance_new']->fid,
+      format_string(
+        'Updated article image field instance default equals expected file ID of @fid.',
+        array('@fid' => $default_images['instance_new']->fid)
+      )
+    );
+
+    // Reload the nodes.
+    $article_built = node_view($article = node_load($article->nid, NULL, $reset = TRUE));
+    $page_built = node_view($page = node_load($page->nid, NULL, $reset = TRUE));
+
+    // Confirm the article uses the new default.
+    $this->assertEqual(
+      $article_built[$field_name]['#items'][0]['fid'],
+      $default_images['instance_new']->fid,
+      format_string(
+        'An existing article node without an image has the expected default image file ID of @fid.',
+        array('@fid' => $default_images['instance_new']->fid)
+      )
+    );
+    // Confirm the page remains unchanged.
+    $this->assertEqual(
+      $page_built[$field_name]['#items'][0]['fid'],
+      $default_images['instance2']->fid,
+      format_string(
+        'An existing page node without an image has the expected default image file ID of @fid.',
+        array('@fid' => $default_images['instance2']->fid)
+      )
+    );
+
+    // Remove the instance default from articles.
+    $instance['settings']['default_image'] = NULL;
+    field_update_instance($instance);
+
+    // Confirm the article field instance default has been removed.
+    $this->drupalGet("admin/structure/types/manage/article/fields/$field_name");
+    $this->assertFieldByXpath(
+      '//input[@name="instance[settings][default_image][fid]"]',
+      '',
+      'Updated article image field instance default has been successfully removed.'
+    );
+
+    // Reload the nodes.
+    $article_built = node_view($article = node_load($article->nid, NULL, $reset = TRUE));
+    $page_built = node_view($page = node_load($page->nid, NULL, $reset = TRUE));
+    // Confirm the article uses the new field (not instance) default.
+    $this->assertEqual(
+      $article_built[$field_name]['#items'][0]['fid'],
+      $default_images['field_new']->fid,
+      format_string(
+        'An existing article node without an image has the expected default image file ID of @fid.',
+        array('@fid' => $default_images['field_new']->fid)
+      )
+    );
+    // Confirm the page remains unchanged.
+    $this->assertEqual(
+      $page_built[$field_name]['#items'][0]['fid'],
+      $default_images['instance2']->fid,
+      format_string(
+        'An existing page node without an image has the expected default image file ID of @fid.',
+        array('@fid' => $default_images['instance2']->fid)
+      )
+    );
+  }
+
+}

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=2263&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 Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = image_module_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/locale/locale.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/locale.admin.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.admin.inc (original)
+++ branches/upstream/current-7/modules/locale/locale.admin.inc Thu May 10 18:20:18 2012
@@ -275,8 +275,7 @@
   else {
     $form['langcode'] = array('#type' => 'textfield',
       '#title' => t('Language code'),
-      '#size' => 12,
-      '#maxlength' => 60,
+      '#maxlength' => 12,
       '#required' => TRUE,
       '#default_value' => @$language->language,
       '#disabled' => (isset($language->language)),

Modified: branches/upstream/current-7/modules/locale/locale.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/locale.api.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.api.php (original)
+++ branches/upstream/current-7/modules/locale/locale.api.php Thu May 10 18:20:18 2012
@@ -24,150 +24,6 @@
 }
 
 /**
- * Allows modules to act after language initialization has been performed.
- *
- * This is primarily needed to provide translation for configuration variables
- * in the proper bootstrap phase. Variables are user-defined strings and
- * therefore should not be translated via t(), since the source string can
- * change without notice and any previous translation would be lost. Moreover,
- * since variables can be used in the bootstrap phase, we need a bootstrap hook
- * to provide a translation early enough to avoid misalignments between code
- * using the original values and code using the translated values. However
- * modules implementing hook_boot() should be aware that language initialization
- * did not happen yet and thus they cannot rely on translated variables.
- */
-function hook_language_init() {
-  global $language, $conf;
-
-  switch ($language->language) {
-    case 'it':
-      $conf['site_name'] = 'Il mio sito Drupal';
-      break;
-
-    case 'fr':
-      $conf['site_name'] = 'Mon site Drupal';
-      break;
-  }
-}
-
-/**
- * Perform alterations on language switcher links.
- *
- * A language switcher link may need to point to a different path or use a
- * translated link text before going through l(), which will just handle the
- * path aliases.
- *
- * @param $links
- *   Nested array of links keyed by language code.
- * @param $type
- *   The language type the links will switch.
- * @param $path
- *   The current path.
- */
-function hook_language_switch_links_alter(array &$links, $type, $path) {
-  global $language;
-
-  if ($type == LANGUAGE_TYPE_CONTENT && isset($links[$language->language])) {
-    foreach ($links[$language->language] as $link) {
-      $link['attributes']['class'][] = 'active-language';
-    }
-  }
-}
-
-/**
- * Allow modules to define their own language types.
- *
- * @return
- *   An array of language type definitions. Each language type has an identifier
- *   key. The language type definition is an associative array that may contain
- *   the following key-value pairs:
- *   - "name": The human-readable language type identifier.
- *   - "description": A description of the language type.
- *   - "fixed": An array of language provider identifiers. Defining this key
- *     makes the language type non-configurable.
- */
-function hook_language_types_info() {
-  return array(
-    'custom_language_type' => array(
-      'name' => t('Custom language'),
-      'description' => t('A custom language type.'),
-    ),
-    'fixed_custom_language_type' => array(
-      'fixed' => array('custom_language_provider'),
-    ),
-  );
-}
-
-/**
- * Perform alterations on language types.
- *
- * @param $language_types
- *   Array of language type definitions.
- */
-function hook_language_types_info_alter(array &$language_types) {
-  if (isset($language_types['custom_language_type'])) {
-    $language_types['custom_language_type_custom']['description'] = t('A far better description.');
-  }
-}
-
-/**
- * Allow modules to define their own language providers.
- *
- * @return
- *   An array of language provider definitions. Each language provider has an
- *   identifier key. The language provider definition is an associative array
- *   that may contain the following key-value pairs:
- *   - "types": An array of allowed language types. If a language provider does
- *     not specify which language types it should be used with, it will be
- *     available for all the configurable language types.
- *   - "callbacks": An array of functions that will be called to perform various
- *     tasks. Possible key-value pairs are:
- *     - "language": Required. The callback that will determine the language
- *       value.
- *     - "switcher": The callback that will determine the language switch links
- *       associated to the current language provider.
- *     - "url_rewrite": The callback that will provide URL rewriting.
- *   - "file": A file that will be included before the callback is invoked; this
- *     allows callback functions to be in separate files.
- *   - "weight": The default weight the language provider has.
- *   - "name": A human-readable identifier.
- *   - "description": A description of the language provider.
- *   - "config": An internal path pointing to the language provider
- *     configuration page.
- *   - "cache": The value Drupal's page cache should be set to for the current
- *     language provider to be invoked.
- */
-function hook_language_negotiation_info() {
-  return array(
-    'custom_language_provider' => array(
-      'callbacks' => array(
-        'language' => 'custom_language_provider_callback',
-        'switcher' => 'custom_language_switcher_callback',
-        'url_rewrite' => 'custom_language_url_rewrite_callback',
-      ),
-      'file' => drupal_get_path('module', 'custom') . '/custom.module',
-      'weight' => -4,
-      'types' => array('custom_language_type'),
-      'name' => t('Custom language provider'),
-      'description' => t('This is a custom language provider.'),
-      'cache' => 0,
-    ),
-  );
-}
-
-/**
- * Perform alterations on language providers.
- *
- * @param $language_providers
- *   Array of language provider definitions.
- */
-function hook_language_negotiation_info_alter(array &$language_providers) {
-  if (isset($language_providers['custom_language_provider'])) {
-    $language_providers['custom_language_provider']['config'] = 'admin/config/regional/language/configure/custom-language-provider';
-  }
-}
-
-/**
  * Allow modules to react to language settings changes.
  *
  * Every module needing to act when the number of enabled languages changes
@@ -181,16 +37,5 @@
 }
 
 /**
- * Perform alterations on the language fallback candidates.
- *
- * @param $fallback_candidates
- *   An array of language codes whose order will determine the language fallback
- *   order.
- */
-function hook_language_fallback_candidates_alter(array &$fallback_candidates) {
-  $fallback_candidates = array_reverse($fallback_candidates);
-}
-
-/**
  * @} End of "addtogroup hooks".
  */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.info (original)
+++ branches/upstream/current-7/modules/locale/locale.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = locale.test
 configure = admin/config/regional/language
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/locale/locale.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/locale.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.install (original)
+++ branches/upstream/current-7/modules/locale/locale.install Thu May 10 18:20:18 2012
@@ -138,6 +138,74 @@
  */
 
 /**
+ * @addtogroup updates-7.x-extra
+ * @{
+ */
+
+/**
+ * Remove duplicates in {locales_source}.
+ */
+function locale_update_7004() {
+  // Look up all duplicates. For each set of duplicates, we select the row
+  // with the lowest lid as the "master" that will be preserved.
+  $result_source = db_query("SELECT MIN(lid) AS lid, source, context FROM {locales_source} WHERE textgroup = 'default' GROUP BY source, context HAVING COUNT(*) > 1");
+
+  $conflict = FALSE;
+  foreach ($result_source as $source) {
+    // Find all rows in {locales_target} that are translations of the same
+    // string (incl. context).
+    $result_target = db_query("SELECT t.lid, t.language, t.plural, t.translation FROM {locales_source} s JOIN {locales_target} t ON s.lid = t.lid WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default' ORDER BY lid", array(
+      ':source' => $source->source,
+      ':context' => $source->context,
+    ));
+
+    $translations = array();
+    $keep_lids = array($source->lid);
+    foreach ($result_target as $target) {
+      if (!isset($translations[$target->language])) {
+        $translations[$target->language] = $target->translation;
+        if ($target->lid != $source->lid) {
+          // Move translation to the master lid.
+          db_query('UPDATE {locales_target} SET lid = :new_lid WHERE lid = :old_lid', array(
+            ':new_lid' => $source->lid,
+            ':old_lid' => $target->lid));
+        }
+      }
+      elseif ($translations[$target->language] == $target->translation) {
+        // Delete duplicate translation.
+        db_query('DELETE FROM {locales_target} WHERE lid = :lid AND language = :language', array(
+          ':lid' => $target->lid,
+          ':language' => $target->language));
+      }
+      else {
+        // The same string is translated into several different strings in one
+        // language. We do not know which is the preferred, so we keep them all.
+        $keep_lids[] = $target->lid;
+        $conflict = TRUE;
+      }
+    }
+
+    // Delete rows in {locales_source} that are no longer referenced from
+    // {locales_target}.
+    db_delete('locales_source')
+      ->condition('source', $source->source)
+      ->condition('context', $source->context)
+      ->condition('textgroup', 'default')
+      ->condition('lid', $keep_lids, 'NOT IN')
+      ->execute();
+  }
+
+  if ($conflict) {
+    $url = 'http://drupal.org/node/746240';
+    drupal_set_message('Your {locales_source} table contains duplicates that could not be removed automatically. See <a href="' . $url .'" target="_blank">' . $url . '</a> for more information.', 'warning');
+  }
+}
+
+/**
+ * @} End of "addtogroup updates-7.x-extra"
+ */
+
+/**
  * Implements hook_uninstall().
  */
 function locale_uninstall() {

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.module (original)
+++ branches/upstream/current-7/modules/locale/locale.module Thu May 10 18:20:18 2012
@@ -22,7 +22,7 @@
     case 'admin/help#locale':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Locale module allows your Drupal site to be presented in languages other than the default English, and to be multilingual. The Locale module works by maintaining a database of translations, and examining text as it is about to be displayed. When a translation of the text is available in the language to be displayed, the translation is displayed rather than the original text. When a translation is unavailable, the original text is displayed, and then stored for review by a translator. For more information, see the online handbook entry for <a href="@locale">Locale module</a>.', array('@locale' => 'http://drupal.org/handbook/modules/locale/')) . '</p>';
+      $output .= '<p>' . t('The Locale module allows your Drupal site to be presented in languages other than the default English, and to be multilingual. The Locale module works by maintaining a database of translations, and examining text as it is about to be displayed. When a translation of the text is available in the language to be displayed, the translation is displayed rather than the original text. When a translation is unavailable, the original text is displayed, and then stored for review by a translator. For more information, see the online handbook entry for <a href="@locale">Locale module</a>.', array('@locale' => 'http://drupal.org/documentation/modules/locale/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Translating interface text') . '</dt>';
@@ -253,6 +253,7 @@
     ),
     'translate interface' => array(
       'title' => t('Translate interface texts'),
+      'restrict access' => TRUE,
     ),
   );
 }
@@ -699,13 +700,15 @@
     }
     else {
       // We don't have the source string, cache this as untranslated.
-      db_insert('locales_source')
-        ->fields(array(
+      db_merge('locales_source')
+        ->insertFields(array(
           'location' => request_uri(),
+          'version' => VERSION,
+        ))
+        ->key(array(
           'source' => $string,
           'context' => (string) $context,
           'textgroup' => 'default',
-          'version' => VERSION,
         ))
         ->execute();
       $locale_t[$langcode][$context][$string] = TRUE;
@@ -734,30 +737,51 @@
  * @param $langcode
  *   Optional language code to translate to a language other than
  *   what is used to display the page.
+ *
+ * @return
+ *   The numeric index of the plural variant to use for this $langcode and
+ *   $count combination or -1 if the language was not found or does not have a
+ *   plural formula.
  */
 function locale_get_plural($count, $langcode = NULL) {
   global $language;
-  $locale_formula = &drupal_static(__FUNCTION__, array());
-  $plurals = &drupal_static(__FUNCTION__ . ':plurals', array());
+
+  // Used to locally cache the plural formulas for all languages.
+  $plural_formulas = &drupal_static(__FUNCTION__, array());
+
+  // Used to store precomputed plural indexes corresponding to numbers
+  // individually for each language.
+  $plural_indexes = &drupal_static(__FUNCTION__ . ':plurals', array());
 
   $langcode = $langcode ? $langcode : $language->language;
 
-  if (!isset($plurals[$langcode][$count])) {
-    if (empty($locale_formula)) {
+  if (!isset($plural_indexes[$langcode][$count])) {
+    // Retrieve and statically cache the plural formulas for all languages.
+    if (empty($plural_formulas)) {
       $language_list = language_list();
-      $locale_formula[$langcode] = $language_list[$langcode]->formula;
-    }
-    if ($locale_formula[$langcode]) {
+      foreach ($language_list as $langcode => $lang) {
+        $plural_formulas[$langcode] = $lang->formula;
+      }
+    }
+    // If there is a plural formula for the language, evaluate it for the given
+    // $count and statically cache the result for the combination of language
+    // and count, since the result will always be identical.
+    if (!empty($plural_formulas[$langcode])) {
+      // $n is used inside the expression in the eval().
       $n = $count;
-      $plurals[$langcode][$count] = @eval('return intval(' . $locale_formula[$langcode] . ');');
-      return $plurals[$langcode][$count];
-    }
+      $plural_indexes[$langcode][$count] = @eval('return intval(' . $plural_formulas[$langcode] . ');');
+    }
+    // In case there is no plural formula for English (no imported translation
+    // for English), use a default formula.
+    elseif ($langcode == 'en') {
+      $plural_indexes[$langcode][$count] = (int) ($count != 1);
+    }
+    // Otherwise, return -1 (unknown).
     else {
-      $plurals[$langcode][$count] = -1;
-      return -1;
-    }
-  }
-  return $plurals[$langcode][$count];
+      $plural_indexes[$langcode][$count] = -1;
+    }
+  }
+  return $plural_indexes[$langcode][$count];
 }
 
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/locale.test (original)
+++ branches/upstream/current-7/modules/locale/locale.test Thu May 10 18:20:18 2012
@@ -694,6 +694,136 @@
 }
 
 /**
+ * Tests plural index computation functionality.
+ */
+class LocalePluralFormatTest extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Plural formula evaluation',
+      'description' => 'Tests plural formula evaluation for various languages.',
+      'group' => 'Locale',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('locale', 'locale_test');
+
+    $admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
+    $this->drupalLogin($admin_user);
+
+    // Import some .po files with formulas to set up the environment.
+    // These will also add the languages to the system and enable them.
+    $this->importPoFile($this->getPoFileWithSimplePlural(), array(
+      'langcode' => 'fr',
+    ));
+    $this->importPoFile($this->getPoFileWithComplexPlural(), array(
+      'langcode' => 'hr',
+    ));
+  }
+
+  /**
+   * Tests locale_get_plural() functionality.
+   */
+  function testGetPluralFormat() {
+    $this->drupalGet('locale_test_plural_format_page');
+    $tests = _locale_test_plural_format_tests();
+    $result = array();
+    foreach ($tests as $test) {
+      $this->assertPluralFormat($test['count'], $test['language'], $test['expected-result']);
+    }
+  }
+
+  /**
+   * Helper assert to test locale_get_plural page.
+   *
+   * @param $count
+   *  Number for testing.
+   * @param $lang
+   *  Language for testing
+   * @param $expected_result
+   *   Expected result.
+   * @param $message
+   */
+  function assertPluralFormat($count, $lang, $expected_result) {
+    $message_param =  array(
+      '@lang' => $lang,
+      '@count' => $count,
+      '@expected_result' => $expected_result,
+    );
+    $message = t("Computed plural index for '@lang' with count @count is @expected_result.", $message_param);
+
+    $message_param = array(
+      '@lang' => $lang,
+      '@expected_result' => $expected_result,
+    );
+    $this->assertText(format_string('Language: @lang, locale_get_plural: @expected_result.', $message_param, $message));
+  }
+
+  /**
+   * Imports a standalone .po file in a given language.
+   *
+   * @param $contents
+   *   Contents of the .po file to import.
+   * @param $options
+   *   Additional options to pass to the translation import form.
+   */
+  function importPoFile($contents, array $options = array()) {
+    $name = tempnam('temporary://', "po_") . '.po';
+    file_put_contents($name, $contents);
+    $options['files[file]'] = $name;
+    $this->drupalPost('admin/config/regional/translate/import', $options, t('Import'));
+    drupal_unlink($name);
+  }
+
+  /**
+   * Returns a .po file with a simple plural formula.
+   */
+  function getPoFileWithSimplePlural() {
+    return <<< EOF
+msgid ""
+msgstr ""
+"Project-Id-Version: Drupal 7\\n"
+"MIME-Version: 1.0\\n"
+"Content-Type: text/plain; charset=UTF-8\\n"
+"Content-Transfer-Encoding: 8bit\\n"
+"Plural-Forms: nplurals=2; plural=(n!=1);\\n"
+
+msgid "One sheep"
+msgid_plural "@count sheep"
+msgstr[0] "un mouton"
+msgstr[1] "@count moutons"
+
+msgid "Monday"
+msgstr "lundi"
+EOF;
+  }
+
+  /**
+   * Returns a .po file with a complex plural formula.
+   */
+  function getPoFileWithComplexPlural() {
+    return <<< EOF
+msgid ""
+msgstr ""
+"Project-Id-Version: Drupal 7\\n"
+"MIME-Version: 1.0\\n"
+"Content-Type: text/plain; charset=UTF-8\\n"
+"Content-Transfer-Encoding: 8bit\\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\\n"
+
+msgid "1 hour"
+msgid_plural "@count hours"
+msgstr[0] "@count sat"
+msgstr[1] "@count sata"
+msgstr[2] "@count sati"
+
+msgid "Monday"
+msgstr "Ponedjeljak"
+EOF;
+  }
+}
+
+/**
  * Functional tests for the import of translation files.
  */
 class LocaleImportFunctionalTest extends DrupalWebTestCase {
@@ -792,6 +922,25 @@
 
     // This import should not have changed number of plural forms.
     $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 2, t('Plural numbers untouched.'));
+
+    $this->importPoFile($this->getPoFileWithBrokenPlural(), array(
+      'langcode' => 'fr',
+      'mode' => 1, // Existing strings are kept, only new strings are added.
+    ));
+
+    // Attempt to import broken .po file as well to prove that this
+    // will not overwrite the proper plural formula imported above.
+    $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 2, t('Broken plurals: plural numbers untouched.'));
+
+    $this->importPoFile($this->getPoFileWithMissingPlural(), array(
+      'langcode' => 'fr',
+      'mode' => 1, // Existing strings are kept, only new strings are added.
+    ));
+
+    // Attempt to import .po file which has no plurals and prove that this
+    // will not overwrite the proper plural formula imported above.
+    $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 2, t('No plurals: plural numbers untouched.'));
+
 
     // Try importing a .po file with overriding strings, and ensure existing
     // strings are overwritten.
@@ -1069,6 +1218,42 @@
 msgid "Will not appear in Drupal core, so we can ensure the test passes"
 msgstr ""
 
+EOF;
+  }
+
+
+  /**
+   * Returns a .po file with a missing plural formula.
+   */
+  function getPoFileWithMissingPlural() {
+    return <<< EOF
+msgid ""
+msgstr ""
+"Project-Id-Version: Drupal 7\\n"
+"MIME-Version: 1.0\\n"
+"Content-Type: text/plain; charset=UTF-8\\n"
+"Content-Transfer-Encoding: 8bit\\n"
+
+msgid "Monday"
+msgstr "Ponedjeljak"
+EOF;
+  }
+
+  /**
+   * Returns a .po file with a broken plural formula.
+   */
+  function getPoFileWithBrokenPlural() {
+    return <<< EOF
+msgid ""
+msgstr ""
+"Project-Id-Version: Drupal 7\\n"
+"MIME-Version: 1.0\\n"
+"Content-Type: text/plain; charset=UTF-8\\n"
+"Content-Transfer-Encoding: 8bit\\n"
+"Plural-Forms: broken, will not parse\\n"
+
+msgid "Monday"
+msgstr "lundi"
 EOF;
   }
 
@@ -1483,6 +1668,7 @@
       'EN' => 'en',
       ' en' => 'en',
       'en ' => 'en',
+      'en, fr' => 'en',
 
       // A less specific language from the browser matches a more specific one
       // from the website, and the other way around for compatibility with
@@ -1517,6 +1703,7 @@
       // Unresolvable cases.
       '' => FALSE,
       'de,pl' => FALSE,
+      'iecRswK4eh' => FALSE,
       $this->randomName(10) => FALSE,
     );
 
@@ -2118,6 +2305,7 @@
         'language_negotiation' => array(LOCALE_LANGUAGE_NEGOTIATION_URL, LANGUAGE_NEGOTIATION_DEFAULT),
         'path' => 'admin/config',
         'expect' => $default_string,
+        'expected_provider' => LANGUAGE_NEGOTIATION_DEFAULT,
         'http_header' => $http_header_browser_fallback,
         'message' => 'URL (PATH) > DEFAULT: no language prefix, UI language is default and the browser language preference setting is not used.',
       ),
@@ -2126,6 +2314,7 @@
         'language_negotiation' => array(LOCALE_LANGUAGE_NEGOTIATION_URL, LANGUAGE_NEGOTIATION_DEFAULT),
         'path' => "$language/admin/config",
         'expect' => $language_string,
+        'expected_provider' => LOCALE_LANGUAGE_NEGOTIATION_URL,
         'http_header' => $http_header_browser_fallback,
         'message' => 'URL (PATH) > DEFAULT: with language prefix, UI language is switched based on path prefix',
       ),
@@ -2134,6 +2323,7 @@
         'language_negotiation' => array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_BROWSER),
         'path' => 'admin/config',
         'expect' => $language_browser_fallback_string,
+        'expected_provider' => LOCALE_LANGUAGE_NEGOTIATION_BROWSER,
         'http_header' => $http_header_browser_fallback,
         'message' => 'URL (PATH) > BROWSER: no language prefix, UI language is determined by browser language preference',
       ),
@@ -2142,6 +2332,7 @@
         'language_negotiation' => array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_BROWSER),
         'path' => "$language/admin/config",
         'expect' => $language_string,
+        'expected_provider' => LOCALE_LANGUAGE_NEGOTIATION_URL,
         'http_header' => $http_header_browser_fallback,
         'message' => 'URL (PATH) > BROWSER: with langage prefix, UI language is based on path prefix',
       ),
@@ -2150,6 +2341,7 @@
         'language_negotiation' => array(LOCALE_LANGUAGE_NEGOTIATION_URL, LOCALE_LANGUAGE_NEGOTIATION_BROWSER, LANGUAGE_NEGOTIATION_DEFAULT),
         'path' => 'admin/config',
         'expect' => $default_string,
+        'expected_provider' => LANGUAGE_NEGOTIATION_DEFAULT,
         'http_header' => $http_header_blah,
         'message' => 'URL (PATH) > BROWSER > DEFAULT: no language prefix and browser language preference set to unknown language should use default language',
       ),
@@ -2177,6 +2369,7 @@
         'locale_language_negotiation_url_part' => LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAIN,
         'path' => 'admin/config',
         'expect' => $default_string,
+        'expected_provider' => LANGUAGE_NEGOTIATION_DEFAULT,
         'http_header' => $http_header_browser_fallback,
         'message' => 'URL (DOMAIN) > DEFAULT: default domain should get default language',
       ),
@@ -2188,6 +2381,7 @@
         'locale_test_domain' => $language_domain,
         'path' => 'admin/config',
         'expect' => $language_string,
+        'expected_provider' => LOCALE_LANGUAGE_NEGOTIATION_URL,
         'http_header' => $http_header_browser_fallback,
         'message' => 'URL (DOMAIN) > DEFAULT: domain example.cn should switch to Chinese',
       ),
@@ -2211,6 +2405,7 @@
     }
     $this->drupalGet($test['path'], array(), $test['http_header']);
     $this->assertText($test['expect'], $test['message']);
+    $this->assertText(t('Language negotiation provider: @name', array('@name' => $test['expected_provider'])));
   }
 
   /**
@@ -2255,6 +2450,56 @@
     // Check that URLs are rewritten using the given browser language.
     $fields = $this->xpath('//div[@id="site-name"]//a[@rel="home" and @href=:url]//span', $args);
     $this->assertTrue($fields[0] == 'Drupal', t('URLs are rewritten using the browser language.'));
+  }
+
+  /**
+   * Tests url() when separate domains are used for multiple languages.
+   */
+  function testLanguageDomain() {
+    // Add the Italian language, without protocol.
+    $langcode = 'it';
+    locale_add_language($langcode, 'Italian', 'Italian', LANGUAGE_LTR, 'it.example.com', '', TRUE, FALSE);
+
+    // Add the French language, with protocol.
+    $langcode = 'fr';
+    locale_add_language($langcode, 'French', 'French', LANGUAGE_LTR, 'http://fr.example.com', '', TRUE, FALSE);
+
+    // Enable language URL detection.
+    $negotiation = array_flip(array(LOCALE_LANGUAGE_NEGOTIATION_URL, LANGUAGE_NEGOTIATION_DEFAULT));
+    language_negotiation_set(LANGUAGE_TYPE_INTERFACE, $negotiation);
+
+    variable_set('locale_language_negotiation_url_part', 1);
+
+    global $is_https;
+    $languages = language_list();
+
+    foreach (array('it', 'fr') as $langcode) {
+      // Build the link we're going to test based on the clean url setting.
+      $link = (!empty($GLOBALS['conf']['clean_url'])) ? $langcode . '.example.com/admin' : $langcode . '.example.com/?q=admin';
+
+      // Test URL in another language.
+      // Base path gives problems on the testbot, so $correct_link is hard-coded.
+      // @see UrlAlterFunctionalTest::assertUrlOutboundAlter (path.test).
+      $url = url('admin', array('language' => $languages[$langcode]));
+      $url_scheme = ($is_https) ? 'https://' : 'http://';
+      $correct_link = $url_scheme . $link;
+      $this->assertTrue($url == $correct_link, t('The url() function returns the right url (@url) in accordance with the chosen language', array('@url' => $url . " == " . $correct_link)));
+
+      // Test https via options.
+      variable_set('https', TRUE);
+      $url = url('admin', array('https' => TRUE, 'language' => $languages[$langcode]));
+      $correct_link = 'https://' . $link;
+      $this->assertTrue($url == $correct_link, t('The url() function returns the right https url (via options) (@url) in accordance with the chosen language', array('@url' => $url . " == " . $correct_link)));
+      variable_set('https', FALSE);
+
+      // Test https via current url scheme.
+      $temp_https = $is_https;
+      $is_https = TRUE;
+      $url = url('admin', array('language' => $languages[$langcode]));
+      $correct_link = 'https://' . $link;
+      $this->assertTrue($url == $correct_link, t('The url() function returns the right url (via current url scheme) (@url) in accordance with the chosen language', array('@url' => $url . " == " . $correct_link)));
+      $is_https = $temp_https;
+    }
   }
 }
 
@@ -2772,3 +3017,4 @@
     }
   }
 }
+

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/tests/locale_test.info (original)
+++ branches/upstream/current-7/modules/locale/tests/locale_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/locale/tests/locale_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/locale/tests/locale_test.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/locale/tests/locale_test.module (original)
+++ branches/upstream/current-7/modules/locale/tests/locale_test.module Thu May 10 18:20:18 2012
@@ -32,6 +32,9 @@
  */
 function locale_test_init() {
   locale_test_store_language_negotiation();
+  if (isset($GLOBALS['language']) && isset($GLOBALS['language']->provider)) {
+    drupal_set_message(t('Language negotiation provider: @name', array('@name' => $GLOBALS['language']->provider)));
+  }
 }
 
 /**
@@ -52,6 +55,22 @@
 }
 
 /**
+ * Implements hook_menu().
+ *
+ * @return array
+ */
+function locale_test_menu() {
+  $items = array();
+  $items['locale_test_plural_format_page'] = array(
+    'page callback' => 'locale_test_plural_format_page',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+
+  return $items;
+}
+
+/**
  * Implements hook_language_types_info_alter().
  */
 function locale_test_language_types_info_alter(array &$language_types) {
@@ -113,3 +132,111 @@
 function locale_test_language_provider($languages) {
   return 'it';
 }
+
+/**
+ * Returns markup for locale_get_plural testing.
+ *
+ * @return array
+ */
+function locale_test_plural_format_page() {
+  $tests = _locale_test_plural_format_tests();
+  $result = array();
+  foreach ($tests as $test) {
+    $string_param = array(
+      '@lang' => $test['language'],
+      '@locale_get_plural' => locale_get_plural($test['count'], $test['language'])
+    );
+    $result[] = array(
+      '#prefix' => '<br/>',
+      '#markup' => format_string('Language: @lang, locale_get_plural: @locale_get_plural.', $string_param),
+    );
+  }
+  return $result;
+}
+
+/**
+ * Helper function with list of test cases
+ *
+ * @return array
+ */
+function _locale_test_plural_format_tests() {
+  return array(
+    // Test data for English (no formula present).
+    array(
+      'count' => 1,
+      'language' => 'en',
+      'expected-result' => 0,
+    ),
+    array(
+      'count' => 0,
+      'language' => 'en',
+      'expected-result' => 1,
+    ),
+    array(
+      'count' => 5,
+      'language' => 'en',
+      'expected-result' => 1,
+    ),
+
+    // Test data for French (simpler formula).
+    array(
+      'count' => 1,
+      'language' => 'fr',
+      'expected-result' => 0,
+    ),
+    array(
+      'count' => 0,
+      'language' => 'fr',
+      'expected-result' => 1,
+    ),
+    array(
+      'count' => 5,
+      'language' => 'fr',
+      'expected-result' => 1,
+    ),
+
+    // Test data for Croatian (more complex formula).
+    array(
+      'count' => 1,
+      'language' => 'hr',
+      'expected-result' => 0,
+    ),
+    array(
+      'count' => 21,
+      'language' => 'hr',
+      'expected-result' => 0,
+    ),
+    array(
+      'count' => 0,
+      'language' => 'hr',
+      'expected-result' => 2,
+    ),
+    array(
+      'count' => 2,
+      'language' => 'hr',
+      'expected-result' => 1,
+    ),
+    array(
+      'count' => 8,
+      'language' => 'hr',
+      'expected-result' => 2,
+    ),
+
+    // Test data for Hungarian (nonexistent language).
+    array(
+      'count' => 1,
+      'language' => 'hu',
+      'expected-result' => -1,
+    ),
+    array(
+      'count' => 21,
+      'language' => 'hu',
+      'expected-result' => -1,
+    ),
+    array(
+      'count' => 0,
+      'language' => 'hu',
+      'expected-result' => -1,
+    ),
+  );
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.admin.inc (original)
+++ branches/upstream/current-7/modules/menu/menu.admin.inc Thu May 10 18:20:18 2012
@@ -260,6 +260,16 @@
     // This is an add form, initialize the menu link.
     $item = array('link_title' => '', 'mlid' => 0, 'plid' => 0, 'menu_name' => $menu['menu_name'], 'weight' => 0, 'link_path' => '', 'options' => array(), 'module' => 'menu', 'expanded' => 0, 'hidden' => 0, 'has_children' => 0);
   }
+  else {
+    // Get the human-readable menu title from the given menu name.
+    $titles = menu_get_menus();
+    $current_title = $titles[$item['menu_name']];
+
+    // Get the current breadcrumb and add a link to that menu's overview page.
+    $breadcrumb = menu_get_active_breadcrumb();
+    $breadcrumb[] = l($current_title, 'admin/structure/menu/manage/' . $item['menu_name']);
+    drupal_set_breadcrumb($breadcrumb);
+  }
   $form['actions'] = array('#type' => 'actions');
   $form['link_title'] = array(
     '#type' => 'textfield',

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.info (original)
+++ branches/upstream/current-7/modules/menu/menu.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = menu.test
 configure = admin/structure/menu
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/menu/menu.module (original)
+++ branches/upstream/current-7/modules/menu/menu.module Thu May 10 18:20:18 2012
@@ -25,7 +25,7 @@
     case 'admin/help#menu':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Menu module provides an interface for managing menus. A menu is a hierarchical collection of links, which can be within or external to the site, generally used for navigation. Each menu is rendered in a block that can be enabled and positioned through the <a href="@blocks">Blocks administration page</a>. You can view and manage menus on the <a href="@menus">Menus administration page</a>. For more information, see the online handbook entry for the <a href="@menu">Menu module</a>.', array('@blocks' => url('admin/structure/block'), '@menus' => url('admin/structure/menu'), '@menu' => 'http://drupal.org/handbook/modules/menu/')) . '</p>';
+      $output .= '<p>' . t('The Menu module provides an interface for managing menus. A menu is a hierarchical collection of links, which can be within or external to the site, generally used for navigation. Each menu is rendered in a block that can be enabled and positioned through the <a href="@blocks">Blocks administration page</a>. You can view and manage menus on the <a href="@menus">Menus administration page</a>. For more information, see the online handbook entry for the <a href="@menu">Menu module</a>.', array('@blocks' => url('admin/structure/block'), '@menus' => url('admin/structure/menu'), '@menu' => 'http://drupal.org/documentation/modules/menu/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Managing menus') . '</dt>';
@@ -470,7 +470,6 @@
 
   $blocks = array();
   foreach ($menus as $name => $title) {
-    // Default "Navigation" block is handled by user.module.
     $blocks[$name]['info'] = check_plain($title);
     // Menu blocks can't be cached because each menu item can have
     // a custom access callback. menu.inc manages its own caching.

Modified: branches/upstream/current-7/modules/node/content_types.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/content_types.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/content_types.inc (original)
+++ branches/upstream/current-7/modules/node/content_types.inc Thu May 10 18:20:18 2012
@@ -78,8 +78,8 @@
  * Form constructor for the node type editing form.
  *
  * @param $type
- *   (optional) The machine name of the node type when editing an existing node
- *   type.
+ *   (optional) An object representing the node type, when editing an existing
+ *   node type.
  *
  * @see node_type_form_validate()
  * @see node_type_form_submit()

Modified: branches/upstream/current-7/modules/node/node.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/node.admin.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.admin.inc (original)
+++ branches/upstream/current-7/modules/node/node.admin.inc Thu May 10 18:20:18 2012
@@ -422,6 +422,7 @@
     ->fields('n',array('nid'))
     ->limit(50)
     ->orderByHeader($header)
+    ->addTag('node_access')
     ->execute()
     ->fetchCol();
   $nodes = node_load_multiple($nids);

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.api.php (original)
+++ branches/upstream/current-7/modules/node/node.api.php Thu May 10 18:20:18 2012
@@ -393,7 +393,7 @@
   if ($op != 'view' && !empty($restricted)) {
     // Now check the roles for this account against the restrictions.
     foreach ($restricted as $role_id) {
-      if (isset($user->roles[$role_id])) {
+      if (isset($account->roles[$role_id])) {
         $grants = array();
       }
     }
@@ -709,8 +709,8 @@
  * @param $node
  *   The node being indexed.
  *
- * @return
- *   Array of additional information to be indexed.
+ * @return string
+ *   Additional node information to be indexed.
  *
  * @ingroup node_api_hooks
  */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.info (original)
+++ branches/upstream/current-7/modules/node/node.info Thu May 10 18:20:18 2012
@@ -9,8 +9,8 @@
 configure = admin/structure/types
 stylesheets[all][] = node.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/node/node.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/node/node.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.install (original)
+++ branches/upstream/current-7/modules/node/node.install Thu May 10 18:20:18 2012
@@ -18,12 +18,14 @@
         'unsigned' => TRUE,
         'not null' => TRUE,
       ),
+      // Defaults to NULL in order to avoid a brief period of potential
+      // deadlocks on the index.
       'vid' => array(
         'description' => 'The current {node_revision}.vid version identifier.',
         'type' => 'int',
         'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
+        'not null' => FALSE,
+        'default' => NULL,
       ),
       'type' => array(
         'description' => 'The {node_type}.type of this node.',
@@ -900,5 +902,18 @@
 }
 
 /**
+ * Change {node}.vid default value from 0 to NULL to avoid deadlock issues on MySQL.
+ */
+function node_update_7013() {
+  db_change_field('node', 'vid', 'vid', array(
+    'description' => 'The current {node_revision}.vid version identifier.',
+    'type' => 'int',
+    'unsigned' => TRUE,
+    'not null' => FALSE,
+    'default' => NULL,
+  ));
+}
+
+/**
  * @} End of "addtogroup updates-6.x-to-7.x"
  */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.module (original)
+++ branches/upstream/current-7/modules/node/node.module Thu May 10 18:20:18 2012
@@ -81,7 +81,7 @@
     case 'admin/help#node':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Node module manages the creation, editing, deletion, settings, and display of the main site content. Content items managed by the Node module are typically displayed as pages on your site, and include a title, some meta-data (author, creation time, content type, etc.), and optional fields containing text or other data (fields are managed by the <a href="@field">Field module</a>). For more information, see the online handbook entry for <a href="@node">Node module</a>.', array('@node' => 'http://drupal.org/handbook/modules/node', '@field' => url('admin/help/field'))) . '</p>';
+      $output .= '<p>' . t('The Node module manages the creation, editing, deletion, settings, and display of the main site content. Content items managed by the Node module are typically displayed as pages on your site, and include a title, some meta-data (author, creation time, content type, etc.), and optional fields containing text or other data (fields are managed by the <a href="@field">Field module</a>). For more information, see the online handbook entry for <a href="@node">Node module</a>.', array('@node' => 'http://drupal.org/documentation/modules/node', '@field' => url('admin/help/field'))) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Creating content') . '</dt>';
@@ -1814,38 +1814,72 @@
   return $output;
 }
 
-function _node_revision_access($node, $op = 'view') {
+/**
+ * Access callback: Checks node revision access.
+ *
+ * @param $node
+ *   The node to check.
+ * @param $op
+ *   (optional) The specific operation being checked. Defaults to 'view.'
+ * @param object $account
+ *   (optional) A user object representing the user for whom the operation is
+ *   to be performed. Determines access for a user other than the current user.
+ *
+ * @return
+ *   TRUE if the operation may be performed, FALSE otherwise.
+ *
+ * @see node_menu()
+ */
+function _node_revision_access($node, $op = 'view', $account = NULL) {
   $access = &drupal_static(__FUNCTION__, array());
-  if (!isset($access[$node->vid])) {
-    // To save additional calls to the database, return early if the user
-    // doesn't have the required permissions.
-    $map = array('view' => 'view revisions', 'update' => 'revert revisions', 'delete' => 'delete revisions');
-    if (isset($map[$op]) && (!user_access($map[$op]) && !user_access('administer nodes'))) {
-      $access[$node->vid] = FALSE;
-      return FALSE;
+
+  $map = array(
+    'view' => 'view revisions',
+    'update' => 'revert revisions',
+    'delete' => 'delete revisions',
+  );
+
+  if (!$node || !isset($map[$op])) {
+    // If there was no node to check against, or the $op was not one of the
+    // supported ones, we return access denied.
+    return FALSE;
+  }
+
+  if (!isset($account)) {
+    $account = $GLOBALS['user'];
+  }
+
+  // Statically cache access by revision ID, user account ID, and operation.
+  $cid = $node->vid . ':' . $account->uid . ':' . $op;
+
+  if (!isset($access[$cid])) {
+    // Perform basic permission checks first.
+    if (!user_access($map[$op], $account) && !user_access('administer nodes', $account)) {
+      return $access[$cid] = FALSE;
     }
 
     $node_current_revision = node_load($node->nid);
     $is_current_revision = $node_current_revision->vid == $node->vid;
 
     // There should be at least two revisions. If the vid of the given node
-    // and the vid of the current revision differs, then we already have two
+    // and the vid of the current revision differ, then we already have two
     // different revisions so there is no need for a separate database check.
     // Also, if you try to revert to or delete the current revision, that's
     // not good.
     if ($is_current_revision && (db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid', array(':nid' => $node->nid))->fetchField() == 1 || $op == 'update' || $op == 'delete')) {
-      $access[$node->vid] = FALSE;
-    }
-    elseif (user_access('administer nodes')) {
-      $access[$node->vid] = TRUE;
+      $access[$cid] = FALSE;
+    }
+    elseif (user_access('administer nodes', $account)) {
+      $access[$cid] = TRUE;
     }
     else {
       // First check the access to the current revision and finally, if the
       // node passed in is not the current revision then access to that, too.
-      $access[$node->vid] = node_access($op, $node_current_revision) && ($is_current_revision || node_access($op, $node));
-    }
-  }
-  return $access[$node->vid];
+      $access[$cid] = node_access($op, $node_current_revision, $account) && ($is_current_revision || node_access($op, $node, $account));
+    }
+  }
+
+  return $access[$cid];
 }
 
 function _node_add_access() {
@@ -2915,7 +2949,7 @@
       return $result;
     }
     elseif (is_object($node) && $op == 'view' && $node->status) {
-      // If no modules implement hook_node_grants(), the default behaviour is to
+      // If no modules implement hook_node_grants(), the default behavior is to
       // allow all users to view published nodes, so reflect that here.
       $rights[$account->uid][$cid][$op] = TRUE;
       return TRUE;
@@ -3218,9 +3252,6 @@
     }
   }
 
-  // Prevent duplicate records.
-  $query->distinct();
-
   // Find all instances of the base table being joined -- could appear
   // more than once in the query, and could be aliased. Join each one to
   // the node_access table.
@@ -3249,17 +3280,9 @@
   foreach ($tables as $nalias => $tableinfo) {
     $table = $tableinfo['table'];
     if (!($table instanceof SelectQueryInterface) && $table == $base_table) {
-
-      // The node_access table has the access grants for any given node so JOIN
-      // it to the table containing the nid which can be either the node
-      // table or a field value table.
-      if ($type == 'node') {
-        $access_alias = $query->join('node_access', 'na', '%alias.nid = ' . $nalias . '.nid');
-      }
-      else {
-        $access_alias = $query->leftJoin('node_access', 'na', '%alias.nid = ' . $nalias . '.entity_id');
-        $base_alias = $nalias;
-      }
+      // Set the subquery.
+      $subquery = db_select('node_access', 'na')
+       ->fields('na', array('nid'));
 
       $grant_conditions = db_or();
       // If any grant exists for the specified user, then user has access
@@ -3267,29 +3290,30 @@
       foreach ($grants as $realm => $gids) {
         foreach ($gids as $gid) {
           $grant_conditions->condition(db_and()
-            ->condition($access_alias . '.gid', $gid)
-            ->condition($access_alias . '.realm', $realm)
+            ->condition('na.gid', $gid)
+            ->condition('na.realm', $realm)
           );
         }
       }
 
-      $count = count($grant_conditions->conditions());
-      if ($type == 'node') {
-        if ($count) {
-          $query->condition($grant_conditions);
-        }
-        $query->condition($access_alias . '.grant_' . $op, 1, '>=');
+      // Attach conditions to the subquery for nodes.
+      if (count($grant_conditions->conditions())) {
+        $subquery->condition($grant_conditions);
       }
-      else {
-        if ($count) {
-          $entity_conditions->condition($grant_conditions);
-        }
-        $entity_conditions->condition($access_alias . '.grant_' . $op, 1, '>=');
+      $subquery->condition('na.grant_' . $op, 1, '>=');
+      $field = 'nid';
+      // Now handle entities.
+      if ($type == 'entity') {
+        // Set a common alias for entities.
+        $base_alias = $nalias;
+        $field = 'entity_id';
       }
-    }
-  }
-
-  if ($type == 'entity' && count($entity_conditions->conditions())) {
+      $subquery->where("$nalias.$field = na.nid");
+      $query->exists($subquery);
+    }
+  }
+
+  if ($type == 'entity' && count($subquery->conditions())) {
     // All the node access conditions are only for field values belonging to
     // nodes.
     $entity_conditions->condition("$base_alias.entity_type", 'node');
@@ -3301,6 +3325,7 @@
     // Add the compiled set of rules to the query.
     $query->condition($or);
   }
+
 }
 
 /**

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/node.test (original)
+++ branches/upstream/current-7/modules/node/node.test Thu May 10 18:20:18 2012
@@ -8,7 +8,7 @@
 /**
  * Test the node_load_multiple() function.
  */
-class NodeLoadMultipleUnitTest extends DrupalWebTestCase {
+class NodeLoadMultipleTestCase extends DrupalWebTestCase {
 
   public static function getInfo() {
     return array(
@@ -821,7 +821,7 @@
  * @todo Cover hook_node_access in a separate test class.
  * hook_node_access_records is covered in another test class.
  */
-class NodeAccessUnitTest extends DrupalWebTestCase {
+class NodeAccessTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Node access',
@@ -888,7 +888,7 @@
 /**
  * Test case to verify hook_node_access_records functionality.
  */
-class NodeAccessRecordsUnitTest extends DrupalWebTestCase {
+class NodeAccessRecordsTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Node access records',
@@ -2306,3 +2306,190 @@
     }
   }
 }
+
+/**
+ * Tests user permissions for node revisions.
+ */
+class NodeRevisionPermissionsTestCase extends DrupalWebTestCase {
+  protected $node_revisions = array();
+  protected $accounts = array();
+
+  // Map revision permission names to node revision access ops.
+  protected $map = array(
+    'view' => 'view revisions',
+    'update' => 'revert revisions',
+    'delete' => 'delete revisions',
+  );
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Node revision permissions',
+      'description' => 'Tests user permissions for node revision operations.',
+      'group' => 'Node',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+
+    // Create a node with several revisions.
+    $node = $this->drupalCreateNode();
+    $this->node_revisions[] = $node;
+
+    for ($i = 0; $i < 3; $i++) {
+      // Create a revision for the same nid and settings with a random log.
+      $revision = clone $node;
+      $revision->revision = 1;
+      $revision->log = $this->randomName(32);
+      node_save($revision);
+      $this->node_revisions[] = $revision;
+    }
+
+    // Create three users, one with each revision permission.
+    foreach ($this->map as $op => $permission) {
+      // Create the user.
+      $account = $this->drupalCreateUser(
+        array(
+          'access content',
+          'edit any page content',
+          'delete any page content',
+          $permission,
+        )
+      );
+      $account->op = $op;
+      $this->accounts[] = $account;
+    }
+
+    // Create an admin account (returns TRUE for all revision permissions).
+    $admin_account = $this->drupalCreateUser(array('access content', 'administer nodes'));
+    $admin_account->is_admin = TRUE;
+    $this->accounts['admin'] = $admin_account;
+
+    // Create a normal account (returns FALSE for all revision permissions).
+    $normal_account = $this->drupalCreateUser();
+    $normal_account->op = FALSE;
+    $this->accounts[] = $normal_account;
+  }
+
+  /**
+   * Tests the _node_revision_access() function.
+   */
+  function testNodeRevisionAccess() {
+    $revision = $this->node_revisions[1];
+
+    $parameters = array(
+      'op' => array_keys($this->map),
+      'account' => $this->accounts,
+    );
+
+    $permutations = $this->generatePermutations($parameters);
+    foreach ($permutations as $case) {
+      if (!empty($case['account']->is_admin) || $case['op'] == $case['account']->op) {
+        $this->assertTrue(_node_revision_access($revision, $case['op'], $case['account']), "{$this->map[$case['op']]} granted.");
+      }
+      else {
+        $this->assertFalse(_node_revision_access($revision, $case['op'], $case['account']), "{$this->map[$case['op']]} not granted.");
+      }
+    }
+
+    // Test that access is FALSE for a node administrator with an invalid $node
+    // or $op parameters.
+    $admin_account = $this->accounts['admin'];
+    $this->assertFalse(_node_revision_access(FALSE, 'view', $admin_account), '_node_revision_access() returns FALSE with an invalid node.');
+    $this->assertFalse(_node_revision_access($revision, 'invalid-op', $admin_account), '_node_revision_access() returns FALSE with an invalid op.');
+
+    // Test that the $account parameter defaults to the "logged in" user.
+    $original_user = $GLOBALS['user'];
+    $GLOBALS['user'] = $admin_account;
+    $this->assertTrue(_node_revision_access($revision, 'view'), '_node_revision_access() returns TRUE when used with global user.');
+    $GLOBALS['user'] = $original_user;
+  }
+}
+
+/**
+ * Tests pagination with a node access module enabled.
+ */
+class NodeAccessPagerTestCase extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Node access pagination',
+      'description' => 'Test access controlled node views have the right amount of comment pages.',
+      'group' => 'Node',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp('node_access_test', 'comment', 'forum');
+    node_access_rebuild();
+    $this->web_user = $this->drupalCreateUser(array('access content', 'access comments', 'node test view'));
+  }
+
+  /**
+   * Tests the comment pager for nodes with multiple grants per realm.
+   */
+  public function testCommentPager() {
+    // Create a node.
+    $node = $this->drupalCreateNode();
+
+    // Create 60 comments.
+    for ($i = 0; $i < 60; $i++) {
+      $comment = new stdClass();
+      $comment->cid = 0;
+      $comment->pid = 0;
+      $comment->uid = $this->web_user->uid;
+      $comment->nid = $node->nid;
+      $comment->subject = $this->randomName();
+      $comment->comment_body = array(
+        LANGUAGE_NONE => array(
+          array('value' => $this->randomName()),
+        ),
+      );
+      comment_save($comment);
+    }
+
+    $this->drupalLogin($this->web_user);
+
+    // View the node page. With the default 50 comments per page there should
+    // be two pages (0, 1) but no third (2) page.
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertText($node->title, t('Node title found.'));
+    $this->assertText(t('Comments'), t('Has a comments section.'));
+    $this->assertRaw('page=1', t('Secound page exists.'));
+    $this->assertNoRaw('page=2', t('No third page exists.'));
+  }
+
+  /**
+   * Tests the forum node pager for nodes with multiple grants per realm.
+   */
+  public function testForumPager() {
+    // Lookup the forums vocabulary vid.
+    $vid = variable_get('forum_nav_vocabulary', 0);
+    $this->assertTrue($vid, t('Forum navigation vocabulary found.'));
+
+    // Lookup the general discussion term.
+    $tree = taxonomy_get_tree($vid, 0, 1);
+    $tid = reset($tree)->tid;
+    $this->assertTrue($tid, t('General discussion term found.'));
+
+    // Create 30 nodes.
+    for ($i = 0; $i < 30; $i++) {
+      $this->drupalCreateNode(array(
+        'nid' => NULL,
+        'type' => 'forum',
+        'taxonomy_forums' => array(
+          LANGUAGE_NONE => array(
+            array('tid' => $tid, 'vid' => $vid, 'vocabulary_machine_name' => 'forums'),
+          ),
+        ),
+      ));
+    }
+
+    // View the general discussion forum page. With the default 25 nodes per
+    // page there should be two pages for 30 nodes, no more.
+    $this->drupalLogin($this->web_user);
+    $this->drupalGet('forum/' . $tid);
+    $this->assertRaw('page=1', t('Secound page exists.'));
+    $this->assertNoRaw('page=2', t('No third page exists.'));
+  }
+}

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -15,7 +15,7 @@
   // First grant a grant to the author for own content.
   $grants['node_access_test_author'] = array($account->uid);
   if ($op == 'view' && user_access('node test view', $account)) {
-    $grants['node_access_test'] = array(8888);
+    $grants['node_access_test'] = array(8888, 8889);
   }
   if ($op == 'view' && $account->uid == variable_get('node_test_node_access_all_uid', 0)) {
     $grants['node_access_all'] = array(0);
@@ -33,6 +33,14 @@
     $grants[] = array(
       'realm' => 'node_access_test',
       'gid' => 8888,
+      'grant_view' => 1,
+      'grant_update' => 0,
+      'grant_delete' => 0,
+      'priority' => 0,
+    );
+    $grants[] = array(
+      'realm' => 'node_access_test',
+      'gid' => 8889,
       'grant_view' => 1,
       'grant_update' => 0,
       'grant_delete' => 0,

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/node/tests/node_test.info (original)
+++ branches/upstream/current-7/modules/node/tests/node_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/openid/openid.info (original)
+++ branches/upstream/current-7/modules/openid/openid.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 files[] = openid.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/openid/openid.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/openid/openid.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/openid/openid.js (original)
+++ branches/upstream/current-7/modules/openid/openid.js Thu May 10 18:20:18 2012
@@ -7,7 +7,7 @@
     var cookie = $.cookie('Drupal.visitor.openid_identifier');
 
     // This behavior attaches by ID, so is only valid once on a page.
-    if (!$('#edit-openid-identifier.openid-processed').size()) {
+    if (!$('#edit-openid-identifier.openid-processed').length) {
       if (cookie) {
         $('#edit-openid-identifier').val(cookie);
       }

Modified: branches/upstream/current-7/modules/openid/openid.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/openid/openid.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/openid/openid.module (original)
+++ branches/upstream/current-7/modules/openid/openid.module Thu May 10 18:20:18 2012
@@ -70,7 +70,7 @@
     case 'admin/help#openid':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The OpenID module allows users to log in using the OpenID single sign on service. <a href="@openid-net">OpenID</a> is a secure method for logging into many websites with a single username and password. It does not require special software, and it does not share passwords with any site to which it is associated, including the site being logged into. The main benefit to users is that they can have a single password that they can use on many websites. This means they can easily update their single password from a centralized location, rather than having to change dozens of passwords individually. For more information, see the online handbook entry for <a href="@handbook">OpenID module</a>.', array('@openid-net' => 'http://openid.net', '@handbook' => 'http://drupal.org/handbook/modules/openid')) . '</p>';
+      $output .= '<p>' . t('The OpenID module allows users to log in using the OpenID single sign on service. <a href="@openid-net">OpenID</a> is a secure method for logging into many websites with a single username and password. It does not require special software, and it does not share passwords with any site to which it is associated, including the site being logged into. The main benefit to users is that they can have a single password that they can use on many websites. This means they can easily update their single password from a centralized location, rather than having to change dozens of passwords individually. For more information, see the online handbook entry for <a href="@handbook">OpenID module</a>.', array('@openid-net' => 'http://openid.net', '@handbook' => 'http://drupal.org/documentation/modules/openid')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Logging in with OpenID') . '</dt>';

Modified: branches/upstream/current-7/modules/openid/openid.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/openid/openid.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/openid/openid.test (original)
+++ branches/upstream/current-7/modules/openid/openid.test Thu May 10 18:20:18 2012
@@ -653,7 +653,7 @@
 /**
  * Test internal helper functions.
  */
-class OpenIDUnitTest extends DrupalWebTestCase {
+class OpenIDTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'OpenID helper functions',

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/openid/tests/openid_test.info (original)
+++ branches/upstream/current-7/modules/openid/tests/openid_test.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 dependencies[] = openid
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/overlay/overlay-parent.js (original)
+++ branches/upstream/current-7/modules/overlay/overlay-parent.js Thu May 10 18:20:18 2012
@@ -1,4 +1,3 @@
-
 (function ($) {
 
 /**
@@ -354,9 +353,14 @@
 
   // Turn the list of administrative paths into a regular expression.
   if (!this.adminPathRegExp) {
-    var regExpPrefix = '^' + Drupal.settings.pathPrefix + '(';
-    var adminPaths = regExpPrefix + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|' + regExpPrefix) + ')$';
-    var nonAdminPaths = regExpPrefix + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|'+ regExpPrefix) + ')$';
+    var prefix = '';
+    if (Drupal.settings.overlay.pathPrefixes.length) {
+      // Allow path prefixes used for language negatiation followed by slash,
+      // and the empty string.
+      prefix = '(' + Drupal.settings.overlay.pathPrefixes.join('/|') + '/|)';
+    }
+    var adminPaths = '^' + prefix + '(' + Drupal.settings.overlay.paths.admin.replace(/\s+/g, '|') + ')$';
+    var nonAdminPaths = '^' + prefix + '(' + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, '|') + ')$';
     adminPaths = adminPaths.replace(/\*/g, '.*');
     nonAdminPaths = nonAdminPaths.replace(/\*/g, '.*');
     this.adminPathRegExp = new RegExp(adminPaths);
@@ -856,8 +860,13 @@
   if (lastDisplaced.length) {
     displacement = lastDisplaced.offset().top + lastDisplaced.outerHeight();
 
-    // Remove height added by IE Shadow filter.
-    if (lastDisplaced[0].filters && lastDisplaced[0].filters.length && lastDisplaced[0].filters.item('DXImageTransform.Microsoft.Shadow')) {
+    // In modern browsers (including IE9), when box-shadow is defined, use the
+    // normal height.
+    var cssBoxShadowValue = lastDisplaced.css('box-shadow');
+    var boxShadow = (typeof cssBoxShadowValue !== 'undefined' && cssBoxShadowValue !== 'none');
+    // In IE8 and below, we use the shadow filter to apply box-shadow styles to
+    // the toolbar. It adds some extra height that we need to remove.
+    if (!boxShadow && /DXImageTransform\.Microsoft\.Shadow/.test(lastDisplaced.css('filter'))) {
       displacement -= lastDisplaced[0].filters.item('DXImageTransform.Microsoft.Shadow').strength;
       displacement = Math.max(0, displacement);
     }

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/overlay/overlay.info (original)
+++ branches/upstream/current-7/modules/overlay/overlay.info Thu May 10 18:20:18 2012
@@ -4,8 +4,8 @@
 version = VERSION
 core = 7.x
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/overlay/overlay.module (original)
+++ branches/upstream/current-7/modules/overlay/overlay.module Thu May 10 18:20:18 2012
@@ -13,7 +13,7 @@
     case 'admin/help#overlay':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Overlay module makes the administration pages on your site display in a JavaScript overlay of the page you were viewing when you clicked the administrative link, instead of replacing the page in your browser window. Use the close link on the overlay to return to the page you were viewing when you clicked the link. For more information, see the online handbook entry for <a href="@overlay">Overlay module</a>.', array('@overlay' => 'http://drupal.org/handbook/modules/overlay')) . '</p>';
+      $output .= '<p>' . t('The Overlay module makes the administration pages on your site display in a JavaScript overlay of the page you were viewing when you clicked the administrative link, instead of replacing the page in your browser window. Use the close link on the overlay to return to the page you were viewing when you clicked the link. For more information, see the online handbook entry for <a href="@overlay">Overlay module</a>.', array('@overlay' => 'http://drupal.org/documentation/modules/overlay')) . '</p>';
       return $output;
   }
 }
@@ -202,7 +202,7 @@
   // Overlay parent.
   $libraries['parent'] = array(
     'title' => 'Overlay: Parent',
-    'website' => 'http://drupal.org/handbook/modules/overlay',
+    'website' => 'http://drupal.org/documentation/modules/overlay',
     'version' => '1.0',
     'js' => array(
       $module_path . '/overlay-parent.js' => array(),
@@ -218,7 +218,7 @@
   // Overlay child.
   $libraries['child'] = array(
     'title' => 'Overlay: Child',
-    'website' => 'http://drupal.org/handbook/modules/overlay',
+    'website' => 'http://drupal.org/documentation/modules/overlay',
     'version' => '1.0',
     'js' => array(
       $module_path . '/overlay-child.js' => array(),
@@ -641,6 +641,20 @@
     $type = str_replace('<front>', variable_get('site_frontpage', 'node'), $type);
   }
   drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting');
+  $path_prefixes = array();
+  if (module_exists('locale') && variable_get('locale_language_negotiation_url_part', LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX) == LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIX) {
+    // Get languages grouped by status and select only the enabled ones.
+    $languages = language_list('enabled');
+    $languages = $languages[1];
+
+    $path_prefixes = array();
+    foreach ($languages as $language) {
+      if ($language->prefix) {
+        $path_prefixes[] = $language->prefix;
+      }
+    }
+  }
+  drupal_add_js(array('overlay' => array('pathPrefixes' => $path_prefixes)), 'setting');
   // Pass along the Ajax callback for rerendering sections of the parent window.
   drupal_add_js(array('overlay' => array('ajaxCallback' => 'overlay-ajax')), 'setting');
 }

Modified: branches/upstream/current-7/modules/path/path.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/path/path.admin.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/path/path.admin.inc (original)
+++ branches/upstream/current-7/modules/path/path.admin.inc Thu May 10 18:20:18 2012
@@ -6,7 +6,7 @@
  */
 
 /**
- * Return a listing of all defined URL aliases.
+ * Returns a listing of all defined URL aliases.
  *
  * When filter key passed, perform a standard search on the given key,
  * and return the list of matching URL aliases.
@@ -87,7 +87,15 @@
 }
 
 /**
- * Menu callback; handles pages for creating and editing URL aliases.
+ * Page callback: Returns a form creating or editing a path alias.
+ *
+ * @param $path
+ *   An array containing the path ID, source, alias, and language code.
+ *
+ * @return
+ *   A form for adding or editing a URL alias.
+ *
+ * @see path_menu()
  */
 function path_admin_edit($path = array()) {
   if ($path) {
@@ -102,11 +110,15 @@
 }
 
 /**
- * Return a form for editing or creating an individual URL alias.
+ * Form constructor for the path administration form.
+ *
+ * @param $path
+ *   An array containing the path ID, source, alias, and language code.
  *
  * @ingroup forms
  * @see path_admin_form_validate()
  * @see path_admin_form_submit()
+ * @see path_admin_form_delete_submit()
  */
 function path_admin_form($form, &$form_state, $path = array('source' => '', 'alias' => '', 'language' => LANGUAGE_NONE, 'pid' => NULL)) {
   $form['source'] = array(
@@ -157,7 +169,10 @@
 }
 
 /**
- * Submit function for the 'Delete' button on the URL alias editing form.
+ * Form submission handler for the 'Delete' button on path_admin_form().
+ *
+ * @see path_admin_form_validate()
+ * @see path_admin_form_submit()
  */
 function path_admin_form_delete_submit($form, &$form_state) {
   $destination = array();
@@ -169,7 +184,10 @@
 }
 
 /**
- * Verify that a URL alias is valid
+ * Form validation handler for path_admin_form().
+ *
+ * @see path_admin_form_submit()
+ * @see path_admin_form_delete_submit()
  */
 function path_admin_form_validate($form, &$form_state) {
   $source = &$form_state['values']['source'];
@@ -195,7 +213,10 @@
 }
 
 /**
- * Save a URL alias to the database.
+ * Form submission handler for path_admin_form().
+ *
+ * @see path_admin_form_validate()
+ * @see path_admin_form_delete_submit()
  */
 function path_admin_form_submit($form, &$form_state) {
   // Remove unnecessary values.
@@ -208,7 +229,12 @@
 }
 
 /**
- * Menu callback; confirms deleting an URL alias
+ * Form constructor for the path deletion form.
+ *
+ * @param $path
+ *   The path alias that will be deleted.
+ *
+ * @see path_admin_delete_confirm_submit()
  */
 function path_admin_delete_confirm($form, &$form_state, $path) {
   if (user_access('administer url aliases')) {
@@ -224,7 +250,7 @@
 }
 
 /**
- * Execute URL alias deletion
+ * Form submission handler for path_admin_delete_confirm().
  */
 function path_admin_delete_confirm_submit($form, &$form_state) {
   if ($form_state['values']['confirm']) {
@@ -234,10 +260,11 @@
 }
 
 /**
- * Return a form to filter URL aliases.
+ * Form constructor for the path admin overview filter form.
  *
  * @ingroup forms
- * @see path_admin_filter_form_submit()
+ * @see path_admin_filter_form_submit_filter()
+ * @see path_admin_filter_form_submit_reset()
  */
 function path_admin_filter_form($form, &$form_state, $keys = '') {
   $form['#attributes'] = array('class' => array('search-form'));
@@ -269,14 +296,18 @@
 }
 
 /**
- * Process filter form submission when the Filter button is pressed.
+ * Form submission handler for the path_admin_filter_form() Filter button.
+ *
+ * @see path_admin_filter_form_submit_reset()
  */
 function path_admin_filter_form_submit_filter($form, &$form_state) {
   $form_state['redirect'] = 'admin/config/search/path/list/' . trim($form_state['values']['filter']);
 }
 
 /**
- * Process filter form submission when the Reset button is pressed.
+ * Form submission handler for the path_admin_filter_form() Reset button.
+ *
+ * @see path_admin_filter_form_submit_filter()
  */
 function path_admin_filter_form_submit_reset($form, &$form_state) {
   $form_state['redirect'] = 'admin/config/search/path/list';

Modified: branches/upstream/current-7/modules/path/path.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/path/path.api.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/path/path.api.php (original)
+++ branches/upstream/current-7/modules/path/path.api.php Thu May 10 18:20:18 2012
@@ -10,9 +10,8 @@
  * @{
  */
 
-
 /**
- * Allow modules to respond to a path being inserted.
+ * Respond to a path being inserted.
  *
  * @param $path
  *   An associative array containing the following keys:
@@ -33,7 +32,7 @@
 }
 
 /**
- * Allow modules to respond to a path being updated.
+ * Respond to a path being updated.
  *
  * @param $path
  *   An associative array containing the following keys:
@@ -52,7 +51,7 @@
 }
 
 /**
- * Allow modules to respond to a path being deleted.
+ * Respond to a path being deleted.
  *
  * @param $path
  *   An associative array containing the following keys:

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/path/path.info (original)
+++ branches/upstream/current-7/modules/path/path.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = path.test
 configure = admin/config/search/path
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/path/path.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/path/path.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/path/path.js (original)
+++ branches/upstream/current-7/modules/path/path.js Thu May 10 18:20:18 2012
@@ -1,3 +1,8 @@
+
+/**
+ * @file
+ * Attaches behaviors for the Path module.
+ */
 
 (function ($) {
 

Modified: branches/upstream/current-7/modules/path/path.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/path/path.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/path/path.module (original)
+++ branches/upstream/current-7/modules/path/path.module Thu May 10 18:20:18 2012
@@ -13,7 +13,7 @@
     case 'admin/help#path':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Path module allows you to specify an alias, or custom URL, for any existing internal system path. Aliases should not be confused with URL redirects, which allow you to forward a changed or inactive URL to a new URL. In addition to making URLs more readable, aliases also help search engines index content more effectively. Multiple aliases may be used for a single internal system path. To automate the aliasing of paths, you can install the contributed module <a href="@pathauto">Pathauto</a>. For more information, see the online handbook entry for the <a href="@path">Path module</a>.', array('@path' => 'http://drupal.org/handbook/modules/path', '@pathauto' => 'http://drupal.org/project/pathauto')) . '</p>';
+      $output .= '<p>' . t('The Path module allows you to specify an alias, or custom URL, for any existing internal system path. Aliases should not be confused with URL redirects, which allow you to forward a changed or inactive URL to a new URL. In addition to making URLs more readable, aliases also help search engines index content more effectively. Multiple aliases may be used for a single internal system path. To automate the aliasing of paths, you can install the contributed module <a href="@pathauto">Pathauto</a>. For more information, see the online handbook entry for the <a href="@path">Path module</a>.', array('@path' => 'http://drupal.org/documentation/modules/path', '@pathauto' => 'http://drupal.org/project/pathauto')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Creating aliases') . '</dt>';
@@ -91,7 +91,9 @@
 }
 
 /**
- * Implements hook_form_BASE_FORM_ID_alter().
+ * Implements hook_form_BASE_FORM_ID_alter() for node_form().
+ *
+ * @see path_form_element_validate()
  */
 function path_form_node_form_alter(&$form, $form_state) {
   $path = array();
@@ -145,11 +147,13 @@
 
 /**
  * Form element validation handler for URL alias form element.
+ *
+ * @see path_form_node_form_alter()
  */
 function path_form_element_validate($element, &$form_state, $complete_form) {
-  if (!empty($form_state['values']['path']['alias'])) {
-    // Trim the submitted value.
-    $alias = trim($form_state['values']['path']['alias']);
+  // Trim the submitted value.
+  $alias = trim($form_state['values']['path']['alias']);
+  if (!empty($alias)) {
     form_set_value($element['alias'], $alias, $form_state);
     // Node language (Locale module) needs special care. Since the language of
     // the URL alias depends on the node language, and the node language can be
@@ -173,7 +177,7 @@
     $query->addExpression('1');
     $query->range(0, 1);
     if ($query->execute()->fetchField()) {
-      form_set_error('alias', t('The alias is already in use.'));
+      form_error($element, t('The alias is already in use.'));
     }
   }
 }
@@ -225,7 +229,7 @@
 }
 
 /**
- * Implements hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter() for taxonomy_form_term().
  */
 function path_form_taxonomy_form_term_alter(&$form, $form_state) {
   // Make sure this does not show up on the delete confirmation form.

Modified: branches/upstream/current-7/modules/path/path.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/path/path.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/path/path.test (original)
+++ branches/upstream/current-7/modules/path/path.test Thu May 10 18:20:18 2012
@@ -2,9 +2,12 @@
 
 /**
  * @file
- * Tests for path.module.
+ * Tests for the Path module.
  */
 
+/**
+ * Provides a base class for testing the Path module.
+ */
 class PathTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
@@ -23,7 +26,7 @@
   }
 
   /**
-   * Test the path cache.
+   * Tests the path cache.
    */
   function testPathCache() {
     // Create test node.
@@ -48,7 +51,7 @@
   }
 
   /**
-   * Test alias functionality through the admin interfaces.
+   * Tests alias functionality through the admin interfaces.
    */
   function testAdminAlias() {
     // Create test node.
@@ -107,7 +110,7 @@
   }
 
   /**
-   * Test alias functionality through the node interfaces.
+   * Tests alias functionality through the node interfaces.
    */
   function testNodeAlias() {
     // Create test node.
@@ -159,13 +162,39 @@
     $this->assertResponse(404);
   }
 
+  /**
+   * Returns the path ID.
+   *
+   * @param $alias
+   *   A string containing an aliased path.
+   *
+   * @return int
+   *   Integer representing the path ID.
+   */
   function getPID($alias) {
     return db_query("SELECT pid FROM {url_alias} WHERE alias = :alias", array(':alias' => $alias))->fetchField();
   }
+
+  /**
+   * Tests that duplicate aliases fail validation.
+   */
+  function testDuplicateNodeAlias() {
+    // Create one node with a random alias.
+    $node_one = $this->drupalCreateNode();
+    $edit = array();
+    $edit['path[alias]'] = $this->randomName();
+    $this->drupalPost('node/' . $node_one->nid . '/edit', $edit, t('Save'));
+
+    // Now create another node and try to set the same alias.
+    $node_two = $this->drupalCreateNode();
+    $this->drupalPost('node/' . $node_two->nid . '/edit', $edit, t('Save'));
+    $this->assertText(t('The alias is already in use.'));
+    $this->assertFieldByXPath("//input[@name='path[alias]' and contains(@class, 'error')]", $edit['path[alias]'], 'Textfield exists and has the error class.');
+  }
 }
 
 /**
- * Test URL aliases for taxonomy terms.
+ * Tests URL aliases for taxonomy terms.
  */
 class PathTaxonomyTermTestCase extends DrupalWebTestCase {
   public static function getInfo() {
@@ -185,7 +214,7 @@
   }
 
   /**
-   * Test alias functionality through the admin interfaces.
+   * Tests alias functionality through the admin interfaces.
    */
   function testTermAlias() {
     // Create a term in the default 'Tags' vocabulary with URL alias.
@@ -228,6 +257,9 @@
   }
 }
 
+/**
+ * Tests URL aliases for translated nodes.
+ */
 class PathLanguageTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/php/php.info (original)
+++ branches/upstream/current-7/modules/php/php.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 files[] = php.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/php/php.module (original)
+++ branches/upstream/current-7/modules/php/php.module Thu May 10 18:20:18 2012
@@ -13,11 +13,11 @@
     case 'admin/help#php':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The PHP filter module adds a PHP filter to your site, for use with <a href="@filter">text formats</a>. This filter adds the ability to execute PHP code in any text field that uses a text format (such as the body of a content item or the text of a comment). <a href="@php-net">PHP</a> is a general-purpose scripting language widely-used for web development, and is the language with which Drupal has been developed. For more information, see the online handbook entry for the <a href="@php">PHP filter module</a>.', array('@filter' => url('admin/help/filter'), '@php-net' => 'http://www.php.net', '@php' => 'http://drupal.org/handbook/modules/php/')) . '</p>';
+      $output .= '<p>' . t('The PHP filter module adds a PHP filter to your site, for use with <a href="@filter">text formats</a>. This filter adds the ability to execute PHP code in any text field that uses a text format (such as the body of a content item or the text of a comment). <a href="@php-net">PHP</a> is a general-purpose scripting language widely-used for web development, and is the language with which Drupal has been developed. For more information, see the online handbook entry for the <a href="@php">PHP filter module</a>.', array('@filter' => url('admin/help/filter'), '@php-net' => 'http://www.php.net', '@php' => 'http://drupal.org/documentation/modules/php/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Enabling execution of PHP in text fields') . '</dt>';
-      $output .= '<dd>' . t('The PHP filter module allows users with the proper permissions to include custom PHP code that will get executed when pages of your site are processed. While this is a powerful and flexible feature if used by a trusted user with PHP experience, it is a significant and dangerous security risk in the hands of a malicious or inexperienced user. Even a trusted user may accidentally compromise the site by entering malformed or incorrect PHP code. Only the most trusted users should be granted permission to use the PHP filter, and all PHP code added through the PHP filter should be carefully examined before use. <a href="@php-snippets">Example PHP snippets</a> can be found on Drupal.org.', array('@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) . '</dd>';
+      $output .= '<dd>' . t('The PHP filter module allows users with the proper permissions to include custom PHP code that will get executed when pages of your site are processed. While this is a powerful and flexible feature if used by a trusted user with PHP experience, it is a significant and dangerous security risk in the hands of a malicious or inexperienced user. Even a trusted user may accidentally compromise the site by entering malformed or incorrect PHP code. Only the most trusted users should be granted permission to use the PHP filter, and all PHP code added through the PHP filter should be carefully examined before use. <a href="@php-snippets">Example PHP snippets</a> can be found on Drupal.org.', array('@php-snippets' => url('http://http://drupal.org/documentation/customization/php-snippets'))) . '</dd>';
       $output .= '</dl>';
       return $output;
   }
@@ -122,7 +122,7 @@
   print t(\'Welcome visitor! Thank you for visiting.\');
 }
 </pre>') . '</li></ul>';
-    $output .= '<p>' . t('<a href="@drupal">Drupal.org</a> offers <a href="@php-snippets">some example PHP snippets</a>, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) . '</p>';
+    $output .= '<p>' . t('<a href="@drupal">Drupal.org</a> offers <a href="@php-snippets">some example PHP snippets</a>, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://http://drupal.org/documentation/customization/php-snippets'))) . '</p>';
     return $output;
   }
   else {

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/poll/poll.info (original)
+++ branches/upstream/current-7/modules/poll/poll.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = poll.test
 stylesheets[all][] = poll.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/poll/poll.module (original)
+++ branches/upstream/current-7/modules/poll/poll.module Thu May 10 18:20:18 2012
@@ -14,7 +14,7 @@
     case 'admin/help#poll':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Poll module can be used to create simple surveys or questionnaires that display cumulative results. A poll is a good way to receive feedback from site users and community members. For more information, see the online handbook entry for the <a href="@poll">Poll module</a>.', array('@poll' => 'http://drupal.org/handbook/modules/poll/')) . '</p>';
+      $output .= '<p>' . t('The Poll module can be used to create simple surveys or questionnaires that display cumulative results. A poll is a good way to receive feedback from site users and community members. For more information, see the online handbook entry for the <a href="@poll">Poll module</a>.', array('@poll' => 'http://drupal.org/documentation/modules/poll/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Creating a poll') . '</dt>';
@@ -76,7 +76,7 @@
       'title' => t('Cancel and change own votes'),
     ),
     'inspect all votes' => array(
-      'title' => t('View voting results'),
+      'title' => t('View details for all votes'),
     ),
   );
 
@@ -476,6 +476,9 @@
 function poll_field_attach_prepare_translation_alter(&$entity, $context) {
   if ($context['entity_type'] == 'node' && $entity->type == 'poll') {
     $entity->choice = $context['source_entity']->choice;
+    foreach ($entity->choice as $i => $options) {
+      $entity->choice[$i]['chvotes'] = 0;
+    }
   }
 }
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/poll/poll.test (original)
+++ branches/upstream/current-7/modules/poll/poll.test Thu May 10 18:20:18 2012
@@ -798,3 +798,75 @@
     $this->assertText('Third choice', t('Third choice remains.'));
   }
 }
+
+/**
+ * Tests poll translation logic.
+ */
+class PollTranslateTestCase extends PollTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Poll translation',
+      'description' => 'Test the poll translation logic.',
+      'group' => 'Poll',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('poll', 'translation');
+  }
+
+  /**
+   * Tests poll creation and translation.
+   *
+   * Checks that the choice names get copied from the original poll and that
+   * the vote count values are set to 0.
+   */
+  function testPollTranslate() {
+    $admin_user = $this->drupalCreateUser(array('administer content types', 'administer languages', 'edit any poll content', 'create poll content', 'administer nodes', 'translate content'));
+
+    // Set up a poll with two choices.
+    $title = $this->randomName();
+    $choices = array($this->randomName(), $this->randomName());
+    $poll_nid = $this->pollCreate($title, $choices, FALSE);
+    $this->assertTrue($poll_nid, t('Poll for translation logic test created.'));
+
+    $this->drupalLogout();
+    $this->drupalLogin($admin_user);
+
+    // Enable a second language.
+    $this->drupalGet('admin/config/regional/language');
+    $edit = array();
+    $edit['langcode'] = 'nl';
+    $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
+    $this->assertRaw(t('The language %language has been created and can now be used.', array('%language' => 'Dutch')), t('Language Dutch has been created.'));
+
+    // Set "Poll" content type to use multilingual support with translation.
+    $this->drupalGet('admin/structure/types/manage/poll');
+    $edit = array();
+    $edit['language_content_type'] = 2;
+    $this->drupalPost('admin/structure/types/manage/poll', $edit, t('Save content type'));
+    $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Poll')), t('Poll content type has been updated.'));
+
+    // Edit poll.
+    $this->drupalGet("node/$poll_nid/edit");
+    $edit = array();
+    // Set the poll's first choice count to 200.
+    $edit['choice[chid:1][chvotes]'] = 200;
+    // Set the language to Dutch.
+    $edit['language'] = 'nl';
+    $this->drupalPost(NULL, $edit, t('Save'));
+
+    // Translate the Dutch poll.
+    $this->drupalGet('node/add/poll', array('query' => array('translation' => $poll_nid, 'target' => 'en')));
+
+    $dutch_poll = node_load($poll_nid);
+
+    // Check that the vote count values didn't get copied from the Dutch poll
+    // and are set to 0.
+    $this->assertFieldByName('choice[chid:1][chvotes]', '0', ('Found choice with vote count 0'));
+    $this->assertFieldByName('choice[chid:2][chvotes]', '0', ('Found choice with vote count 0'));
+    // Check that the choice names got copied from the Dutch poll.
+    $this->assertFieldByName('choice[chid:1][chtext]', $dutch_poll->choice[1]['chtext'], t('Found choice with text @text', array('@text' => $dutch_poll->choice[1]['chtext'])));
+    $this->assertFieldByName('choice[chid:2][chtext]', $dutch_poll->choice[2]['chtext'], t('Found choice with text @text', array('@text' => $dutch_poll->choice[2]['chtext'])));
+  }
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/profile/profile.info (original)
+++ branches/upstream/current-7/modules/profile/profile.info Thu May 10 18:20:18 2012
@@ -11,8 +11,8 @@
 ; See user_system_info_alter().
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/profile/profile.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/profile/profile.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/profile/profile.js (original)
+++ branches/upstream/current-7/modules/profile/profile.js Thu May 10 18:20:18 2012
@@ -24,7 +24,7 @@
           }
         }
         // This category has become empty
-        if ($(this).next('tr').is(':not(.draggable)') || $(this).next('tr').size() == 0) {
+        if ($(this).next('tr').is(':not(.draggable)') || $(this).next('tr').length == 0) {
           $(this).removeClass('category-populated').addClass('category-empty');
         }
         // This category has become populated.

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/profile/profile.module (original)
+++ branches/upstream/current-7/modules/profile/profile.module Thu May 10 18:20:18 2012
@@ -33,7 +33,7 @@
     case 'admin/help#profile':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Profile module allows site administrators to define custom fields (such as country, full name, or age) for user profiles, which are then displayed in the <a href="@user">My Account</a> section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information. For more information, see the online handbook entry for <a href="@profile">Profile module</a>.', array('@user' => url('user'), '@profile' => 'http://drupal.org/handbook/modules/profile/')) . '</p>';
+      $output .= '<p>' . t('The Profile module allows site administrators to define custom fields (such as country, full name, or age) for user profiles, which are then displayed in the <a href="@user">My Account</a> section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information. For more information, see the online handbook entry for <a href="@profile">Profile module</a>.', array('@user' => url('user'), '@profile' => 'http://drupal.org/documentation/modules/profile/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Adding fields to the default profile') . '</dt>';
@@ -435,7 +435,7 @@
         break;
 
       case 'selection':
-        $options = $field->required ? array() : array('--');
+        $options = array();
         $lines = preg_split("/[\n\r]/", $field->options);
         foreach ($lines as $line) {
           if ($line = trim($line)) {
@@ -449,6 +449,7 @@
           '#options' => $options,
           '#description' => _profile_form_explanation($field),
           '#required' => $field->required,
+          '#empty_value' => 0,
         );
         break;
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/rdf/rdf.info (original)
+++ branches/upstream/current-7/modules/rdf/rdf.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 files[] = rdf.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/rdf/rdf.module (original)
+++ branches/upstream/current-7/modules/rdf/rdf.module Thu May 10 18:20:18 2012
@@ -13,7 +13,7 @@
     case 'admin/help#rdf':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The RDF module enriches your content with metadata to let other applications (e.g., search engines, aggregators, and so on) better understand its relationships and attributes. This semantically enriched, machine-readable output for Drupal sites uses the <a href="@rdfa">RDFa specification</a> which allows RDF data to be embedded in HTML markup. Other modules can define mappings of their data to RDF terms, and the RDF module makes this RDF data available to the theme. The core Drupal modules define RDF mappings for their data model, and the core Drupal themes output this RDF metadata information along with the human-readable visual information. For more information, see the online handbook entry for <a href="@rdf">RDF module</a>.', array('@rdfa' => 'http://www.w3.org/TR/xhtml-rdfa-primer/', '@rdf' => 'http://drupal.org/handbook/modules/rdf')) . '</p>';
+      $output .= '<p>' . t('The RDF module enriches your content with metadata to let other applications (e.g., search engines, aggregators, and so on) better understand its relationships and attributes. This semantically enriched, machine-readable output for Drupal sites uses the <a href="@rdfa">RDFa specification</a> which allows RDF data to be embedded in HTML markup. Other modules can define mappings of their data to RDF terms, and the RDF module makes this RDF data available to the theme. The core Drupal modules define RDF mappings for their data model, and the core Drupal themes output this RDF metadata information along with the human-readable visual information. For more information, see the online handbook entry for <a href="@rdf">RDF module</a>.', array('@rdfa' => 'http://www.w3.org/TR/xhtml-rdfa-primer/', '@rdf' => 'http://drupal.org/documentation/modules/rdf')) . '</p>';
       return $output;
   }
 }

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/rdf/tests/rdf_test.info (original)
+++ branches/upstream/current-7/modules/rdf/tests/rdf_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/search/search.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/search/search.admin.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.admin.inc (original)
+++ branches/upstream/current-7/modules/search/search.admin.inc Thu May 10 18:20:18 2012
@@ -95,7 +95,8 @@
     '#default_value' => variable_get('minimum_word_size', 3),
     '#size' => 5,
     '#maxlength' => 3,
-    '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).')
+    '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).'),
+    '#element_validate' => array('element_validate_integer_positive'),
   );
   $form['indexing_settings']['overlap_cjk'] = array(
     '#type' => 'checkbox',

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.info (original)
+++ branches/upstream/current-7/modules/search/search.info Thu May 10 18:20:18 2012
@@ -8,8 +8,8 @@
 configure = admin/config/search/settings
 stylesheets[all][] = search.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.module (original)
+++ branches/upstream/current-7/modules/search/search.module Thu May 10 18:20:18 2012
@@ -68,7 +68,7 @@
     case 'admin/help#search':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Search module provides the ability to index and search for content by exact keywords, and for users by username or e-mail. For more information, see the online handbook entry for <a href="@search-module">Search module</a>.', array('@search-module' => 'http://drupal.org/handbook/modules/search/', '@search' => url('search'))) . '</p>';
+      $output .= '<p>' . t('The Search module provides the ability to index and search for content by exact keywords, and for users by username or e-mail. For more information, see the online handbook entry for <a href="@search-module">Search module</a>.', array('@search-module' => 'http://drupal.org/documentation/modules/search/', '@search' => url('search'))) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Searching content and users') . '</dt>';
@@ -1293,6 +1293,11 @@
   $simplified_key = search_simplify($key);
   $simplified_text = search_simplify($text);
 
+  // Return immediately if simplified key or text are empty.
+  if (!$simplified_key || !$simplified_text) {
+    return FALSE;
+  }
+
   // Check if we have a match after simplification in the text.
   if (!preg_match('/' . $boundary . $simplified_key . $boundary . '/iu', $simplified_text, $match, PREG_OFFSET_CAPTURE, $offset)) {
     return FALSE;

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/search/search.test (original)
+++ branches/upstream/current-7/modules/search/search.test Thu May 10 18:20:18 2012
@@ -1461,6 +1461,17 @@
     $this->assertText(t('The index will be rebuilt'));
     $this->drupalGet('admin/config/search/settings');
     $this->assertText(t('There is 1 item left to index.'));
+
+    // Test that the form saves with the default values.
+    $this->drupalPost('admin/config/search/settings', array(), t('Save configuration'));
+    $this->assertText(t('The configuration options have been saved.'), 'Form saves with the default values.');
+
+    // Test that the form does not save with an invalid word length.
+    $edit = array(
+      'minimum_word_size' => $this->randomName(3),
+    );
+    $this->drupalPost('admin/config/search/settings', $edit, t('Save configuration'));
+    $this->assertNoText(t('The configuration options have been saved.'), 'Form does not save with an invalid word length.');
   }
 
   /**
@@ -1639,6 +1650,21 @@
 
     $result = preg_replace('| +|', ' ', search_excerpt('"abc def"', $text));
     $this->assertTrue(strpos($result, '<strong>abc,def</strong>') !== FALSE, 'Phrase with keyword simplified into two separate words is highlighted with simplified match');
+
+    // Test phrases with characters which are being truncated.
+    $result = preg_replace('| +|', ' ', search_excerpt('"ipsum _"', $text));
+    $this->assertTrue(strpos($result, '<strong>ipsum </strong>') !== FALSE, 'Only valid part of the phrase is highlighted and invalid part containing "_" is ignored.');
+
+    $result = preg_replace('| +|', ' ', search_excerpt('"ipsum 0000"', $text));
+    $this->assertTrue(strpos($result, '<strong>ipsum </strong>') !== FALSE, 'Only valid part of the phrase is highlighted and invalid part "0000" is ignored.');
+
+    // Test combination of the valid keyword and keyword containing only
+    // characters which are being truncated during simplification.
+    $result = preg_replace('| +|', ' ', search_excerpt('ipsum _', $text));
+    $this->assertTrue(strpos($result, '<strong>ipsum</strong>') !== FALSE, 'Only valid keyword is highlighted and invalid keyword "_" is ignored.');
+
+    $result = preg_replace('| +|', ' ', search_excerpt('ipsum 0000', $text));
+    $this->assertTrue(strpos($result, '<strong>ipsum</strong>') !== FALSE, 'Only valid keyword is highlighted and invalid keyword "0000" is ignored.');
   }
 }
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/shortcut/shortcut.admin.js (original)
+++ branches/upstream/current-7/modules/shortcut/shortcut.admin.js Thu May 10 18:20:18 2012
@@ -52,7 +52,7 @@
             // 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);
+            tableDrag.rowStatusChange(changedRowObject);
           }
         }
         else if (total != visibleLength) {
@@ -71,18 +71,18 @@
 
       // Add a handler so when a row is dropped, update fields dropped into new regions.
       tableDrag.onDrop = function () {
-        rowStatusChange(this.rowObject);
+        tableDrag.rowStatusChange(this.rowObject);
         return true;
       };
 
-      function rowStatusChange(rowObject) {
+      tableDrag.rowStatusChange = function (rowObject) {
         // Use "status-message" row instead of "status" row because
         // "status-{status_name}-message" is less prone to regexp match errors.
         var statusRow = $(rowObject.element).prevAll('tr.shortcut-status').get(0);
         var statusName = statusRow.className.replace(/([^ ]+[ ]+)*shortcut-status-([^ ]+)([ ]+[^ ]+)*/, '$2');
         var statusField = $('select.shortcut-status-select', rowObject.element);
         statusField.val(statusName);
-      }
+      };
 
       tableDrag.restripeTable = function () {
         // :even and :odd are reversed because jQuery counts from 0 and
@@ -106,7 +106,7 @@
 Drupal.behaviors.newSet = {
   attach: function (context, settings) {
     var selectDefault = function() {
-      $($(this).parents('div.form-item').get(1)).find('> label > input').attr('checked', 'checked');
+      $(this).closest('form').find('.form-item-set .form-type-radio:last input').attr('checked', 'checked');
     };
     $('div.form-item-new input').focus(selectDefault).keyup(selectDefault);
   }

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/shortcut/shortcut.info (original)
+++ branches/upstream/current-7/modules/shortcut/shortcut.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = shortcut.test
 configure = admin/config/user-interface/shortcut
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/shortcut/shortcut.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/shortcut/shortcut.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/shortcut/shortcut.module (original)
+++ branches/upstream/current-7/modules/shortcut/shortcut.module Thu May 10 18:20:18 2012
@@ -22,7 +22,7 @@
   switch ($path) {
     case 'admin/help#shortcut':
       $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Shortcut module allows users to create sets of <em>shortcut</em> links to commonly-visited pages of the site. Shortcuts are contained within <em>sets</em>. Each user with <em>Select any shortcut set</em> permission can select a shortcut set created by anyone at the site. For more information, see the online handbook entry for <a href="@shortcut">Shortcut module</a>.', array('@shortcut' => 'http://drupal.org/handbook/modules/shortcut/')) . '</p>';
+      $output .= '<p>' . t('The Shortcut module allows users to create sets of <em>shortcut</em> links to commonly-visited pages of the site. Shortcuts are contained within <em>sets</em>. Each user with <em>Select any shortcut set</em> permission can select a shortcut set created by anyone at the site. For more information, see the online handbook entry for <a href="@shortcut">Shortcut module</a>.', array('@shortcut' => 'http://drupal.org/documentation/modules/shortcut/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl><dt>' . t('Administering shortcuts') . '</dt>';
       $output .= '<dd>' . t('Users with the <em>Administer shortcuts</em> permission can manage shortcut sets and edit the shortcuts within sets from the <a href="@shortcuts">Shortcuts administration page</a>.', array('@shortcuts' => url('admin/config/user-interface/shortcut'))) . '</dd>';

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=2263&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 Thu May 10 18:20:18 2012
@@ -1271,6 +1271,10 @@
       ->condition('test_id', $this->testId)
       ->execute();
 
+    // Reset all statics and variables to perform tests in a clean environment.
+    $conf = array();
+    drupal_static_reset();
+
     // Clone the current connection and replace the current prefix.
     $connection_info = Database::getConnectionInfo('default');
     Database::renameConnection('default', 'simpletest_original_default');
@@ -1318,10 +1322,6 @@
     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();
-    drupal_static_reset();
-
     // Set the test information for use in other parts of Drupal.
     $test_info = &$GLOBALS['drupal_test_info'];
     $test_info['test_run_id'] = $this->databasePrefix;
@@ -1343,6 +1343,12 @@
     variable_set('file_public_path', $public_files_directory);
     variable_set('file_private_path', $private_files_directory);
     variable_set('file_temporary_path', $temp_files_directory);
+
+    // Set the 'simpletest_parent_profile' variable to add the parent profile's
+    // search path to the child site's search paths.
+    // @see drupal_system_listing()
+    // @todo This may need to be primed like 'install_profile' above.
+    variable_set('simpletest_parent_profile', $this->originalProfile);
 
     // Include the testing profile.
     variable_set('install_profile', $this->profile);
@@ -2049,6 +2055,8 @@
       // them.
       $dom = new DOMDocument();
       @$dom->loadHTML($content);
+      // XPath allows for finding wrapper nodes better than DOM does.
+      $xpath = new DOMXPath($dom);
       foreach ($return as $command) {
         switch ($command['command']) {
           case 'settings':
@@ -2056,52 +2064,52 @@
             break;
 
           case 'insert':
-            // @todo ajax.js can process commands that include a 'selector', but
-            //   these are hard to emulate with DOMDocument. For now, we only
-            //   implement 'insert' commands that use $ajax_settings['wrapper'].
+            $wrapperNode = NULL;
+            // When a command doesn't specify a selector, use the
+            // #ajax['wrapper'] which is always an HTML ID.
             if (!isset($command['selector'])) {
-              // $dom->getElementById() doesn't work when drupalPostAJAX() is
-              // invoked multiple times for a page, so use XPath instead. This
-              // also sets us up for adding support for $command['selector'] in
-              // the future, once we figure out how to transform a jQuery
-              // selector to XPath.
-              $xpath = new DOMXPath($dom);
               $wrapperNode = $xpath->query('//*[@id="' . $ajax_settings['wrapper'] . '"]')->item(0);
-              if ($wrapperNode) {
-                // ajax.js adds an enclosing DIV to work around a Safari bug.
-                $newDom = new DOMDocument();
-                $newDom->loadHTML('<div>' . $command['data'] . '</div>');
-                $newNode = $dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE);
-                $method = isset($command['method']) ? $command['method'] : $ajax_settings['method'];
-                // The "method" is a jQuery DOM manipulation function. Emulate
-                // each one using PHP's DOMNode API.
-                switch ($method) {
-                  case 'replaceWith':
-                    $wrapperNode->parentNode->replaceChild($newNode, $wrapperNode);
-                    break;
-                  case 'append':
-                    $wrapperNode->appendChild($newNode);
-                    break;
-                  case 'prepend':
-                    // If no firstChild, insertBefore() falls back to
-                    // appendChild().
-                    $wrapperNode->insertBefore($newNode, $wrapperNode->firstChild);
-                    break;
-                  case 'before':
-                    $wrapperNode->parentNode->insertBefore($newNode, $wrapperNode);
-                    break;
-                  case 'after':
-                    // If no nextSibling, insertBefore() falls back to
-                    // appendChild().
-                    $wrapperNode->parentNode->insertBefore($newNode, $wrapperNode->nextSibling);
-                    break;
-                  case 'html':
-                    foreach ($wrapperNode->childNodes as $childNode) {
-                      $wrapperNode->removeChild($childNode);
-                    }
-                    $wrapperNode->appendChild($newNode);
-                    break;
-                }
+            }
+            // @todo Ajax commands can target any jQuery selector, but these are
+            //   hard to fully emulate with XPath. For now, just handle 'head'
+            //   and 'body', since these are used by ajax_render().
+            elseif (in_array($command['selector'], array('head', 'body'))) {
+              $wrapperNode = $xpath->query('//' . $command['selector'])->item(0);
+            }
+            if ($wrapperNode) {
+              // ajax.js adds an enclosing DIV to work around a Safari bug.
+              $newDom = new DOMDocument();
+              $newDom->loadHTML('<div>' . $command['data'] . '</div>');
+              $newNode = $dom->importNode($newDom->documentElement->firstChild->firstChild, TRUE);
+              $method = isset($command['method']) ? $command['method'] : $ajax_settings['method'];
+              // The "method" is a jQuery DOM manipulation function. Emulate
+              // each one using PHP's DOMNode API.
+              switch ($method) {
+                case 'replaceWith':
+                  $wrapperNode->parentNode->replaceChild($newNode, $wrapperNode);
+                  break;
+                case 'append':
+                  $wrapperNode->appendChild($newNode);
+                  break;
+                case 'prepend':
+                  // If no firstChild, insertBefore() falls back to
+                  // appendChild().
+                  $wrapperNode->insertBefore($newNode, $wrapperNode->firstChild);
+                  break;
+                case 'before':
+                  $wrapperNode->parentNode->insertBefore($newNode, $wrapperNode);
+                  break;
+                case 'after':
+                  // If no nextSibling, insertBefore() falls back to
+                  // appendChild().
+                  $wrapperNode->parentNode->insertBefore($newNode, $wrapperNode->nextSibling);
+                  break;
+                case 'html':
+                  foreach ($wrapperNode->childNodes as $childNode) {
+                    $wrapperNode->removeChild($childNode);
+                  }
+                  $wrapperNode->appendChild($newNode);
+                  break;
               }
             }
             break;

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/simpletest.info (original)
+++ branches/upstream/current-7/modules/simpletest/simpletest.info Thu May 10 18:20:18 2012
@@ -27,6 +27,7 @@
 files[] = tests/mail.test
 files[] = tests/menu.test
 files[] = tests/module.test
+files[] = tests/pager.test
 files[] = tests/password.test
 files[] = tests/path.test
 files[] = tests/registry.test
@@ -39,18 +40,22 @@
 files[] = tests/xmlrpc.test
 files[] = tests/upgrade/upgrade.test
 files[] = tests/upgrade/upgrade.comment.test
+files[] = tests/upgrade/update.field.test
 files[] = tests/upgrade/upgrade.filter.test
 files[] = tests/upgrade/upgrade.forum.test
 files[] = tests/upgrade/upgrade.locale.test
 files[] = tests/upgrade/upgrade.menu.test
 files[] = tests/upgrade/upgrade.node.test
 files[] = tests/upgrade/upgrade.taxonomy.test
+files[] = tests/upgrade/upgrade.trigger.test
 files[] = tests/upgrade/upgrade.translatable.test
+files[] = tests/upgrade/update.trigger.test
 files[] = tests/upgrade/upgrade.upload.test
+files[] = tests/upgrade/update.user.test
 files[] = tests/upgrade/upgrade.user.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/simpletest/simpletest.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/simpletest.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/simpletest.js (original)
+++ branches/upstream/current-7/modules/simpletest/simpletest.js Thu May 10 18:20:18 2012
@@ -14,9 +14,9 @@
 
     // Adds group toggling functionality to arrow images.
     $('div.simpletest-image').click(function () {
-      var trs = $(this).parents('tbody').children('.' + settings.simpleTest[this.id].testClass);
+      var trs = $(this).closest('tbody').children('.' + settings.simpleTest[this.id].testClass);
       var direction = settings.simpleTest[this.id].imageDirection;
-      var row = direction ? trs.size() - 1 : 0;
+      var row = direction ? trs.length - 1 : 0;
 
       // If clicked in the middle of expanding a group, stop so we can switch directions.
       if (timeout) {
@@ -35,7 +35,7 @@
           }
         }
         else {
-          if (row < trs.size()) {
+          if (row < trs.length) {
             $(trs[row]).removeClass('js-hide').show();
             row++;
             timeout = setTimeout(rowToggle, 20);

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/simpletest.module (original)
+++ branches/upstream/current-7/modules/simpletest/simpletest.module Thu May 10 18:20:18 2012
@@ -13,7 +13,7 @@
     case 'admin/help#simpletest':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Testing module provides a framework for running automated unit tests. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules. For more information, see the online handbook entry for <a href="@simpletest">Testing module</a>.', array('@simpletest' => 'http://drupal.org/handbook/modules/simpletest', '@blocks' => url('admin/structure/block'))) . '</p>';
+      $output .= '<p>' . t('The Testing module provides a framework for running automated unit tests. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules. For more information, see the online handbook entry for <a href="@simpletest">Testing module</a>.', array('@simpletest' => 'http://drupal.org/documentation/modules/simpletest', '@blocks' => url('admin/structure/block'))) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Running tests') . '</dt>';

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/simpletest.test (original)
+++ branches/upstream/current-7/modules/simpletest/simpletest.test Thu May 10 18:20:18 2012
@@ -567,3 +567,91 @@
     }
   }
 }
+
+/**
+ * Verifies that tests bundled with installation profile modules are found.
+ */
+class SimpleTestInstallationProfileModuleTestsTestCase extends DrupalWebTestCase {
+  /**
+   * Use the Testing profile.
+   *
+   * The Testing profile contains drupal_system_listing_compatible_test.test,
+   * which attempts to:
+   * - run tests using the Minimal profile (which does not contain the
+   *   drupal_system_listing_compatible_test.module)
+   * - but still install the drupal_system_listing_compatible_test.module
+   *   contained in the Testing profile.
+   *
+   * @see DrupalSystemListingCompatibleTestCase
+   */
+  protected $profile = 'testing';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Installation profile module tests',
+      'description' => 'Verifies that tests bundled with installation profile modules are found.',
+      'group' => 'SimpleTest',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('simpletest'));
+
+    $this->admin_user = $this->drupalCreateUser(array('administer unit tests'));
+    $this->drupalLogin($this->admin_user);
+  }
+
+  /**
+   * Tests existence of test case located in an installation profile module.
+   */
+  function testInstallationProfileTests() {
+    $this->drupalGet('admin/config/development/testing');
+    $this->assertText('Installation profile module tests helper');
+    $edit = array(
+      'DrupalSystemListingCompatibleTestCase' => TRUE,
+    );
+    $this->drupalPost(NULL, $edit, t('Run tests'));
+    $this->assertText('DrupalSystemListingCompatibleTestCase test executed.');
+  }
+}
+
+/**
+ * Verifies that tests in other installation profiles are not found.
+ *
+ * @see SimpleTestInstallationProfileModuleTestsTestCase
+ */
+class SimpleTestOtherInstallationProfileModuleTestsTestCase extends DrupalWebTestCase {
+  /**
+   * Use the Minimal profile.
+   *
+   * The Testing profile contains drupal_system_listing_compatible_test.test,
+   * which should not be found.
+   *
+   * @see SimpleTestInstallationProfileModuleTestsTestCase
+   * @see DrupalSystemListingCompatibleTestCase
+   */
+  protected $profile = 'minimal';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Other Installation profiles',
+      'description' => 'Verifies that tests in other installation profiles are not found.',
+      'group' => 'SimpleTest',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('simpletest'));
+
+    $this->admin_user = $this->drupalCreateUser(array('administer unit tests'));
+    $this->drupalLogin($this->admin_user);
+  }
+
+  /**
+   * Tests that tests located in another installation profile do not appear.
+   */
+  function testOtherInstallationProfile() {
+    $this->drupalGet('admin/config/development/testing');
+    $this->assertNoText('Installation profile module tests helper');
+  }
+}

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/actions_loop_test.module Thu May 10 18:20:18 2012
@@ -81,6 +81,7 @@
     'severity'    => $severity,
     'link'        => $link,
     'user'        => $user,
+    'uid'         => isset($user->uid) ? $user->uid : 0,
     'request_uri' => $base_root . request_uri(),
     'referer'     => $_SERVER['HTTP_REFERER'],
     'ip'          => ip_address(),

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/ajax.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/ajax.test Thu May 10 18:20:18 2012
@@ -127,31 +127,7 @@
       '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.
+    // @todo D8: Add a drupal_css_defaults() helper function.
     $expected_css_html = drupal_get_css(array($expected['css'] => array(
       'type' => 'file',
       'group' => CSS_DEFAULT,
@@ -162,6 +138,52 @@
       'data' => $expected['css'],
       'browsers' => array('IE' => TRUE, '!IE' => TRUE),
     )), TRUE);
+    $expected_js_html = drupal_get_js('header', array($expected['js'] => drupal_js_defaults($expected['js'])), TRUE);
+
+    // 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 requests.
+    $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 without triggering files getting added.
+    $commands = $this->drupalPostAJAX(NULL, array('add_files' => FALSE), array('op' => t('Submit')));
+    $new_settings = $this->drupalGetSettings();
+
+    // Verify the setting was not added when not expected.
+    $this->assertTrue(!isset($new_settings['setting_name']), t('Page still lacks the %setting, as expected.', array('%setting' => $expected['setting_name'])));
+    // Verify a settings command does not add CSS or scripts to Drupal.settings
+    // and no command inserts the corresponding tags on the page.
+    $found_settings_command = FALSE;
+    $found_markup_command = FALSE;
+    foreach ($commands as $command) {
+      if ($command['command'] == 'settings' && (array_key_exists('css', $command['settings']['ajaxPageState']) || array_key_exists('js', $command['settings']['ajaxPageState']))) {
+        $found_settings_command = TRUE;
+      }
+      if (isset($command['data']) && ($command['data'] == $expected_js_html || $command['data'] == $expected_css_html)) {
+        $found_markup_command = TRUE;
+      }
+    }
+    $this->assertFalse($found_settings_command, t('Page state still lacks the %css and %js files, as expected.', array('%css' => $expected['css'], '%js' => $expected['js'])));
+    $this->assertFalse($found_markup_command, t('Page still lacks the %css and %js files, as expected.', array('%css' => $expected['css'], '%js' => $expected['js'])));
+
+    // Submit the AJAX request and trigger adding files.
+    $commands = $this->drupalPostAJAX(NULL, array('add_files' => TRUE), 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.
     $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'])));
 
@@ -170,9 +192,29 @@
     // 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'])));
+  }
+
+  /**
+   * Tests that overridden CSS files are not added during lazy load.
+   */
+  function testLazyLoadOverriddenCSS() {
+    // The test theme overrides system.base.css without an implementation,
+    // thereby removing it.
+    theme_enable(array('test_theme'));
+    variable_set('theme_default', 'test_theme');
+
+    // This gets the form, and emulates an Ajax submission on it, including
+    // adding markup to the HEAD and BODY for any lazy loaded JS/CSS files.
+    $this->drupalPostAJAX('ajax_forms_test_lazy_load_form', array('add_files' => TRUE), array('op' => t('Submit')));
+
+    // Verify that the resulting HTML does not load the overridden CSS file.
+    // We add a "?" to the assertion, because Drupal.settings may include
+    // information about the file; we only really care about whether it appears
+    // in a LINK or STYLE tag, for which Drupal always adds a query string for
+    // cache control.
+    $this->assertNoText('system.base.css?', 'Ajax lazy loading does not add overridden CSS files.');
   }
 }
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -468,6 +468,10 @@
  * Form builder: Builds a form that triggers a simple AJAX callback.
  */
 function ajax_forms_test_lazy_load_form($form, &$form_state) {
+  $form['add_files'] = array(
+    '#type' => 'checkbox',
+    '#default_value' => FALSE,
+  );
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Submit'),
@@ -482,9 +486,11 @@
  * 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');
+  if ($form_state['values']['add_files']) {
+    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;
 }
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/ajax_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/ajax_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/ajax_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/ajax_test.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/ajax_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/ajax_test.module Thu May 10 18:20:18 2012
@@ -29,6 +29,14 @@
     'access callback' => TRUE,
   );
   return $items;
+}
+
+/**
+ * Implements hook_system_theme_info().
+ */
+function ajax_test_system_theme_info() {
+  $themes['test_theme'] = drupal_get_path('module', 'ajax_test') . '/themes/test_theme/test_theme.info';
+  return $themes;
 }
 
 /**

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/batch_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/batch_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/cache.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/cache.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/cache.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/cache.test Thu May 10 18:20:18 2012
@@ -338,6 +338,40 @@
       $id = 'test_cid_clear' . $id;
       $this->assertFalse($this->checkCacheExists($id, $this->default_value, $bin), t('All cache entries removed from @bin.', array('@bin' => $bin)));
     }
+  }
+
+  /**
+   * Test minimum cache lifetime.
+   */
+  function testMinimumCacheLifetime() {
+    // Set a minimum/maximum cache lifetime.
+    $this->setupLifetime(300);
+    // Login as a newly-created user.
+    $account = $this->drupalCreateUser(array());
+    $this->drupalLogin($account);
+
+    // Set two cache objects in different bins.
+    $data = $this->randomName(100);
+    cache_set($data, $data, 'cache', CACHE_TEMPORARY);
+    $cached = cache_get($data);
+    $this->assertTrue(isset($cached->data) && $cached->data === $data, 'Cached item retrieved.');
+    cache_set($data, $data, 'cache_page', CACHE_TEMPORARY);
+
+    // Expire temporary items in the 'page' bin.
+    cache_clear_all(NULL, 'cache_page');
+
+    // Since the database cache uses REQUEST_TIME, set the $_SESSION variable
+    // manually to force it to the current time.
+    $_SESSION['cache_expiration']['cache_page'] = time();
+
+    // Items in the default cache bin should not be expired.
+    $cached = cache_get($data);
+    $this->assertTrue(isset($cached->data) && $cached->data == $data, 'Cached item retrieved');
+
+    // Despite the minimum cache lifetime, the item in the 'page' bin should
+    // be invalidated for the current user.
+    $cached = cache_get($data, 'cache_page');
+    $this->assertFalse($cached, 'Cached item was invalidated');
   }
 }
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/common.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/common.test Thu May 10 18:20:18 2012
@@ -353,7 +353,7 @@
 }
 
 /**
- * Tests for the check_plain(), filter_xss() and format_string() functions.
+ * Tests for check_plain(), filter_xss(), format_string(), and check_url().
  */
 class CommonXssUnitTest extends DrupalUnitTestCase {
 
@@ -424,6 +424,9 @@
   }
 }
 
+/**
+ * Tests file size parsing and formatting functions.
+ */
 class CommonSizeTestCase extends DrupalUnitTestCase {
   protected $exact_test_cases;
   protected $rounded_test_cases;
@@ -935,7 +938,7 @@
   }
 
   function setUp() {
-    parent::setUp('system_test');
+    parent::setUp('system_test', 'locale');
   }
 
   function testDrupalHTTPRequest() {
@@ -1032,6 +1035,22 @@
     $multiple_redirect_3 = drupal_http_request(url('system-test/multiple-redirects/3', array('absolute' => TRUE)), array('max_redirects' => 3));
     $this->assertEqual($multiple_redirect_3->redirect_url, $multiple_redirect_final_url, t('redirect_url contains the final redirection location after 3 redirects.'));
   }
+
+  /**
+   * Tests Content-language headers generated by Drupal.
+   */
+  function testDrupalHTTPRequestHeaders() {
+    // Check the default header.
+    $request = drupal_http_request(url('<front>', array('absolute' => TRUE)));
+    $this->assertEqual($request->headers['content-language'], 'en', 'Content-Language HTTP header is English.');
+
+    // Add German language and set as default.
+    locale_add_language('de', 'German', 'Deutsch', LANGUAGE_LTR, '', '', TRUE, TRUE);
+
+    // Request front page and check for matching Content-Language.
+    $request = drupal_http_request(url('<front>', array('absolute' => TRUE)));
+    $this->assertEqual($request->headers['content-language'], 'de', 'Content-Language HTTP header is German.');
+  }
 }
 
 /**
@@ -1321,6 +1340,48 @@
   function testDifferentWeight() {
     $javascript = drupal_add_js('misc/collapse.js', array('weight' => 2));
     $this->assertEqual($javascript['misc/collapse.js']['weight'], 2, t('Adding a JavaScript file with a different weight caches the given weight.'));
+  }
+
+  /**
+   * Tests JavaScript aggregation when files are added to a different scope.
+   */
+  function testAggregationOrder() {
+    // Enable JavaScript aggregation.
+    variable_set('preprocess_js', 1);
+    drupal_static_reset('drupal_add_js');
+
+    // Add two JavaScript files to the current request and build the cache.
+    drupal_add_js('misc/ajax.js');
+    drupal_add_js('misc/autocomplete.js');
+
+    $js_items = drupal_add_js();
+    drupal_build_js_cache(array(
+      'misc/ajax.js' => $js_items['misc/ajax.js'],
+      'misc/autocomplete.js' => $js_items['misc/autocomplete.js']
+    ));
+
+    // Store the expected key for the first item in the cache.
+    $cache = array_keys(variable_get('drupal_js_cache_files', array()));
+    $expected_key = $cache[0];
+
+    // Reset variables and add a file in a different scope first.
+    variable_del('drupal_js_cache_files');
+    drupal_static_reset('drupal_add_js');
+    drupal_add_js('some/custom/javascript_file.js', array('scope' => 'footer'));
+    drupal_add_js('misc/ajax.js');
+    drupal_add_js('misc/autocomplete.js');
+
+    // Rebuild the cache.
+    $js_items = drupal_add_js();
+    drupal_build_js_cache(array(
+      'misc/ajax.js' => $js_items['misc/ajax.js'],
+      'misc/autocomplete.js' => $js_items['misc/autocomplete.js']
+    ));
+
+    // Compare the expected key for the first file to the current one.
+    $cache = array_keys(variable_get('drupal_js_cache_files', array()));
+    $key = $cache[0];
+    $this->assertEqual($key, $expected_key, 'JavaScript aggregation is not affected by ordering in different scopes.');
   }
 
   /**

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/common_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/common_test.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 stylesheets[print][] = common_test.print.css
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/database_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/database_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/database_test.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/database_test.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/database_test.install (original)
+++ branches/upstream/current-7/modules/simpletest/tests/database_test.install Thu May 10 18:20:18 2012
@@ -28,6 +28,7 @@
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'binary' => TRUE,
       ),
       'age' => array(
         'description' => "The person's age",

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/database_test.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/database_test.test Thu May 10 18:20:18 2012
@@ -2065,6 +2065,7 @@
   function testHavingCountQuery() {
     $query = db_select('test')
       ->extend('PagerDefault')
+      ->groupBy('age')
       ->having('age + 1 > 0');
     $query->addField('test', 'age');
     $query->addExpression('age + 1');
@@ -3117,6 +3118,39 @@
       ->execute()
       ->fetchField();
     $this->assertIdentical($num_matches, '1', t('Found 1 record.'));
+  }
+}
+
+/**
+ * Test case sensitivity handling.
+ */
+class DatabaseCaseSensitivityTestCase extends DatabaseTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Case sensitivity',
+      'description' => 'Test handling case sensitive collation.',
+      'group' => 'Database',
+    );
+  }
+
+  /**
+   * Test BINARY collation in MySQL.
+   */
+  function testCaseSensitiveInsert() {
+    $num_records_before = db_query('SELECT COUNT(*) FROM {test}')->fetchField();
+
+    $john = db_insert('test')
+      ->fields(array(
+        'name' => 'john', // <- A record already exists with name 'John'.
+        'age' => 2,
+        'job' => 'Baby',
+      ))
+      ->execute();
+
+    $num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField();
+    $this->assertIdentical($num_records_before + 1, (int) $num_records_after, t('Record inserts correctly.'));
+    $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', array(':name' => 'john'))->fetchField();
+    $this->assertIdentical($saved_age, '2', t('Can retrieve after inserting.'));
   }
 }
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 dependencies[] = entity_cache_test_dependency
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/entity_query.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/entity_query.test Thu May 10 18:20:18 2012
@@ -1406,6 +1406,27 @@
     ), t('Test pager integration in field storage: page 2.'), TRUE);
 
     unset($_GET['page']);
+  }
+
+  /**
+   * Tests disabling the pager in EntityFieldQuery.
+   */
+  function testEntityFieldQueryDisablePager() {
+    // Test enabling a pager and then disabling it.
+    $query = new EntityFieldQuery();
+    $query
+      ->entityCondition('entity_type', 'test_entity_bundle_key')
+      ->propertyOrderBy('ftid', 'ASC')
+      ->pager(1)
+      ->pager(0);
+    $this->assertEntityFieldQuery($query, array(
+      array('test_entity_bundle_key', 1),
+      array('test_entity_bundle_key', 2),
+      array('test_entity_bundle_key', 3),
+      array('test_entity_bundle_key', 4),
+      array('test_entity_bundle_key', 5),
+      array('test_entity_bundle_key', 6),
+    ), 'All test entities are listed when the pager is enabled and then disabled.', TRUE);
   }
 
   /**

Modified: branches/upstream/current-7/modules/simpletest/tests/error.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/error.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/error.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/error.test Thu May 10 18:20:18 2012
@@ -3,7 +3,7 @@
 /**
  * Tests Drupal error and exception handlers.
  */
-class DrupalErrorHandlerUnitTest extends DrupalWebTestCase {
+class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Drupal error handlers',

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/error_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/error_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/file.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/file.test Thu May 10 18:20:18 2012
@@ -2026,6 +2026,19 @@
     $loaded_file = db_query('SELECT * FROM {file_managed} f WHERE f.fid = :fid', array(':fid' => $saved_file->fid))->fetch(PDO::FETCH_OBJ);
     $this->assertNotNull($loaded_file, t("Record still exists in the database."), 'File');
     $this->assertEqual($loaded_file->status, $saved_file->status, t("Status was saved correctly."));
+
+    // Try to insert a second file with the same name apart from case insensitivity
+    // to ensure the 'uri' index allows for filenames with different cases.
+    $file = (object) array(
+      'uid' => 1,
+      'filename' => 'DRUPLICON.txt',
+      'uri' => 'public://DRUPLICON.txt',
+      'filemime' => 'text/plain',
+      'timestamp' => 1,
+      'status' => FILE_STATUS_PERMANENT,
+    );
+    file_put_contents($file->uri, 'hello world');
+    file_save($file);
   }
 }
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/file_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/file_test.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = file_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/filter_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/filter_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/form.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/form.test Thu May 10 18:20:18 2012
@@ -122,6 +122,72 @@
   }
 
   /**
+   * Tests validation for required checkbox, select, and radio elements.
+   *
+   * Submits a test form containing several types of form elements. The form
+   * is submitted twice, first without values for required fields and then
+   * with values. Each submission is checked for relevant error messages.
+   *
+   * @see form_test_validate_required_form()
+   */
+  function testRequiredCheckboxesRadio() {
+    $form = $form_state = array();
+    $form = form_test_validate_required_form($form, $form_state);
+
+    // Attempt to submit the form with no required fields set.
+    $edit = array();
+    $this->drupalPost('form-test/validate-required', $edit, 'Submit');
+
+    // The only error messages that should appear are the relevant 'required'
+    // messages for each field.
+    $expected = array();
+    foreach (array('textfield', 'checkboxes', 'select', 'radios') as $key) {
+      $expected[] = t('!name field is required.', array('!name' => $form[$key]['#title']));
+    }
+
+    // Check the page for error messages.
+    $errors = $this->xpath('//div[contains(@class, "error")]//li');
+    foreach ($errors as $error) {
+      $expected_key = array_search($error[0], $expected);
+      // If the error message is not one of the expected messages, fail.
+      if ($expected_key === FALSE) {
+        $this->fail(format_string("Unexpected error message: @error", array('@error' => $error[0])));
+      }
+      // Remove the expected message from the list once it is found.
+      else {
+        unset($expected[$expected_key]);
+      }
+    }
+
+    // Fail if any expected messages were not found.
+    foreach ($expected as $not_found) {
+      $this->fail(format_string("Found error message: @error", array('@error' => $not_found)));
+    }
+
+    // Verify that input elements are still empty.
+    $this->assertFieldByName('textfield', '');
+    $this->assertNoFieldChecked('edit-checkboxes-foo');
+    $this->assertNoFieldChecked('edit-checkboxes-bar');
+    $this->assertOptionSelected('edit-select', '');
+    $this->assertNoFieldChecked('edit-radios-foo');
+    $this->assertNoFieldChecked('edit-radios-bar');
+    $this->assertNoFieldChecked('edit-radios-optional-foo');
+    $this->assertNoFieldChecked('edit-radios-optional-bar');
+
+    // Submit again with required fields set and verify that there are no
+    // error messages.
+    $edit = array(
+      'textfield' => $this->randomString(),
+      'checkboxes[foo]' => TRUE,
+      'select' => 'foo',
+      'radios' => 'bar',
+    );
+    $this->drupalPost(NULL, $edit, 'Submit');
+    $this->assertNoFieldByXpath('//div[contains(@class, "error")]', FALSE, 'No error message is displayed when all required fields are filled.');
+    $this->assertRaw("The form_test_validate_required_form form was submitted successfully.", 'Validation form submitted successfully.');
+  }
+
+  /**
    * Test default value handling for checkboxes.
    *
    * @see _form_test_checkbox()
@@ -600,12 +666,12 @@
     $this->assertTrue(isset($elements[0]), t("Label 0 found radios."));
 
     // Exercise various defaults for checkboxes and modifications to ensure
-    // appropriate override and correct behaviour.
+    // appropriate override and correct behavior.
     $elements = $this->xpath('//input[@id="edit-form-checkbox-test"]/following-sibling::label[@for="edit-form-checkbox-test" and @class="option"]');
     $this->assertTrue(isset($elements[0]), t("Label follows field and label option class correct for a checkbox by default."));
 
     // Exercise various defaults for textboxes and modifications to ensure
-    // appropriate override and correct behaviour.
+    // appropriate override and correct behavior.
     $elements = $this->xpath('//label[@for="edit-form-textfield-test-title-and-required"]/child::span[@class="form-required"]/parent::*/following-sibling::input[@id="edit-form-textfield-test-title-and-required"]');
     $this->assertTrue(isset($elements[0]), t("Label precedes textfield, with required marker inside label."));
 
@@ -637,6 +703,12 @@
 
     $elements = $this->xpath('//div[@id="form-test-textfield-title-suffix"]/preceding-sibling::div[contains(@class, \'form-item-form-textfield-test-title\')]');
     $this->assertTrue(isset($elements[0]), t("Properly places the #suffix element before the form item."));
+
+    // Check title attribute for radios and checkboxes.
+    $elements = $this->xpath('//div[@id="edit-form-checkboxes-title-attribute"]');
+    $this->assertEqual($elements[0]['title'], 'Checkboxes test' . ' (' . t('Required') . ')', 'Title attribute found.');
+    $elements = $this->xpath('//div[@id="edit-form-radios-title-attribute"]');
+    $this->assertEqual($elements[0]['title'], 'Radios test' . ' (' . t('Required') . ')', 'Title attribute found.');
   }
 }
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/form_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/form_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/form_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/form_test.module Thu May 10 18:20:18 2012
@@ -21,6 +21,13 @@
     'page callback' => 'drupal_get_form',
     'page arguments' => array('form_test_validate_form'),
     'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['form-test/validate-required'] = array(
+    'title' => 'Form #required validation',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('form_test_validate_required_form'),
+    'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
   $items['form-test/limit-validation-errors'] = array(
@@ -329,6 +336,52 @@
     // Trigger a form validation error to see our changes.
     form_set_error('');
   }
+}
+
+/**
+ * Form constructor to test the #required property.
+ */
+function form_test_validate_required_form($form, &$form_state) {
+  $options = drupal_map_assoc(array('foo', 'bar'));
+
+  $form['textfield'] = array(
+    '#type' => 'textfield',
+    '#title' => 'Textfield',
+    '#required' => TRUE,
+  );
+  $form['checkboxes'] = array(
+    '#type' => 'checkboxes',
+    '#title' => 'Checkboxes',
+    '#options' => $options,
+    '#required' => TRUE,
+  );
+  $form['select'] = array(
+    '#type' => 'select',
+    '#title' => 'Select',
+    '#options' => $options,
+    '#required' => TRUE,
+  );
+  $form['radios'] = array(
+    '#type' => 'radios',
+    '#title' => 'Radios',
+    '#options' => $options,
+    '#required' => TRUE,
+  );
+  $form['radios_optional'] = array(
+    '#type' => 'radios',
+    '#title' => 'Radios (optional)',
+    '#options' => $options,
+  );
+  $form['actions'] = array('#type' => 'actions');
+  $form['actions']['submit'] = array('#type' => 'submit', '#value' => 'Submit');
+  return $form;
+}
+
+/**
+ * Form submission handler for form_test_validate_required_form().
+ */
+function form_test_validate_required_form_submit($form, &$form_state) {
+  drupal_set_message('The form_test_validate_required_form form was submitted successfully.');
 }
 
 /**
@@ -738,9 +791,30 @@
     '#title' => t('Textfield test for invisible title'),
     '#title_display' => 'invisible',
   );
-  // Textfield test for title set not to display
+  // Textfield test for title set not to display.
   $form['form_textfield_test_title_no_show'] = array(
     '#type' => 'textfield',
+  );
+  // Checkboxes & radios with title as attribute.
+  $form['form_checkboxes_title_attribute'] = array(
+    '#type' => 'checkboxes',
+    '#title' => 'Checkboxes test',
+    '#options' => array(
+      'first-checkbox' => 'First checkbox',
+      'second-checkbox' => 'Second checkbox',
+    ),
+    '#title_display' => 'attribute',
+    '#required' => TRUE,
+  );
+  $form['form_radios_title_attribute'] = array(
+    '#type' => 'radios',
+    '#title' => 'Radios test',
+    '#options' => array(
+      'first-radio' => 'First radio',
+      'second-radio' => 'Second radio',
+    ),
+    '#title_display' => 'attribute',
+    '#required' => TRUE,
   );
 
   return $form;

Modified: branches/upstream/current-7/modules/simpletest/tests/image.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/image.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/image.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/image.test Thu May 10 18:20:18 2012
@@ -458,3 +458,44 @@
 
   }
 }
+
+/**
+ * Tests the file move function for managed files.
+ */
+class ImageFileMoveTest extends ImageToolkitTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Image moving',
+      'description' => 'Tests the file move function for managed files.',
+      'group' => 'Image',
+    );
+  }
+
+  /**
+   * Tests moving a randomly generated image.
+   */
+  function testNormal() {
+    // Pick a file for testing.
+    $file = current($this->drupalGetTestFiles('image'));
+
+    // Create derivative image.
+    $style = image_style_load(key(image_styles()));
+    $derivative_uri = image_style_path($style['name'], $file->uri);
+    image_style_create_derivative($style, $file->uri, $derivative_uri);
+
+    // Check if derivative image exists.
+    $this->assertTrue(file_exists($derivative_uri), 'Make sure derivative image is generated successfully.');
+
+    // Clone the object so we don't have to worry about the function changing
+    // our reference copy.
+    $desired_filepath = 'public://' . $this->randomName();
+    $result = file_move(clone $file, $desired_filepath, FILE_EXISTS_ERROR);
+
+    // Check if image has been moved.
+    $this->assertTrue(file_exists($result->uri), 'Make sure image is moved successfully.');
+
+    // Check if derivative image has been flushed.
+    $this->assertFalse(file_exists($derivative_uri), 'Make sure derivative image has been flushed.');
+  }
+}
+

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/image_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/image_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/menu.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/menu.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/menu.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/menu.test Thu May 10 18:20:18 2012
@@ -1139,6 +1139,7 @@
     $trail += array(
       'admin/structure/menu/manage/navigation' => t('Navigation'),
     );
+    $this->assertBreadcrumb("admin/structure/menu/item/6/edit", $trail);
     $this->assertBreadcrumb('admin/structure/menu/manage/navigation/edit', $trail);
     $this->assertBreadcrumb('admin/structure/menu/manage/navigation/add', $trail);
 
@@ -1643,4 +1644,97 @@
     variable_set('menu_test_menu_tree_set_path', $test_menu_path);
     $this->assertBreadcrumb('admin/config/development/menu-trail', $override_breadcrumb, t('Menu trail - Case 2'), $override_tree);
   }
+
+  /**
+   * Tests that the active trail works correctly on custom 403 and 404 pages.
+   */
+  function testCustom403And404Pages() {
+    // Set the custom 403 and 404 pages we will use.
+    variable_set('site_403', 'menu-test/custom-403-page');
+    variable_set('site_404', 'menu-test/custom-404-page');
+
+    // Define the paths we'll visit to trigger 403 and 404 responses during
+    // this test, and the expected active trail for each case.
+    $paths = array(
+      403 => 'admin/config',
+      404 => $this->randomName(),
+    );
+    // For the 403 page, the initial trail during the Drupal bootstrap should
+    // include the page that the user is trying to visit, while the final trail
+    // should reflect the custom 403 page that the user was redirected to.
+    $expected_trail[403]['initial'] = array(
+      '<front>' => 'Home',
+      'admin/config' => 'Configuration',
+    );
+    $expected_trail[403]['final'] = array(
+      '<front>' => 'Home',
+      'menu-test' => 'Menu test root',
+      'menu-test/custom-403-page' => 'Custom 403 page',
+    );
+    // For the 404 page, the initial trail during the Drupal bootstrap should
+    // only contain the link back to "Home" (since the page the user is trying
+    // to visit doesn't have any menu items associated with it), while the
+    // final trail should reflect the custom 404 page that the user was
+    // redirected to.
+    $expected_trail[404]['initial'] = array(
+      '<front>' => 'Home',
+    );
+    $expected_trail[404]['final'] = array(
+      '<front>' => 'Home',
+      'menu-test' => 'Menu test root',
+      'menu-test/custom-404-page' => 'Custom 404 page',
+    );
+
+    // Visit each path as an anonymous user so that we will actually get a 403
+    // on admin/config.
+    $this->drupalLogout();
+    foreach (array(403, 404) as $status_code) {
+      // Before visiting the page, trigger the code in the menu_test module
+      // that will record the active trail (so we can check it in this test).
+      variable_set('menu_test_record_active_trail', TRUE);
+      $this->drupalGet($paths[$status_code]);
+      $this->assertResponse($status_code);
+
+      // Check that the initial trail (during the Drupal bootstrap) matches
+      // what we expect.
+      $initial_trail = variable_get('menu_test_active_trail_initial', array());
+      $this->assertEqual(count($initial_trail), count($expected_trail[$status_code]['initial']), t('The initial active trail for a @status_code page contains the expected number of items (expected: @expected, found: @found).', array(
+        '@status_code' => $status_code,
+        '@expected' => count($expected_trail[$status_code]['initial']),
+        '@found' => count($initial_trail),
+      )));
+      foreach (array_keys($expected_trail[$status_code]['initial']) as $index => $path) {
+        $this->assertEqual($initial_trail[$index]['href'], $path, t('Element number @number of the initial active trail for a @status_code page contains the correct path (expected: @expected, found: @found)', array(
+          '@number' => $index + 1,
+          '@status_code' => $status_code,
+          '@expected' => $path,
+          '@found' => $initial_trail[$index]['href'],
+        )));
+      }
+
+      // Check that the final trail (after the user has been redirected to the
+      // custom 403/404 page) matches what we expect.
+      $final_trail = variable_get('menu_test_active_trail_final', array());
+      $this->assertEqual(count($final_trail), count($expected_trail[$status_code]['final']), t('The final active trail for a @status_code page contains the expected number of items (expected: @expected, found: @found).', array(
+        '@status_code' => $status_code,
+        '@expected' => count($expected_trail[$status_code]['final']),
+        '@found' => count($final_trail),
+      )));
+      foreach (array_keys($expected_trail[$status_code]['final']) as $index => $path) {
+        $this->assertEqual($final_trail[$index]['href'], $path, t('Element number @number of the final active trail for a @status_code page contains the correct path (expected: @expected, found: @found)', array(
+          '@number' => $index + 1,
+          '@status_code' => $status_code,
+          '@expected' => $path,
+          '@found' => $final_trail[$index]['href'],
+        )));
+      }
+
+      // Check that the breadcrumb displayed on the final custom 403/404 page
+      // matches what we expect. (The last item of the active trail represents
+      // the current page, which is not supposed to appear in the breadcrumb,
+      // so we need to remove it from the array before checking.)
+      array_pop($expected_trail[$status_code]['final']);
+      $this->assertBreadcrumb(NULL, $expected_trail[$status_code]['final']);
+    }
+  }
 }

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/menu_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/menu_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/menu_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/menu_test.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/menu_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/menu_test.module Thu May 10 18:20:18 2012
@@ -229,6 +229,16 @@
     'description' => 'Tests menu_tree_set_path()',
     'page callback' => 'menu_test_menu_trail_callback',
     'access arguments' => array('access administration pages'),
+  );
+  $items['menu-test/custom-403-page'] = array(
+    'title' => 'Custom 403 page',
+    'page callback' => 'menu_test_custom_403_404_callback',
+    'access arguments' => array('access content'),
+  );
+  $items['menu-test/custom-404-page'] = array(
+    'title' => 'Custom 404 page',
+    'page callback' => 'menu_test_custom_403_404_callback',
+    'access arguments' => array('access content'),
   );
 
   // File inheritance tests. This menu item should inherit the page callback
@@ -367,6 +377,32 @@
     menu_tree_set_path($menu_path['menu_name'], $menu_path['path']);
   }
   return 'This is menu_test_menu_trail_callback().';
+}
+
+/**
+ * Implements hook_init().
+ */
+function menu_test_init() {
+  // When requested by one of the MenuTrailTestCase tests, record the initial
+  // active trail during Drupal's bootstrap (before the user is redirected to a
+  // custom 403 or 404 page). See menu_test_custom_403_404_callback().
+  if (variable_get('menu_test_record_active_trail', FALSE)) {
+    variable_set('menu_test_active_trail_initial', menu_get_active_trail());
+  }
+}
+
+/**
+ * Callback for our custom 403 and 404 pages.
+ */
+function menu_test_custom_403_404_callback() {
+  // When requested by one of the MenuTrailTestCase tests, record the final
+  // active trail now that the user has been redirected to the custom 403 or
+  // 404 page. See menu_test_init().
+  if (variable_get('menu_test_record_active_trail', FALSE)) {
+    variable_set('menu_test_active_trail_final', menu_get_active_trail());
+  }
+
+  return 'This is menu_test_custom_403_404_callback().';
 }
 
 /**

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/module_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/module_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Added: branches/upstream/current-7/modules/simpletest/tests/pager.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/pager.test?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/pager.test (added)
+++ branches/upstream/current-7/modules/simpletest/tests/pager.test Thu May 10 18:20:18 2012
@@ -1,0 +1,159 @@
+<?php
+
+/**
+ * @file
+ * Tests for pager functionality.
+ */
+
+/**
+ * Tests pager functionality.
+ */
+class PagerFunctionalWebTestCase extends DrupalWebTestCase {
+  protected $profile = 'testing';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Pager functionality',
+      'description' => 'Tests pager functionality.',
+      'group' => 'Pager',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('dblog'));
+
+    // Insert 300 log messages.
+    for ($i = 0; $i < 300; $i++) {
+      watchdog('pager_test', $this->randomString(), NULL, WATCHDOG_DEBUG);
+    }
+
+    $this->admin_user = $this->drupalCreateUser(array(
+      'access site reports',
+    ));
+    $this->drupalLogin($this->admin_user);
+  }
+
+  /**
+   * Tests markup and CSS classes of pager links.
+   */
+  function testActiveClass() {
+    // Verify first page.
+    $this->drupalGet('admin/reports/dblog');
+    $current_page = 0;
+    $this->assertPagerItems($current_page);
+
+    // Verify any page but first/last.
+    $current_page++;
+    $this->drupalGet('admin/reports/dblog', array('query' => array('page' => $current_page)));
+    $this->assertPagerItems($current_page);
+
+    // Verify last page.
+    $elements = $this->xpath('//li[contains(@class, :class)]/a', array(':class' => 'pager-last'));
+    preg_match('@page=(\d+)@', $elements[0]['href'], $matches);
+    $current_page = (int) $matches[1];
+    $this->drupalGet($GLOBALS['base_root'] . $elements[0]['href'], array('external' => TRUE));
+    $this->assertPagerItems($current_page);
+  }
+
+  /**
+   * Asserts pager items and links.
+   *
+   * @param int $current_page
+   *   The current pager page the internal browser is on.
+   */
+  protected function assertPagerItems($current_page) {
+    $elements = $this->xpath('//ul[@class=:class]/li', array(':class' => 'pager'));
+    $this->assertTrue(!empty($elements), 'Pager found.');
+
+    // Make current page 1-based.
+    $current_page++;
+
+    // Extract first/previous and next/last items.
+    // first/previous only exist, if the current page is not the first.
+    if ($current_page > 1) {
+      $first = array_shift($elements);
+      $previous = array_shift($elements);
+    }
+    // next/last always exist, unless the current page is the last.
+    if ($current_page != count($elements)) {
+      $last = array_pop($elements);
+      $next = array_pop($elements);
+    }
+
+    // Verify items and links to pages.
+    foreach ($elements as $page => $element) {
+      // Make item/page index 1-based.
+      $page++;
+      if ($current_page == $page) {
+        $this->assertClass($element, 'pager-current', 'Item for current page has .pager-current class.');
+        $this->assertFalse(isset($element->a), 'Item for current page has no link.');
+      }
+      else {
+        $this->assertNoClass($element, 'pager-current', "Item for page $page has no .pager-current class.");
+        $this->assertClass($element, 'pager-item', "Item for page $page has .pager-item class.");
+        $this->assertTrue($element->a, "Link to page $page found.");
+        $this->assertNoClass($element->a, 'active', "Link to page $page is not active.");
+      }
+      unset($elements[--$page]);
+    }
+    // Verify that no other items remain untested.
+    $this->assertTrue(empty($elements), 'All expected items found.');
+
+    // Verify first/previous and next/last items and links.
+    if (isset($first)) {
+      $this->assertClass($first, 'pager-first', "Item for first page has .pager-first class.");
+      $this->assertTrue($first->a, "Link to first page found.");
+      $this->assertNoClass($first->a, 'active', "Link to first page is not active.");
+    }
+    if (isset($previous)) {
+      $this->assertClass($previous, 'pager-previous', "Item for first page has .pager-previous class.");
+      $this->assertTrue($previous->a, "Link to previous page found.");
+      $this->assertNoClass($previous->a, 'active', "Link to previous page is not active.");
+    }
+    if (isset($next)) {
+      $this->assertClass($next, 'pager-next', "Item for next page has .pager-next class.");
+      $this->assertTrue($next->a, "Link to next page found.");
+      $this->assertNoClass($next->a, 'active', "Link to next page is not active.");
+    }
+    if (isset($last)) {
+      $this->assertClass($last, 'pager-last', "Item for last page has .pager-last class.");
+      $this->assertTrue($last->a, "Link to last page found.");
+      $this->assertNoClass($last->a, 'active', "Link to last page is not active.");
+    }
+  }
+
+  /**
+   * Asserts that an element has a given class.
+   *
+   * @param SimpleXMLElement $element
+   *   The element to test.
+   * @param string $class
+   *   The class to assert.
+   * @param string $message
+   *   (optional) A verbose message to output.
+   */
+  protected function assertClass(SimpleXMLElement $element, $class, $message = NULL) {
+    if (!isset($message)) {
+      $message = "Class .$class found.";
+    }
+    $this->assertTrue(strpos($element['class'], $class) !== FALSE, $message);
+  }
+
+  /**
+   * Asserts that an element does not have a given class.
+   *
+   * @param SimpleXMLElement $element
+   *   The element to test.
+   * @param string $class
+   *   The class to assert.
+   * @param string $message
+   *   (optional) A verbose message to output.
+   */
+  protected function assertNoClass(SimpleXMLElement $element, $class, $message = NULL) {
+    if (!isset($message)) {
+      $message = "Class .$class not found.";
+    }
+    $this->assertTrue(strpos($element['class'], $class) === FALSE, $message);
+  }
+}
+

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/path.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/path.test Thu May 10 18:20:18 2012
@@ -333,3 +333,49 @@
     $this->assertEqual(drupal_lookup_path('source', $path['alias']), $path['source'], t('Newer alias record is returned when comparing two LANGUAGE_NONE paths with the same alias.'));
   }
 }
+
+/**
+ * Tests the path_save() function.
+ */
+class PathSaveTest extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => t('Path save'),
+      'description' => t('Tests that path_save() exposes the previous alias value.'),
+      'group' => t('Path API'),
+    );
+  }
+
+  function setUp() {
+    // Enable a helper module that implements hook_path_update().
+    parent::setUp('path_test');
+    path_test_reset();
+  }
+
+  /**
+   * Tests that path_save() makes the original path available to modules.
+   */
+  function testDrupalSaveOriginalPath() {
+    $account = $this->drupalCreateUser();
+    $uid = $account->uid;
+    $name = $account->name;
+
+    // Create a language-neutral alias.
+    $path = array(
+      'source' => "user/$uid",
+      'alias' => 'foo',
+    );
+    $path_original = $path;
+    path_save($path);
+
+    // Alter the path.
+    $path['alias'] = 'bar';
+    path_save($path);
+
+    // Test to see if the original alias is available to modules during
+    // hook_path_update().
+    $results = variable_get('path_test_results', array());
+    $this->assertIdentical($results['hook_path_update']['original']['alias'], $path_original['alias'], t('Old path alias available to modules during hook_path_update.'));
+    $this->assertIdentical($results['hook_path_update']['original']['source'], $path_original['source'], t('Old path alias available to modules during hook_path_update.'));
+  }
+}

Added: branches/upstream/current-7/modules/simpletest/tests/path_test.info
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/path_test.info?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/path_test.info (added)
+++ branches/upstream/current-7/modules/simpletest/tests/path_test.info Thu May 10 18:20:18 2012
@@ -1,0 +1,12 @@
+name = "Hook path tests"
+description = "Support module for path hook testing."
+package = Testing
+version = VERSION
+core = 7.x
+hidden = TRUE
+
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
+project = "drupal"
+datestamp = "1335997555"
+

Added: branches/upstream/current-7/modules/simpletest/tests/path_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/path_test.module?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/path_test.module (added)
+++ branches/upstream/current-7/modules/simpletest/tests/path_test.module Thu May 10 18:20:18 2012
@@ -1,0 +1,23 @@
+<?php
+
+/**
+ * @file
+ * Helper module for the path tests.
+ */
+
+/**
+ * Resets the path test results.
+ */
+function path_test_reset() {
+  variable_set('path_test_results', array());
+}
+
+/**
+ * Implements hook_path_update().
+ */
+function path_test_path_update($path) {
+  $results = variable_get('path_test_results', array());
+  $results['hook_path_update'] = $path;
+  variable_set('path_test_results', $results);
+}
+

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/requirements1_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/requirements1_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/requirements2_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/requirements2_test.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/simpletest/tests/session.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/session.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/session.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/session.test Thu May 10 18:20:18 2012
@@ -455,7 +455,7 @@
       }
     }
 
-    // Test that session data saved before login is not available using the 
+    // Test that session data saved before login is not available using the
     // pre-login anonymous cookie.
     $this->cookies = array();
     $this->drupalGet('session-test/get', array('Cookie: ' . $anonymous_cookie));
@@ -471,15 +471,10 @@
     $this->drupalGet('user');
     $form = $this->xpath('//form[@id="user-login"]');
     $form[0]['action'] = $this->httpsUrl('user');
-    $this->drupalPost(NULL, $edit, t('Log in'), array(), array('Cookie: ' . $secure_session_name . '=' . $this->cookies[$secure_session_name]['value']));
-
-    // Get the insecure session cookie set by the secure login POST request.
-    $headers = $this->drupalGetHeaders(TRUE);
-    strtok($headers[0]['set-cookie'], ';=');
-    $session_id = strtok(';=');
+    $this->drupalPost(NULL, $edit, t('Log in'));
 
     // Test that the user is also authenticated on the insecure site.
-    $this->drupalGet("user/{$user->uid}/edit", array(), array('Cookie: ' . $insecure_session_name . '=' . $session_id));
+    $this->drupalGet("user/{$user->uid}/edit");
     $this->assertResponse(200);
   }
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/session_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/session_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 hidden = TRUE
 dependencies[] = _missing_dependency
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_dependencies_test.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 hidden = TRUE
 dependencies[] = system_incompatible_core_version_test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_core_version_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 5.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_dependencies_test.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 ; 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"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/system_incompatible_module_version_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/system_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/system_test.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = system_test.module
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/taxonomy_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/taxonomy_test.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 hidden = TRUE
 dependencies[] = taxonomy
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/theme.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/theme.test Thu May 10 18:20:18 2012
@@ -8,7 +8,7 @@
 /**
  * Unit tests for the Theme API.
  */
-class ThemeUnitTest extends DrupalWebTestCase {
+class ThemeTestCase extends DrupalWebTestCase {
   protected $profile = 'testing';
 
   public static function getInfo() {
@@ -52,11 +52,19 @@
   }
 
   /**
-  * Preprocess functions for the base hook should run even for suggestion implementations.
-  */
+   * Ensures preprocess functions run even for suggestion implementations.
+   *
+   * The theme hook used by this test has its base preprocess function in a
+   * separate file, so this test also ensures that that file is correctly loaded
+   * when needed.
+   */
   function testPreprocessForSuggestions() {
-    $this->drupalGet('theme-test/suggestion');
-    $this->assertText('test_theme_breadcrumb__suggestion: 1', t('Theme hook suggestion ran with data available from a preprocess function for the base hook.'));
+    // Test with both an unprimed and primed theme registry.
+    drupal_theme_rebuild();
+    for ($i = 0; $i < 2; $i++) {
+      $this->drupalGet('theme-test/suggestion');
+      $this->assertText('Theme hook implementor=test_theme_theme_test__suggestion(). Foo=template_preprocess_theme_test', 'Theme hook suggestion ran with data available from a preprocess function for the base hook.');
+    }
   }
 
   /**
@@ -103,12 +111,25 @@
     $this->drupalGet('theme-test/suggestion');
     variable_set('preprocess_css', 0);
   }
+
+  /**
+   * Ensures the theme registry is rebuilt when modules are disabled/enabled.
+   */
+  function testRegistryRebuild() {
+    $this->assertIdentical(theme('theme_test_foo', array('foo' => 'a')), 'a', 'The theme registry contains theme_test_foo.');
+
+    module_disable(array('theme_test'), FALSE);
+    $this->assertIdentical(theme('theme_test_foo', array('foo' => 'b')), '', 'The theme registry does not contain theme_test_foo, because the module is disabled.');
+
+    module_enable(array('theme_test'), FALSE);
+    $this->assertIdentical(theme('theme_test_foo', array('foo' => 'c')), 'c', 'The theme registry contains theme_test_foo again after re-enabling the module.');
+  }
 }
 
 /**
  * Unit tests for theme_table().
  */
-class ThemeTableUnitTest extends DrupalWebTestCase {
+class ThemeTableTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Theme Table',
@@ -307,7 +328,7 @@
 /**
  * Functional test for initialization of the theme system in hook_init().
  */
-class ThemeHookInitUnitTest extends DrupalWebTestCase {
+class ThemeHookInitTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
       'name' => 'Theme initialization in hook_init()',

Added: branches/upstream/current-7/modules/simpletest/tests/theme_test.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/theme_test.inc?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/theme_test.inc (added)
+++ branches/upstream/current-7/modules/simpletest/tests/theme_test.inc Thu May 10 18:20:18 2012
@@ -1,0 +1,15 @@
+<?php
+
+/**
+ * Returns HTML for the 'theme_test' theme hook used by tests.
+ */
+function theme_theme_test($variables) {
+  return 'Theme hook implementor=theme_theme_test(). Foo=' . $variables['foo'];
+}
+
+/**
+ * Preprocesses variables for theme_theme_test().
+ */
+function template_preprocess_theme_test(&$variables) {
+  $variables['foo'] = 'template_preprocess_theme_test';
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/theme_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/theme_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/theme_test.module (original)
+++ branches/upstream/current-7/modules/simpletest/tests/theme_test.module Thu May 10 18:20:18 2012
@@ -4,13 +4,19 @@
  * Implements hook_theme().
  */
 function theme_test_theme($existing, $type, $theme, $path) {
+  $items['theme_test'] = array(
+    'file' => 'theme_test.inc',
+    'variables' => array('foo' => ''),
+  );
   $items['theme_test_template_test'] = array(
     'template' => 'theme_test.template_test',
   );
   $items['theme_test_template_test_2'] = array(
     'template' => 'theme_test.template_test',
   );
-
+  $items['theme_test_foo'] = array(
+    'variables' => array('foo' => NULL),
+  );
   return $items;
 }
 
@@ -115,14 +121,12 @@
  * Page callback, calls a theme hook suggestion.
  */
 function _theme_test_suggestion() {
-  return theme(array('breadcrumb__suggestion', 'breadcrumb'), array());
+  return theme(array('theme_test__suggestion', 'theme_test'), array());
 }
 
 /**
- * Implements hook_preprocess_breadcrumb().
- *
- * Set a variable that can later be tested to see if this function ran.
+ * Theme function for testing theme('theme_test_foo').
  */
-function theme_test_preprocess_breadcrumb(&$variables) {
-  $variables['theme_test_preprocess_breadcrumb'] = 1;
+function theme_theme_test_foo($variables) {
+  return $variables['foo'];
 }

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/template.php (original)
+++ branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/template.php Thu May 10 18:20:18 2012
@@ -3,10 +3,8 @@
 /**
  * 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'];
+function test_theme_theme_test__suggestion($variables) {
+  return 'Theme hook implementor=test_theme_theme_test__suggestion(). Foo=' . $variables['foo'];
 }
 
 /**

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/test_theme.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/themes/test_theme/test_theme.info Thu May 10 18:20:18 2012
@@ -15,8 +15,8 @@
 ; file within the theme folder.
 stylesheets[all][] = system.base.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/update_script_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/update_script_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php (added)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.trigger.database.php Thu May 10 18:20:18 2012
@@ -1,0 +1,82 @@
+<?php
+/**
+ * @file
+ * Test content for the trigger upgrade path.
+ */
+db_create_table('trigger_assignments', array(
+  'fields' => array(
+    'hook' => array(
+      'type' => 'varchar',
+      'length' => 32,
+      'not null' => TRUE,
+      'default' => '',
+    ),
+    'op' => array(
+      'type' => 'varchar',
+      'length' => 32,
+      'not null' => TRUE,
+      'default' => '',
+    ),
+    'aid' => array(
+      'type' => 'varchar',
+      'length' => 255,
+      'not null' => TRUE,
+      'default' => '',
+    ),
+    'weight' => array(
+      'type' => 'int',
+      'not null' => TRUE,
+      'default' => 0,
+    ),
+  ),
+  'primary key' => array('hook', 'op', 'aid'),
+  'module' => 'trigger',
+  'name' => 'trigger_assignments',
+));
+
+
+// Add several trigger configurations.
+db_insert('trigger_assignments')->fields(array(
+  'hook',
+  'op',
+  'aid',
+  'weight',
+))
+->values(array(
+  'hook' => 'node',
+  'op' => 'presave',
+  'aid' => 'node_publish_action',
+  'weight' => '1',
+))
+->values(array(
+  'hook' => 'comment',
+  'op' => 'presave',
+  'aid' => 'comment_publish_action',
+  'weight' => '1',
+))
+->values(array(
+  'hook' => 'comment_delete',
+  'op' => 'presave',
+  'aid' => 'node_save_action',
+  'weight' => '1',
+))
+->values(array(
+  'hook' => 'nodeapi',
+  'op' => 'presave',
+  'aid' => 'node_make_sticky_action',
+  'weight' => '1',
+))
+->values(array(
+  'hook' => 'nodeapi',
+  'op' => 'somehow_nodeapi_got_a_very_long',
+  'aid' => 'node_save_action',
+  'weight' => '1',
+))
+->execute();
+
+db_update('system')->fields(array(
+  'schema_version' => '6000',
+  'status' => '1',
+))
+->condition('filename', 'modules/trigger/trigger.module')
+->execute();

Modified: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.upload.database.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.upload.database.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.upload.database.php (original)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-6.upload.database.php Thu May 10 18:20:18 2012
@@ -113,6 +113,19 @@
   'filesize' => '329',
   'status' => '1',
   'timestamp' => '1285708957',
+))
+/*
+ * This is a case where the path is repeated twice.
+ */
+->values(array(
+  'fid' => '11',
+  'uid' => '1',
+  'filename' => 'crazy-basename.png',
+  'filepath' => '/drupal-6/file/directory/path/drupal-6/file/directory/path/crazy-basename.png',
+  'filemime' => 'image/png',
+  'filesize' => '329',
+  'status' => '1',
+  'timestamp' => '1285708958',
 ))
 ->execute();
 
@@ -235,8 +248,8 @@
   'vid' => '53',
   'uid' => '1',
   'title' => 'node title 40 revision 53',
-  'body' => "Attachments:\r\nforum-hot-new.png\r\nforum-hot.png\r\nforum-sticky.png\r\nforum-new.png",
-  'teaser' => "Attachments:\r\nforum-hot-new.png\r\nforum-hot.png\r\nforum-sticky.png\r\nforum-new.png",
+  'body' => "Attachments:\r\nforum-hot-new.png\r\nforum-hot.png\r\nforum-sticky.png\r\nforum-new.png\r\ncrazy-basename.png",
+  'teaser' => "Attachments:\r\nforum-hot-new.png\r\nforum-hot.png\r\nforum-sticky.png\r\nforum-new.png\r\ncrazy-basename.png",
   'log' => '',
   'timestamp' => '1285709012',
   'format' => '1',
@@ -394,4 +407,12 @@
   'list' => '1',
   'weight' => '-1',
 ))
+->values(array(
+  'fid' => '11',
+  'nid' => '40',
+  'vid' => '53',
+  'description' => 'crazy-basename.png',
+  'list' => '1',
+  'weight' => '0',
+))
 ->execute();

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.field.database.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.field.database.php?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.field.database.php (added)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.field.database.php Thu May 10 18:20:18 2012
@@ -1,0 +1,16 @@
+<?php
+
+/**
+ * @file
+ * Test content for the field update path.
+ */
+
+db_insert('variable')->fields(array(
+  'name',
+  'value',
+))
+->values(array(
+  'name' => 'field_bundle_settings',
+  'value' => 'a:1:{s:4:"node";a:1:{s:4:"poll";a:1:{s:12:"extra_fields";a:1:{s:7:"display";a:2:{s:16:"poll_view_voting";a:1:{s:7:"default";a:2:{s:6:"weight";s:1:"0";s:7:"visible";b:1;}}s:17:"poll_view_results";a:1:{s:7:"default";a:2:{s:6:"weight";s:1:"0";s:7:"visible";b:0;}}}}}}}',
+))
+->execute();

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.trigger.database.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.trigger.database.php?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.trigger.database.php (added)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/drupal-7.trigger.database.php Thu May 10 18:20:18 2012
@@ -1,0 +1,28 @@
+<?php
+/**
+ * @file
+ * Test content for the trigger upgrade path.
+ */
+
+// Add several trigger configurations.
+db_insert('trigger_assignments')->fields(array(
+  'hook',
+  'aid',
+  'weight',
+))
+->values(array(
+  'hook' => 'node_presave',
+  'aid' => 'node_publish_action',
+  'weight' => '1',
+))
+->values(array(
+  'hook' => 'comment_presave',
+  'aid' => 'comment_publish_action',
+  'weight' => '1',
+))
+->values(array(
+  'hook' => 'comment_delete',
+  'aid' => 'node_save_action',
+  'weight' => '1',
+))
+->execute();

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/update.field.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/update.field.test?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/update.field.test (added)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/update.field.test Thu May 10 18:20:18 2012
@@ -1,0 +1,61 @@
+<?php
+
+/**
+ * @file
+ * Provides update path tests for the Field module.
+ */
+
+/**
+ * Tests the Field 7.0 -> 7.x update path.
+ */
+class FieldUpdatePathTestCase extends UpdatePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Field update path',
+      'description' => 'Field update path tests.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Use the filled update path and our field data.
+    $path = drupal_get_path('module', 'simpletest') . '/tests/upgrade';
+    $this->databaseDumpFiles = array(
+      $path . '/drupal-7.filled.standard_all.database.php.gz',
+      $path . '/drupal-7.field.database.php',
+    );
+    parent::setUp();
+
+    // Our test data includes poll extra field settings.
+    $this->uninstallModulesExcept(array('field', 'poll'));
+  }
+
+  /**
+   * Tests that the update is successful.
+   */
+  public function testFilledUpgrade() {
+    $this->assertTrue($this->performUpgrade(), t('The update was completed successfully.'));
+    $expected_settings = array(
+      'extra_fields' => array(
+        'display' => array(
+          'poll_view_voting' => array(
+            'default' => array(
+              'weight' => '0',
+              'visible' => TRUE,
+            ),
+          ),
+          'poll_view_results' => array(
+            'default' => array(
+              'weight' => '0',
+              'visible' => FALSE,
+            ),
+          ),
+        ),
+        'form' => array(),
+      ),
+      'view_modes' => array(),
+    );
+    $actual_settings = field_bundle_settings('node', 'poll');
+    $this->assertEqual($expected_settings, $actual_settings, 'Settings stored in field_bundle_settings were updated to per-bundle settings.');
+  }
+}

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/update.trigger.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/update.trigger.test?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/update.trigger.test (added)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/update.trigger.test Thu May 10 18:20:18 2012
@@ -1,0 +1,37 @@
+<?php
+/**
+ * @file
+ * Provides upgrade path tests for the Trigger module.
+ */
+
+/**
+ * Tests the Trigger 7.0 -> 7.x upgrade path.
+ */
+class TriggerUpdatePathTestCase extends UpdatePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Trigger update path',
+      'description'  => 'Trigger update path tests.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Use the filled upgrade path and our trigger data.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-7.filled.standard_all.database.php.gz',
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-7.trigger.database.php',
+    );
+    parent::setUp();
+
+    // Our test data includes node and comment trigger assignments.
+    $this->uninstallModulesExcept(array('comment', 'trigger'));
+  }
+
+  /**
+   * Tests that the upgrade is successful.
+   */
+  public function testFilledUpgrade() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+  }
+}

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/update.user.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/update.user.test?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/update.user.test (added)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/update.user.test Thu May 10 18:20:18 2012
@@ -1,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Provides update path tests for the User module.
+ */
+
+/**
+ * Tests the User 7.0 -> 7.x update path.
+ */
+class UserUpdatePathTestCase extends UpdatePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'User update path',
+      'description' => 'User update path tests.',
+      'group' => 'Upgrade path',
+    );
+  }
+
+  public function setUp() {
+    // Use the filled update path and our field data.
+    $this->databaseDumpFiles = array(
+      drupal_get_path('module', 'simpletest') . '/tests/upgrade/drupal-7.filled.standard_all.database.php.gz',
+    );
+    parent::setUp();
+  }
+
+  /**
+   * Tests that the update is successful.
+   */
+  public function testFilledUpgrade() {
+    $this->assertTrue($this->performUpgrade(), t('The update was completed successfully.'));
+    $this->assertTrue(db_index_exists('users', 'picture'), 'The {users}.picture column has an index.');
+  }
+}

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.test Thu May 10 18:20:18 2012
@@ -549,7 +549,7 @@
     ));
 
     // Test that the site name is correctly displayed.
-    $this->assertText('drupal', t('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');
@@ -625,7 +625,7 @@
     ));
 
     // Test that the site name is correctly displayed.
-    $this->assertText('drupal', t('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');
@@ -702,7 +702,7 @@
     ));
 
     // Test that the site name is correctly displayed.
-    $this->assertText('drupal', t('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');
@@ -778,7 +778,7 @@
     ));
 
     // Test that the site name is correctly displayed.
-    $this->assertText('drupal', t('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');

Added: branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.trigger.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.trigger.test?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.trigger.test (added)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.trigger.test Thu May 10 18:20:18 2012
@@ -1,0 +1,39 @@
+<?php
+/**
+ * @file
+ * Provides upgrade path tests for the Trigger module.
+ */
+
+/**
+ * Tests the Trigger 6 -> 7 upgrade path.
+ */
+class UpgradePathTriggerTestCase extends UpgradePathTestCase {
+  public static function getInfo() {
+    return array(
+      'name'  => 'Trigger upgrade path',
+      'description'  => 'Trigger upgrade path tests for Drupal 6.x.',
+      '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.trigger.database.php',
+    );
+    parent::setUp();
+  }
+
+  /**
+   * Basic tests for the trigger upgrade.
+   */
+  public function testTaxonomyUpgrade() {
+    $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
+    $this->drupalGet('admin/structure/trigger/node');
+    $this->assertRaw('<td>'. t('Make post sticky') .'</td>');
+    $this->assertRaw('<td>'. t('Publish post') .'</td>');
+    $this->drupalGet('admin/structure/trigger/comment');
+    $this->assertRaw('<td>'. t('Publish comment') .'</td>');
+  }
+}

Modified: branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.upload.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.upload.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.upload.test (original)
+++ branches/upstream/current-7/modules/simpletest/tests/upgrade/upgrade.upload.test Thu May 10 18:20:18 2012
@@ -64,6 +64,12 @@
       }
       $this->assertIdentical($filenames, $recorded_filenames, 'The uploaded files are present in the same order after the upgrade.');
     }
+    // Test for the file with repeating basename to only have the streaming
+    // path replaced.
+    $node = node_load(40, 53);
+    $repeated_basename_file = $node->upload[LANGUAGE_NONE][4];
+    $this->assertEqual($repeated_basename_file['uri'], 'private://drupal-6/file/directory/path/crazy-basename.png', "The file with the repeated basename path only had the stream portion replaced");
+
     // Make sure the file settings were properly migrated.
     $d6_file_directory_temp = '/drupal-6/file/directory/temp';
     $d6_file_directory_path = '/drupal-6/file/directory/path';

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/simpletest/tests/xmlrpc_test.info (original)
+++ branches/upstream/current-7/modules/simpletest/tests/xmlrpc_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/statistics/statistics.info (original)
+++ branches/upstream/current-7/modules/statistics/statistics.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = statistics.test
 configure = admin/config/system/statistics
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/statistics/statistics.module (original)
+++ branches/upstream/current-7/modules/statistics/statistics.module Thu May 10 18:20:18 2012
@@ -13,7 +13,7 @@
     case 'admin/help#statistics':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Statistics module shows you how often a given page is viewed, who viewed it, the previous page the user visited (referrer URL), and when it was viewed. These statistics are useful in determining how users are visiting and navigating your site. For more information, see the online handbook entry for the <a href="@statistics">Statistics module</a>.', array('@statistics' => url('http://drupal.org/handbook/modules/statistics/'))) . '</p>';
+      $output .= '<p>' . t('The Statistics module shows you how often a given page is viewed, who viewed it, the previous page the user visited (referrer URL), and when it was viewed. These statistics are useful in determining how users are visiting and navigating your site. For more information, see the online handbook entry for the <a href="@statistics">Statistics module</a>.', array('@statistics' => url('http://drupal.org/documentation/modules/statistics/'))) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Managing logs') . '</dt>';

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/syslog/syslog.info (original)
+++ branches/upstream/current-7/modules/syslog/syslog.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 files[] = syslog.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/syslog/syslog.module (original)
+++ branches/upstream/current-7/modules/syslog/syslog.module Thu May 10 18:20:18 2012
@@ -29,7 +29,7 @@
     case 'admin/help#syslog':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t("The Syslog module logs events by sending messages to the logging facility of your web server's operating system. Syslog is an operating system administrative logging tool that provides valuable information for use in system management and security auditing. Most suited to medium and large sites, Syslog provides filtering tools that allow messages to be routed by type and severity. For more information, see the online handbook entry for <a href='@syslog'>Syslog module</a> and PHP's <a href='@php_openlog'>openlog</a> and <a href='@php_syslog'>syslog</a> functions.", array('@syslog' => 'http://drupal.org/handbook/modules/syslog', '@php_openlog' => 'http://www.php.net/manual/function.openlog.php', '@php_syslog' => 'http://www.php.net/manual/function.syslog.php')) . '</p>';
+      $output .= '<p>' . t("The Syslog module logs events by sending messages to the logging facility of your web server's operating system. Syslog is an operating system administrative logging tool that provides valuable information for use in system management and security auditing. Most suited to medium and large sites, Syslog provides filtering tools that allow messages to be routed by type and severity. For more information, see the online handbook entry for <a href='@syslog'>Syslog module</a> and PHP's <a href='@php_openlog'>openlog</a> and <a href='@php_syslog'>syslog</a> functions.", array('@syslog' => 'http://drupal.org/documentation/modules/syslog', '@php_openlog' => 'http://www.php.net/manual/function.openlog.php', '@php_syslog' => 'http://www.php.net/manual/function.syslog.php')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Logging for UNIX, Linux, and Mac OS X') . '</dt>';
@@ -71,7 +71,7 @@
 }
 
  /**
- * List all possible syslog facilities for UNIX/Linux.
+ * Lists all possible syslog facilities for UNIX/Linux.
  *
  * @return array
  */
@@ -109,7 +109,7 @@
     '!ip'          => $log_entry['ip'],
     '!request_uri' => $log_entry['request_uri'],
     '!referer'     => $log_entry['referer'],
-    '!uid'         => $log_entry['user']->uid,
+    '!uid'         => $log_entry['uid'],
     '!link'        => strip_tags($log_entry['link']),
     '!message'     => strip_tags(!isset($log_entry['variables']) ? $log_entry['message'] : strtr($log_entry['message'], $log_entry['variables'])),
   ));

Modified: branches/upstream/current-7/modules/syslog/syslog.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/syslog/syslog.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/syslog/syslog.test (original)
+++ branches/upstream/current-7/modules/syslog/syslog.test Thu May 10 18:20:18 2012
@@ -5,6 +5,9 @@
  * Tests for syslog.module.
  */
 
+/**
+ * Tests the Syslog module functionality.
+ */
 class SyslogTestCase extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
@@ -19,7 +22,7 @@
   }
 
   /**
-   * Test the syslog settings page.
+   * Tests the syslog settings page.
    */
   function testSettings() {
     $admin_user = $this->drupalCreateUser(array('administer site configuration'));

Added: branches/upstream/current-7/modules/system/language.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/language.api.php?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/modules/system/language.api.php (added)
+++ branches/upstream/current-7/modules/system/language.api.php Thu May 10 18:20:18 2012
@@ -1,0 +1,170 @@
+<?php
+
+/**
+ * @file
+ * Hooks provided by the base system for language support.
+ */
+
+/**
+ * @addtogroup hooks
+ * @{
+ */
+
+/**
+ * Allows modules to act after language initialization has been performed.
+ *
+ * This is primarily needed to provide translation for configuration variables
+ * in the proper bootstrap phase. Variables are user-defined strings and
+ * therefore should not be translated via t(), since the source string can
+ * change without notice and any previous translation would be lost. Moreover,
+ * since variables can be used in the bootstrap phase, we need a bootstrap hook
+ * to provide a translation early enough to avoid misalignments between code
+ * using the original values and code using the translated values. However
+ * modules implementing hook_boot() should be aware that language initialization
+ * did not happen yet and thus they cannot rely on translated variables.
+ */
+function hook_language_init() {
+  global $language, $conf;
+
+  switch ($language->language) {
+    case 'it':
+      $conf['site_name'] = 'Il mio sito Drupal';
+      break;
+
+    case 'fr':
+      $conf['site_name'] = 'Mon site Drupal';
+      break;
+  }
+}
+
+/**
+ * Perform alterations on language switcher links.
+ *
+ * A language switcher link may need to point to a different path or use a
+ * translated link text before going through l(), which will just handle the
+ * path aliases.
+ *
+ * @param $links
+ *   Nested array of links keyed by language code.
+ * @param $type
+ *   The language type the links will switch.
+ * @param $path
+ *   The current path.
+ */
+function hook_language_switch_links_alter(array &$links, $type, $path) {
+  global $language;
+
+  if ($type == LANGUAGE_TYPE_CONTENT && isset($links[$language->language])) {
+    foreach ($links[$language->language] as $link) {
+      $link['attributes']['class'][] = 'active-language';
+    }
+  }
+}
+
+/**
+ * Allow modules to define their own language types.
+ *
+ * @return
+ *   An array of language type definitions. Each language type has an identifier
+ *   key. The language type definition is an associative array that may contain
+ *   the following key-value pairs:
+ *   - "name": The human-readable language type identifier.
+ *   - "description": A description of the language type.
+ *   - "fixed": An array of language provider identifiers. Defining this key
+ *     makes the language type non-configurable.
+ */
+function hook_language_types_info() {
+  return array(
+    'custom_language_type' => array(
+      'name' => t('Custom language'),
+      'description' => t('A custom language type.'),
+    ),
+    'fixed_custom_language_type' => array(
+      'fixed' => array('custom_language_provider'),
+    ),
+  );
+}
+
+/**
+ * Perform alterations on language types.
+ *
+ * @param $language_types
+ *   Array of language type definitions.
+ */
+function hook_language_types_info_alter(array &$language_types) {
+  if (isset($language_types['custom_language_type'])) {
+    $language_types['custom_language_type_custom']['description'] = t('A far better description.');
+  }
+}
+
+/**
+ * Allow modules to define their own language providers.
+ *
+ * @return
+ *   An array of language provider definitions. Each language provider has an
+ *   identifier key. The language provider definition is an associative array
+ *   that may contain the following key-value pairs:
+ *   - "types": An array of allowed language types. If a language provider does
+ *     not specify which language types it should be used with, it will be
+ *     available for all the configurable language types.
+ *   - "callbacks": An array of functions that will be called to perform various
+ *     tasks. Possible key-value pairs are:
+ *     - "language": Required. The callback that will determine the language
+ *       value.
+ *     - "switcher": The callback that will determine the language switch links
+ *       associated to the current language provider.
+ *     - "url_rewrite": The callback that will provide URL rewriting.
+ *   - "file": A file that will be included before the callback is invoked; this
+ *     allows callback functions to be in separate files.
+ *   - "weight": The default weight the language provider has.
+ *   - "name": A human-readable identifier.
+ *   - "description": A description of the language provider.
+ *   - "config": An internal path pointing to the language provider
+ *     configuration page.
+ *   - "cache": The value Drupal's page cache should be set to for the current
+ *     language provider to be invoked.
+ */
+function hook_language_negotiation_info() {
+  return array(
+    'custom_language_provider' => array(
+      'callbacks' => array(
+        'language' => 'custom_language_provider_callback',
+        'switcher' => 'custom_language_switcher_callback',
+        'url_rewrite' => 'custom_language_url_rewrite_callback',
+      ),
+      'file' => drupal_get_path('module', 'custom') . '/custom.module',
+      'weight' => -4,
+      'types' => array('custom_language_type'),
+      'name' => t('Custom language provider'),
+      'description' => t('This is a custom language provider.'),
+      'cache' => 0,
+    ),
+  );
+}
+
+/**
+ * Perform alterations on language providers.
+ *
+ * @param $language_providers
+ *   Array of language provider definitions.
+ */
+function hook_language_negotiation_info_alter(array &$language_providers) {
+  if (isset($language_providers['custom_language_provider'])) {
+    $language_providers['custom_language_provider']['config'] = 'admin/config/regional/language/configure/custom-language-provider';
+  }
+}
+
+/**
+ * Perform alterations on the language fallback candidates.
+ *
+ * @param $fallback_candidates
+ *   An array of language codes whose order will determine the language fallback
+ *   order.
+ */
+function hook_language_fallback_candidates_alter(array &$fallback_candidates) {
+  $fallback_candidates = array_reverse($fallback_candidates);
+}
+
+/**
+ * @} End of "addtogroup hooks".
+ */

Modified: branches/upstream/current-7/modules/system/page.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/page.tpl.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/page.tpl.php (original)
+++ branches/upstream/current-7/modules/system/page.tpl.php Thu May 10 18:20:18 2012
@@ -3,6 +3,9 @@
 /**
  * @file
  * Default theme implementation to display a single Drupal page.
+ *
+ * The doctype, html, head and body tags are not in this template. Instead they
+ * can be found in the html.tpl.php template in this directory.
  *
  * Available variables:
  *
@@ -64,6 +67,7 @@
  * @see template_preprocess()
  * @see template_preprocess_page()
  * @see template_process()
+ * @see html.tpl.php
  */
 ?>
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.admin.inc (original)
+++ branches/upstream/current-7/modules/system/system.admin.inc Thu May 10 18:20:18 2012
@@ -106,7 +106,15 @@
 }
 
 /**
- * Menu callback; displays a module's settings page.
+ * Displays the configuration overview page.
+ *
+ * This menu callback implementation is a legacy function that used to display
+ * the configuration overview page at admin/config. It is currently unused and
+ * will be removed in Drupal 8. The page at admin/config is now generated by
+ * system_admin_config_page().
+ *
+ * @deprecated
+ * @see system_admin_config_page()
  */
 function system_settings_overview() {
   // Check database setup if necessary
@@ -470,17 +478,11 @@
         ),
       ),
     );
-    $logo_path = theme_get_setting('logo_path', $key);
-    // If $logo_path is a public:// URI, display the path relative to the files
-    // directory; stream wrappers are not end-user friendly.
-    if (file_uri_scheme($logo_path) == 'public') {
-      $logo_path = file_uri_target($logo_path);
-    }
     $form['logo']['settings']['logo_path'] = array(
       '#type' => 'textfield',
       '#title' => t('Path to custom logo'),
-      '#default_value' => $logo_path,
       '#description' => t('The path to the file you would like to use as your logo file instead of the default logo.'),
+      '#default_value' => theme_get_setting('logo_path', $key),
     );
     $form['logo']['settings']['logo_upload'] = array(
       '#type' => 'file',
@@ -511,23 +513,33 @@
         ),
       ),
     );
-    $favicon_path = theme_get_setting('favicon_path', $key);
-    // If $favicon_path is a public:// URI, display the path relative to the
-    // files directory; stream wrappers are not end-user friendly.
-    if (file_uri_scheme($favicon_path) == 'public') {
-      $favicon_path = file_uri_target($favicon_path);
-    }
     $form['favicon']['settings']['favicon_path'] = array(
       '#type' => 'textfield',
       '#title' => t('Path to custom icon'),
-      '#default_value' => $favicon_path,
-      '#description' => t('The path to the image file you would like to use as your custom shortcut icon.')
+      '#description' => t('The path to the image file you would like to use as your custom shortcut icon.'),
+      '#default_value' => theme_get_setting('favicon_path', $key),
     );
     $form['favicon']['settings']['favicon_upload'] = array(
       '#type' => 'file',
       '#title' => t('Upload icon image'),
       '#description' => t("If you don't have direct file access to the server, use this field to upload your shortcut icon.")
     );
+  }
+
+  // Inject human-friendly values for logo and favicon.
+  foreach (array('logo' => 'logo.png', 'favicon' => 'favicon.ico') as $type => $default) {
+    if (isset($form[$type]['settings'][$type . '_path'])) {
+      $element = &$form[$type]['settings'][$type . '_path'];
+
+      // If path is a public:// URI, display the path relative to the files
+      // directory; stream wrappers are not end-user friendly.
+      $original_path = $element['#default_value'];
+      $friendly_path = NULL;
+      if (file_uri_scheme($original_path) == 'public') {
+        $friendly_path = file_uri_target($original_path);
+        $element['#default_value'] = $friendly_path;
+      }
+    }
   }
 
   if ($key) {
@@ -657,13 +669,20 @@
  *   the path could not be validated.
  */
 function _system_theme_settings_validate_path($path) {
-  if (drupal_realpath($path)) {
-    // The path is relative to the Drupal root, or is a valid URI.
+  // Absolute local file paths are invalid.
+  if (drupal_realpath($path) == $path) {
+    return FALSE;
+  }
+  // A path relative to the Drupal root or a fully qualified URI is valid.
+  if (is_file($path)) {
     return $path;
   }
-  $uri = 'public://' . $path;
-  if (file_exists($uri)) {
-    return $uri;
+  // Prepend 'public://' for relative file paths within public filesystem.
+  if (file_uri_scheme($path) === FALSE) {
+    $path = 'public://' . $path;
+  }
+  if (is_file($path)) {
+    return $path;
   }
   return FALSE;
 }
@@ -1370,6 +1389,7 @@
     '#theme' => 'table',
     '#header' => $header,
     '#rows' => $rows,
+    '#empty' => t('No blocked IP addresses available.'),
   );
 
   return $build;
@@ -1766,7 +1786,7 @@
     '#title' => t('Private file system path'),
     '#default_value' => variable_get('file_private_path', ''),
     '#maxlength' => 255,
-    '#description' => t('An existing local file system path for storing private files. It should be writable by Drupal and not accessible over the web. See the online handbook for <a href="@handbook">more information about securing private files</a>.', array('@handbook' => 'http://drupal.org/handbook/modules/file')),
+    '#description' => t('An existing local file system path for storing private files. It should be writable by Drupal and not accessible over the web. See the online handbook for <a href="@handbook">more information about securing private files</a>.', array('@handbook' => 'http://drupal.org/documentation/modules/file')),
     '#after_build' => array('system_check_directory'),
   );
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.api.php (original)
+++ branches/upstream/current-7/modules/system/system.api.php Thu May 10 18:20:18 2012
@@ -1200,22 +1200,23 @@
  *       "default" task, which should display the same page as the parent item.
  *     If the "type" element is omitted, MENU_NORMAL_ITEM is assumed.
  *   - "options": An array of options to be passed to l() when generating a link
- *     from this menu item.
+ *     from this menu item. Note that the "options" parameter has no effect on
+ *     MENU_LOCAL_TASK, MENU_DEFAULT_LOCAL_TASK, and MENU_LOCAL_ACTION items.
  *
  * For a detailed usage example, see page_example.module.
  * For comprehensive documentation on the menu system, see
  * http://drupal.org/node/102338.
  */
 function hook_menu() {
-  $items['blog'] = array(
-    'title' => 'blogs',
-    'page callback' => 'blog_page',
+  $items['example'] = array(
+    'title' => 'Example Page',
+    'page callback' => 'example_page',
     'access arguments' => array('access content'),
     'type' => MENU_SUGGESTED_ITEM,
   );
-  $items['blog/feed'] = array(
-    'title' => 'RSS feed',
-    'page callback' => 'blog_feed',
+  $items['example/feed'] = array(
+    'title' => 'Example RSS feed',
+    'page callback' => 'example_feed',
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
@@ -2233,6 +2234,10 @@
  * theme set via a theme callback function in hook_menu(); the themes on those
  * pages can only be overridden using hook_menu_alter().
  *
+ * Note that returning different themes for the same path may not work with page
+ * caching. This is most likely to be a problem if an anonymous user on a given
+ * path could have different themes returned under different conditions.
+ *
  * Since only one theme can be used at a time, the last (i.e., highest
  * weighted) module which returns a valid theme name from this hook will
  * prevail.
@@ -2328,31 +2333,40 @@
 }
 
 /**
- * Log an event message
+ * Log an event message.
  *
  * This hook allows modules to route log events to custom destinations, such as
  * SMS, Email, pager, syslog, ...etc.
  *
  * @param $log_entry
  *   An associative array containing the following keys:
- *   - type: The type of message for this entry. For contributed modules, this is
- *     normally the module name. Do not use 'debug', use severity WATCHDOG_DEBUG instead.
- *   - user: The user object for the user who was logged in when the event happened.
- *   - request_uri: The Request URI for the page the event happened in.
- *   - referer: The page that referred the use to the page where the event occurred.
+ *   - type: The type of message for this entry.
+ *   - user: The user object for the user who was logged in when the event
+ *     happened.
+ *   - request_uri: The request URI for the page the event happened in.
+ *   - referer: The page that referred the user to the page where the event
+ *     occurred.
  *   - ip: The IP address where the request for the page came from.
- *   - timestamp: The UNIX timestamp of the date/time the event occurred
- *   - severity: One of the following values as defined in RFC 3164 http://www.faqs.org/rfcs/rfc3164.html
- *     WATCHDOG_EMERGENCY Emergency: system is unusable
- *     WATCHDOG_ALERT     Alert: action must be taken immediately
- *     WATCHDOG_CRITICAL  Critical: critical conditions
- *     WATCHDOG_ERROR     Error: error conditions
- *     WATCHDOG_WARNING   Warning: warning conditions
- *     WATCHDOG_NOTICE    Notice: normal but significant condition
- *     WATCHDOG_INFO      Informational: informational messages
- *     WATCHDOG_DEBUG     Debug: debug-level messages
- *   - link: an optional link provided by the module that called the watchdog() function.
- *   - message: The text of the message to be logged.
+ *   - timestamp: The UNIX timestamp of the date/time the event occurred.
+ *   - severity: The severity of the message; one of the following values as
+ *     defined in @link http://www.faqs.org/rfcs/rfc3164.html RFC 3164: @endlink
+ *     - WATCHDOG_EMERGENCY: Emergency, system is unusable.
+ *     - WATCHDOG_ALERT: Alert, action must be taken immediately.
+ *     - WATCHDOG_CRITICAL: Critical conditions.
+ *     - WATCHDOG_ERROR: Error conditions.
+ *     - WATCHDOG_WARNING: Warning conditions.
+ *     - WATCHDOG_NOTICE: Normal but significant conditions.
+ *     - WATCHDOG_INFO: Informational messages.
+ *     - WATCHDOG_DEBUG: Debug-level messages.
+ *   - link: An optional link provided by the module that called the watchdog()
+ *     function.
+ *   - message: The text of the message to be logged. Variables in the message
+ *     are indicated by using placeholder strings alongside the variables
+ *     argument to declare the value of the placeholders. See t() for
+ *     documentation on how the message and variable parameters interact.
+ *   - variables: An array of variables to be inserted into the message on
+ *     display. Will be NULL or missing if a message is already translated or if
+ *     the message is not possible to translate.
  */
 function hook_watchdog(array $log_entry) {
   global $base_url, $language;

Modified: branches/upstream/current-7/modules/system/system.base-rtl.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.base-rtl.css?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.base-rtl.css (original)
+++ branches/upstream/current-7/modules/system/system.base-rtl.css Thu May 10 18:20:18 2012
@@ -36,8 +36,12 @@
  */
 .draggable a.tabledrag-handle {
   float: right;
-  margin: -0.4em -0.5em -0.4em 0;
-  padding: 0.42em 0.5em 0.42em 1.5em;
+  margin-right: -1em;
+  margin-left: 0;
+}
+a.tabledrag-handle .handle {
+  margin: -0.4em 0.5em;
+  padding: 0.42em 0.5em;
 }
 div.indentation {
   float: right;

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.base.css (original)
+++ branches/upstream/current-7/modules/system/system.base.css Thu May 10 18:20:18 2012
@@ -93,21 +93,22 @@
   cursor: move;
   float: left; /* LTR */
   height: 1.7em;
-  margin: -0.4em 0 -0.4em -0.5em; /* LTR */
-  padding: 0.42em 1.5em 0.42em 0.5em; /* LTR */
+  margin-left: -1em; /* LTR */
+  overflow: hidden;
   text-decoration: none;
 }
 a.tabledrag-handle:hover {
   text-decoration: none;
 }
 a.tabledrag-handle .handle {
-  background: url(../../misc/draggable.png) no-repeat 0 0;
+  background: url(../../misc/draggable.png) no-repeat 6px 9px;
   height: 13px;
-  margin-top: 4px;
+  margin: -0.4em 0.5em; /* LTR */
+  padding: 0.42em 0.5em; /* LTR */
   width: 13px;
 }
 a.tabledrag-handle-hover .handle {
-  background-position: 0 -20px;
+  background-position: 6px -11px;
 }
 div.indentation {
   float: left; /* LTR */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.info (original)
+++ branches/upstream/current-7/modules/system/system.info Thu May 10 18:20:18 2012
@@ -12,8 +12,8 @@
 required = TRUE
 configure = admin/config/system
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.install (original)
+++ branches/upstream/current-7/modules/system/system.install Thu May 10 18:20:18 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 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'))),
+        '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/documentation/modules/update', '@module' => url('admin/modules'))),
       );
     }
     else {
@@ -810,6 +810,7 @@
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'binary' => TRUE,
       ),
       'uri' => array(
         'description' => 'The URI to access the file (either local or remote).',
@@ -817,6 +818,7 @@
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'binary' => TRUE,
       ),
       'filemime' => array(
         'description' => "The file's MIME type.",
@@ -2173,6 +2175,7 @@
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'binary' => TRUE,
       ),
       'uri' => array(
         'description' => 'URI of file.',
@@ -2180,6 +2183,7 @@
         'length' => 255,
         'not null' => TRUE,
         'default' => '',
+        'binary' => TRUE,
       ),
       'filemime' => array(
         'description' => "The file's MIME type.",
@@ -2791,7 +2795,7 @@
       foreach ($revision['file'][LANGUAGE_NONE] as $delta => $file) {
         // We will convert filepaths to uri using the default scheme
         // and stripping off the existing file directory path.
-        $file['uri'] = $scheme . str_replace($basename, '', $file['filepath']);
+        $file['uri'] = $scheme . preg_replace('!^' . preg_quote($basename) . '!', '', $file['filepath']);
         $file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
         unset($file['filepath']);
         // Insert into the file_managed table.
@@ -2989,6 +2993,29 @@
  */
 
 /**
+ * Add binary to {file_managed}, in case system_update_7034() was run without
+ * it.
+ */
+function system_update_7073() {
+  db_change_field('file_managed', 'filename', 'filename', array(
+    'description' => 'Name of the file with no path components. This may differ from the basename of the URI if the file is renamed to avoid overwriting an existing file.',
+    'type' => 'varchar',
+    'length' => 255,
+    'not null' => TRUE,
+    'default' => '',
+    'binary' => TRUE,
+  ));
+  db_change_field('file_managed', 'uri', 'uri', array(
+    'description' => 'The URI to access the file (either local or remote).',
+    'type' => 'varchar',
+    'length' => 255,
+    'not null' => TRUE,
+    'default' => '',
+    'binary' => TRUE,
+  ));
+}
+
+/**
  * @} End of "defgroup updates-7.x-extra"
  * The next series of updates should start at 8000.
  */

Modified: branches/upstream/current-7/modules/system/system.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/system/system.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.js (original)
+++ branches/upstream/current-7/modules/system/system.js Thu May 10 18:20:18 2012
@@ -96,19 +96,22 @@
  */
 Drupal.behaviors.dateTime = {
   attach: function (context, settings) {
-    for (var value in settings.dateTime) {
-      var settings = settings.dateTime[value];
-      var source = '#edit-' + value;
-      var suffix = source + '-suffix';
+    for (var fieldName in settings.dateTime) {
+      if (settings.dateTime.hasOwnProperty(fieldName)) {
+        (function (fieldSettings, fieldName) {
+          var source = '#edit-' + fieldName;
+          var suffix = source + '-suffix';
 
-      // Attach keyup handler to custom format inputs.
-      $('input' + source, context).once('date-time').keyup(function () {
-        var input = $(this);
-        var url = settings.lookup + (settings.lookup.match(/\?q=/) ? '&format=' : '?format=') + encodeURIComponent(input.val());
-        $.getJSON(url, function (data) {
-          $(suffix).empty().append(' ' + settings.text + ': <em>' + data + '</em>');
-        });
-      });
+          // Attach keyup handler to custom format inputs.
+          $('input' + source, context).once('date-time').keyup(function () {
+            var input = $(this);
+            var url = fieldSettings.lookup + (/\?q=/.test(fieldSettings.lookup) ? '&format=' : '?format=') + encodeURIComponent(input.val());
+            $.getJSON(url, function (data) {
+              $(suffix).empty().append(' ' + fieldSettings.text + ': <em>' + data + '</em>');
+            });
+          });
+        })(settings.dateTime[fieldName], fieldName);
+      }
     }
   }
 };

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.module (original)
+++ branches/upstream/current-7/modules/system/system.module Thu May 10 18:20:18 2012
@@ -76,7 +76,7 @@
     case 'admin/help#system':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The System module is integral to the site, and provides basic but extensible functionality for use by other modules and themes. Some integral elements of Drupal are contained in and managed by the System module, including caching, enabling and disabling modules and themes, preparing and displaying the administrative page, and configuring fundamental site settings. A number of key system maintenance operations are also part of the System module. For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/handbook/modules/system')) . '</p>';
+      $output .= '<p>' . t('The System module is integral to the site, and provides basic but extensible functionality for use by other modules and themes. Some integral elements of Drupal are contained in and managed by the System module, including caching, enabling and disabling modules and themes, preparing and displaying the administrative page, and configuring fundamental site settings. A number of key system maintenance operations are also part of the System module. For more information, see the online handbook entry for <a href="@system">System module</a>.', array('@system' => 'http://drupal.org/documentation/modules/system')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Managing modules') . '</dt>';

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/system/system.test (original)
+++ branches/upstream/current-7/modules/system/system.test Thu May 10 18:20:18 2012
@@ -1638,26 +1638,98 @@
   function testThemeSettings() {
     // Specify a filesystem path to be used for the logo.
     $file = current($this->drupalGetTestFiles('image'));
-    $fullpath = drupal_realpath($file->uri);
-    $edit = array(
-      'default_logo' => FALSE,
-      'logo_path' => $fullpath,
-    );
-    $this->drupalPost('admin/appearance/settings', $edit, t('Save configuration'));
-    $this->drupalGet('node');
-    $this->assertRaw($fullpath, t('Logo path successfully changed.'));
+    $file_relative = strtr($file->uri, array('public:/' => variable_get('file_public_path', conf_path() . '/files')));
+    $default_theme_path = 'themes/stark';
+
+    $supported_paths = array(
+      // Raw stream wrapper URI.
+      $file->uri => array(
+        'form' => file_uri_target($file->uri),
+        'src' => file_create_url($file->uri),
+      ),
+      // Relative path within the public filesystem.
+      file_uri_target($file->uri) => array(
+        'form' => file_uri_target($file->uri),
+        'src' => file_create_url($file->uri),
+      ),
+      // Relative path to a public file.
+      $file_relative => array(
+        'form' => $file_relative,
+        'src' => file_create_url($file->uri),
+      ),
+      // Relative path to an arbitrary file.
+      'misc/druplicon.png' => array(
+        'form' => 'misc/druplicon.png',
+        'src' => $GLOBALS['base_url'] . '/' . 'misc/druplicon.png',
+      ),
+      // Relative path to a file in a theme.
+      $default_theme_path . '/logo.png' => array(
+        'form' => $default_theme_path . '/logo.png',
+        'src' => $GLOBALS['base_url'] . '/' . $default_theme_path . '/logo.png',
+      ),
+    );
+    foreach ($supported_paths as $input => $expected) {
+      $edit = array(
+        'default_logo' => FALSE,
+        'logo_path' => $input,
+      );
+      $this->drupalPost('admin/appearance/settings', $edit, t('Save configuration'));
+      $this->assertNoText('The custom logo path is invalid.');
+      $this->assertFieldByName('logo_path', $expected['form']);
+
+      // Verify the actual 'src' attribute of the logo being output.
+      $this->drupalGet('');
+      $elements = $this->xpath('//*[@id=:id]/img', array(':id' => 'logo'));
+      $this->assertEqual((string) $elements[0]['src'], $expected['src']);
+    }
+
+    $unsupported_paths = array(
+      // Stream wrapper URI to non-existing file.
+      'public://whatever.png',
+      'private://whatever.png',
+      'temporary://whatever.png',
+      // Bogus stream wrapper URIs.
+      'public:/whatever.png',
+      '://whatever.png',
+      ':whatever.png',
+      'public://',
+      // Relative path within the public filesystem to non-existing file.
+      'whatever.png',
+      // Relative path to non-existing file in public filesystem.
+      variable_get('file_public_path', conf_path() . '/files') . '/whatever.png',
+      // Semi-absolute path to non-existing file in public filesystem.
+      '/' . variable_get('file_public_path', conf_path() . '/files') . '/whatever.png',
+      // Relative path to arbitrary non-existing file.
+      'misc/whatever.png',
+      // Semi-absolute path to arbitrary non-existing file.
+      '/misc/whatever.png',
+      // Absolute paths to any local file (even if it exists).
+      drupal_realpath($file->uri),
+    );
+    $this->drupalGet('admin/appearance/settings');
+    foreach ($unsupported_paths as $path) {
+      $edit = array(
+        'default_logo' => FALSE,
+        'logo_path' => $path,
+      );
+      $this->drupalPost(NULL, $edit, t('Save configuration'));
+      $this->assertText('The custom logo path is invalid.');
+    }
 
     // Upload a file to use for the logo.
-    $file = current($this->drupalGetTestFiles('image'));
     $edit = array(
       'default_logo' => FALSE,
       'logo_path' => '',
       'files[logo_upload]' => drupal_realpath($file->uri),
     );
-    $options = array();
-    $this->drupalPost('admin/appearance/settings', $edit, t('Save configuration'), $options);
-    $this->drupalGet('node');
-    $this->assertRaw($file->name, t('Logo file successfully uploaded.'));
+    $this->drupalPost('admin/appearance/settings', $edit, t('Save configuration'));
+
+    $fields = $this->xpath($this->constructFieldXpath('name', 'logo_path'));
+    $uploaded_filename = 'public://' . $fields[0]['value'];
+
+    $this->drupalGet('');
+    $elements = $this->xpath('//*[@id=:id]/img', array(':id' => 'logo'));
+    $this->assertEqual($elements[0]['src'], file_create_url($uploaded_filename));
   }
 
   /**
@@ -2239,6 +2311,56 @@
     $final_theme_data = db_query("SELECT * FROM {system} WHERE type = 'theme' ORDER BY name")->fetchAll();
     $this->assertEqual($original_theme_data, $final_theme_data, t('Visiting update.php does not alter the information about themes stored in the database.'));
   }
+
+  /**
+   * Tests update.php when there are no updates to apply.
+   */
+  function testNoUpdateFunctionality() {
+    // Click through update.php with 'administer software updates' permission.
+    $this->drupalLogin($this->update_user);
+    $this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE));
+    $this->assertText(t('No pending updates.'));
+    $this->assertNoLink('Administration pages');
+    $this->clickLink('Front page');
+    $this->assertResponse(200);
+
+    // Click through update.php with 'access administration pages' permission.
+    $admin_user = $this->drupalCreateUser(array('administer software updates', 'access administration pages'));
+    $this->drupalLogin($admin_user);
+    $this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE));
+    $this->assertText(t('No pending updates.'));
+    $this->clickLink('Administration pages');
+    $this->assertResponse(200);
+  }
+
+  /**
+   * Tests update.php after performing a successful update.
+   */
+  function testSuccessfulUpdateFunctionality() {
+    drupal_set_installed_schema_version('update_script_test', drupal_get_installed_schema_version('update_script_test') - 1);
+    // Click through update.php with 'administer software updates' permission.
+    $this->drupalLogin($this->update_user);
+    $this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE));
+    $this->drupalPost(NULL, array(), t('Apply pending updates'));
+    $this->assertText('Updates were attempted.');
+    $this->assertLink('site');
+    $this->assertNoLink('Administration pages');
+    $this->assertNoLink('logged');
+    $this->clickLink('Front page');
+    $this->assertResponse(200);
+
+    drupal_set_installed_schema_version('update_script_test', drupal_get_installed_schema_version('update_script_test') - 1);
+    // Click through update.php with 'access administration pages' and
+    // 'access site reports' permissions.
+    $admin_user = $this->drupalCreateUser(array('administer software updates', 'access administration pages', 'access site reports'));
+    $this->drupalLogin($admin_user);
+    $this->drupalPost($this->update_url, array(), t('Continue'), array('external' => TRUE));
+    $this->drupalPost(NULL, array(), t('Apply pending updates'));
+    $this->assertText('Updates were attempted.');
+    $this->assertLink('logged');
+    $this->clickLink('Administration pages');
+    $this->assertResponse(200);
+  }
 }
 
 /**

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.info (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.info Thu May 10 18:20:18 2012
@@ -8,8 +8,8 @@
 files[] = taxonomy.test
 configure = admin/structure/taxonomy
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/taxonomy/taxonomy.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/taxonomy/taxonomy.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.js (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.js Thu May 10 18:20:18 2012
@@ -10,7 +10,7 @@
   attach: function (context, settings) {
     var table = $('#taxonomy', context);
     var tableDrag = Drupal.tableDrag.taxonomy; // Get the blocks tableDrag object.
-    var rows = $('tr', table).size();
+    var rows = $('tr', table).length;
 
     // When a row is swapped, keep previous and next page classes set.
     tableDrag.row.prototype.onSwap = function (swappedRow) {

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.module (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.module Thu May 10 18:20:18 2012
@@ -21,7 +21,7 @@
     case 'admin/help#taxonomy':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Taxonomy module allows you to classify the content of your website. To classify content, you define <em>vocabularies</em> that contain related <em>terms</em>, and then assign the vocabularies to content types. For more information, see the online handbook entry for the <a href="@taxonomy">Taxonomy module</a>.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) . '</p>';
+      $output .= '<p>' . t('The Taxonomy module allows you to classify the content of your website. To classify content, you define <em>vocabularies</em> that contain related <em>terms</em>, and then assign the vocabularies to content types. For more information, see the online handbook entry for the <a href="@taxonomy">Taxonomy module</a>.', array('@taxonomy' => 'http://drupal.org/documentation/modules/taxonomy/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Creating vocabularies') . '</dt>';
@@ -195,7 +195,7 @@
  * @param $limit
  *   Integer. The maximum number of nodes to find.
  *   Set to FALSE for no limit.
- * @order
+ * @param $order
  *   An array of fields and directions.
  *
  * @return
@@ -475,6 +475,30 @@
     module_invoke_all('taxonomy_vocabulary_delete', $vocabulary);
     module_invoke_all('entity_delete', $vocabulary, 'taxonomy_vocabulary');
 
+    // Load all Taxonomy module fields and delete those which use only this
+    // vocabulary.
+    $taxonomy_fields = field_read_fields(array('module' => 'taxonomy'));
+    foreach ($taxonomy_fields as $field_name => $taxonomy_field) {
+      $modified_field = FALSE;
+      // Term reference fields may reference terms from more than one
+      // vocabulary.
+      foreach ($taxonomy_field['settings']['allowed_values'] as $key => $allowed_value) {
+        if ($allowed_value['vocabulary'] == $vocabulary->machine_name) {
+          unset($taxonomy_field['settings']['allowed_values'][$key]);
+          $modified_field = TRUE;
+        }
+      }
+      if ($modified_field) {
+        if (empty($taxonomy_field['settings']['allowed_values'])) {
+          field_delete_field($field_name);
+        }
+        else {
+          // Update the field definition with the new allowed values.
+          field_update_field($taxonomy_field);
+        }
+      }
+    }
+
     cache_clear_all();
     taxonomy_vocabulary_static_reset();
 
@@ -544,7 +568,7 @@
       $hierarchy = 2;
       break;
     }
-    elseif (count($term->parents) == 1 && 0 !== array_shift($term->parents)) {
+    elseif (count($term->parents) == 1 && !isset($term->parents[0])) {
       $hierarchy = 1;
     }
   }
@@ -847,7 +871,11 @@
  * Get names for all taxonomy vocabularies.
  *
  * @return
- *   An array of vocabulary ids, names, machine names, keyed by machine name.
+ *   An associative array of objects keyed by vocabulary machine name with
+ *   information about taxonomy vocabularies. Each object has properties:
+ *   - name: The vocabulary name.
+ *   - machine_name: The machine name.
+ *   - vid: The vocabulary ID.
  */
 function taxonomy_vocabulary_get_names() {
   $names = &drupal_static(__FUNCTION__);
@@ -1071,12 +1099,25 @@
  *
  * @param $name
  *   Name of the term to search for.
+ * @param $vocabulary
+ *   (optional) Vocabulary machine name to limit the search. Defaults to NULL.
  *
  * @return
  *   An array of matching term objects.
  */
-function taxonomy_get_term_by_name($name) {
-  return taxonomy_term_load_multiple(array(), array('name' => trim($name)));
+function taxonomy_get_term_by_name($name, $vocabulary = NULL) {
+  $conditions = array('name' => trim($name));
+  if (isset($vocabulary)) {
+    $vocabularies = taxonomy_vocabulary_get_names();
+    if (isset($vocabularies[$vocabulary])) {
+      $conditions['vid'] = $vocabularies[$vocabulary]->vid;
+    }
+    else {
+      // Return an empty array when filtering by a non-existing vocabulary.
+      return array();
+    }
+  }
+  return taxonomy_term_load_multiple(array(), $conditions);
 }
 
 /**
@@ -1331,7 +1372,7 @@
 /**
  * Implements hook_options_list().
  */
-function taxonomy_options_list($field) {
+function taxonomy_options_list($field, $instance, $entity_type, $entity) {
   $function = !empty($field['settings']['options_list_callback']) ? $field['settings']['options_list_callback'] : 'taxonomy_allowed_values';
   return $function($field);
 }
@@ -1418,6 +1459,10 @@
       'label' => t('Plain text'),
       'field types' => array('taxonomy_term_reference'),
     ),
+    'taxonomy_term_reference_rss_category' => array(
+      'label' => t('RSS category'),
+      'field types' => array('taxonomy_term_reference'),
+    ),
   );
 }
 
@@ -1460,6 +1505,18 @@
         );
       }
       break;
+
+    case 'taxonomy_term_reference_rss_category':
+      foreach ($items as $delta => $item) {
+        $entity->rss_elements[] = array(
+          'key' => 'category',
+          'value' => $item['tid'] != 'autocreate' ? $item['taxonomy_term']->name : $item['name'],
+          'attributes' => array(
+            'domain' => $item['tid'] != 'autocreate' ? url('taxonomy/term/' . $item['tid'], array('absolute' => TRUE)) : '',
+          ),
+        );
+      }
+      break;
   }
 
   return $element;
@@ -1519,7 +1576,7 @@
           $items[$id][$delta]['taxonomy_term'] = $terms[$item['tid']];
         }
         // Terms to be created are not in $terms, but are still legitimate.
-        else if ($item['tid'] == 'autocreate') {
+        elseif ($item['tid'] == 'autocreate') {
           // Leave the item in place.
         }
         // Otherwise, unset the instance value, since the term does not exist.

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.pages.inc (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.pages.inc Thu May 10 18:20:18 2012
@@ -108,7 +108,20 @@
  * @see taxonomy_field_widget_info()
  */
 function taxonomy_autocomplete($field_name, $tags_typed = '') {
-  $field = field_info_field($field_name);
+  // If the request has a '/' in the search text, then the menu system will have
+  // split it into multiple arguments, recover the intended $tags_typed.
+  $args = func_get_args();
+  // Shift off the $field_name argument.
+  array_shift($args);
+  $tags_typed = implode('/', $args);
+
+  // Make sure the field exists and is a taxonomy field.
+  if (!($field = field_info_field($field_name)) || $field['type'] !== 'taxonomy_term_reference') {
+    // Error string. The JavaScript handler will realize this is not JSON and
+    // will display it as debugging information.
+    print t('Taxonomy field @field_name not found.', array('@field_name' => $field_name));
+    exit;
+  }
 
   // The user enters a comma-separated list of tags. We only autocomplete the last tag.
   $tags_typed = drupal_explode_tags($tags_typed);

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/taxonomy/taxonomy.test (original)
+++ branches/upstream/current-7/modules/taxonomy/taxonomy.test Thu May 10 18:20:18 2012
@@ -180,7 +180,7 @@
 /**
  * Tests for taxonomy vocabulary functions.
  */
-class TaxonomyVocabularyUnitTest extends TaxonomyWebTestCase {
+class TaxonomyVocabularyTestCase extends TaxonomyWebTestCase {
 
   public static function getInfo() {
     return array(
@@ -215,7 +215,7 @@
     // This should return a vocabulary object since it now matches a real vid.
     $vocabulary = taxonomy_vocabulary_load($vid);
     $this->assertTrue(!empty($vocabulary) && is_object($vocabulary), t('Vocabulary is an object'));
-    $this->assertTrue($vocabulary->vid == $vid, t('Valid vocabulary vid is the same as our previously invalid one.'));
+    $this->assertEqual($vocabulary->vid, $vid, 'Valid vocabulary vid is the same as our previously invalid one.');
   }
 
   /**
@@ -319,10 +319,10 @@
 
     // Fetch vocabulary 1 by name.
     $vocabulary = current(taxonomy_vocabulary_load_multiple(array(), array('name' => $vocabulary1->name)));
-    $this->assertTrue($vocabulary->vid == $vocabulary1->vid, t('Vocabulary loaded successfully by name.'));
+    $this->assertEqual($vocabulary->vid, $vocabulary1->vid, 'Vocabulary loaded successfully by name.');
 
     // Fetch vocabulary 1 by name and ID.
-    $this->assertTrue(current(taxonomy_vocabulary_load_multiple(array($vocabulary1->vid), array('name' => $vocabulary1->name)))->vid == $vocabulary1->vid, t('Vocabulary loaded successfully by name and ID.'));
+    $this->assertEqual(current(taxonomy_vocabulary_load_multiple(array($vocabulary1->vid), array('name' => $vocabulary1->name)))->vid, $vocabulary1->vid, 'Vocabulary loaded successfully by name and ID.');
   }
 
   /**
@@ -369,7 +369,6 @@
     field_create_instance($this->instance);
 
     module_disable(array('taxonomy'));
-    drupal_flush_all_caches();
     require_once DRUPAL_ROOT . '/includes/install.inc';
     drupal_uninstall_modules(array('taxonomy'));
     module_enable(array('taxonomy'));
@@ -389,7 +388,7 @@
 /**
  * Unit tests for taxonomy term functions.
  */
-class TaxonomyTermUnitTest extends TaxonomyWebTestCase {
+class TaxonomyTermFunctionTestCase extends TaxonomyWebTestCase {
 
   public static function getInfo() {
     return array(
@@ -561,6 +560,10 @@
     $term1 = $this->createTerm($this->vocabulary);
     $term2 = $this->createTerm($this->vocabulary);
 
+    // Check that hierarchy is flat.
+    $vocabulary = taxonomy_vocabulary_load($this->vocabulary->vid);
+    $this->assertEqual(0, $vocabulary->hierarchy, 'Vocabulary is flat.');
+
     // Edit $term2, setting $term1 as parent.
     $edit = array();
     $edit['parent[]'] = array($term1->tid);
@@ -696,6 +699,66 @@
     $input = substr($term_objects['term3']->name, 0, 3);
     $this->drupalGet('taxonomy/autocomplete/taxonomy_' . $this->vocabulary->machine_name . '/' . $input);
     $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)));
+
+    // Test taxonomy autocomplete with a nonexistent field.
+    $field_name = $this->randomName();
+    $tag = $this->randomName();
+    $message = t("Taxonomy field @field_name not found.", array('@field_name' => $field_name));
+    $this->assertFalse(field_info_field($field_name), t('Field %field_name does not exist.', array('%field_name' => $field_name)));
+    $this->drupalGet('taxonomy/autocomplete/' . $field_name . '/' . $tag);
+    $this->assertRaw($message, t('Autocomplete returns correct error message when the taxonomy field does not exist.'));
+  }
+
+  /**
+   * Tests term autocompletion edge cases with slashes in the names.
+   */
+  function testTermAutocompletion() {
+    // Add a term with a slash in the name.
+    $first_term = $this->createTerm($this->vocabulary);
+    $first_term->name = '10/16/2011';
+    taxonomy_term_save($first_term);
+    // Add another term that differs after the slash character.
+    $second_term = $this->createTerm($this->vocabulary);
+    $second_term->name = '10/17/2011';
+    taxonomy_term_save($second_term);
+    // Add another term that has both a comma and a slash character.
+    $third_term = $this->createTerm($this->vocabulary);
+    $third_term->name = 'term with, a comma and / a slash';
+    taxonomy_term_save($third_term);
+
+    // Try to autocomplete a term name that matches both terms.
+    // We should get both term in a json encoded string.
+    $input = '10/';
+    $path = 'taxonomy/autocomplete/taxonomy_';
+    $path .= $this->vocabulary->machine_name . '/' . $input;
+    // The result order is not guaranteed, so check each term separately.
+    $url = url($path, array('absolute' => TRUE));
+    $result = drupal_http_request($url);
+    $data = drupal_json_decode($result->data);
+    $this->assertEqual($data[$first_term->name], check_plain($first_term->name), 'Autocomplete returned the first matching term');
+    $this->assertEqual($data[$second_term->name], check_plain($second_term->name), 'Autocomplete returned the second matching term');
+
+    // Try to autocomplete a term name that matches first term.
+    // We should only get the first term in a json encoded string.
+    $input = '10/16';
+    $url = 'taxonomy/autocomplete/taxonomy_';
+    $url .= $this->vocabulary->machine_name . '/' . $input;
+    $this->drupalGet($url);
+    $target = array($first_term->name => check_plain($first_term->name));
+    $this->assertRaw(drupal_json_encode($target), 'Autocomplete returns only the expected matching term.');
+
+    // Try to autocomplete a term name with both a comma and a slash.
+    $input = '"term with, comma and / a';
+    $url = 'taxonomy/autocomplete/taxonomy_';
+    $url .= $this->vocabulary->machine_name . '/' . $input;
+    $this->drupalGet($url);
+    $n = $third_term->name;
+    // Term names containing commas or quotes must be wrapped in quotes.
+    if (strpos($third_term->name, ',') !== FALSE || strpos($third_term->name, '"') !== FALSE) {
+      $n = '"' . str_replace('"', '""', $third_term->name) . '"';
+    }
+    $target = array($n => check_plain($third_term->name));
+    $this->assertRaw(drupal_json_encode($target), 'Autocomplete returns a term containing a comma and a slash.');
   }
 
   /**
@@ -887,6 +950,127 @@
     // Try to load the term using a substring of the name.
     $terms = taxonomy_get_term_by_name(drupal_substr($term->name, 2));
     $this->assertFalse($terms);
+
+    // Create a new term in a different vocabulary with the same name.
+    $new_vocabulary = $this->createVocabulary();
+    $new_term = new stdClass();
+    $new_term->name = $term->name;
+    $new_term->vid = $new_vocabulary->vid;
+    taxonomy_term_save($new_term);
+
+    // Load multiple terms with the same name.
+    $terms = taxonomy_get_term_by_name($term->name);
+    $this->assertEqual(count($terms), 2, t('Two terms loaded with the same name.'));
+
+    // Load single term when restricted to one vocabulary.
+    $terms = taxonomy_get_term_by_name($term->name, $this->vocabulary->machine_name);
+    $this->assertEqual(count($terms), 1, t('One term loaded when restricted by vocabulary.'));
+    $this->assertTrue(isset($terms[$term->tid]), t('Term loaded using exact name and vocabulary machine name.'));
+
+    // Create a new term with another name.
+    $term2 = $this->createTerm($this->vocabulary);
+
+    // Try to load a term by name that doesn't exist in this vocabulary but
+    // exists in another vocabulary.
+    $terms = taxonomy_get_term_by_name($term2->name, $new_vocabulary->machine_name);
+    $this->assertFalse($terms, t('Invalid term name restricted by vocabulary machine name not loaded.'));
+
+    // Try to load terms filtering by a non-existing vocabulary.
+    $terms = taxonomy_get_term_by_name($term2->name, 'non_existing_vocabulary');
+    $this->assertEqual(count($terms), 0, t('No terms loaded when restricted by a non-existing vocabulary.'));
+  }
+}
+
+/**
+ * Tests the rendering of term reference fields in RSS feeds.
+ */
+class TaxonomyRSSTestCase extends TaxonomyWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Taxonomy RSS Content.',
+      'description' => 'Ensure that data added as terms appears in RSS feeds if "RSS Category" format is selected.',
+      'group' => 'Taxonomy',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('taxonomy');
+    $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'bypass node access', 'administer content types'));
+    $this->drupalLogin($this->admin_user);
+    $this->vocabulary = $this->createVocabulary();
+
+    $field = array(
+      'field_name' => 'taxonomy_' . $this->vocabulary->machine_name,
+      'type' => 'taxonomy_term_reference',
+      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
+      'settings' => array(
+        'allowed_values' => array(
+          array(
+            'vocabulary' => $this->vocabulary->machine_name,
+            'parent' => 0,
+          ),
+        ),
+      ),
+    );
+    field_create_field($field);
+
+    $this->instance = array(
+      'field_name' => 'taxonomy_' . $this->vocabulary->machine_name,
+      'bundle' => 'article',
+      'entity_type' => 'node',
+      'widget' => array(
+        'type' => 'options_select',
+      ),
+      'display' => array(
+        'default' => array(
+          'type' => 'taxonomy_term_reference_link',
+        ),
+      ),
+    );
+    field_create_instance($this->instance);
+  }
+
+  /**
+   * Tests that terms added to nodes are displayed in core RSS feed.
+   *
+   * Create a node and assert that taxonomy terms appear in rss.xml.
+   */
+  function testTaxonomyRSS() {
+    // Create two taxonomy terms.
+    $term1 = $this->createTerm($this->vocabulary);
+
+    // RSS display must be added manually.
+    $this->drupalGet("admin/structure/types/manage/article/display");
+    $edit = array(
+      "view_modes_custom[rss]" => '1',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+
+    // Change the format to 'RSS category'.
+    $this->drupalGet("admin/structure/types/manage/article/display/rss");
+    $edit = array(
+      "fields[taxonomy_" . $this->vocabulary->machine_name . "][type]" => 'taxonomy_term_reference_rss_category',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+
+    // Post an article.
+    $edit = array();
+    $langcode = LANGUAGE_NONE;
+    $edit["title"] = $this->randomName();
+    $edit[$this->instance['field_name'] . '[' . $langcode .'][]'] = $term1->tid;
+    $this->drupalPost('node/add/article', $edit, t('Save'));
+
+    // Check that the term is displayed when the RSS feed is viewed.
+    $this->drupalGet('rss.xml');
+    $test_element = array(
+      'key' => 'category',
+      'value' => $term1->name,
+      'attributes' => array(
+        'domain' => url('taxonomy/term/' . $term1->tid, array('absolute' => TRUE)),
+      ),
+    );
+    $this->assertRaw(format_xml_elements(array($test_element)), 'Term is displayed when viewing the rss feed.');
   }
 }
 
@@ -1110,7 +1294,7 @@
 /**
  * Test the taxonomy_term_load_multiple() function.
  */
-class TaxonomyLoadMultipleUnitTest extends TaxonomyWebTestCase {
+class TaxonomyLoadMultipleTestCase extends TaxonomyWebTestCase {
 
   public static function getInfo() {
     return array(
@@ -1143,11 +1327,11 @@
     // Load the terms from the vocabulary.
     $terms = taxonomy_term_load_multiple(NULL, array('vid' => $vocabulary->vid));
     $count = count($terms);
-    $this->assertTrue($count == 5, t('Correct number of terms were loaded. !count terms.', array('!count' => $count)));
+    $this->assertEqual($count, 5, format_string('Correct number of terms were loaded. !count terms.', array('!count' => $count)));
 
     // Load the same terms again by tid.
     $terms2 = taxonomy_term_load_multiple(array_keys($terms));
-    $this->assertTrue($count == count($terms2), t('Five terms were loaded by tid'));
+    $this->assertEqual($count, count($terms2), 'Five terms were loaded by tid');
     $this->assertEqual($terms, $terms2, t('Both arrays contain the same terms'));
 
     // Load the terms by tid, with a condition on vid.
@@ -1162,7 +1346,7 @@
 
     // Load terms from the vocabulary by vid.
     $terms4 = taxonomy_term_load_multiple(NULL, array('vid' => $vocabulary->vid));
-    $this->assertTrue(count($terms4 == 4), t('Correct number of terms were loaded.'));
+    $this->assertEqual(count($terms4), 4, 'Correct number of terms were loaded.');
     $this->assertFalse(isset($terms4[$deleted->tid]));
 
     // Create a single term and load it by name.
@@ -1335,6 +1519,11 @@
     $entity->content = field_attach_view('test_entity', $entity, 'full');
     $this->content = drupal_render($entity->content);
     $this->assertText($term->name, t('Term name is displayed'));
+
+    // Delete the vocabulary and verify that the widget is gone.
+    taxonomy_vocabulary_delete($this->vocabulary->vid);
+    $this->drupalGet('test-entity/add/test-bundle');
+    $this->assertNoFieldByName("{$this->field_name}[$langcode]", '', 'Widget is not displayed');
   }
 
   /**
@@ -1377,6 +1566,127 @@
     $this->assertEqual($allowed_values[2]['vocabulary'], 'foo', t('Index 2: Machine name was left untouched.'));
   }
 }
+
+/**
+ * Tests a taxonomy term reference field that allows multiple vocabularies.
+ */
+class TaxonomyTermFieldMultipleVocabularyTestCase extends TaxonomyWebTestCase {
+  protected $instance;
+  protected $vocabulary1;
+  protected $vocabulary2;
+
+  public static function getInfo() {
+    return array(
+      'name'  => 'Multiple vocabulary term reference field',
+      'description'  => 'Tests term reference fields that allow multiple vocabularies.',
+      'group' => 'Taxonomy',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('field_test');
+
+    $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer taxonomy'));
+    $this->drupalLogin($web_user);
+    $this->vocabulary1 = $this->createVocabulary();
+    $this->vocabulary2 = $this->createVocabulary();
+
+    // Set up a field and instance.
+    $this->field_name = drupal_strtolower($this->randomName());
+    $this->field = array(
+      'field_name' => $this->field_name,
+      'type' => 'taxonomy_term_reference',
+      'cardinality' => FIELD_CARDINALITY_UNLIMITED,
+      'settings' => array(
+        'allowed_values' => array(
+          array(
+            'vocabulary' => $this->vocabulary1->machine_name,
+            'parent' => '0',
+          ),
+          array(
+            'vocabulary' => $this->vocabulary2->machine_name,
+            'parent' => '0',
+          ),
+        ),
+      )
+    );
+    field_create_field($this->field);
+    $this->instance = array(
+      'field_name' => $this->field_name,
+      'entity_type' => 'test_entity',
+      'bundle' => 'test_bundle',
+      'widget' => array(
+        'type' => 'options_select',
+      ),
+      'display' => array(
+        'full' => array(
+          'type' => 'taxonomy_term_reference_link',
+        ),
+      ),
+    );
+    field_create_instance($this->instance);
+  }
+
+  /**
+   * Tests term reference field and widget with multiple vocabularies.
+   */
+  function testTaxonomyTermFieldMultipleVocabularies() {
+    // Create a term in each vocabulary.
+    $term1 = $this->createTerm($this->vocabulary1);
+    $term2 = $this->createTerm($this->vocabulary2);
+
+    // Submit an entity with both terms.
+    $langcode = LANGUAGE_NONE;
+    $this->drupalGet('test-entity/add/test-bundle');
+    $this->assertFieldByName("{$this->field_name}[$langcode][]", '', 'Widget is displayed');
+    $edit = array(
+      "{$this->field_name}[$langcode][]" => array($term1->tid, $term2->tid),
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    $id = $match[1];
+    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created.');
+
+    // Render the entity.
+    $entity = field_test_entity_test_load($id);
+    $entities = array($id => $entity);
+    field_attach_prepare_view('test_entity', $entities, 'full');
+    $entity->content = field_attach_view('test_entity', $entity, 'full');
+    $this->content = drupal_render($entity->content);
+    $this->assertText($term1->name, 'Term 1 name is displayed.');
+    $this->assertText($term2->name, 'Term 2 name is displayed.');
+
+    // Delete vocabulary 2.
+    taxonomy_vocabulary_delete($this->vocabulary2->vid);
+
+    // Re-render the content.
+    $entity = field_test_entity_test_load($id);
+    $entities = array($id => $entity);
+    field_attach_prepare_view('test_entity', $entities, 'full');
+    $entity->content = field_attach_view('test_entity', $entity, 'full');
+    $this->plainTextContent = FALSE;
+    $this->content = drupal_render($entity->content);
+
+    // Term 1 should still be displayed; term 2 should not be.
+    $this->assertText($term1->name, 'Term 1 name is displayed.');
+    $this->assertNoText($term2->name, 'Term 2 name is not displayed.');
+
+    // Verify that field and instance settings are correct.
+    $field_info = field_info_field($this->field_name);
+    $this->assertEqual(sizeof($field_info['settings']['allowed_values']), 1, 'Only one vocabulary is allowed for the field.');
+
+    // The widget should still be displayed.
+    $this->drupalGet('test-entity/add/test-bundle');
+    $this->assertFieldByName("{$this->field_name}[$langcode][]", '', 'Widget is still displayed');
+
+    // Term 1 should still pass validation.
+    $edit = array(
+      "{$this->field_name}[$langcode][]" => array($term1->tid),
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+  }
+}
+
 
 /**
  * Test taxonomy token replacement in strings.

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/toolbar/toolbar.info (original)
+++ branches/upstream/current-7/modules/toolbar/toolbar.info Thu May 10 18:20:18 2012
@@ -4,8 +4,8 @@
 package = Core
 version = VERSION
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/toolbar/toolbar.js
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/toolbar/toolbar.js?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/toolbar/toolbar.js (original)
+++ branches/upstream/current-7/modules/toolbar/toolbar.js Thu May 10 18:20:18 2012
@@ -94,11 +94,16 @@
 };
 
 Drupal.toolbar.height = function() {
-  var height = $('#toolbar').outerHeight();
-  // In IE, Shadow filter adds some extra height, so we need to remove it from
-  // the returned height.
-  if ($('#toolbar').css('filter').match(/DXImageTransform\.Microsoft\.Shadow/)) {
-    height -= $('#toolbar').get(0).filters.item("DXImageTransform.Microsoft.Shadow").strength;
+  var $toolbar = $('#toolbar');
+  var height = $toolbar.outerHeight();
+  // In modern browsers (including IE9), when box-shadow is defined, use the
+  // normal height.
+  var cssBoxShadowValue = $toolbar.css('box-shadow');
+  var boxShadow = (typeof cssBoxShadowValue !== 'undefined' && cssBoxShadowValue !== 'none');
+  // In IE8 and below, we use the shadow filter to apply box-shadow styles to
+  // the toolbar. It adds some extra height that we need to remove.
+  if (!boxShadow && /DXImageTransform\.Microsoft\.Shadow/.test($toolbar.css('filter'))) {
+    height -= $toolbar[0].filters.item("DXImageTransform.Microsoft.Shadow").strength;
   }
   return height;
 };

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/toolbar/toolbar.module (original)
+++ branches/upstream/current-7/modules/toolbar/toolbar.module Thu May 10 18:20:18 2012
@@ -12,7 +12,7 @@
   switch ($path) {
     case 'admin/help#toolbar':
       $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Toolbar module displays links to top-level administration menu items and links from other modules at the top of the screen. For more information, see the online handbook entry for <a href="@toolbar">Toolbar module</a>.', array('@toolbar' => 'http://drupal.org/handbook/modules/toolbar/')) . '</p>';
+      $output .= '<p>' . t('The Toolbar module displays links to top-level administration menu items and links from other modules at the top of the screen. For more information, see the online handbook entry for <a href="@toolbar">Toolbar module</a>.', array('@toolbar' => 'http://drupal.org/documentation/modules/toolbar/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Displaying administrative links') . '</dt>';

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/tracker/tracker.info (original)
+++ branches/upstream/current-7/modules/tracker/tracker.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 core = 7.x
 files[] = tracker.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/tracker/tracker.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/tracker/tracker.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/tracker/tracker.install (original)
+++ branches/upstream/current-7/modules/tracker/tracker.install Thu May 10 18:20:18 2012
@@ -1,4 +1,9 @@
 <?php
+
+/**
+ * @file
+ * Install, update, and uninstall functions for tracker.module.
+ */
 
 /**
  * Implements hook_uninstall().

Modified: branches/upstream/current-7/modules/tracker/tracker.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/tracker/tracker.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/tracker/tracker.module (original)
+++ branches/upstream/current-7/modules/tracker/tracker.module Thu May 10 18:20:18 2012
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Enables tracking of recent content for users.
+ * Tracks recent content posted by a user or users.
  */
 
 /**
@@ -12,7 +12,7 @@
   switch ($path) {
     case 'admin/help#tracker':
       $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Tracker module displays the most recently added and updated content on your site, and allows you to follow new content created by each user. This module has no configuration options. For more information, see the online handbook entry for <a href="@tracker">Tracker module</a>.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) . '</p>';
+      $output .= '<p>' . t('The Tracker module displays the most recently added and updated content on your site, and allows you to follow new content created by each user. This module has no configuration options. For more information, see the online handbook entry for <a href="@tracker">Tracker module</a>.', array('@tracker' => 'http://drupal.org/documentation/modules/tracker/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Navigation') . '</dt>';
@@ -70,6 +70,11 @@
 
 /**
  * Implements hook_cron().
+ *
+ * Updates tracking information for any items still to be tracked. The variable
+ * 'tracker_index_nid' is set to ((the last node ID that was indexed) - 1) and
+ * used to select the nodes to be processed. If there are no remaining nodes to
+ * process, 'tracker_index_nid' will be 0.
  */
 function tracker_cron() {
   $max_nid = variable_get('tracker_index_nid', 0);
@@ -164,6 +169,8 @@
 
 /**
  * Implements hook_node_insert().
+ *
+ * Adds new tracking information for this node since it's new.
  */
 function tracker_node_insert($node, $arg = 0) {
   _tracker_add($node->nid, $node->uid, $node->changed);
@@ -171,6 +178,8 @@
 
 /**
  * Implements hook_node_update().
+ *
+ * Adds tracking information for this node since it's been updated.
  */
 function tracker_node_update($node, $arg = 0) {
   _tracker_add($node->nid, $node->uid, $node->changed);
@@ -178,6 +187,8 @@
 
 /**
  * Implements hook_node_delete().
+ *
+ * Deletes tracking information for a node.
  */
 function tracker_node_delete($node, $arg = 0) {
   db_delete('tracker_node')
@@ -196,7 +207,7 @@
  */
 function tracker_comment_update($comment) {
   // comment_save() calls hook_comment_publish() for all published comments
-  // so we to handle all other values here.
+  // so we need to handle all other values here.
   if ($comment->status != COMMENT_PUBLISHED) {
     _tracker_remove($comment->nid, $comment->uid, $comment->changed);
   }
@@ -227,7 +238,7 @@
 }
 
 /**
- * Update indexing tables when a node is added, updated or commented on.
+ * Updates indexing tables when a node is added, updated, or commented on.
  *
  * @param $nid
  *   A node ID.
@@ -266,7 +277,7 @@
 }
 
 /**
- * Determine the max timestamp between $node->changed and the last comment.
+ * Determines the max timestamp between $node->changed and the last comment.
  *
  * @param $nid
  *   A node ID.
@@ -288,7 +299,7 @@
 }
 
 /**
- * Clean up indexed data when nodes or comments are removed.
+ * Cleans up indexed data when nodes or comments are removed.
  *
  * @param $nid
  *  The node ID.
@@ -301,8 +312,8 @@
   $node = db_query('SELECT nid, status, uid, changed FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
 
   // The user only keeps his or her subscription if both of the following are true:
-  // (1) The node exists.
-  // (2) The user is either the node author or has commented on the node.
+  //   (1) The node exists.
+  //   (2) The user is either the node author or has commented on the node.
   $keep_subscription = FALSE;
 
   if ($node) {
@@ -311,7 +322,7 @@
 
     // Comments are a second reason to keep the user's subscription.
     if (!$keep_subscription) {
-      // Check if the user has commented at least once on the given nid
+      // Check if the user has commented at least once on the given nid.
       $keep_subscription = db_query_range('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND uid = :uid AND status = :status', 0, 1, array(
         ':nid' => $nid,
         ':uid' => $uid,
@@ -329,9 +340,8 @@
 
     // Now we need to update the (possibly) changed timestamps for other users
     // and the node itself.
-
     // We only need to do this if the removed item has a timestamp that equals
-    // or exceeds the listed changed timestamp for the node
+    // or exceeds the listed changed timestamp for the node.
     $tracker_node = db_query('SELECT nid, changed FROM {tracker_node} WHERE nid = :nid', array(':nid' => $nid))->fetchObject();
     if ($tracker_node && $changed >= $tracker_node->changed) {
       // If we're here, the item being removed is *possibly* the item that
@@ -356,7 +366,7 @@
         ))
         ->condition('nid', $nid)
         ->execute();
-   }
+    }
   }
   else {
     // If the node doesn't exist, remove everything.

Modified: branches/upstream/current-7/modules/tracker/tracker.pages.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/tracker/tracker.pages.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/tracker/tracker.pages.inc (original)
+++ branches/upstream/current-7/modules/tracker/tracker.pages.inc Thu May 10 18:20:18 2012
@@ -2,12 +2,15 @@
 
 /**
  * @file
- * User page callbacks for the tracker module.
+ * User page callbacks for tracker.module.
  */
 
 
 /**
- * Menu callback; prints a listing of active nodes on the site.
+ * Page callback: prints a listing of active nodes on the site.
+ *
+ * Queries the database for info, adds RDFa info if applicable, and generates
+ * the render array that will be used to render the page.
  */
 function tracker_page($account = NULL, $set_title = FALSE) {
   if ($account) {
@@ -38,23 +41,23 @@
 
   $rows = array();
   if (!empty($nodes)) {
-    // Now, get the data and put into the placeholder array
+    // Now, get the data and put into the placeholder array.
     $result = db_query('SELECT n.nid, n.title, n.type, n.changed, n.uid, u.name, l.comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {users} u ON n.uid = u.uid WHERE n.nid IN (:nids)', array(':nids' => array_keys($nodes)), array('target' => 'slave'));
     foreach ($result as $node) {
       $node->last_activity = $nodes[$node->nid]->changed;
       $nodes[$node->nid] = $node;
     }
 
-    // Finally display the data
+    // Display the data.
     foreach ($nodes as $node) {
-      // Determine the number of comments:
+      // Determine the number of comments.
       $comments = 0;
       if ($node->comment_count) {
         $comments = $node->comment_count;
 
         if ($new = comment_num_new($node->nid)) {
           $comments .= '<br />';
-          $comments .= l(format_plural($new, '1 new', '@count new'), 'node/'. $node->nid, array('fragment' => 'new'));
+          $comments .= l(format_plural($new, '1 new', '@count new'), 'node/' . $node->nid, array('fragment' => 'new'));
         }
       }
 
@@ -97,7 +100,7 @@
         $row['last updated'] += $mapping_last_activity;
 
         // We need to add the about attribute on the tr tag to specify which
-        // node the RDFa annoatations above apply to. We move the content of
+        // node the RDFa annotations above apply to. We move the content of
         // $row to a 'data' sub array so we can specify attributes for the row.
         $row = array('data' => $row);
         $row['about'] = url('node/' . $node->nid);

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/tracker/tracker.test (original)
+++ branches/upstream/current-7/modules/tracker/tracker.test Thu May 10 18:20:18 2012
@@ -5,8 +5,23 @@
  * Tests for tracker.module.
  */
 
+/**
+ * Defines a base class for testing tracker.module.
+ */
 class TrackerTest extends DrupalWebTestCase {
+
+  /**
+   * The main user for testing.
+   *
+   * @var object
+   */
   protected $user;
+
+  /**
+   * A second user that will 'create' comments and nodes.
+   *
+   * @var object
+   */
   protected $other_user;
 
   public static function getInfo() {
@@ -29,13 +44,13 @@
   }
 
   /**
-   * Test the presence of nodes on the global tracker listing.
+   * Tests for the presence of nodes on the global tracker listing.
    */
   function testTrackerAll() {
     $this->drupalLogin($this->user);
 
     $unpublished = $this->drupalCreateNode(array(
-      'title' =>$this->randomName(8),
+      'title' => $this->randomName(8),
       'status' => 0,
     ));
     $published = $this->drupalCreateNode(array(
@@ -55,7 +70,7 @@
   }
 
   /**
-   * Test the presence of nodes on a user's tracker listing.
+   * Tests for the presence of nodes on a user's tracker listing.
    */
   function testTrackerUser() {
     $this->drupalLogin($this->user);
@@ -101,7 +116,7 @@
   }
 
   /**
-   * Test the presence of the "new" flag for nodes.
+   * Tests for the presence of the "new" flag for nodes.
    */
   function testTrackerNewNodes() {
     $this->drupalLogin($this->user);
@@ -129,7 +144,7 @@
   }
 
   /**
-   * Test comment counters on the tracker listing.
+   * Tests for comment counters on the tracker listing.
    */
   function testTrackerNewComments() {
     $this->drupalLogin($this->user);
@@ -144,7 +159,8 @@
       'subject' => $this->randomName(),
       'comment_body[' . LANGUAGE_NONE . '][0][value]' => $this->randomName(20),
     );
-    $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save')); // The new comment is automatically viewed by the current user.
+    // The new comment is automatically viewed by the current user.
+    $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save'));
 
     $this->drupalLogin($this->other_user);
     $this->drupalGet('tracker');
@@ -157,7 +173,7 @@
       'comment_body[' . LANGUAGE_NONE . '][0][value]' => $this->randomName(20),
     );
     // If the comment is posted in the same second as the last one then Drupal
-    // can't tell a difference, so wait one second here.
+    // can't tell the difference, so we wait one second here.
     sleep(1);
     $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save'));
 
@@ -167,7 +183,7 @@
   }
 
   /**
-   * Test that existing nodes are indexed by cron.
+   * Tests that existing nodes are indexed by cron.
    */
   function testTrackerCronIndexing() {
     $this->drupalLogin($this->user);
@@ -213,7 +229,6 @@
     $this->assertText('1 new', t('New comment is counted on the tracker listing pages.'));
     $this->assertText('updated', t('Node is listed as updated'));
 
-
     // Fetch the site-wide tracker.
     $this->drupalGet('tracker');
 
@@ -225,7 +240,7 @@
   }
 
   /**
-   * Test that publish/unpublish works at admin/content/node
+   * Tests that publish/unpublish works at admin/content/node.
    */
   function testTrackerAdminUnpublish() {
     $admin_user = $this->drupalCreateUser(array('access content overview', 'administer nodes', 'bypass node access'));

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/translation/tests/translation_test.info (original)
+++ branches/upstream/current-7/modules/translation/tests/translation_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 version = VERSION
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/translation/translation.info (original)
+++ branches/upstream/current-7/modules/translation/translation.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 core = 7.x
 files[] = translation.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/translation/translation.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/translation/translation.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/translation/translation.module (original)
+++ branches/upstream/current-7/modules/translation/translation.module Thu May 10 18:20:18 2012
@@ -2,21 +2,21 @@
 
 /**
  * @file
- *   Manages content translations.
- *
- *   Translations are managed in sets of posts, which represent the same
- *   information in different languages. Only content types for which the
- *   administrator explicitly enabled translations could have translations
- *   associated. Translations are managed in sets with exactly one source
- *   post per set. The source post is used to translate to different
- *   languages, so if the source post is significantly updated, the
- *   editor can decide to mark all translations outdated.
- *
- *   The node table stores the values used by this module:
- *    - 'tnid' is the translation set id, which equals the node id
- *      of the source post.
- *    - 'translate' is a flag, either indicating that the translation
- *      is up to date (0) or needs to be updated (1).
+ * Manages content translations.
+ *
+ * Translations are managed in sets of posts, which represent the same
+ * information in different languages. Only content types for which the
+ * administrator has explicitly enabled translations could have translations
+ * associated. Translations are managed in sets with exactly one source post
+ * per set. The source post is used to translate to different languages, so if
+ * the source post is significantly updated, the editor can decide to mark all
+ * translations outdated.
+ *
+ * The node table stores the values used by this module:
+ * - tnid: Integer for the translation set ID, which equals the node ID of the
+ *   source post.
+ * - translate: Integer flag, either indicating that the translation is up to
+ *   date (0) or needs to be updated (1).
  */
 
 /**
@@ -32,11 +32,11 @@
     case 'admin/help#translation':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Content translation module allows content to be translated into different languages. Working with the <a href="@locale">Locale module</a> (which manages enabled languages and provides translation for the site interface), the Content translation module is key to creating and maintaining translated site content. For more information, see the online handbook entry for <a href="@translation">Content translation module</a>.', array('@locale' => url('admin/help/locale'), '@translation' => 'http://drupal.org/handbook/modules/translation/')) . '</p>';
+      $output .= '<p>' . t('The Content translation module allows content to be translated into different languages. Working with the <a href="@locale">Locale module</a> (which manages enabled languages and provides translation for the site interface), the Content translation module is key to creating and maintaining translated site content. For more information, see the online handbook entry for <a href="@translation">Content translation module</a>.', array('@locale' => url('admin/help/locale'), '@translation' => 'http://drupal.org/documentation/modules/translation/')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Configuring content types for translation') . '</dt>';
-      $output .= '<dd>' . t('To configure a particular content type for translation, visit the <a href="@content-types">Content types</a> page, and click the <em>edit</em> link for the content type. In the <em>Publishing options</em> section, select <em>Enabled, with translation</em> under <em>Multilingual support</em>.', array('@content-types' => url('admin/structure/types'))) . '</li></ul><dd>';
+      $output .= '<dd>' . t('To configure a particular content type for translation, visit the <a href="@content-types">Content types</a> page, and click the <em>edit</em> link for the content type. In the <em>Publishing options</em> section, select <em>Enabled, with translation</em> under <em>Multilingual support</em>.', array('@content-types' => url('admin/structure/types'))) . '</dd>';
       $output .= '<dt>' . t('Assigning a language to content') . '</dt>';
       $output .= '<dd>' . t('Use the <em>Language</em> drop down to select the appropriate language when creating or editing content.') . '</dd>';
       $output .= '<dt>' . t('Translating content') . '</dt>';
@@ -70,11 +70,18 @@
 }
 
 /**
- * Menu access callback.
- *
- * Only display translation tab for node types, which have translation enabled
- * and where the current node is not language neutral (which should span
- * all languages).
+ * Access callback: Checks that the user has permission to 'translate content'.
+ *
+ * Only displays the translation tab for nodes that are not language-neutral
+ * of types that have translation enabled.
+ *
+ * @param $node
+ *   A node object.
+ *
+ * @return
+ *   TRUE if the translation tab should be displayed, FALSE otherwise.
+ *
+ * @see translation_menu()
  */
 function _translation_tab_access($node) {
   if ($node->language != LANGUAGE_NONE && translation_supported_type($node->type) && node_access('view', $node)) {
@@ -107,7 +114,7 @@
 }
 
 /**
- * Implements hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter() for node_type_form().
  */
 function translation_form_node_type_form_alter(&$form, &$form_state) {
   // Add translation option to content type form.
@@ -117,10 +124,12 @@
 }
 
 /**
- * Implements hook_form_BASE_FORM_ID_alter().
- *
- * This function alters language fields on node edit forms when a translation is
- * about to be created.
+ * Implements hook_form_BASE_FORM_ID_alter() for node_form().
+ *
+ * Alters language fields on node edit forms when a translation is about to be
+ * created.
+ *
+ * @see node_form()
  */
 function translation_form_node_form_alter(&$form, &$form_state) {
   if (translation_supported_type($form['#node']->type)) {
@@ -200,9 +209,9 @@
 /**
  * Implements hook_node_view().
  *
- * Display translation links with native language names, if this node is part of
- * a translation set. If no language provider is enabled "fall back" to the
- * simple links built through the result of translation_node_get_translations().
+ * Displays translation links with language names if this node is part of a
+ * translation set. If no language provider is enabled, "fall back" to simple
+ * links built through the result of translation_node_get_translations().
  */
 function translation_node_view($node, $view_mode) {
   // If the site has no translations or is not multilingual we have no content
@@ -373,7 +382,7 @@
 /**
  * Implements hook_node_validate().
  *
- * Ensure that duplicate translations can not be created for the same source.
+ * Ensures that duplicate translations can't be created for the same source.
  */
 function translation_node_validate($node, $form) {
   // Only act on translatable nodes with a tnid or translation_source.
@@ -397,8 +406,10 @@
 }
 
 /**
- * Remove a node from its translation set (if any)
- * and update the set accordingly.
+ * Removes a node from its translation set and updates accordingly.
+ *
+ * @param $node
+ *   A node object.
  */
 function translation_remove_from_set($node) {
   if (isset($node->tnid)) {
@@ -432,17 +443,18 @@
 }
 
 /**
- * Get all nodes in a translation set, represented by $tnid.
+ * Gets all nodes in a given translation set.
  *
  * @param $tnid
- *   The translation source nid of the translation set, the identifier
- *   of the node used to derive all translations in the set.
+ *   The translation source nid of the translation set, the identifier of the
+ *   node used to derive all translations in the set.
+ *
  * @return
- *   Array of partial node objects (nid, title, language) representing
- *   all nodes in the translation set, in effect all translations
- *   of node $tnid, including node $tnid itself. Because these are
- *   partial nodes, you need to node_load() the full node, if you
- *   need more properties. The array is indexed by language code.
+ *   Array of partial node objects (nid, title, language) representing all
+ *   nodes in the translation set, in effect all translations of node $tnid,
+ *   including node $tnid itself. Because these are partial nodes, you need to
+ *   node_load() the full node, if you need more properties. The array is
+ *   indexed by language code.
  */
 function translation_node_get_translations($tnid) {
   if (is_numeric($tnid) && $tnid) {
@@ -468,21 +480,21 @@
  * Returns whether the given content type has support for translations.
  *
  * @return
- *   Boolean value.
+ *   TRUE if translation is supported, and FALSE if not.
  */
 function translation_supported_type($type) {
   return variable_get('language_content_type_' . $type, 0) == TRANSLATION_ENABLED;
 }
 
 /**
- * Return paths of all translations of a node, based on
- * its Drupal path.
+ * Returns the paths of all translations of a node, based on its Drupal path.
  *
  * @param $path
  *   A Drupal path, for example node/432.
+ *
  * @return
- *   An array of paths of translations of the node accessible
- *   to the current user keyed with language codes.
+ *   An array of paths of translations of the node accessible to the current
+ *   user, keyed with language codes.
  */
 function translation_path_get_translations($path) {
   $paths = array();
@@ -528,8 +540,8 @@
       else {
         // No translation in this language, or no permission to view.
         unset($links[$langcode]['href']);
-        $links[$langcode]['attributes']['class'] = 'locale-untranslated';
-      }
-    }
-  }
-}
+        $links[$langcode]['attributes']['class'][] = 'locale-untranslated';
+      }
+    }
+  }
+}

Modified: branches/upstream/current-7/modules/translation/translation.pages.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/translation/translation.pages.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/translation/translation.pages.inc (original)
+++ branches/upstream/current-7/modules/translation/translation.pages.inc Thu May 10 18:20:18 2012
@@ -2,14 +2,19 @@
 
 /**
  * @file
- * User page callbacks for the translation module.
+ * User page callbacks for the Translation module.
  */
 
 /**
- * Overview page for a node's translations.
+ * Page callback: Displays a list of a node's translations.
  *
  * @param $node
- *   Node object.
+ *   A node object.
+ *
+ * @return
+ *   A render array for a page containing a list of content.
+ *
+ * @see translation_menu()
  */
 function translation_node_overview($node) {
   include_once DRUPAL_ROOT . '/includes/language.inc';

Modified: branches/upstream/current-7/modules/translation/translation.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/translation/translation.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/translation/translation.test (original)
+++ branches/upstream/current-7/modules/translation/translation.test Thu May 10 18:20:18 2012
@@ -2,9 +2,12 @@
 
 /**
  * @file
- * Tests for translation.module
+ * Tests for the Translation module.
  */
 
+/**
+ * Functional tests for the Translation module.
+ */
 class TranslationTestCase extends DrupalWebTestCase {
   protected $book;
 
@@ -58,8 +61,7 @@
   }
 
   /**
-   * Create a basic page with translation, modify the basic page outdating
-   * translation, and update translation.
+   * Creates, modifies, and updates a basic page with a translation.
    */
   function testContentTranslation() {
     // Create Basic page in English.
@@ -151,7 +153,7 @@
   }
 
   /**
-   * Check that language switch links behave properly.
+   * Checks that the language switch links behave properly.
    */
   function testLanguageSwitchLinks() {
     // Create a Basic page in English and its translations in Spanish and
@@ -192,7 +194,7 @@
   }
 
   /**
-   * Test that the language switcher block alterations work as intended.
+   * Tests that the language switcher block alterations work as intended.
    */
   function testLanguageSwitcherBlockIntegration() {
     // Enable Italian to have three items in the language switcher block.
@@ -254,25 +256,30 @@
   }
 
   /**
-   * Reset static caches to make the test code match the client site behavior.
+   * Resets static caches to make the test code match the client-side behavior.
    */
   function resetCaches() {
     drupal_static_reset('locale_url_outbound_alter');
   }
 
   /**
-   * Return an empty node data structure.
+   * Returns an empty node data structure.
+   *
+   * @param $langcode
+   *   The language code.
+   *
+   * @return
+   *   An empty node data structure.
    */
   function emptyNode($langcode) {
     return (object) array('nid' => NULL, 'language' => $langcode);
   }
 
   /**
-   * Install a the specified language if it has not been already. Otherwise make sure that
-   * the language is enabled.
+   * Installs the specified language, or enables it if it is already installed.
    *
    * @param $language_code
-   *   The language code the check.
+   *   The language code to check.
    */
   function addLanguage($language_code) {
     // Check to make sure that language has not already been installed.
@@ -306,14 +313,17 @@
   }
 
   /**
-   * Create a "Basic page" in the specified language.
+   * Creates a "Basic page" in the specified language.
    *
    * @param $title
-   *   Title of basic page in specified language.
+   *   The title of a basic page in the specified language.
    * @param $body
-   *   Body of basic page in specified language.
-   * @param
-   *   $language Language code.
+   *   The body of a basic page in the specified language.
+   * @param $language
+   *   (optional) Language code.
+   *
+   * @return
+   *   A node object.
    */
   function createPage($title, $body, $language = NULL) {
     $edit = array();
@@ -334,17 +344,19 @@
   }
 
   /**
-   * Create a translation for the specified basic page in the specified
-   * language.
+   * Creates a translation for a basic page in the specified language.
    *
    * @param $node
-   *   The basic page to create translation for.
+   *   The basic page to create the translation for.
    * @param $title
-   *   Title of basic page in specified language.
+   *   The title of a basic page in the specified language.
    * @param $body
-   *   Body of basic page in specified language.
+   *   The body of a basic page in the specified language.
    * @param $language
    *   Language code.
+   *
+   * @return
+   *   Translation object.
    */
   function createTranslation($node, $title, $body, $language) {
     $this->drupalGet('node/add/page', array('query' => array('translation' => $node->nid, 'target' => $language)));
@@ -369,10 +381,10 @@
   }
 
   /**
-   * Assert that an element identified by the given XPath has the given content.
+   * Asserts an element identified by the given XPath has the given content.
    *
    * @param $xpath
-   *   XPath used to find the element.
+   *   The XPath used to find the element.
    * @param array $arguments
    *   An array of arguments with keys in the form ':name' matching the
    *   placeholders in the query. The values may be either strings or numeric
@@ -380,7 +392,7 @@
    * @param $value
    *   The text content of the matched element to assert.
    * @param $message
-   *   Message to display.
+   *   The message to display.
    * @param $group
    *   The group this message belongs to.
    *
@@ -393,7 +405,7 @@
   }
 
   /**
-   * Check that the specified language switch links are found/not found.
+   * Tests whether the specified language switch links are found.
    *
    * @param $node
    *   The node to display.
@@ -405,7 +417,7 @@
    *   The page areas to be checked.
    *
    * @return
-   *   TRUE if the language switch links are found/not found.
+   *   TRUE if the language switch links are found, FALSE if not.
    */
   function assertLanguageSwitchLinks($node, $translation, $find = TRUE, $types = NULL) {
     if (empty($types)) {
@@ -436,7 +448,7 @@
         $xpath = '//div[contains(@class, :type)]//a[@href=:url]';
       }
       else {
-        $xpath = '//div[contains(@class, :type)]//span[@class="locale-untranslated"]';
+        $xpath = '//div[contains(@class, :type)]//span[contains(@class, "locale-untranslated")]';
       }
 
       $found = $this->findContentByXPath($xpath, array(':type' => $type, ':url' => $url), $translation_language->native);
@@ -447,7 +459,19 @@
   }
 
   /**
-   * Search for elements matching the given xpath and value.
+   * Searches for elements matching the given xpath and value.
+   *
+   * @param $xpath
+   *   The XPath used to find the element.
+   * @param array $arguments
+   *   An array of arguments with keys in the form ':name' matching the
+   *   placeholders in the query. The values may be either strings or numeric
+   *   values.
+   * @param $value
+   *   The text content of the matched element to assert.
+   *
+   * @return
+   *   TRUE if found, otherwise FALSE.
    */
   function findContentByXPath($xpath, array $arguments = array(), $value = NULL) {
     $elements = $this->xpath($xpath, $arguments);

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/tests/trigger_test.info (original)
+++ branches/upstream/current-7/modules/trigger/tests/trigger_test.info Thu May 10 18:20:18 2012
@@ -4,8 +4,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/trigger/tests/trigger_test.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/trigger/tests/trigger_test.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/tests/trigger_test.module (original)
+++ branches/upstream/current-7/modules/trigger/tests/trigger_test.module Thu May 10 18:20:18 2012
@@ -57,7 +57,7 @@
 function trigger_test_trigger_info() {
   // Register triggers that this module provides. The first is an additional
   // node trigger and the second is our own, which should create a new tab
-  // on the trigger assignment page.
+  // on the trigger assignment page. The last tests long trigger names.
   return array(
     'node' => array(
       'node_triggertest' => array(
@@ -67,6 +67,9 @@
     'trigger_test' => array(
       'trigger_test_triggertest' => array(
         'label' => t('Another test trigger is fired'),
+      ),
+      'trigger_test_we_sweat_it_out_in_the_streets_of_a_runaway_american_dream' => array(
+        'label' => t('A test trigger with a name over 64 characters'),
       ),
     ),
   );

Modified: branches/upstream/current-7/modules/trigger/trigger.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/trigger/trigger.admin.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/trigger.admin.inc (original)
+++ branches/upstream/current-7/modules/trigger/trigger.admin.inc Thu May 10 18:20:18 2012
@@ -6,13 +6,16 @@
  */
 
 /**
- * Builds the form that allows users to assign actions to triggers.
+ * Builds a form that allows users to assign actions to triggers.
  *
  * @param $module_to_display
- *   Which tab of triggers to display. E.g., 'node' for all
- *   node-related triggers.
+ *   Which tab of triggers to display. E.g., 'node' for all node-related
+ *   triggers.
+ *
  * @return
  *   HTML form.
+ *
+ * @see trigger_menu()
  */
 function trigger_assign($module_to_display = NULL) {
   // If no type is specified we default to node actions, since they
@@ -36,16 +39,18 @@
 }
 
 /**
- * Confirm removal of an assigned action.
+ * Form constructor for confirmation page for removal of an assigned action.
  *
  * @param $module
  *   The tab of triggers the user will be directed to after successful
  *   removal of the action, or if the confirmation form is cancelled.
  * @param $hook
+ *   The name of the trigger hook, e.g., 'node_insert'.
  * @param $aid
  *   The action ID.
+ *
+ * @see trigger_unassign_submit()
  * @ingroup forms
- * @see trigger_unassign_submit()
  */
 function trigger_unassign($form, $form_state, $module, $hook = NULL, $aid = NULL) {
   if (!($hook && $aid)) {
@@ -79,7 +84,7 @@
 }
 
 /**
- * Submit callback for trigger_unassign() form.
+ * Form submission handler for trigger_unassign().
  */
 function trigger_unassign_submit($form, &$form_state) {
   if ($form_state['values']['confirm'] == 1) {
@@ -88,6 +93,7 @@
       ->condition('hook', $form_state['values']['hook'])
       ->condition('aid', $aid)
       ->execute();
+    drupal_static_reset('trigger_get_assigned_actions');
     $actions = actions_get_all_actions();
     watchdog('actions', 'Action %action has been unassigned.',  array('%action' => $actions[$aid]['label']));
     drupal_set_message(t('Action %action has been unassigned.', array('%action' => $actions[$aid]['label'])));
@@ -108,9 +114,9 @@
  * @param $label
  *   A plain English description of what this trigger does.
  *
- * @ingoup forms
  * @see trigger_assign_form_validate()
  * @see trigger_assign_form_submit()
+ * @ingroup forms
  */
 function trigger_assign_form($form, $form_state, $module, $hook, $label) {
   $form['module'] = array(
@@ -197,9 +203,11 @@
 }
 
 /**
- * Validation function for trigger_assign_form().
+ * Form validation handler for trigger_assign_form().
  *
  * Makes sure that the user is not re-assigning an action to an event.
+ *
+ * @see trigger_assign_form_submit()
  */
 function trigger_assign_form_validate($form, $form_state) {
   $form_values = $form_state['values'];
@@ -216,7 +224,9 @@
 }
 
 /**
- * Submit function for trigger_assign_form().
+ * Form submission handler for trigger_assign_form().
+ *
+ * @see trigger_assign_form_validate()
  */
 function trigger_assign_form_submit($form, &$form_state) {
   if (!empty($form_state['values']['aid'])) {
@@ -271,6 +281,7 @@
       }
     }
   }
+  drupal_static_reset('trigger_get_assigned_actions');
 }
 
 /**
@@ -306,4 +317,3 @@
   }
   return $output;
 }
-

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/trigger.info (original)
+++ branches/upstream/current-7/modules/trigger/trigger.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = trigger.test
 configure = admin/structure/trigger
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/trigger/trigger.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/trigger/trigger.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/trigger.install (original)
+++ branches/upstream/current-7/modules/trigger/trigger.install Thu May 10 18:20:18 2012
@@ -9,12 +9,14 @@
  * Implements hook_schema().
  */
 function trigger_schema() {
+  // The total index length (hook and aid) must be less than 333. Since the aid
+  // field is 255 characters, the hook field can have a maximum length of 78.
   $schema['trigger_assignments'] = array(
     'description' => 'Maps trigger to hook and operation assignments from trigger.module.',
     'fields' => array(
       'hook' => array(
         'type' => 'varchar',
-        'length' => 32,
+        'length' => 78,
         'not null' => TRUE,
         'default' => '',
         'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.',
@@ -53,9 +55,15 @@
 }
 
 /**
- * Adds operation names to the hook names and drops the "op" field.
+ * Alter the "hook" field and drop the "op field" of {trigger_assignments}.
+ *
+ * Increase the length of the "hook" field to 78 characters and adds operation
+ * names to the hook names, and drops the "op" field.
  */
 function trigger_update_7000() {
+  db_drop_primary_key('trigger_assignments');
+  db_change_field('trigger_assignments', 'hook', 'hook', array('type' => 'varchar', 'length' => 78, 'not null' => TRUE, 'default' => '', 'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.'));
+
   $result = db_query("SELECT hook, op, aid FROM {trigger_assignments} WHERE op <> ''");
 
   foreach ($result as $record) {
@@ -67,4 +75,33 @@
       ->execute();
   }
   db_drop_field('trigger_assignments', 'op');
+
+  db_add_primary_key('trigger_assignments', array('hook', 'aid'));
 }
+
+/**
+ * Increase the length of the "hook" field to 78 characters.
+ *
+ * This is a separate function for those who ran an older version of
+ * trigger_update_7000() that did not do this.
+ */
+function trigger_update_7001() {
+  db_drop_primary_key('trigger_assignments');
+  db_change_field('trigger_assignments', 'hook', 'hook', array('type' => 'varchar', 'length' => 78, 'not null' => TRUE, 'default' => '', 'description' => 'Primary Key: The name of the internal Drupal hook; for example, node_insert.', ), array('primary key' => array('hook', 'aid')));
+}
+
+/**
+ * Renames nodeapi to node.
+ */
+function trigger_update_7002() {
+  $result = db_query("SELECT hook, aid FROM {trigger_assignments}");
+
+  foreach($result as $record) {
+    $new_hook = str_replace('nodeapi', 'node', $record->hook);
+    db_update('trigger_assignments')
+      ->fields(array('hook' => $new_hook))
+      ->condition('hook', $record->hook)
+      ->condition('aid', $record->aid)
+      ->execute();
+  }
+}

Modified: branches/upstream/current-7/modules/trigger/trigger.module
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/trigger/trigger.module?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/trigger.module (original)
+++ branches/upstream/current-7/modules/trigger/trigger.module Thu May 10 18:20:18 2012
@@ -2,8 +2,7 @@
 
 /**
  * @file
- * Enables functions to be stored and executed at a later time when
- * triggered by other modules or by one of Drupal's core API hooks.
+ * Enables functions to be stored and executed at a later time.
  */
 
 /**
@@ -27,7 +26,7 @@
   if ($path == 'admin/help#trigger') {
     $output = '';
     $output .= '<h3>' . t('About') . '</h3>';
-    $output .= '<p>' . t('The Trigger module provides the ability to cause <em>actions</em> to run when certain <em>triggers</em> take place on your site. Triggers are events, such as new content being added to your site or a user logging in, and actions are tasks, such as unpublishing content or e-mailing an administrator. For more information, see the online handbook entry for <a href="@trigger">Trigger module</a>.', array('@trigger' => 'http://drupal.org/handbook/modules/trigger/')) . '</p>';
+    $output .= '<p>' . t('The Trigger module provides the ability to cause <em>actions</em> to run when certain <em>triggers</em> take place on your site. Triggers are events, such as new content being added to your site or a user logging in, and actions are tasks, such as unpublishing content or e-mailing an administrator. For more information, see the online handbook entry for <a href="@trigger">Trigger module</a>.', array('@trigger' => 'http://drupal.org/documentation/modules/trigger/')) . '</p>';
     $output .= '<h3>' . t('Uses') . '</h3>';
     $output .= '<dl>';
     $output .= '<dt>' . t('Configuring triggers and actions') . '</dt>';
@@ -158,15 +157,20 @@
  *
  * @param $hook
  *   The name of the hook being fired.
+ *
  * @return
  *   An array whose keys are action IDs that the user has associated with
  *   this trigger, and whose values are arrays containing the action type and
  *   label.
  */
 function trigger_get_assigned_actions($hook) {
-  return db_query("SELECT ta.aid, a.type, a.label FROM {trigger_assignments} ta LEFT JOIN {actions} a ON ta.aid = a.aid WHERE ta.hook = :hook ORDER BY ta.weight", array(
-    ':hook' => $hook,
-  ))->fetchAllAssoc( 'aid', PDO::FETCH_ASSOC);
+  $actions = &drupal_static(__FUNCTION__, array());
+  if (!isset($actions[$hook])) {
+    $actions[$hook] = db_query("SELECT ta.aid, a.type, a.label FROM {trigger_assignments} ta LEFT JOIN {actions} a ON ta.aid = a.aid WHERE ta.hook = :hook ORDER BY ta.weight", array(
+      ':hook' => $hook,
+    ))->fetchAllAssoc('aid', PDO::FETCH_ASSOC);
+  }
+  return $actions[$hook];
 }
 
 /**
@@ -231,8 +235,8 @@
  *
  * @param $node
  *   Node object.
- * @param $op
- *   Operation to trigger.
+ * @param $hook
+ *   Hook to trigger.
  * @param $a3
  *   Additional argument to action function.
  * @param $a4
@@ -384,8 +388,8 @@
  *
  * @param $a1
  *   Comment object or array of form values.
- * @param $op
- *   Operation to trigger.
+ * @param $hook
+ *   Hook to trigger.
  */
 function _trigger_comment($a1, $hook) {
   // Keep objects for reuse so that changes actions make to objects can persist.
@@ -442,6 +446,7 @@
  *   The type of action that is about to be called.
  * @param $account
  *   The account object that was passed via the user hook.
+ *
  * @return
  *   The object expected by the action that is about to be called.
  */
@@ -518,6 +523,15 @@
 
 /**
  * Calls action functions for user triggers.
+ *
+ * @param $hook
+ *   The hook that called this function.
+ * @param $edit
+ *   Edit variable passed in to the hook or empty array if not needed.
+ * @param $account
+ *   Account variable passed in to the hook.
+ * @param $method
+ *   Method variable passed in to the hook or NULL if not needed.
  */
 function _trigger_user($hook, &$edit, $account, $category = NULL) {
   // Keep objects for reuse so that changes actions make to objects can persist.
@@ -592,10 +606,14 @@
   db_delete('trigger_assignments')
     ->condition('aid', $aid)
     ->execute();
+  drupal_static_reset('trigger_get_assigned_actions');
 }
 
 /**
  * Retrieves and caches information from hook_trigger_info() implementations.
+ *
+ * @return
+ *   Array of all triggers.
  */
 function _trigger_get_all_info() {
   $triggers = &drupal_static(__FUNCTION__);

Modified: branches/upstream/current-7/modules/trigger/trigger.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/trigger/trigger.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/trigger/trigger.test (original)
+++ branches/upstream/current-7/modules/trigger/trigger.test Thu May 10 18:20:18 2012
@@ -11,7 +11,7 @@
 class TriggerWebTestCase extends DrupalWebTestCase {
 
   /**
-   * Configure an advanced action.
+   * Configures an advanced action.
    *
    * @param $action
    *   The name of the action callback. For example: 'user_block_user_action'
@@ -344,6 +344,7 @@
 
     $edit = array('aid' => drupal_hash_base64($aid));
     $this->drupalPost('admin/structure/trigger/user', $edit, t('Assign'), array(), array(), $form_html_id);
+    drupal_static_reset('trigger_get_asssigned_actions');
   }
 
 
@@ -372,6 +373,7 @@
 
     $edit = array('aid' => drupal_hash_base64($aid));
     $this->drupalPost('admin/structure/trigger/user', $edit, t('Assign'), array(), array(), $form_html_id);
+    drupal_static_reset('trigger_get_assigned_actions');
   }
 
   /**

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=2263&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 Thu May 10 18:20:18 2012
@@ -4,8 +4,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -4,8 +4,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&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 Thu May 10 18:20:18 2012
@@ -4,8 +4,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info (original)
+++ branches/upstream/current-7/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info Thu May 10 18:20:18 2012
@@ -3,8 +3,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: 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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info (original)
+++ branches/upstream/current-7/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info Thu May 10 18:20:18 2012
@@ -4,8 +4,8 @@
 base theme = update_test_basetheme
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/tests/update_test.info (original)
+++ branches/upstream/current-7/modules/update/tests/update_test.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/update/update.fetch.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/update.fetch.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/update.fetch.inc (original)
+++ branches/upstream/current-7/modules/update/update.fetch.inc Thu May 10 18:20:18 2012
@@ -237,12 +237,22 @@
   if (empty($fetch_tasks[$cid])) {
     $queue = DrupalQueue::get('update_fetch_tasks');
     $queue->createItem($project);
-    db_insert('cache_update')
-      ->fields(array(
-        'cid' => $cid,
-        'created' => REQUEST_TIME,
-      ))
-      ->execute();
+    // Due to race conditions, it is possible that another process already
+    // inserted a row into the {cache_update} table and the following query will
+    // throw an exception.
+    // @todo: Remove the need for the manual check by relying on a queue that
+    // enforces unique items.
+    try {
+      db_insert('cache_update')
+        ->fields(array(
+          'cid' => $cid,
+          'created' => REQUEST_TIME,
+        ))
+        ->execute();
+    }
+    catch (Exception $e) {
+      // The exception can be ignored safely.
+    }
     $fetch_tasks[$cid] = REQUEST_TIME;
   }
 }
@@ -271,7 +281,7 @@
   // in the first place, and if this is not a disabled module or theme. We do
   // not want to record usage statistics for disabled code.
   if (!empty($site_key) && (strpos($project['project_type'], 'disabled') === FALSE)) {
-    $url .= (strpos($url, '?') === TRUE) ? '&' : '?';
+    $url .= (strpos($url, '?') !== FALSE) ? '&' : '?';
     $url .= 'site_key=';
     $url .= rawurlencode($site_key);
     if (!empty($project['info']['version'])) {

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/update.info (original)
+++ branches/upstream/current-7/modules/update/update.info Thu May 10 18:20:18 2012
@@ -6,8 +6,8 @@
 files[] = update.test
 configure = admin/reports/updates/settings
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/update.module (original)
+++ branches/upstream/current-7/modules/update/update.module Thu May 10 18:20:18 2012
@@ -81,7 +81,7 @@
     case 'admin/help#update':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t("The Update manager module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts administrators to available updates. In order to provide update information, anonymous usage statistics are sent to Drupal.org. If desired, you may disable the Update manager module from the <a href='@modules'>Module administration page</a>. For more information, see the online handbook entry for <a href='@update'>Update manager module</a>.", array('@update' => 'http://drupal.org/handbook/modules/update', '@modules' => url('admin/modules'))) . '</p>';
+      $output .= '<p>' . t("The Update manager module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts administrators to available updates. In order to provide update information, anonymous usage statistics are sent to Drupal.org. If desired, you may disable the Update manager module from the <a href='@modules'>Module administration page</a>. For more information, see the online handbook entry for <a href='@update'>Update manager module</a>.", array('@update' => 'http://drupal.org/documentation/modules/update', '@modules' => url('admin/modules'))) . '</p>';
       // Only explain the Update manager if it has not been disabled.
       if (update_manager_access()) {
         $output .= '<p>' . t('The Update manager also allows administrators to update and install modules and themes through the administration interface.') . '</p>';
@@ -93,7 +93,7 @@
       // Only explain the Update manager if it has not been disabled.
       if (update_manager_access()) {
         $output .= '<dt>' . t('Performing updates through the user interface') . '</dt>';
-        $output .= '<dd>' . t('The Update manager module allows administrators to perform updates directly through the administration interface. At the top of the <a href="@modules_page">modules</a> and <a href="@themes_page">themes</a> pages you will see a link to update to new releases. This will direct you to the <a href="@update-page">update page</a> where you see a listing of all the missing updates and confirm which ones you want to upgrade. From there, you are prompted for your FTP/SSH password, which then transfers the files into your Drupal installation, overwriting your old files. More detailed instructions can be found in the <a href="@update">online handbook</a>.', array('@modules_page' => url('admin/modules'), '@themes_page' => url('admin/appearance'),  '@update-page' => url('admin/reports/updates/update'), '@update' => 'http://drupal.org/handbook/modules/update')) . '</dd>';
+        $output .= '<dd>' . t('The Update manager module allows administrators to perform updates directly through the administration interface. At the top of the <a href="@modules_page">modules</a> and <a href="@themes_page">themes</a> pages you will see a link to update to new releases. This will direct you to the <a href="@update-page">update page</a> where you see a listing of all the missing updates and confirm which ones you want to upgrade. From there, you are prompted for your FTP/SSH password, which then transfers the files into your Drupal installation, overwriting your old files. More detailed instructions can be found in the <a href="@update">online handbook</a>.', array('@modules_page' => url('admin/modules'), '@themes_page' => url('admin/appearance'),  '@update-page' => url('admin/reports/updates/update'), '@update' => 'http://drupal.org/documentation/modules/update')) . '</dd>';
         $output .= '<dt>' . t('Installing new modules and themes through the user interface') . '</dt>';
         $output .= '<dd>' . t('You can also install new modules and themes in the same fashion, through the <a href="@install">install page</a>, or by clicking the <em>Install new module/theme</em> link at the top of the <a href="@modules_page">modules</a> and <a href="@themes_page">themes</a> pages. In this case, you are prompted to provide either the URL to the download, or to upload a packaged release file from your local computer.', array('@modules_page' => url('admin/modules'), '@themes_page' => url('admin/appearance'), '@install' => url('admin/reports/updates/install'))) . '</dd>';
       }
@@ -809,14 +809,19 @@
  *
  * @param $cid
  *   Optional cache ID of the record to clear from the private update module
- *   cache. If empty, all records will be cleared from the table.
+ *   cache. If empty, all records will be cleared from the table except
+ *   fetch tasks.
  * @param $wildcard
  *   If $wildcard is TRUE, cache IDs starting with $cid are deleted in
  *   addition to the exact cache ID specified by $cid.
  */
 function _update_cache_clear($cid = NULL, $wildcard = FALSE) {
   if (empty($cid)) {
-    db_truncate('cache_update')->execute();
+    db_delete('cache_update')
+      // Clear everything except fetch task information because these are used
+      // to ensure that the fetch task queue items are not added multiple times.
+      ->condition('cid', 'fetch_task::%', 'NOT LIKE')
+      ->execute();
   }
   else {
     $query = db_delete('cache_update');

Modified: branches/upstream/current-7/modules/update/update.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/update/update.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/update/update.test (original)
+++ branches/upstream/current-7/modules/update/update.test Thu May 10 18:20:18 2012
@@ -225,6 +225,33 @@
     $this->assertUniqueText(t('Failed to get available update data for one project.'));
   }
 
+  /**
+   * Tests that exactly one fetch task per project is created and not more.
+   */
+  function testFetchTasks() {
+    $projecta = array(
+      'name' => 'aaa_update_test',
+    );
+    $projectb = array(
+      'name' => 'bbb_update_test',
+    );
+    $queue = DrupalQueue::get('update_fetch_tasks');
+    $this->assertEqual($queue->numberOfItems(), 0, 'Queue is empty');
+    update_create_fetch_task($projecta);
+    $this->assertEqual($queue->numberOfItems(), 1, 'Queue contains one item');
+    update_create_fetch_task($projectb);
+    $this->assertEqual($queue->numberOfItems(), 2, 'Queue contains two items');
+    // Try to add project a again.
+    update_create_fetch_task($projecta);
+    $this->assertEqual($queue->numberOfItems(), 2, 'Queue still contains two items');
+
+    // Clear cache and try again.
+    _update_cache_clear();
+    drupal_static_reset('_update_create_fetch_task');
+    update_create_fetch_task($projecta);
+    $this->assertEqual($queue->numberOfItems(), 2, 'Queue contains two items');
+  }
+
   protected function setSystemInfo7_0() {
     $setting = array(
       '#all' => array(
@@ -649,7 +676,7 @@
    * Ensure that archiver extensions are properly merged in the UI.
    */
   function testFileNameExtensionMerging() {
-    $this->drupalGet('admin/modules/install');    
+    $this->drupalGet('admin/modules/install');
     // Make sure the bogus extension supported by update_test.module is there.
     $this->assertPattern('/file extensions are supported:.*update-test-extension/', t("Found 'update-test-extension' extension"));
     // Make sure it didn't clobber the first option from core.
@@ -697,3 +724,57 @@
   }
 
 }
+
+class UpdateCoreUnitTestCase extends DrupalUnitTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => "Unit tests",
+      'description' => 'Test update funcionality unrelated to the database.',
+      'group' => 'Update',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('update');
+    module_load_include('inc', 'update', 'update.fetch');
+  }
+
+  /**
+   * Tests _update_build_fetch_url according to issue 1481156
+   */
+  function testUpdateBuildFetchUrl() {
+    //first test that we didn't break the trivial case
+    $project['name'] = 'update_test';
+    $project['project_type'] = '';
+    $project['info']['version'] = '';
+    $project['info']['project status url'] = 'http://www.example.com';
+    $site_key = '';
+    $expected = 'http://www.example.com/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY;
+    $url = _update_build_fetch_url($project, $site_key);
+    $this->assertEqual($url, $expected, "'$url' when no site_key provided should be '$expected'.");
+
+    //For disabled projects it shouldn't add the site key either.
+    $site_key = 'site_key';
+    $project['project_type'] = 'disabled';
+    $expected = 'http://www.example.com/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY;
+    $url = _update_build_fetch_url($project, $site_key);
+    $this->assertEqual($url, $expected, "'$url' should be '$expected' for disabled projects.");
+
+    //for enabled projects, adding the site key
+    $project['project_type'] = '';
+    $expected = 'http://www.example.com/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY;
+    $expected .= '?site_key=site_key';
+    $url = _update_build_fetch_url($project, $site_key);
+    $this->assertEqual($url, $expected, "When site_key provided, '$url' should be '$expected'.");
+
+    // http://drupal.org/node/1481156 test incorrect logic when url contains
+    // a question mark.
+    $project['info']['project status url'] = 'http://www.example.com/?project=';
+    $expected = 'http://www.example.com/?project=/' . $project['name'] . '/' . DRUPAL_CORE_COMPATIBILITY;
+    $expected .= '&site_key=site_key';
+    $url = _update_build_fetch_url($project, $site_key);
+    $this->assertEqual($url, $expected, "When ? is present, '$url' should be '$expected'.");
+
+  }
+}

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=2263&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 Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/modules/user/user.admin.inc
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/user/user.admin.inc?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.admin.inc (original)
+++ branches/upstream/current-7/modules/user/user.admin.inc Thu May 10 18:20:18 2012
@@ -413,6 +413,7 @@
     '#maxlength' => 10,
     '#field_suffix' => ' ' . t('KB'),
     '#description' => t('Maximum allowed file size for uploaded pictures. Upload size is normally limited only by the PHP maximum post and file upload settings, and images are automatically scaled down to the dimensions specified above.'),
+    '#element_validate' => array('element_validate_integer_positive'),
   );
   $form['personalization']['pictures']['user_picture_guidelines'] = array(
     '#type' => 'textarea',

Modified: branches/upstream/current-7/modules/user/user.api.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/user/user.api.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.api.php (original)
+++ branches/upstream/current-7/modules/user/user.api.php Thu May 10 18:20:18 2012
@@ -224,9 +224,10 @@
  * @see hook_user_update()
  */
 function hook_user_presave(&$edit, $account, $category) {
-  // Make sure that our form value 'mymodule_foo' is stored as 'mymodule_bar'.
+  // Make sure that our form value 'mymodule_foo' is stored as
+  // 'mymodule_bar' in the 'data' (serialized) column.
   if (isset($edit['mymodule_foo'])) {
-    $edit['data']['my_module_foo'] = $edit['my_module_foo'];
+    $edit['data']['mymodule_bar'] = $edit['mymodule_foo'];
   }
 }
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.info (original)
+++ branches/upstream/current-7/modules/user/user.info Thu May 10 18:20:18 2012
@@ -9,8 +9,8 @@
 configure = admin/config/people
 stylesheets[all][] = user.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.install (original)
+++ branches/upstream/current-7/modules/user/user.install Thu May 10 18:20:18 2012
@@ -120,6 +120,8 @@
     ),
   );
 
+  // The table name here is plural, despite Drupal table naming standards,
+  // because "user" is a reserved word in many databases.
   $schema['users'] = array(
     'description' => 'Stores user data.',
     'fields' => array(
@@ -234,6 +236,7 @@
       'access' => array('access'),
       'created' => array('created'),
       'mail' => array('mail'),
+      'picture' => array('picture'),
     ),
     'unique keys' => array(
       'name' => array('name'),
@@ -890,3 +893,21 @@
 /**
  * @} End of "addtogroup updates-6.x-to-7.x"
  */
+
+/**
+ * @addtogroup updates-7.x-extra
+ * @{
+ */
+
+/**
+ * Ensure there is an index on {users}.picture.
+ */
+function user_update_7018() {
+  if (!db_index_exists('users', 'picture')) {
+    db_add_index('users', 'picture', array('picture'));
+  }
+}
+
+/**
+ * @} End of "addtogroup updates-7.x-extra"
+ */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.js (original)
+++ branches/upstream/current-7/modules/user/user.js Thu May 10 18:20:18 2012
@@ -95,10 +95,10 @@
 Drupal.evaluatePasswordStrength = function (password, translate) {
   var weaknesses = 0, strength = 100, msg = [];
 
-  var hasLowercase = password.match(/[a-z]+/);
-  var hasUppercase = password.match(/[A-Z]+/);
-  var hasNumbers = password.match(/[0-9]+/);
-  var hasPunctuation = password.match(/[^a-zA-Z0-9]+/);
+  var hasLowercase = /[a-z]+/.test(password);
+  var hasUppercase = /[A-Z]+/.test(password);
+  var hasNumbers = /[0-9]+/.test(password);
+  var hasPunctuation = /[^a-zA-Z0-9]+/.test(password);
 
   // If there is a username edit box on the page, compare password to that, otherwise
   // use value from the database.
@@ -180,7 +180,7 @@
   attach: function (context, settings) {
     var $checkbox = $('form#field-ui-field-edit-form input#edit-instance-settings-user-register-form');
 
-    if ($checkbox.size()) {
+    if ($checkbox.length) {
       $('input#edit-instance-required', context).once('user-register-form-checkbox', function () {
         $(this).bind('change', function (e) {
           if ($(this).attr('checked')) {

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.module (original)
+++ branches/upstream/current-7/modules/user/user.module Thu May 10 18:20:18 2012
@@ -41,7 +41,7 @@
     case 'admin/help#user':
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The User module allows users to register, log in, and log out. It also allows users with proper permissions to manage user roles (used to classify users) and permissions associated with those roles. For more information, see the online handbook entry for <a href="@user">User module</a>.', array('@user' => 'http://drupal.org/handbook/modules/user')) . '</p>';
+      $output .= '<p>' . t('The User module allows users to register, log in, and log out. It also allows users with proper permissions to manage user roles (used to classify users) and permissions associated with those roles. For more information, see the online handbook entry for <a href="@user">User module</a>.', array('@user' => 'http://drupal.org/documentation/modules/user')) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Creating and managing users') . '</dt>';
@@ -493,6 +493,10 @@
           file_delete($account->original->picture);
         }
       }
+      elseif (isset($edit['picture_delete']) && $edit['picture_delete']) {
+        file_usage_delete($account->original->picture, 'user', 'user', $account->uid);
+        file_delete($account->original->picture);
+      }
       $account->picture = empty($account->picture->fid) ? 0 : $account->picture->fid;
 
       // Do not allow 'uid' to be changed.
@@ -1282,7 +1286,7 @@
 }
 
 function user_login_block($form) {
-  $form['#action'] = url($_GET['q'], array('query' => drupal_get_destination()));
+  $form['#action'] = url(current_path(), array('query' => drupal_get_destination(), 'external' => FALSE));
   $form['#id'] = 'user-login-form';
   $form['#validate'] = user_login_default_validators();
   $form['#submit'][] = 'user_login_submit';
@@ -2739,7 +2743,7 @@
   if ($replace) {
     // We do not sanitize the token replacement, since the output of this
     // replacement is intended for an e-mail message, not a web browser.
-    return token_replace($text, $variables, array('language' => $language, 'callback' => 'user_mail_tokens', 'sanitize' => FALSE));
+    return token_replace($text, $variables, array('language' => $language, 'callback' => 'user_mail_tokens', 'sanitize' => FALSE, 'clear' => TRUE));
   }
 
   return $text;
@@ -3385,15 +3389,6 @@
       $query->condition($filters[$key]['field'], $value);
     }
   }
-}
-
-/**
- * Implements hook_forms().
- */
-function user_forms() {
-  $forms['user_admin_access_add_form']['callback'] = 'user_admin_access_form';
-  $forms['user_admin_access_edit_form']['callback'] = 'user_admin_access_form';
-  return $forms;
 }
 
 /**
@@ -3688,6 +3683,14 @@
 
   $admin = user_access('administer users');
 
+  // Pass access information to the submit handler. Running an access check
+  // inside the submit function interferes with form processing and breaks
+  // hook_form_alter().
+  $form['administer_users'] = array(
+     '#type' => 'value',
+     '#value' => $admin,
+  );
+
   // If we aren't admin but already logged on, go to the user page instead.
   if (!$admin && $user->uid) {
     drupal_goto('user/' . $user->uid);
@@ -3746,7 +3749,7 @@
  * @see user_register_form()
  */
 function user_register_submit($form, &$form_state) {
-  $admin = user_access('administer users');
+  $admin = $form_state['values']['administer_users'];
 
   if (!variable_get('user_email_verification', TRUE) || $admin) {
     $pass = $form_state['values']['pass'];

Modified: branches/upstream/current-7/modules/user/user.test
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/modules/user/user.test?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/modules/user/user.test (original)
+++ branches/upstream/current-7/modules/user/user.test Thu May 10 18:20:18 2012
@@ -1080,6 +1080,50 @@
     $this->assertEqual($pic_path, (string) $elements[0]['src'], t("User picture source is correct."));
   }
 
+  /**
+   * Tests deletion of user pictures.
+   */
+  function testDeletePicture() {
+    $this->drupalLogin($this->user);
+
+    $image = current($this->drupalGetTestFiles('image'));
+    $info = image_get_info($image->uri);
+
+    // Set new variables: valid dimensions, valid filesize (0 = no limit).
+    $test_dim = ($info['width'] + 10) . 'x' . ($info['height'] + 10);
+    variable_set('user_picture_dimensions', $test_dim);
+    variable_set('user_picture_file_size', 0);
+
+    // Save a new picture.
+    $edit = array('files[picture_upload]' => drupal_realpath($image->uri));
+    $this->drupalPost('user/' . $this->user->uid . '/edit', $edit, t('Save'));
+
+    // Load actual user data from database.
+    $account = user_load($this->user->uid, TRUE);
+    $pic_path = isset($account->picture) ? $account->picture->uri : NULL;
+
+    // Check if image is displayed in user's profile page.
+    $this->drupalGet('user');
+    $this->assertRaw(file_uri_target($pic_path), "Image is displayed in user's profile page");
+
+    // Check if file is located in proper directory.
+    $this->assertTrue(is_file($pic_path), 'File is located in proper directory');
+
+    $edit = array('picture_delete' => 1);
+    $this->drupalPost('user/' . $this->user->uid . '/edit', $edit, t('Save'));
+
+    // Load actual user data from database.
+    $account1 = user_load($this->user->uid, TRUE);
+    $this->assertNull($account1->picture, 'User object has no picture');
+
+    $file = file_load($account->picture->fid);
+    $this->assertFalse($file, 'File is removed from database');
+
+    // Clear out PHP's file stat cache so we see the current value.
+    clearstatcache();
+    $this->assertFalse(is_file($pic_path), 'File is removed from file system');
+  }
+
   function saveUserPicture($image) {
     $edit = array('files[picture_upload]' => drupal_realpath($image->uri));
     $this->drupalPost('user/' . $this->user->uid . '/edit', $edit, t('Save'));
@@ -1087,6 +1131,24 @@
     // Load actual user data from database.
     $account = user_load($this->user->uid, TRUE);
     return isset($account->picture) ? $account->picture->uri : NULL;
+  }
+
+  /**
+   * Tests the admin form validates user picture settings.
+   */
+  function testUserPictureAdminFormValidation() {
+    $this->drupalLogin($this->drupalCreateUser(array('administer users')));
+
+    // The default values are valid.
+    $this->drupalPost('admin/config/people/accounts', array(), t('Save configuration'));
+    $this->assertText(t('The configuration options have been saved.'), 'The default values are valid.');
+
+    // The form does not save with an invalid file size.
+    $edit = array(
+      'user_picture_file_size' => $this->randomName(),
+    );
+    $this->drupalPost('admin/config/people/accounts', $edit, t('Save configuration'));
+    $this->assertNoText(t('The configuration options have been saved.'), 'The form does not save with an invalid file size.');
   }
 }
 
@@ -1385,7 +1447,7 @@
   }
 
   /**
-   * Test the user login block.
+   * Tests the secondary menu.
    */
   function testSecondaryMenu() {
     // Create a regular user.
@@ -1455,6 +1517,13 @@
     $this->drupalPost('filter/tips', $edit, t('Log in'));
     $this->assertNoText(t('User login'), t('Logged in.'));
     $this->assertPattern('!<title.*?' . t('Compose tips') . '.*?</title>!', t('Still on the same page after login for allowed page'));
+
+    // Check that the user login block is not vulnerable to information
+    // disclosure to third party sites.
+    $this->drupalLogout();
+    $this->drupalPost('http://example.com/', $edit, t('Log in'), array('external' => FALSE));
+    // Check that we remain on the site after login.
+    $this->assertEqual(url('user/' . $user->uid, array('absolute' => TRUE)), $this->getUrl(), t('Redirected to user profile page after login from the frontpage'));
   }
 
   /**
@@ -1510,7 +1579,7 @@
 }
 
 /**
- * Test case to test user_save() behaviour.
+ * Tests saving a user account.
  */
 class UserSaveTestCase extends DrupalWebTestCase {
 
@@ -1599,7 +1668,7 @@
 }
 
 /**
- * Test case to test user_save() behaviour.
+ * Tests editing a user account.
  */
 class UserEditTestCase extends DrupalWebTestCase {
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/minimal/minimal.info (original)
+++ branches/upstream/current-7/profiles/minimal/minimal.info Thu May 10 18:20:18 2012
@@ -4,10 +4,9 @@
 core = 7.x
 dependencies[] = block
 dependencies[] = dblog
-files[] = minimal.profile
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/profiles/minimal/minimal.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/minimal/minimal.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/minimal/minimal.install (original)
+++ branches/upstream/current-7/profiles/minimal/minimal.install Thu May 10 18:20:18 2012
@@ -1,9 +1,15 @@
 <?php
+/**
+ * @file
+ * Install, update and uninstall functions for the the minimal install profile.
+ */
 
 /**
  * Implements hook_install().
  *
- * Perform actions to set up the site for this profile.
+ * Performs actions to set up the site for this profile.
+ *
+ * @see system_install()
  */
 function minimal_install() {
   // Enable some standard blocks.

Modified: branches/upstream/current-7/profiles/minimal/minimal.profile
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/minimal/minimal.profile?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/minimal/minimal.profile (original)
+++ branches/upstream/current-7/profiles/minimal/minimal.profile Thu May 10 18:20:18 2012
@@ -1,7 +1,11 @@
 <?php
+/**
+ * @file
+ * Enables modules and site configuration for a minimal site installation.
+ */
 
 /**
- * Implements hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter() for install_configure_form().
  *
  * Allows the profile to alter the site configuration form.
  */

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/standard/standard.info (original)
+++ branches/upstream/current-7/profiles/standard/standard.info Thu May 10 18:20:18 2012
@@ -23,10 +23,9 @@
 dependencies[] = field_ui
 dependencies[] = file
 dependencies[] = rdf
-files[] = standard.profile
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/standard/standard.install (original)
+++ branches/upstream/current-7/profiles/standard/standard.install Thu May 10 18:20:18 2012
@@ -1,9 +1,15 @@
 <?php
+/**
+ * @file
+ * Install, update and uninstall functions for the standard install profile.
+ */
 
 /**
  * Implements hook_install().
  *
  * Perform actions to set up the site for this profile.
+ *
+ * @see system_install()
  */
 function standard_install() {
   // Add text formats.

Modified: branches/upstream/current-7/profiles/standard/standard.profile
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/standard/standard.profile?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/standard/standard.profile (original)
+++ branches/upstream/current-7/profiles/standard/standard.profile Thu May 10 18:20:18 2012
@@ -1,7 +1,11 @@
 <?php
+/**
+ * @file
+ * Enables modules and site configuration for a standard site installation.
+ */
 
 /**
- * Implements hook_form_FORM_ID_alter().
+ * Implements hook_form_FORM_ID_alter() for install_configure_form().
  *
  * Allows the profile to alter the site configuration form.
  */

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=2263&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 Thu May 10 18:20:18 2012
@@ -4,9 +4,10 @@
 version = VERSION
 core = 7.x
 hidden = TRUE
+files[] = drupal_system_listing_compatible_test.test
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Added: branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.test
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.test?rev=2263&op=file
==============================================================================
--- branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.test (added)
+++ branches/upstream/current-7/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.test Thu May 10 18:20:18 2012
@@ -1,0 +1,37 @@
+<?php
+
+/**
+ * Helper to verify tests in installation profile modules.
+ */
+class DrupalSystemListingCompatibleTestCase extends DrupalWebTestCase {
+  /**
+   * Use the Minimal profile.
+   *
+   * This test needs to use a different installation profile than the test which
+   * asserts that this test is found.
+   *
+   * @see SimpleTestInstallationProfileModuleTestsTestCase
+   */
+  protected $profile = 'minimal';
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Installation profile module tests helper',
+      'description' => 'Verifies that tests in installation profile modules are found and may use another profile for running tests.',
+      'group' => 'Installation profile',
+    );
+  }
+
+  function setUp() {
+    // Attempt to install a module in Testing profile, while this test runs with
+    // a different profile.
+    parent::setUp(array('drupal_system_listing_compatible_test'));
+  }
+
+  /**
+   * Non-empty test* method required to executed the test case class.
+   */
+  function testDrupalSystemListing() {
+    $this->pass(__CLASS__ . ' test executed.');
+  }
+}

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=2263&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 Thu May 10 18:20:18 2012
@@ -8,8 +8,8 @@
 core = 6.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/testing/testing.info (original)
+++ branches/upstream/current-7/profiles/testing/testing.info Thu May 10 18:20:18 2012
@@ -4,8 +4,8 @@
 core = 7.x
 hidden = TRUE
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/profiles/testing/testing.install
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/testing/testing.install?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/testing/testing.install (original)
+++ branches/upstream/current-7/profiles/testing/testing.install Thu May 10 18:20:18 2012
@@ -1,9 +1,15 @@
 <?php
+/**
+ * @file
+ * Install, update and uninstall functions for the testing profile.
+ */
 
 /**
  * Implements hook_install().
  *
  * Perform actions to set up the site for this profile.
+ *
+ * @see system_install()
  */
 function testing_install() {
   // Allow visitor account creation, but with administrative approval.

Modified: branches/upstream/current-7/profiles/testing/testing.profile
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/profiles/testing/testing.profile?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/profiles/testing/testing.profile (original)
+++ branches/upstream/current-7/profiles/testing/testing.profile Thu May 10 18:20:18 2012
@@ -1,2 +1,6 @@
 <?php
+/**
+ * @file
+ * Installation profile for tests.
+ */
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/scripts/run-tests.sh (original)
+++ branches/upstream/current-7/scripts/run-tests.sh Thu May 10 18:20:18 2012
@@ -253,14 +253,14 @@
   if (!empty($args['php'])) {
     $php = $args['php'];
   }
-  elseif (!empty($_ENV['_'])) {
+  elseif ($php_env = getenv('_')) {
     // '_' is an environment variable set by the shell. It contains the command that was executed.
-    $php = $_ENV['_'];
-  }
-  elseif (!empty($_ENV['SUDO_COMMAND'])) {
+    $php = $php_env;
+  }
+  elseif ($sudo = getenv('SUDO_COMMAND')) {
     // 'SUDO_COMMAND' is an environment variable set by the sudo program.
     // Extract only the PHP interpreter, not the rest of the command.
-    list($php, ) = explode(' ', $_ENV['SUDO_COMMAND'], 2);
+    list($php, ) = explode(' ', $sudo, 2);
   }
   else {
     simpletest_script_print_error('Unable to automatically determine the path to the PHP interpreter. Supply the --php command line argument.');
@@ -597,9 +597,9 @@
           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";
+          // Print table header.
+          echo "Status    Group      Filename          Line Function                            \n";
+          echo "--------------------------------------------------------------------------------\n";
         }
 
         simpletest_script_format_result($result);

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/sites/default/default.settings.php (original)
+++ branches/upstream/current-7/sites/default/default.settings.php Thu May 10 18:20:18 2012
@@ -219,10 +219,10 @@
  * Salt for one-time login links and cancel links, form tokens, etc.
  *
  * This variable will be set to a random value by the installer. All one-time
- * login links will be invalidated if the value is changed.  Note that this
- * variable must have the same value on every web server.  If this variable is
- * empty, a hash of the serialized database credentials will be used as a
- * fallback salt.
+ * login links will be invalidated if the value is changed. Note that if your
+ * site is deployed on a cluster of web servers, you must ensure that this
+ * variable has the same value on each server. If this variable is empty, a hash
+ * of the serialized database credentials will be used as a fallback salt.
  *
  * For enhanced security, you may set this variable to a value using the
  * contents of a file outside your docroot that is never saved together

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/bartik/bartik.info (original)
+++ branches/upstream/current-7/themes/bartik/bartik.info Thu May 10 18:20:18 2012
@@ -34,8 +34,8 @@
 settings[shortcut_module_link] = 0
 
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/bartik/css/style-rtl.css (original)
+++ branches/upstream/current-7/themes/bartik/css/style-rtl.css Thu May 10 18:20:18 2012
@@ -15,6 +15,10 @@
 }
 blockquote:after {
   content: "\201C";
+}
+tr td,
+tr th {
+  text-align: right;
 }
 
 /* ------------------ List Styles ------------------ */

Modified: branches/upstream/current-7/themes/bartik/template.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/bartik/template.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/bartik/template.php (original)
+++ branches/upstream/current-7/themes/bartik/template.php Thu May 10 18:20:18 2012
@@ -77,8 +77,12 @@
  * Implements hook_preprocess_maintenance_page().
  */
 function bartik_preprocess_maintenance_page(&$variables) {
+  // By default, site_name is set to Drupal if no db connection is available
+  // or during site installation. Setting site_name to an empty string makes
+  // the site and update pages look cleaner.
+  // @see template_preprocess_maintenance_page
   if (!$variables['db_is_active']) {
-    unset($variables['site_name']);
+    $variables['site_name'] = '';
   }
   drupal_add_css(drupal_get_path('theme', 'bartik') . '/css/maintenance-page.css');
 }

Modified: branches/upstream/current-7/themes/bartik/templates/page.tpl.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/bartik/templates/page.tpl.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/bartik/templates/page.tpl.php (original)
+++ branches/upstream/current-7/themes/bartik/templates/page.tpl.php Thu May 10 18:20:18 2012
@@ -6,7 +6,7 @@
  *
  * The doctype, html, head and body tags are not in this template. Instead they
  * can be found in the html.tpl.php template normally located in the
- * modules/system folder.
+ * modules/system directory.
  *
  * Available variables:
  *
@@ -82,6 +82,7 @@
  * @see template_preprocess_page()
  * @see template_process()
  * @see bartik_process_page()
+ * @see html.tpl.php
  */
 ?>
 <div id="page-wrapper"><div id="page">

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/garland/garland.info (original)
+++ branches/upstream/current-7/themes/garland/garland.info Thu May 10 18:20:18 2012
@@ -7,8 +7,8 @@
 stylesheets[print][] = print.css
 settings[garland_width] = fluid
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/themes/garland/template.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/garland/template.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/garland/template.php (original)
+++ branches/upstream/current-7/themes/garland/template.php Thu May 10 18:20:18 2012
@@ -1,11 +1,7 @@
 <?php
 
 /**
- * Return a themed breadcrumb trail.
- *
- * @param $breadcrumb
- *   An array containing the breadcrumb links.
- * @return a string containing the breadcrumb output.
+ * Override of theme_breadcrumb().
  */
 function garland_breadcrumb($variables) {
   $breadcrumb = $variables['breadcrumb'];

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/seven/seven.info (original)
+++ branches/upstream/current-7/themes/seven/seven.info Thu May 10 18:20:18 2012
@@ -13,8 +13,8 @@
 regions[sidebar_first] = First sidebar
 regions_hidden[] = sidebar_first
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/themes/seven/vertical-tabs.css
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/themes/seven/vertical-tabs.css?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/seven/vertical-tabs.css (original)
+++ branches/upstream/current-7/themes/seven/vertical-tabs.css Thu May 10 18:20:18 2012
@@ -8,7 +8,7 @@
   margin: 10px 0;
   position: relative;
 }
-div.vertical-tabs fieldset {
+fieldset.vertical-tabs-pane {
   border: 0;
   padding: 0;
   margin: 0;
@@ -69,8 +69,11 @@
   margin: 0 0 0 265px; /* LTR */
   padding: 10px 15px 10px 0; /* LTR */
 }
-div.vertical-tabs .vertical-tabs-panes legend {
+fieldset.vertical-tabs-pane legend {
   display: none;
+}
+fieldset.vertical-tabs-pane fieldset legend {
+  display: block;
 }
 .vertical-tabs-pane .fieldset-wrapper > div:first-child {
   padding-top: 5px;

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=2263&op=diff
==============================================================================
--- branches/upstream/current-7/themes/stark/stark.info (original)
+++ branches/upstream/current-7/themes/stark/stark.info Thu May 10 18:20:18 2012
@@ -5,8 +5,8 @@
 core = 7.x
 stylesheets[all][] = layout.css
 
-; Information added by drupal.org packaging script on 2012-02-01
-version = "7.12"
+; Information added by drupal.org packaging script on 2012-05-02
+version = "7.14"
 project = "drupal"
-datestamp = "1328134560"
+datestamp = "1335997555"
 

Modified: branches/upstream/current-7/update.php
URL: http://svn.debian.org/wsvn/pkg-drupal/branches/upstream/current-7/update.php?rev=2263&op=diff
==============================================================================
--- branches/upstream/current-7/update.php (original)
+++ branches/upstream/current-7/update.php Thu May 10 18:20:18 2012
@@ -145,7 +145,9 @@
   // NOTE: we can't use l() here because the URL would point to
   // 'update.php?q=admin'.
   $links[] = '<a href="' . base_path() . '">Front page</a>';
-  $links[] = '<a href="' . base_path() . '?q=admin">Administration pages</a>';
+  if (user_access('access administration pages')) {
+    $links[] = '<a href="' . base_path() . '?q=admin">Administration pages</a>';
+  }
   return $links;
 }
 
@@ -155,7 +157,7 @@
 
   update_task_list();
   // Report end result.
-  if (module_exists('dblog')) {
+  if (module_exists('dblog') && user_access('access site reports')) {
     $log_message = ' All errors have been <a href="' . base_path() . '?q=admin/reports/dblog">logged</a>.';
   }
   else {
@@ -163,7 +165,7 @@
   }
 
   if ($_SESSION['update_success']) {
-    $output = '<p>Updates were attempted. If you see no failures below, you may proceed happily to the <a href="' . base_path() . '?q=admin">administration pages</a>. Otherwise, you may need to update your database manually.' . $log_message . '</p>';
+    $output = '<p>Updates were attempted. If you see no failures below, you may proceed happily back to your <a href="' . base_path() . '">site</a>. Otherwise, you may need to update your database manually.' . $log_message . '</p>';
   }
   else {
     list($module, $version) = array_pop(reset($_SESSION['updates_remaining']));




More information about the Pkg-drupal-commits mailing list