From 4c0585d24f599d051254b26166f0777b596befda Mon Sep 17 00:00:00 2001 From: Artyom Miroshnik Date: Sat, 1 Nov 2014 16:36:39 +0200 Subject: [PATCH 1/2] #1 | Push latest D8 master to current repo --- drupal/LICENSE.txt | 339 ++++ drupal/composer.json | 2 +- drupal/composer.lock | 14 +- .../config/schema/core.data_types.schema.yml | 146 +- drupal/core/core.services.yml | 8 +- drupal/core/includes/common.inc | 20 +- drupal/core/includes/file.inc | 17 +- drupal/core/includes/form.inc | 24 - drupal/core/includes/theme.inc | 3 +- drupal/core/includes/unicode.inc | 2 +- .../Plugin/ConfigurablePluginInterface.php | 27 +- .../Plugin/DependentPluginInterface.php | 42 + .../Drupal/Component/Utility/SafeMarkup.php | 26 +- .../Drupal/Core/Ajax/AjaxResponseRenderer.php | 93 - .../Block/MainContentBlockPluginInterface.php | 27 + .../Config/Entity/ConfigDependencyManager.php | 8 +- .../Drupal/Core/Controller/AjaxController.php | 79 +- .../Core/Controller/HtmlControllerBase.php | 9 +- .../Display/Annotation/DisplayVariant.php | 5 +- .../Display/Annotation/PageDisplayVariant.php | 26 + .../Core/Display/PageVariantInterface.php | 39 + .../Entity/Display/EntityDisplayInterface.php | 3 +- .../Core/Entity/Entity/EntityFormDisplay.php | 20 + .../Core/Entity/Entity/EntityViewDisplay.php | 19 + .../Drupal/Core/Entity/EntityDisplayBase.php | 11 - .../Entity/EntityDisplayPluginCollection.php | 24 + .../CustomPageExceptionHtmlSubscriber.php | 82 +- .../DefaultExceptionHtmlSubscriber.php | 103 +- .../Drupal/Core/Field/BaseFieldDefinition.php | 11 + .../lib/Drupal/Core/Field/FieldConfigBase.php | 20 +- .../lib/Drupal/Core/Field/FieldItemBase.php | 7 + .../Drupal/Core/Field/FieldItemInterface.php | 28 + .../Field/FieldType/EntityReferenceItem.php | 25 + .../Drupal/Core/Field/PluginSettingsBase.php | 16 +- .../lib/Drupal/Core/Field/WidgetFactory.php | 25 - .../Drupal/Core/Field/WidgetPluginManager.php | 2 - .../Drupal/Core/Mail/Plugin/Mail/PhpMail.php | 5 +- .../Core/Plugin/PluginDependencyTrait.php | 8 +- .../Drupal/Core/Render/Element/HtmlTag.php | 34 +- .../Core/Render/Element/MachineName.php | 5 +- .../Core/TypedData/TypedDataManager.php | 3 +- .../core/lib/Drupal/Core/Updater/Updater.php | 3 +- drupal/core/misc/tabledrag.js | 2 +- drupal/core/modules/action/action.info.yml | 10 +- .../action_bulk_test.info.yml | 10 +- .../modules/aggregator/aggregator.info.yml | 11 +- .../src/AggregatorFeedViewsData.php | 146 +- .../src/AggregatorItemViewsData.php | 162 +- .../templates/aggregator-feed.html.twig | 2 +- .../templates/aggregator-item.html.twig | 4 +- .../aggregator_test/aggregator_test.info.yml | 10 +- .../aggregator_test_views.info.yml | 10 +- drupal/core/modules/ban/ban.info.yml | 10 +- .../modules/basic_auth/basic_auth.info.yml | 10 +- drupal/core/modules/block/block.info.yml | 10 +- drupal/core/modules/block/block.module | 1 + .../Plugin/DisplayVariant/FullPageVariant.php | 37 +- .../modules/block/src/Tests/BlockTest.php | 3 - .../modules/block_test/block_test.info.yml | 10 +- .../block_test_specialchars_theme.info.yml | 8 +- .../block_test_theme.info.yml | 10 +- .../block_test_views.info.yml | 10 +- .../DisplayVariant/FullPageVariantTest.php | 105 +- .../block_content/block_content.info.yml | 10 +- .../block_content_test.info.yml | 10 +- drupal/core/modules/book/book.info.yml | 10 +- .../modules/breakpoint/breakpoint.info.yml | 10 +- .../breakpoint_module_test.info.yml | 10 +- .../breakpoint_theme_test.info.yml | 10 +- .../core/modules/ckeditor/ckeditor.info.yml | 10 +- .../tests/modules/ckeditor_test.info.yml | 10 +- drupal/core/modules/color/color.info.yml | 10 +- .../modules/color_test/color_test.info.yml | 10 +- .../color_test_theme.info.yml | 10 +- drupal/core/modules/comment/comment.info.yml | 10 +- .../comment_empty_title_test.info.yml | 10 +- .../comment_test/comment_test.info.yml | 10 +- .../comment_test_views.info.yml | 10 +- drupal/core/modules/config/config.info.yml | 10 +- .../Tests/AssertConfigEntityImportTrait.php | 42 + .../src/Tests/ConfigImportRecreateTest.php | 2 +- .../ConfigImportRenameValidationTest.php | 2 +- .../config_collection_install_test.info.yml | 10 +- .../config_entity_static_cache_test.info.yml | 10 +- .../config_events_test.info.yml | 10 +- .../config_export_test.info.yml | 10 +- .../config_import_test.info.yml | 10 +- .../config_integration_test.info.yml | 10 +- .../config_other_module_config_test.info.yml | 10 +- .../config_override_test.info.yml | 10 +- .../config_schema_test.info.yml | 10 +- .../tests/config_test/config_test.info.yml | 10 +- .../config_translation.info.yml | 10 +- .../src/Tests/ConfigTranslationUiTest.php | 10 + .../config_translation_test.info.yml | 10 +- .../config_translation_test_theme.info.yml | 10 +- drupal/core/modules/contact/contact.info.yml | 10 +- .../modules/contact/src/MessageInterface.php | 2 +- .../contact_storage_test.info.yml | 10 +- .../contact_test/contact_test.info.yml | 10 +- .../contact_test_views.info.yml | 10 +- .../content_translation.info.yml | 10 +- .../Tests/ContentTranslationSettingsTest.php | 23 + .../content_translation_test_views.info.yml | 10 +- .../modules/contextual/contextual.info.yml | 10 +- .../core/modules/datetime/datetime.info.yml | 10 +- drupal/core/modules/dblog/dblog.info.yml | 10 +- .../modules/dblog/src/Tests/DbLogTest.php | 3 +- .../dblog_test_views.info.yml | 10 +- drupal/core/modules/editor/editor.admin.inc | 5 +- drupal/core/modules/editor/editor.info.yml | 10 +- .../editor/tests/modules/editor_test.info.yml | 10 +- .../config/schema/entity_reference.schema.yml | 30 - .../entity_reference.info.yml | 10 +- .../EntityReferenceFieldDefaultValueTest.php | 3 + .../Tests/EntityReferenceIntegrationTest.php | 38 +- .../entity_reference_test.info.yml | 10 +- .../entity_reference_test_views.info.yml | 10 +- drupal/core/modules/field/field.info.yml | 10 +- .../src/Tests/Boolean/BooleanItemTest.php | 2 +- .../field/src/Tests/FieldAttachOtherTest.php | 2 + .../field/src/Tests/FieldUnitTestBase.php | 2 +- .../Tests/TestItemWithDependenciesTest.php | 57 + .../field_plugins_test.info.yml | 10 +- .../modules/field_test/field_test.info.yml | 10 +- .../FieldType/TestItemWithDependencies.php | 39 + .../field_test_config.info.yml | 10 +- .../field_test_views.info.yml | 10 +- .../field_third_party_test.info.yml | 10 +- .../src/Unit/FieldConfigEntityUnitTest.php | 57 +- .../core/modules/field_ui/field_ui.info.yml | 10 +- .../src/Form/FieldStorageEditForm.php | 24 +- .../field_ui/src/Tests/EntityDisplayTest.php | 4 +- .../src/Tests/EntityFormDisplayTest.php | 2 +- .../field_ui/src/Tests/FieldUiTestBase.php | 1 + .../field_ui_test/field_ui_test.info.yml | 10 +- drupal/core/modules/file/file.info.yml | 10 +- drupal/core/modules/file/file.module | 2 +- .../file_module_test.info.yml | 10 +- .../file/tests/file_test/file_test.info.yml | 10 +- .../file_test_views/file_test_views.info.yml | 10 +- drupal/core/modules/filter/filter.info.yml | 10 +- drupal/core/modules/filter/filter.module | 4 +- .../filter/src/Tests/FilterCrudTest.php | 4 +- .../src/Tests/FilterDefaultConfigTest.php | 4 +- .../filter/src/Tests/FilterSettingsTest.php | 4 +- .../filter/src/Tests/FilterUnitTest.php | 4 +- .../tests/filter_test/filter_test.info.yml | 10 +- drupal/core/modules/forum/forum.info.yml | 10 +- .../forum_test_views.info.yml | 10 +- drupal/core/modules/hal/hal.info.yml | 10 +- drupal/core/modules/help/help.info.yml | 10 +- drupal/core/modules/history/history.info.yml | 10 +- drupal/core/modules/image/image.info.yml | 10 +- .../image_module_test.info.yml | 10 +- .../core/modules/language/language.info.yml | 10 +- .../src/Form/NegotiationSessionForm.php | 2 +- .../LanguageUILanguageNegotiationTest.php | 31 +- .../language_config_override_test.info.yml | 10 +- .../language_elements_test.info.yml | 10 +- .../language_test/language_test.info.yml | 10 +- drupal/core/modules/link/link.info.yml | 10 +- drupal/core/modules/locale/locale.info.yml | 10 +- .../early_translation_test.info.yml | 10 +- .../modules/locale_test/locale_test.info.yml | 10 +- ...cale_test_not_development_release.info.yml | 10 +- .../locale_test_translate.info.yml | 10 +- .../menu_link_content.info.yml | 10 +- .../src/Entity/MenuLinkContent.php | 2 +- drupal/core/modules/menu_ui/menu_ui.info.yml | 10 +- .../modules/menu_ui/menu_ui.libraries.yml | 6 + drupal/core/modules/menu_ui/src/MenuForm.php | 4 +- .../modules/menu_ui/src/MenuListBuilder.php | 4 +- .../menu_ui/src/Tests/MenuCacheTagsTest.php | 2 +- .../config/schema/migrate.source.schema.yml | 354 +--- drupal/core/modules/migrate/migrate.info.yml | 10 +- .../src/Plugin/migrate/source/SqlBase.php | 9 +- ...d6_comment_entity_form_display_subject.yml | 2 +- ...tion.d6_field_instance_widget_settings.yml | 2 +- .../migrate.migration.d6_forum_settings.yml | 8 + .../migrate.migration.d6_node_settings.yml | 5 +- .../schema/migrate_drupal.source.schema.yml | 351 ++++ .../migrate_drupal/migrate_drupal.info.yml | 10 +- .../process/d6/FieldInstanceDefaults.php | 23 +- .../src/Tests/Dump/Drupal6NodeSettings.php | 4 + .../src/Tests/Dump/Drupal6User.php | 6 +- .../Tests/Dump/Drupal6UserProfileFields.php | 2 +- ...ntVariableEntityFormDisplaySubjectTest.php | 2 +- .../src/Tests/d6/MigrateDrupal6Test.php | 2 +- .../src/Tests/d6/MigrateForumConfigsTest.php | 8 +- .../src/Tests/d6/MigrateMenuTest.php | 2 +- .../src/Tests/d6/MigrateNodeConfigsTest.php | 3 +- .../Tests/d6/MigrateUserProfileFieldTest.php | 4 +- ...t.php => MigrateUserProfileValuesTest.php} | 12 +- .../src/Tests/d6/MigrateUserTest.php | 6 +- drupal/core/modules/node/node.info.yml | 10 +- .../src/Tests/Config/NodeImportChangeTest.php | 2 +- .../src/Tests/Config/NodeImportCreateTest.php | 2 +- .../node_access_test.info.yml | 10 +- .../node_access_test_language.info.yml | 10 +- .../modules/node_test/node_test.info.yml | 10 +- .../node_test_config.info.yml | 10 +- .../node_test_exception.info.yml | 10 +- .../node_test_views/node_test_views.info.yml | 10 +- drupal/core/modules/options/options.info.yml | 10 +- .../options/src/Tests/OptionsFieldUITest.php | 1 + .../src/Tests/OptionsFieldUnitTestBase.php | 1 + .../options_config_install_test.info.yml | 10 +- .../tests/options_test/options_test.info.yml | 10 +- drupal/core/modules/path/path.info.yml | 10 +- drupal/core/modules/path/path.routing.yml | 2 +- .../path/src/Controller/PathController.php | 13 +- .../modules/path/src/Form/PathFilterForm.php | 4 +- .../modules/path/src/Tests/PathAdminTest.php | 19 + .../core/modules/quickedit/quickedit.info.yml | 10 +- .../src/Tests/EditorSelectionTest.php | 2 +- .../src/Tests/MetadataGeneratorTest.php | 2 +- .../quickedit/src/Tests/QuickEditTestBase.php | 2 +- .../tests/modules/quickedit_test.info.yml | 10 +- drupal/core/modules/rdf/rdf.info.yml | 10 +- drupal/core/modules/rdf/rdf.module | 8 +- .../rdf/src/Tests/Field/LinkFieldRdfaTest.php | 12 +- .../src/Tests/Field/NumberFieldRdfaTest.php | 16 +- .../Tests/Field/TelephoneFieldRdfaTest.php | 2 +- .../rdf/templates/rdf-metadata.html.twig | 2 +- .../rdf_conflicting_namespaces.info.yml | 10 +- .../rdf_test_namespaces.info.yml | 10 +- .../responsive_image.info.yml | 10 +- .../responsive_image_test_module.info.yml | 10 +- drupal/core/modules/rest/rest.info.yml | 10 +- .../modules/rest/src/Tests/DeleteTest.php | 2 +- .../rest_test_views/rest_test_views.info.yml | 10 +- drupal/core/modules/search/search.info.yml | 10 +- drupal/core/modules/search/search.module | 2 +- .../search/src/Tests/SearchSimplifyTest.php | 3 +- .../search/templates/search-result.html.twig | 8 +- .../search_embedded_form.info.yml | 10 +- .../search_extra_type.info.yml | 10 +- .../search_langcode_test.info.yml | 10 +- .../search_query_alter.info.yml | 10 +- .../serialization/serialization.info.yml | 10 +- .../serialization_test.info.yml | 10 +- .../modules/shortcut/css/shortcut.icons.css | 5 +- .../modules/shortcut/css/shortcut.theme.css | 17 +- .../modules/shortcut/images/favstar-rtl.svg | 19 + .../core/modules/shortcut/shortcut.info.yml | 10 +- drupal/core/modules/shortcut/shortcut.module | 7 +- .../modules/simpletest/simpletest.info.yml | 10 +- .../modules/simpletest/src/WebTestBase.php | 2 +- .../phpunit_test/phpunit_test.info.yml | 10 +- .../modules/statistics/statistics.info.yml | 10 +- .../statistics_test_views.info.yml | 10 +- drupal/core/modules/syslog/syslog.info.yml | 10 +- drupal/core/modules/system/entity.api.php | 4 + drupal/core/modules/system/file.api.php | 212 +++ drupal/core/modules/system/form.api.php | 183 +- drupal/core/modules/system/module.api.php | 775 ++++++++ .../src/Controller/Http4xxController.php | 41 + .../core/modules/system/src/Entity/Menu.php | 13 +- .../core/modules/system/src/MenuInterface.php | 8 + .../src/Plugin/Block/SystemMainBlock.php | 21 +- .../src/Tests/Common/JavaScriptTest.php | 3 +- .../system/src/Tests/Common/RenderTest.php | 20 +- .../Tests/DrupalKernel/DrupalKernelTest.php | 2 +- .../src/Tests/Entity/EntityUnitTestBase.php | 2 +- .../src/Tests/Entity/FieldAccessTest.php | 2 +- .../src/Tests/File/UrlRewritingTest.php | 12 + .../system/src/Tests/Form/FormCacheTest.php | 2 +- .../Tests/Routing/ExceptionHandlingTest.php | 27 +- drupal/core/modules/system/system.admin.inc | 6 +- drupal/core/modules/system/system.api.php | 1629 ----------------- drupal/core/modules/system/system.info.yml | 10 +- drupal/core/modules/system/system.routing.yml | 16 + .../modules/action_test/action_test.info.yml | 10 +- .../ajax_forms_test/ajax_forms_test.info.yml | 10 +- .../ajax_forms_test/ajax_forms_test.module | 4 +- .../modules/ajax_test/ajax_test.info.yml | 10 +- .../modules/batch_test/batch_test.info.yml | 10 +- .../tests/modules/bc_test/bc_test.info.yml | 10 +- .../modules/cache_test/cache_test.info.yml | 10 +- .../modules/common_test/common_test.info.yml | 10 +- .../common_test_cron_helper.info.yml | 10 +- .../condition_test/condition_test.info.yml | 10 +- .../cron_queue_test/cron_queue_test.info.yml | 10 +- .../database_test/database_test.info.yml | 10 +- ...al_system_listing_compatible_test.info.yml | 10 +- .../entity_crud_hook_test.info.yml | 10 +- .../entity_schema_test.info.yml | 10 +- .../modules/entity_test/entity_test.info.yml | 10 +- .../src/Controller/EntityTestController.php | 2 +- .../entity_test/src/Entity/EntityTest.php | 4 +- .../modules/error_test/error_test.info.yml | 10 +- .../src/Controller/ErrorTestController.php | 2 +- .../modules/form_test/form_test.info.yml | 10 +- .../src/Controller/FormTestController.php | 7 +- .../httpkernel_test/httpkernel_test.info.yml | 10 +- .../modules/image_test/image_test.info.yml | 10 +- ..._maximum_allowed_character_length.info.yml | 10 +- .../keyvalue_test/keyvalue_test.info.yml | 10 +- .../modules/menu_test/menu_test.info.yml | 10 +- .../tests/modules/menu_test/menu_test.module | 4 +- .../modules/menu_test/src/TestControllers.php | 12 +- .../module_autoload_test.info.yml | 10 +- .../modules/module_test/module_test.info.yml | 10 +- .../src/Controller/ModuleTestController.php | 2 +- .../paramconverter_test.info.yml | 10 +- .../src/TestControllers.php | 6 +- .../modules/path_test/path_test.info.yml | 10 +- .../modules/plugin_test/plugin_test.info.yml | 10 +- .../requirements1_test.info.yml | 10 +- .../requirements2_test.info.yml | 10 +- .../router_test.info.yml | 10 +- .../router_test_directory/src/TestContent.php | 6 +- .../src/TestControllers.php | 8 +- .../service_provider_test.info.yml | 10 +- .../session_test/session_test.info.yml | 10 +- .../session_test/session_test.routing.yml | 8 - .../src/Controller/SessionTestController.php | 28 +- .../system_dependencies_test.info.yml | 10 +- ...le_core_version_dependencies_test.info.yml | 10 +- ...em_incompatible_core_version_test.info.yml | 10 +- ..._module_version_dependencies_test.info.yml | 10 +- ..._incompatible_module_version_test.info.yml | 10 +- .../system_mail_failure_test.info.yml | 10 +- .../system_module_test.info.yml | 10 +- .../src/Controller/SystemTestController.php | 11 +- .../modules/system_test/system_test.info.yml | 10 +- .../modules/system_test/system_test.module | 6 +- .../test_page_test/test_page_test.info.yml | 10 +- .../theme_page_test/theme_page_test.info.yml | 10 +- .../theme_region_test.info.yml | 10 +- .../theme_suggestions_test.info.yml | 10 +- .../theme_test/src/ThemeTestController.php | 6 +- .../modules/theme_test/theme_test.info.yml | 10 +- .../transliterate_test.info.yml | 10 +- .../twig_extension_test.info.yml | 10 +- .../twig_namespace_a.info.yml | 10 +- .../twig_namespace_b.info.yml | 10 +- .../src/TwigThemeTestController.php | 2 +- .../twig_theme_test/twig_theme_test.info.yml | 10 +- .../update_script_test.info.yml | 10 +- .../update_test_0/update_test_0.info.yml | 10 +- .../update_test_1/update_test_1.info.yml | 10 +- .../update_test_2/update_test_2.info.yml | 10 +- .../update_test_3/update_test_3.info.yml | 10 +- .../update_test_invalid_hook.info.yml | 10 +- .../update_test_with_7x.info.yml | 10 +- .../url_alter_test/url_alter_test.info.yml | 10 +- .../test_basetheme/test_basetheme.info.yml | 10 +- .../test_invalid_basetheme.info.yml | 10 +- .../test_invalid_engine.info.yml | 10 +- .../test_subtheme/test_subtheme.info.yml | 10 +- .../themes/test_theme/test_theme.info.yml | 10 +- ...veery_long_name_which_is_too_long.info.yml | 10 +- .../test_theme_phptemplate.info.yml | 10 +- drupal/core/modules/system/theme.api.php | 491 +++++ .../modules/taxonomy/src/Tests/TermTest.php | 3 +- .../core/modules/taxonomy/taxonomy.info.yml | 10 +- .../templates/taxonomy-term.html.twig | 17 +- .../taxonomy_crud/taxonomy_crud.info.yml | 10 +- .../taxonomy_test_views.info.yml | 10 +- .../core/modules/telephone/telephone.info.yml | 10 +- drupal/core/modules/text/text.info.yml | 10 +- .../toolbar_test/toolbar_test.info.yml | 10 +- drupal/core/modules/toolbar/toolbar.info.yml | 10 +- .../tour/tests/tour_test/tour_test.info.yml | 10 +- drupal/core/modules/tour/tour.info.yml | 10 +- .../tracker_test_views.info.yml | 10 +- drupal/core/modules/tracker/tracker.info.yml | 10 +- .../update/src/Tests/UpdateContribTest.php | 34 +- .../update/src/Tests/UpdateCoreTest.php | 200 +- .../update/src/Tests/UpdateUploadTest.php | 8 +- .../aaa_update_test/aaa_update_test.info.yml | 10 +- .../aaa_update_test/aaa_update_test.info.yml | 10 +- .../bbb_update_test/bbb_update_test.info.yml | 10 +- .../ccc_update_test/ccc_update_test.info.yml | 10 +- .../update_test/aaa_update_test.1_0.xml | 4 +- .../modules/update_test/drupal.0.0-alpha1.xml | 36 + .../modules/update_test/drupal.0.0-beta1.xml | 55 + .../tests/modules/update_test/drupal.0.0.xml | 73 + .../modules/update_test/drupal.0.1-alpha1.xml | 92 + .../modules/update_test/drupal.0.1-beta1.xml | 111 ++ .../tests/modules/update_test/drupal.0.1.xml | 129 ++ .../{drupal.2-sec.xml => drupal.0.2-sec.xml} | 45 +- .../tests/modules/update_test/drupal.0.xml | 34 - .../modules/update_test/drupal.1.0-alpha1.xml | 148 ++ .../modules/update_test/drupal.1.0-beta1.xml | 167 ++ .../tests/modules/update_test/drupal.1.0.xml | 185 ++ .../modules/update_test/drupal.1.1-alpha1.xml | 204 +++ .../modules/update_test/drupal.1.1-beta1.xml | 223 +++ .../tests/modules/update_test/drupal.1.1.xml | 241 +++ .../modules/update_test/drupal.1.2-sec.xml | 72 + .../tests/modules/update_test/drupal.1.xml | 51 - .../tests/modules/update_test/drupal.9.xml | 35 + .../tests/modules/update_test/drupal.dev.xml | 32 +- .../modules/update_test/update_test.info.yml | 10 +- .../update_test_basetheme.info.yml | 10 +- .../update_test_subtheme.info.yml | 10 +- drupal/core/modules/update/update.info.yml | 10 +- .../user/src/Tests/UserAutocompleteTest.php | 5 +- .../modules/user/templates/user.html.twig | 2 +- .../modules/user/templates/username.html.twig | 2 +- .../user_custom_phpass_params_test.info.yml | 10 +- .../user_form_test/user_form_test.info.yml | 10 +- .../user_test_views/user_test_views.info.yml | 10 +- drupal/core/modules/user/user.info.yml | 10 +- .../config/schema/views.data_types.schema.yml | 21 + drupal/core/modules/views/js/ajax_view.js | 2 +- .../views/display/DisplayPluginBase.php | 3 +- .../Plugin/views/field/FieldPluginBase.php | 5 +- .../src/Plugin/views/join/JoinPluginBase.php | 6 +- .../Tests/Entity/RowEntityRenderersTest.php | 2 +- .../views/src/Tests/Handler/FieldWebTest.php | 3 +- .../views/src/Tests/Plugin/JoinTest.php | 25 +- .../views/src/Tests/ViewExecutableTest.php | 2 +- .../templates/views-mini-pager.html.twig | 32 +- .../views_test_config.info.yml | 10 +- .../views_test_data/views_test_data.info.yml | 10 +- drupal/core/modules/views/views.info.yml | 10 +- drupal/core/modules/views/views.theme.inc | 86 +- .../views_ui/src/Tests/DuplicateTest.php | 41 + .../src/Tests/FilterBooleanWebTest.php | 9 + .../views_ui/src/Tests/PreviewTest.php | 30 +- .../modules/views_ui/src/Tests/XssTest.php | 34 + .../views_ui/src/ViewDuplicateForm.php | 1 + .../views.view.sa_contrib_2013_035.yml | 215 +++ .../views_ui_test/views_ui_test.info.yml | 10 +- .../core/modules/views_ui/views_ui.info.yml | 10 +- drupal/core/modules/views_ui/views_ui.module | 3 +- .../core/modules/views_ui/views_ui.theme.inc | 12 +- drupal/core/profiles/minimal/minimal.info.yml | 10 +- .../core/profiles/standard/standard.info.yml | 10 +- ...al_system_listing_compatible_test.info.yml | 10 +- drupal/core/profiles/testing/testing.info.yml | 10 +- .../testing_multilingual.info.yml | 10 +- .../Core/Ajax/AjaxResponseRendererTest.php | 132 -- .../Drupal/Tests/Core/Cache/CacheTest.php | 2 +- .../Core/Controller/AjaxControllerTest.php | 120 ++ .../Core/Entity/BaseFieldDefinitionTest.php | 27 +- .../module_handler_test.info.yml | 10 +- .../module_handler_test_added.info.yml | 10 +- .../module_handler_test_all1.info.yml | 10 +- .../module_handler_test_all2.info.yml | 10 +- drupal/core/themes/bartik/bartik.info.yml | 10 +- drupal/core/themes/classy/classy.info.yml | 10 +- .../templates/aggregator-block-item.html.twig | 15 + .../templates/aggregator-feed.html.twig | 31 + .../templates/aggregator-item.html.twig | 28 + .../classy/templates/file-link.html.twig | 16 + .../templates/file-managed-file.html.twig | 17 + .../templates/file-upload-help.html.twig | 14 + .../templates/file-widget-multiple.html.twig | 16 + .../classy/templates/file-widget.html.twig | 17 + .../classy/templates/rdf-metadata.html.twig | 22 + .../classy/templates/search-result.html.twig | 73 + .../classy/templates/taxonomy-term.html.twig | 43 + .../themes/classy/templates/user.html.twig | 30 + .../classy/templates/username.html.twig | 25 + .../engines/phptemplate/phptemplate.info.yml | 10 +- drupal/core/themes/engines/twig/twig.info.yml | 10 +- .../core/themes/seven/css/components/tabs.css | 97 +- drupal/core/themes/seven/seven.info.yml | 10 +- drupal/core/themes/stark/stark.info.yml | 10 +- drupal/core/vendor/bin/phpunit | 56 +- drupal/core/vendor/composer/installed.json | 118 +- drupal/core/vendor/twig/twig/.travis.yml | 1 + drupal/core/vendor/twig/twig/CHANGELOG | 30 +- drupal/core/vendor/twig/twig/composer.json | 2 +- drupal/core/vendor/twig/twig/doc/api.rst | 37 +- .../core/vendor/twig/twig/doc/deprecated.rst | 10 +- .../vendor/twig/twig/doc/filters/batch.rst | 2 +- .../twig/doc/filters/convert_encoding.rst | 2 +- .../vendor/twig/twig/doc/filters/first.rst | 2 +- .../twig/twig/doc/filters/json_encode.rst | 2 +- .../vendor/twig/twig/doc/filters/last.rst | 2 +- .../vendor/twig/twig/doc/filters/length.rst | 2 +- .../vendor/twig/twig/doc/filters/merge.rst | 6 + .../vendor/twig/twig/doc/filters/nl2br.rst | 2 +- .../twig/twig/doc/filters/number_format.rst | 2 +- .../core/vendor/twig/twig/doc/filters/raw.rst | 24 + .../vendor/twig/twig/doc/filters/slice.rst | 5 +- .../vendor/twig/twig/doc/filters/split.rst | 18 +- .../vendor/twig/twig/doc/filters/trim.rst | 2 +- .../twig/twig/doc/filters/url_encode.rst | 10 +- .../vendor/twig/twig/doc/functions/date.rst | 4 +- .../vendor/twig/twig/doc/functions/dump.rst | 2 +- .../twig/twig/doc/functions/include.rst | 2 +- .../vendor/twig/twig/doc/functions/max.rst | 5 +- .../vendor/twig/twig/doc/functions/min.rst | 5 +- .../vendor/twig/twig/doc/functions/random.rst | 2 +- .../vendor/twig/twig/doc/functions/source.rst | 2 +- .../doc/functions/template_from_string.rst | 2 +- drupal/core/vendor/twig/twig/doc/index.rst | 4 +- .../vendor/twig/twig/doc/installation.rst | 87 +- .../core/vendor/twig/twig/doc/internals.rst | 2 +- drupal/core/vendor/twig/twig/doc/intro.rst | 10 +- drupal/core/vendor/twig/twig/doc/recipes.rst | 2 +- .../vendor/twig/twig/doc/tags/autoescape.rst | 12 + drupal/core/vendor/twig/twig/doc/tags/do.rst | 2 +- .../vendor/twig/twig/doc/tags/extends.rst | 4 +- drupal/core/vendor/twig/twig/doc/tags/if.rst | 17 + drupal/core/vendor/twig/twig/doc/tags/use.rst | 3 +- .../core/vendor/twig/twig/doc/templates.rst | 36 +- .../vendor/twig/twig/doc/tests/sameas.rst | 4 +- drupal/core/vendor/twig/twig/ext/twig/LICENSE | 31 - .../core/vendor/twig/twig/ext/twig/php_twig.h | 2 +- drupal/core/vendor/twig/twig/ext/twig/twig.c | 12 +- .../vendor/twig/twig/lib/Twig/Autoloader.php | 2 +- .../vendor/twig/twig/lib/Twig/Compiler.php | 16 +- .../twig/twig/lib/Twig/CompilerInterface.php | 3 +- .../vendor/twig/twig/lib/Twig/Environment.php | 16 +- .../core/vendor/twig/twig/lib/Twig/Error.php | 8 +- .../twig/lib/Twig/ExistsLoaderInterface.php | 5 +- .../twig/twig/lib/Twig/ExpressionParser.php | 6 +- .../twig/twig/lib/Twig/Extension/Core.php | 182 +- .../twig/twig/lib/Twig/Extension/Sandbox.php | 2 +- .../twig/twig/lib/Twig/LexerInterface.php | 3 +- .../twig/twig/lib/Twig/Loader/Array.php | 2 + .../twig/twig/lib/Twig/Loader/Filesystem.php | 27 +- .../twig/twig/lib/Twig/Loader/String.php | 4 +- .../twig/twig/lib/Twig/LoaderInterface.php | 2 +- .../core/vendor/twig/twig/lib/Twig/Node.php | 9 +- .../twig/twig/lib/Twig/Node/AutoEscape.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/Block.php | 2 +- .../twig/lib/Twig/Node/BlockReference.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/Do.php | 2 +- .../twig/lib/Twig/Node/Expression/Array.php | 2 +- .../lib/Twig/Node/Expression/AssignName.php | 2 +- .../twig/lib/Twig/Node/Expression/Binary.php | 2 +- .../Twig/Node/Expression/Binary/EndsWith.php | 10 +- .../Twig/Node/Expression/Binary/FloorDiv.php | 2 +- .../lib/Twig/Node/Expression/Binary/In.php | 2 +- .../lib/Twig/Node/Expression/Binary/NotIn.php | 2 +- .../lib/Twig/Node/Expression/Binary/Power.php | 2 +- .../lib/Twig/Node/Expression/Binary/Range.php | 2 +- .../Node/Expression/Binary/StartsWith.php | 8 +- .../Twig/Node/Expression/BlockReference.php | 2 +- .../twig/lib/Twig/Node/Expression/Call.php | 4 +- .../Node/Expression/ExtensionReference.php | 2 +- .../twig/lib/Twig/Node/Expression/GetAttr.php | 34 +- .../twig/lib/Twig/Node/Expression/Parent.php | 2 +- .../Twig/Node/Expression/Test/Divisibleby.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/Flush.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/For.php | 2 +- .../twig/twig/lib/Twig/Node/ForLoop.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/If.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/Import.php | 2 +- .../twig/twig/lib/Twig/Node/Include.php | 48 +- .../vendor/twig/twig/lib/Twig/Node/Macro.php | 6 +- .../vendor/twig/twig/lib/Twig/Node/Module.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/Print.php | 2 +- .../twig/twig/lib/Twig/Node/Sandbox.php | 2 +- .../twig/lib/Twig/Node/SandboxedModule.php | 44 +- .../twig/lib/Twig/Node/SandboxedPrint.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/Set.php | 2 +- .../twig/twig/lib/Twig/Node/Spaceless.php | 2 +- .../vendor/twig/twig/lib/Twig/Node/Text.php | 2 +- .../twig/twig/lib/Twig/NodeInterface.php | 5 +- .../twig/twig/lib/Twig/NodeTraverser.php | 2 +- .../twig/lib/Twig/NodeVisitor/Optimizer.php | 13 +- .../twig/lib/Twig/NodeVisitor/Sandbox.php | 14 +- .../twig/lib/Twig/NodeVisitorInterface.php | 2 +- .../twig/twig/lib/Twig/ParserInterface.php | 3 +- .../Sandbox/SecurityNotAllowedFilterError.php | 31 + .../SecurityNotAllowedFunctionError.php | 31 + .../Sandbox/SecurityNotAllowedTagError.php | 31 + .../twig/lib/Twig/Sandbox/SecurityPolicy.php | 6 +- .../vendor/twig/twig/lib/Twig/Template.php | 59 +- .../twig/twig/lib/Twig/TemplateInterface.php | 3 +- .../core/vendor/twig/twig/lib/Twig/Token.php | 18 +- .../vendor/twig/twig/lib/Twig/TokenStream.php | 6 +- .../twig/test/Twig/Tests/EnvironmentTest.php | 6 +- .../test/Twig/Tests/Extension/CoreTest.php | 18 + .../test/Twig/Tests/Extension/SandboxTest.php | 9 +- .../twig/test/Twig/Tests/FileCachingTest.php | 4 +- .../Fixtures/exceptions/undefined_trait.test | 2 +- .../Tests/Fixtures/expressions/bitwise.test | 2 +- .../Fixtures/expressions/divisibleby.test | 4 - .../Tests/Fixtures/expressions/ends_with.test | 14 + .../Tests/Fixtures/expressions/sameas.test | 4 +- .../Fixtures/expressions/starts_with.test | 10 + .../{batch_float.php => batch_float.test} | 6 +- .../Twig/Tests/Fixtures/filters/date.test | 18 +- .../Fixtures/filters/date_immutable.test | 2 + .../Twig/Tests/Fixtures/filters/default.test | 58 +- .../Twig/Tests/Fixtures/filters/first.test | 1 + .../Twig/Tests/Fixtures/filters/last.test | 1 + .../Twig/Tests/Fixtures/filters/slice.test | 6 + .../Twig/Tests/Fixtures/filters/split.test | 2 + .../Tests/Fixtures/filters/split_utf8.test | 24 + .../Tests/Fixtures/filters/urlencode.test | 8 +- .../filters/urlencode_deprecated.test | 16 + .../Tests/Fixtures/functions/attribute.test | 4 +- .../Fixtures/functions/include/sandbox.test | 5 +- .../recursive_block_with_inheritance.test | 21 + .../regression/combined_debug_info.test | 15 + .../Fixtures/regression/multi_word_tests.test | 10 + .../Fixtures/tags/inheritance/block_expr.test | 32 + .../tags/inheritance/block_expr2.test | 34 + .../Fixtures/tags/macro/super_globals.test | 14 + .../Tests/Fixtures/tags/use/inheritance.test | 25 + .../Tests/Fixtures/tags/use/inheritance2.test | 24 + .../Tests/Fixtures/tags/use/parent_block.test | 24 + .../Fixtures/tags/use/parent_block2.test | 24 + .../Fixtures/tags/use/parent_block3.test | 38 + .../twig/test/Twig/Tests/IntegrationTest.php | 12 + .../twig/twig/test/Twig/Tests/LexerTest.php | 17 +- .../test/Twig/Tests/NativeExtensionTest.php | 2 +- .../Tests/Node/Expression/GetAttrTest.php | 2 +- .../twig/test/Twig/Tests/Node/IncludeTest.php | 3 +- .../twig/test/Twig/Tests/Node/MacroTest.php | 6 +- .../Twig/Tests/Node/SandboxedModuleTest.php | 56 +- .../twig/test/Twig/Tests/TemplateTest.php | 6 +- .../twig/test/Twig/Tests/escapingTest.php | 4 +- drupal/themes/contrib/readme.txt | 0 drupal/themes/custom/readme.txt | 0 616 files changed, 10066 insertions(+), 4471 deletions(-) create mode 100644 drupal/LICENSE.txt create mode 100644 drupal/core/lib/Drupal/Component/Plugin/DependentPluginInterface.php delete mode 100644 drupal/core/lib/Drupal/Core/Ajax/AjaxResponseRenderer.php create mode 100644 drupal/core/lib/Drupal/Core/Block/MainContentBlockPluginInterface.php create mode 100644 drupal/core/lib/Drupal/Core/Display/Annotation/PageDisplayVariant.php create mode 100644 drupal/core/lib/Drupal/Core/Display/PageVariantInterface.php create mode 100644 drupal/core/lib/Drupal/Core/Entity/EntityDisplayPluginCollection.php delete mode 100644 drupal/core/lib/Drupal/Core/Field/WidgetFactory.php create mode 100644 drupal/core/modules/config/src/Tests/AssertConfigEntityImportTrait.php create mode 100644 drupal/core/modules/field/src/Tests/TestItemWithDependenciesTest.php create mode 100644 drupal/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItemWithDependencies.php create mode 100644 drupal/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml rename drupal/core/modules/migrate_drupal/src/Tests/d6/{MigrateProfileValuesTest.php => MigrateUserProfileValuesTest.php} (93%) create mode 100644 drupal/core/modules/shortcut/images/favstar-rtl.svg create mode 100644 drupal/core/modules/system/file.api.php create mode 100644 drupal/core/modules/system/module.api.php create mode 100644 drupal/core/modules/system/src/Controller/Http4xxController.php create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.0.0-alpha1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.0.0-beta1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.0.0.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.0.1-alpha1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.0.1-beta1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.0.1.xml rename drupal/core/modules/update/tests/modules/update_test/{drupal.2-sec.xml => drupal.0.2-sec.xml} (61%) delete mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.0.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.1.0-alpha1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.1.0-beta1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.1.0.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.1.1-alpha1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.1.1-beta1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.1.1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.1.2-sec.xml delete mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.1.xml create mode 100644 drupal/core/modules/update/tests/modules/update_test/drupal.9.xml create mode 100644 drupal/core/modules/views_ui/src/Tests/DuplicateTest.php create mode 100644 drupal/core/modules/views_ui/src/Tests/XssTest.php create mode 100644 drupal/core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml delete mode 100644 drupal/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseRendererTest.php create mode 100644 drupal/core/tests/Drupal/Tests/Core/Controller/AjaxControllerTest.php create mode 100644 drupal/core/themes/classy/templates/aggregator-block-item.html.twig create mode 100644 drupal/core/themes/classy/templates/aggregator-feed.html.twig create mode 100644 drupal/core/themes/classy/templates/aggregator-item.html.twig create mode 100644 drupal/core/themes/classy/templates/file-link.html.twig create mode 100644 drupal/core/themes/classy/templates/file-managed-file.html.twig create mode 100644 drupal/core/themes/classy/templates/file-upload-help.html.twig create mode 100644 drupal/core/themes/classy/templates/file-widget-multiple.html.twig create mode 100644 drupal/core/themes/classy/templates/file-widget.html.twig create mode 100644 drupal/core/themes/classy/templates/rdf-metadata.html.twig create mode 100644 drupal/core/themes/classy/templates/search-result.html.twig create mode 100644 drupal/core/themes/classy/templates/taxonomy-term.html.twig create mode 100644 drupal/core/themes/classy/templates/user.html.twig create mode 100644 drupal/core/themes/classy/templates/username.html.twig mode change 120000 => 100755 drupal/core/vendor/bin/phpunit delete mode 100644 drupal/core/vendor/twig/twig/ext/twig/LICENSE create mode 100644 drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php create mode 100644 drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php create mode 100644 drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php rename drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/{batch_float.php => batch_float.test} (95%) create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test create mode 100644 drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test delete mode 100644 drupal/themes/contrib/readme.txt delete mode 100644 drupal/themes/custom/readme.txt diff --git a/drupal/LICENSE.txt b/drupal/LICENSE.txt new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/drupal/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/drupal/composer.json b/drupal/composer.json index 117dbb81..71c714f4 100644 --- a/drupal/composer.json +++ b/drupal/composer.json @@ -16,7 +16,7 @@ "symfony/serializer": "2.5.*", "symfony/validator": "2.5.*", "symfony/yaml": "dev-master#499f7d7aa96747ad97940089bd7a1fb24ad8182a", - "twig/twig": "1.15.*", + "twig/twig": "1.16.*", "doctrine/common": "dev-master#a45d110f71c323e29f41eb0696fa230e3fa1b1b5", "doctrine/annotations": "1.2.*", "guzzlehttp/guzzle": "~5.0", diff --git a/drupal/composer.lock b/drupal/composer.lock index c61f7902..f933c558 100644 --- a/drupal/composer.lock +++ b/drupal/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "838f4566f4f537d5f71fa46b66f263b0", + "hash": "4378dea31ef5185651bc10bd9a40e591", "packages": [ { "name": "doctrine/annotations", @@ -2373,16 +2373,16 @@ }, { "name": "twig/twig", - "version": "v1.15.1", + "version": "v1.16.2", "source": { "type": "git", "url": "https://github.com/fabpot/Twig.git", - "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed" + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/1fb5784662f438d7d96a541e305e28b812e2eeed", - "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed", + "url": "https://api.github.com/repos/fabpot/Twig/zipball/42f758d9fe2146d1f0470604fc05ee43580873fc", + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc", "shasum": "" }, "require": { @@ -2391,7 +2391,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.16-dev" } }, "autoload": { @@ -2426,7 +2426,7 @@ "keywords": [ "templating" ], - "time": "2014-02-13 10:19:29" + "time": "2014-10-17 12:53:44" }, { "name": "zendframework/zend-escaper", diff --git a/drupal/core/config/schema/core.data_types.schema.yml b/drupal/core/config/schema/core.data_types.schema.yml index 0e589e17..ef68a3e1 100644 --- a/drupal/core/config/schema/core.data_types.schema.yml +++ b/drupal/core/config/schema/core.data_types.schema.yml @@ -414,14 +414,19 @@ core.date_format.*: type: string label: 'Default language' -# Schema for the String field type. +# Schema for the configuration of the String field type. + +field.string.storage_settings: + type: mapping + label: 'String settings' + mapping: + max_length: + type: integer + label: 'Maximum length' field.string.field_settings: type: sequence label: 'String settings' - sequence: - - type: string - label: 'Setting' field.string.value: type: sequence @@ -434,7 +439,127 @@ field.string.value: type: string label: 'Value' -# Schema for the configuration files of the Boolean field type. +# Schema for the configuration of the String (long) field type. + +field.string_long.storage_settings: + type: field.string.storage_settings + label: 'String (long) settings' + +field.string_long.field_settings: + type: field.string.field_settings + label: 'String (long) settings' + +field.string_long.value: + type: sequence + label: 'Default value' + sequence: + - type: mapping + label: 'Default' + mapping: + value: + type: text + label: 'Value' + +# Schema for the configuration of the URI field type. + +field.uri.storage_settings: + type: mapping + label: 'URI settings' + mapping: + max_length: + type: integer + label: 'Maximum length' + +field.uri.field_settings: + type: sequence + label: 'URI settings' + +field.uri.value: + type: sequence + label: 'Default value' + sequence: + - type: mapping + label: 'Default' + mapping: + value: + type: string + label: 'Value' + +# Schema for the configuration of the Created field type. + +field.created.storage_settings: + type: sequence + label: 'Created timestamp settings' + +field.created.field_settings: + type: sequence + label: 'Created timestamp settings' + +field.created.value: + type: sequence + label: 'Default value' + sequence: + - type: mapping + label: 'Default' + mapping: + value: + type: integer + label: 'Value' + +# Schema for the configuration of the Changed field type. + +field.changed.storage_settings: + type: sequence + label: 'Changed timestamp settings' + +field.changed.field_settings: + type: sequence + label: 'Changed timestamp settings' + +field.changed.value: + type: sequence + label: 'Default value' + sequence: + - type: mapping + label: 'Default' + mapping: + value: + type: integer + label: 'Value' + +# Schema for the configuration of the Entity reference field type. + +field.entity_reference.storage_settings: + type: mapping + label: 'Entity reference settings' + mapping: + target_type: + type: string + label: 'Type of item to reference' + +field.entity_reference.field_settings: + type: mapping + label: 'Entity reference settings' + mapping: + handler: + type: string + label: 'Reference method' + handler_settings: + type: entity_reference.[%parent.handler].handler_settings + label: 'Reference method settings' + +field.entity_reference.value: + type: sequence + label: 'Default value' + sequence: + - type: mapping + label: 'Default' + mapping: + target_id: + type: integer + label: 'Value' + +# Schema for the configuration of the Boolean field type. field.boolean.storage_settings: type: mapping @@ -449,8 +574,7 @@ field.boolean.storage_settings: field.boolean.field_settings: label: 'Boolean settings' - type: mapping - mapping: { } + type: sequence field.boolean.value: type: sequence @@ -463,7 +587,7 @@ field.boolean.value: type: integer label: 'Value' -# Schema for the configuration files of the Email field type. +# Schema for the configuration of the Email field type. field.email.storage_settings: type: sequence @@ -489,7 +613,7 @@ field.email.value: type: email label: 'Value' -# Schema for configuration files of a numeric field types. +# Schema for the configuration of the Integer field type. field.integer.storage_settings: type: sequence @@ -526,6 +650,8 @@ field.integer.value: type: integer label: 'Value' +# Schema for the configuration of the Decimal field type. + field.decimal.storage_settings: type: mapping label: 'Decimal settings' @@ -565,6 +691,8 @@ field.decimal.value: type: float label: 'Value' +# Schema for the configuration of the Float field type. + field.float.storage_settings: type: sequence label: 'Float settings' diff --git a/drupal/core/core.services.yml b/drupal/core/core.services.yml index 7f9ed9b1..384659bc 100644 --- a/drupal/core/core.services.yml +++ b/drupal/core/core.services.yml @@ -655,12 +655,10 @@ services: arguments: ['@controller_resolver', '@title_resolver', '@render_html_renderer'] controller.ajax: class: Drupal\Core\Controller\AjaxController - arguments: ['@controller_resolver', '@ajax_response_renderer'] + arguments: ['@controller_resolver', '@element_info'] controller.dialog: class: Drupal\Core\Controller\DialogController arguments: ['@controller_resolver', '@title_resolver'] - ajax_response_renderer: - class: Drupal\Core\Ajax\AjaxResponseRenderer router_listener: class: Symfony\Component\HttpKernel\EventListener\RouterListener tags: @@ -672,7 +670,7 @@ services: class: Drupal\Core\EventSubscriber\ViewSubscriber tags: - { name: event_subscriber } - arguments: ['@content_negotiation', '@title_resolver', '@ajax_response_renderer'] + arguments: ['@content_negotiation', '@title_resolver'] html_view_subscriber: class: Drupal\Core\EventSubscriber\HtmlViewSubscriber tags: @@ -774,7 +772,7 @@ services: class: Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber tags: - { name: event_subscriber } - arguments: ['@html_fragment_renderer', '@html_page_renderer'] + arguments: ['@http_kernel', '@logger.channel.php'] exception.default: class: Drupal\Core\EventSubscriber\DefaultExceptionSubscriber tags: diff --git a/drupal/core/includes/common.inc b/drupal/core/includes/common.inc index 3545e05e..77e270bf 100644 --- a/drupal/core/includes/common.inc +++ b/drupal/core/includes/common.inc @@ -59,7 +59,7 @@ use Drupal\Core\Session\AnonymousUserSession; * * Correct: * @code - * $my_substring = drupal_substr($original_string, 0, 5); + * $my_substring = Unicode::substr($original_string, 0, 5); * @endcode * * @} @@ -2869,6 +2869,19 @@ function drupal_render(&$elements, $is_root_call = FALSE) { // Assume that if #theme is set it represents an implemented hook. $theme_is_implemented = isset($elements['#theme']); + // Check the elements for insecure HTML and pass through sanitization. + if (isset($elements)) { + $markup_keys = array( + '#description', + '#field_prefix', + '#field_suffix', + ); + foreach ($markup_keys as $key) { + if (!empty($elements[$key]) && is_scalar($elements[$key])) { + $elements[$key] = SafeMarkup::checkAdminXss($elements[$key]); + } + } + } // Call the element's #theme function if it is set. Then any children of the // element have to be rendered there. If the internal #render_children @@ -2950,8 +2963,9 @@ function drupal_render(&$elements, $is_root_call = FALSE) { // with how render cached output gets stored. This ensures that // #post_render_cache callbacks get the same data to work with, no matter if // #cache is disabled, #cache is enabled, there is a cache hit or miss. - $prefix = isset($elements['#prefix']) ? $elements['#prefix'] : ''; - $suffix = isset($elements['#suffix']) ? $elements['#suffix'] : ''; + $prefix = isset($elements['#prefix']) ? SafeMarkup::checkAdminXss($elements['#prefix']) : ''; + $suffix = isset($elements['#suffix']) ? SafeMarkup::checkAdminXss($elements['#suffix']) : ''; + $elements['#markup'] = $prefix . $elements['#children'] . $suffix; // We've rendered this element (and its subtree!), now update the stack. diff --git a/drupal/core/includes/file.inc b/drupal/core/includes/file.inc index f543c77d..b38cf141 100644 --- a/drupal/core/includes/file.inc +++ b/drupal/core/includes/file.inc @@ -5,6 +5,7 @@ * API for handling file uploads and server file management. */ +use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\UrlHelper; use Drupal\Component\PhpStorage\FileStorage; use Drupal\Component\Utility\Bytes; @@ -316,13 +317,25 @@ function file_create_url($uri) { // HTTP and to https://example.com/bar.jpg when viewing a HTTPS page) // Both types of relative URIs are characterized by a leading slash, hence // we can use a single check. - if (drupal_substr($uri, 0, 1) == '/') { + if (Unicode::substr($uri, 0, 1) == '/') { return $uri; } else { // If this is not a properly formatted stream, then it is a shipped file. // Therefore, return the urlencoded URI with the base URL prepended. - return $GLOBALS['base_url'] . '/' . UrlHelper::encodePath($uri); + $options = UrlHelper::parse($uri); + $path = $GLOBALS['base_url'] . '/' . UrlHelper::encodePath($options['path']); + // Append the query. + if ($options['query']) { + $path .= '?' . UrlHelper::buildQuery($options['query']); + } + + // Append fragment. + if ($options['fragment']) { + $path .= '#' . $options['fragment']; + } + + return $path; } } elseif ($scheme == 'http' || $scheme == 'https' || $scheme == 'data') { diff --git a/drupal/core/includes/form.inc b/drupal/core/includes/form.inc index d5eaa54f..0bffd396 100644 --- a/drupal/core/includes/form.inc +++ b/drupal/core/includes/form.inc @@ -17,30 +17,6 @@ use Drupal\Core\Render\Element; use Drupal\Core\Template\Attribute; use Symfony\Component\HttpFoundation\RedirectResponse; -/** - * Fetches a form from the cache. - * - * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. - * Use \Drupal::formBuilder()->getCache(). - * - * @see \Drupal\Core\Form\FormCacheInterface::getCache(). - */ -function form_get_cache($form_build_id, FormStateInterface $form_state) { - return \Drupal::formBuilder()->getCache($form_build_id, $form_state); -} - -/** - * Stores a form in the cache. - * - * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. - * Use \Drupal::formBuilder()->setCache(). - * - * @see \Drupal\Core\Form\FormCacheInterface::setCache(). - */ -function form_set_cache($form_build_id, $form, FormStateInterface $form_state) { - \Drupal::formBuilder()->setCache($form_build_id, $form, $form_state); -} - /** * Retrieves, populates, and processes a form. * diff --git a/drupal/core/includes/theme.inc b/drupal/core/includes/theme.inc index 15d62a8d..e772289e 100644 --- a/drupal/core/includes/theme.inc +++ b/drupal/core/includes/theme.inc @@ -11,6 +11,7 @@ use Drupal\Component\Serialization\Json; use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\String; +use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\Xss; use Drupal\Core\Config\Config; @@ -764,7 +765,7 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config) $config->set('favicon.mimetype', $value); } else if (substr($key, 0, 7) == 'toggle_') { - $config->set('features.' . drupal_substr($key, 7), $value); + $config->set('features.' . Unicode::substr($key, 7), $value); } else if (!in_array($key, array('theme', 'logo_upload'))) { $config->set($key, $value); diff --git a/drupal/core/includes/unicode.inc b/drupal/core/includes/unicode.inc index a0dc9ccd..c9e7246f 100644 --- a/drupal/core/includes/unicode.inc +++ b/drupal/core/includes/unicode.inc @@ -96,7 +96,7 @@ function drupal_xml_parser_create(&$data) { // Unsupported encodings are converted here into UTF-8. $php_supported = array('utf-8', 'iso-8859-1', 'us-ascii'); if (!in_array(strtolower($encoding), $php_supported)) { - $out = drupal_convert_to_utf8($data, $encoding); + $out = Unicode::convertToUtf8($data, $encoding); if ($out !== FALSE) { $encoding = 'utf-8'; $data = preg_replace('/^(<\?xml[^>]+encoding)="(.+?)"/', '\\1="utf-8"', $out); diff --git a/drupal/core/lib/Drupal/Component/Plugin/ConfigurablePluginInterface.php b/drupal/core/lib/Drupal/Component/Plugin/ConfigurablePluginInterface.php index b77d3a2a..47679a79 100644 --- a/drupal/core/lib/Drupal/Component/Plugin/ConfigurablePluginInterface.php +++ b/drupal/core/lib/Drupal/Component/Plugin/ConfigurablePluginInterface.php @@ -12,7 +12,7 @@ * * @ingroup plugin_api */ -interface ConfigurablePluginInterface { +interface ConfigurablePluginInterface extends DependentPluginInterface { /** * Returns this plugin's configuration. @@ -38,29 +38,4 @@ public function setConfiguration(array $configuration); */ public function defaultConfiguration(); - /** - * Calculates dependencies for the configured plugin. - * - * Dependencies are saved in the plugin's configuration entity and are used to - * determine configuration synchronization order. For example, if the plugin - * integrates with specific user roles, this method should return an array of - * dependencies listing the specified roles. - * - * @return array - * An array of dependencies grouped by type (config, content, module, - * theme). For example: - * @code - * array( - * 'config' => array('user.role.anonymous', 'user.role.authenticated'), - * 'content' => array('node:article:f0a189e6-55fb-47fb-8005-5bef81c44d6d'), - * 'module' => array('node', 'user'), - * 'theme' => array('seven'), - * ); - * @endcode - * - * @see \Drupal\Core\Config\Entity\ConfigDependencyManager - * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() - */ - public function calculateDependencies(); - } diff --git a/drupal/core/lib/Drupal/Component/Plugin/DependentPluginInterface.php b/drupal/core/lib/Drupal/Component/Plugin/DependentPluginInterface.php new file mode 100644 index 00000000..780c1202 --- /dev/null +++ b/drupal/core/lib/Drupal/Component/Plugin/DependentPluginInterface.php @@ -0,0 +1,42 @@ + array('user.role.anonymous', 'user.role.authenticated'), + * 'content' => array('node:article:f0a189e6-55fb-47fb-8005-5bef81c44d6d'), + * 'module' => array('node', 'user'), + * 'theme' => array('seven'), + * ); + * @endcode + * + * @see \Drupal\Core\Config\Entity\ConfigDependencyManager + * @see \Drupal\Core\Entity\EntityInterface::getConfigDependencyName() + */ + public function calculateDependencies(); + +} diff --git a/drupal/core/lib/Drupal/Component/Utility/SafeMarkup.php b/drupal/core/lib/Drupal/Component/Utility/SafeMarkup.php index dc0a6a1b..56bd518a 100644 --- a/drupal/core/lib/Drupal/Component/Utility/SafeMarkup.php +++ b/drupal/core/lib/Drupal/Component/Utility/SafeMarkup.php @@ -52,7 +52,7 @@ class SafeMarkup { * or element that set it. Therefore, only valid HTML should be * marked as safe (never partial markup). For example, you should never do: * @code - * SafeMarkup::set("<"); + * SafeMarkup::set('<'); * @endcode * or: * @code @@ -85,7 +85,7 @@ public static function set($string, $strategy = 'html') { * @param string $string * The content to be checked. * @param string $strategy - * The escaping strategy. See SafeMarkup::set(). Defaults to 'html'. + * The escaping strategy. See self::set(). Defaults to 'html'. * * @return bool * TRUE if the string has been marked secure, FALSE otherwise. @@ -103,7 +103,7 @@ public static function isSafe($string, $strategy = 'html') { * added to any safe strings already marked for the current request. * * @param array $safe_strings - * A list of safe strings as previously retrieved by SafeMarkup::getAll(). + * A list of safe strings as previously retrieved by self::getAll(). * * @throws \UnexpectedValueException */ @@ -125,17 +125,33 @@ public static function setMultiple(array $safe_strings) { /** * Encodes special characters in a plain-text string for display as HTML. * - * @param $string + * @param string $string * A string. * * @return string * The escaped string. If $string was already set as safe with - * SafeString::set, it won't be escaped again. + * self::set(), it won't be escaped again. */ public static function escape($string) { return static::isSafe($string) ? $string : String::checkPlain($string); } + /** + * Applies a very permissive XSS/HTML filter for admin-only use. + * + * @param string $string + * A string. + * + * @return string + * The escaped string. If $string was already set as safe with + * self::set(), it won't be escaped again. + * + * @see \Drupal\Component\Utility\Xss::filterAdmin() + */ + public static function checkAdminXss($string) { + return static::isSafe($string) ? $string : Xss::filterAdmin($string); + } + /** * Retrieves all strings currently marked as safe. * diff --git a/drupal/core/lib/Drupal/Core/Ajax/AjaxResponseRenderer.php b/drupal/core/lib/Drupal/Core/Ajax/AjaxResponseRenderer.php deleted file mode 100644 index ab9aa8e8..00000000 --- a/drupal/core/lib/Drupal/Core/Ajax/AjaxResponseRenderer.php +++ /dev/null @@ -1,93 +0,0 @@ -isOk()) { - return $content; - } - - // Allow controllers to return an HtmlFragment directly. - if ($content instanceof HtmlFragment) { - $content = $content->getContent(); - } - // Most controllers return a render array, but some return a string. - if (!is_array($content)) { - $content = array( - '#markup' => $content, - ); - } - - $response = new AjaxResponse(); - - if (isset($content['#type']) && ($content['#type'] == 'ajax')) { - // Complex Ajax callbacks can return a result that contains an error - // message or a specific set of commands to send to the browser. - $content += $this->elementInfo('ajax'); - $error = $content['#error']; - if (!empty($error)) { - // Fall back to some default message otherwise use the specific one. - if (!is_string($error)) { - $error = 'An error occurred while handling the request: The server received invalid input.'; - } - $response->addCommand(new AlertCommand($error)); - } - } - - $html = $this->drupalRenderRoot($content); - - // The selector for the insert command is NULL as the new content will - // replace the element making the Ajax call. The default 'replaceWith' - // behavior can be changed with #ajax['method']. - $response->addCommand(new InsertCommand(NULL, $html)); - $status_messages = array('#theme' => 'status_messages'); - $output = $this->drupalRenderRoot($status_messages); - if (!empty($output)) { - $response->addCommand(new PrependCommand(NULL, $output)); - } - return $response; - } - - /** - * Wraps drupal_render_root(). - * - * @todo: Remove as part of https://drupal.org/node/2182149 - */ - protected function drupalRenderRoot(&$elements) { - $output = drupal_render_root($elements); - drupal_process_attached($elements); - return $output; - } - - /** - * Wraps element_info(). - */ - protected function elementInfo($type) { - return element_info($type); - } - -} diff --git a/drupal/core/lib/Drupal/Core/Block/MainContentBlockPluginInterface.php b/drupal/core/lib/Drupal/Core/Block/MainContentBlockPluginInterface.php new file mode 100644 index 00000000..2516348b --- /dev/null +++ b/drupal/core/lib/Drupal/Core/Block/MainContentBlockPluginInterface.php @@ -0,0 +1,27 @@ +getConfigDependencyName(); } } - - return array_merge($dependent_entities, $this->createGraphConfigEntityDependencies($entities_to_check)); + $dependencies = array_merge($this->createGraphConfigEntityDependencies($entities_to_check), $dependent_entities); + // Sort dependencies in the reverse order of the graph. So the least + // dependent is at the top. For example, this ensures that fields are + // always after field storages. This is because field storages need to be + // created before a field. + return array_reverse(array_intersect_key($this->graph, $dependencies)); } /** diff --git a/drupal/core/lib/Drupal/Core/Controller/AjaxController.php b/drupal/core/lib/Drupal/Core/Controller/AjaxController.php index c63360cc..79ee2c08 100644 --- a/drupal/core/lib/Drupal/Core/Controller/AjaxController.php +++ b/drupal/core/lib/Drupal/Core/Controller/AjaxController.php @@ -7,10 +7,16 @@ namespace Drupal\Core\Controller; -use Drupal\Core\Ajax\AjaxResponseRenderer; +use Drupal\Core\Ajax\AjaxResponse; +use Drupal\Core\Ajax\AlertCommand; +use Drupal\Core\Ajax\InsertCommand; +use Drupal\Core\Ajax\PrependCommand; +use Drupal\Core\Page\HtmlFragment; +use Drupal\Core\Render\ElementInfoManagerInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; /** * Default controller for Ajax requests. @@ -27,23 +33,23 @@ class AjaxController implements ContainerAwareInterface { protected $controllerResolver; /** - * The Ajax response renderer. + * The element info manager. * - * @var \Drupal\Core\Ajax\AjaxResponseRenderer + * @var \Drupal\Core\Render\ElementInfoManagerInterface */ - protected $ajaxRenderer; + protected $elementInfoManager; /** * Constructs a new AjaxController instance. * * @param \Drupal\Core\Controller\ControllerResolverInterface $controller_resolver * The controller resolver. - * @param \Drupal\Core\Ajax\AjaxResponseRenderer $ajax_renderer - * The Ajax response renderer. + * @param \Drupal\Core\Render\ElementInfoManagerInterface $element_info_manager + * The element info manager. */ - public function __construct(ControllerResolverInterface $controller_resolver, AjaxResponseRenderer $ajax_renderer) { + public function __construct(ControllerResolverInterface $controller_resolver, ElementInfoManagerInterface $element_info_manager) { $this->controllerResolver = $controller_resolver; - $this->ajaxRenderer = $ajax_renderer; + $this->elementInfoManager = $element_info_manager; } /** @@ -59,7 +65,51 @@ public function __construct(ControllerResolverInterface $controller_resolver, Aj */ public function content(Request $request, $_content) { $content = $this->getContentResult($request, $_content); - return $this->ajaxRenderer->render($content); + + // If there is already a Response object, return it without manipulation. + if ($content instanceof Response && $content->isOk()) { + return $content; + } + + // Allow controllers to return an HtmlFragment directly. + if ($content instanceof HtmlFragment) { + $content = $content->getContent(); + } + // Most controllers return a render array, but some return a string. + if (!is_array($content)) { + $content = array( + '#markup' => $content, + ); + } + + $response = new AjaxResponse(); + + if (isset($content['#type']) && ($content['#type'] == 'ajax')) { + // Complex Ajax callbacks can return a result that contains an error + // message or a specific set of commands to send to the browser. + $content += $this->elementInfoManager->getInfo('ajax'); + $error = $content['#error']; + if (!empty($error)) { + // Fall back to some default message otherwise use the specific one. + if (!is_string($error)) { + $error = 'An error occurred while handling the request: The server received invalid input.'; + } + $response->addCommand(new AlertCommand($error)); + } + } + + $html = $this->drupalRenderRoot($content); + + // The selector for the insert command is NULL as the new content will + // replace the element making the Ajax call. The default 'replaceWith' + // behavior can be changed with #ajax['method']. + $response->addCommand(new InsertCommand(NULL, $html)); + $status_messages = array('#theme' => 'status_messages'); + $output = $this->drupalRenderRoot($status_messages); + if (!empty($output)) { + $response->addCommand(new PrependCommand(NULL, $output)); + } + return $response; } /** @@ -87,4 +137,15 @@ public function getContentResult(Request $request, $controller_definition) { return $page_content; } + /** + * Wraps drupal_render_root(). + * + * @todo: Remove as part of https://drupal.org/node/2182149 + */ + protected function drupalRenderRoot(&$elements) { + $output = drupal_render_root($elements); + drupal_process_attached($elements); + return $output; + } + } diff --git a/drupal/core/lib/Drupal/Core/Controller/HtmlControllerBase.php b/drupal/core/lib/Drupal/Core/Controller/HtmlControllerBase.php index b2a639bf..88e0efe7 100644 --- a/drupal/core/lib/Drupal/Core/Controller/HtmlControllerBase.php +++ b/drupal/core/lib/Drupal/Core/Controller/HtmlControllerBase.php @@ -49,13 +49,16 @@ public function __construct(TitleResolverInterface $title_resolver, RenderHtmlRe /** * Converts a render array into an HtmlFragment object. * - * @param array|string $page_content + * @param array|\Drupal\Core\Page\HtmlFragmentInterface|\Symfony\Component\HttpFoundation\Response $page_content * The page content area to display. * @param \Symfony\Component\HttpFoundation\Request $request * The request object. * * @return \Drupal\Core\Page\HtmlPage * A page object. + * + * @throws \InvalidArgumentException + * Thrown if the controller returns a string. */ protected function createHtmlFragment($page_content, Request $request) { // Allow controllers to return a HtmlFragment or a Response object directly. @@ -63,8 +66,8 @@ protected function createHtmlFragment($page_content, Request $request) { return $page_content; } - if (!is_array($page_content)) { - $page_content = ['#markup' => $page_content]; + if (is_string($page_content)) { + throw new \InvalidArgumentException('_content controllers are not allowed to return strings. You can return a render array, a html fragment or a response object.'); } $fragment = $this->renderHtmlRenderer->render($page_content); diff --git a/drupal/core/lib/Drupal/Core/Display/Annotation/DisplayVariant.php b/drupal/core/lib/Drupal/Core/Display/Annotation/DisplayVariant.php index dd5a1323..3c05cf3b 100644 --- a/drupal/core/lib/Drupal/Core/Display/Annotation/DisplayVariant.php +++ b/drupal/core/lib/Drupal/Core/Display/Annotation/DisplayVariant.php @@ -13,9 +13,7 @@ * Defines a display variant annotation object. * * Display variants are used to dictate the output of a given Display, which - * can be used to control the output of many parts of Drupal. For example, the - * FullPageVariant is used by the Block module to control regions and output - * block content placed in those regions. + * can be used to control the output of many parts of Drupal. * * Variants are usually chosen by some selection criteria, and are instantiated * directly. Each variant must define its own approach to rendering, and can @@ -33,6 +31,7 @@ * @see \Drupal\Core\Display\VariantInterface * @see \Drupal\Core\Display\VariantBase * @see \Drupal\Core\Display\VariantManager + * @see \Drupal\Core\Display\PageVariantInterface * @see plugin_api * * @Annotation diff --git a/drupal/core/lib/Drupal/Core/Display/Annotation/PageDisplayVariant.php b/drupal/core/lib/Drupal/Core/Display/Annotation/PageDisplayVariant.php new file mode 100644 index 00000000..bc07297c --- /dev/null +++ b/drupal/core/lib/Drupal/Core/Display/Annotation/PageDisplayVariant.php @@ -0,0 +1,26 @@ +__construct($values, $this->entityTypeId); } + /** + * {@inheritdoc} + */ + public function getPluginCollections() { + $configurations = array(); + foreach ($this->getComponents() as $field_name => $configuration) { + if (!empty($configuration['type']) && ($field_definition = $this->getFieldDefinition($field_name))) { + $configurations[$configuration['type']] = $configuration + array( + 'field_definition' => $field_definition, + 'form_mode' => $this->mode, + ); + } + } + + return array( + 'widgets' => new EntityDisplayPluginCollection($this->pluginManager, $configurations) + ); + } + } diff --git a/drupal/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php b/drupal/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php index 9a73268e..17d6b44a 100644 --- a/drupal/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php +++ b/drupal/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php @@ -9,6 +9,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; +use Drupal\Core\Entity\EntityDisplayPluginCollection; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\EntityDisplayBase; @@ -252,4 +253,22 @@ public function buildMultiple(array $entities) { return $build_list; } + /** + * {@inheritdoc} + */ + public function getPluginCollections() { + $configurations = array(); + foreach ($this->getComponents() as $field_name => $configuration) { + if (!empty($configuration['type']) && ($field_definition = $this->getFieldDefinition($field_name))) { + $configurations[$configuration['type']] = $configuration + array( + 'field_definition' => $field_definition, + 'view_mode' => $this->originalMode, + ); + } + } + + return array( + 'formatters' => new EntityDisplayPluginCollection($this->pluginManager, $configurations) + ); + } } diff --git a/drupal/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/drupal/core/lib/Drupal/Core/Entity/EntityDisplayBase.php index e46dff0e..98c242fb 100644 --- a/drupal/core/lib/Drupal/Core/Entity/EntityDisplayBase.php +++ b/drupal/core/lib/Drupal/Core/Entity/EntityDisplayBase.php @@ -175,17 +175,6 @@ public function calculateDependencies() { if ($field) { $this->addDependency('config', $field->getConfigDependencyName()); } - // Create a dependency on the module that provides the formatter or - // widget. - if (isset($component['type']) && $definition = $this->pluginManager->getDefinition($component['type'], FALSE)) { - $this->addDependency('module', $definition['provider']); - } - // Create dependencies on any modules providing third party settings. - if (isset($component['third_party_settings'])) { - foreach($component['third_party_settings'] as $module => $settings) { - $this->addDependency('module', $module); - } - } } // Depend on configured modes. if ($this->mode != 'default') { diff --git a/drupal/core/lib/Drupal/Core/Entity/EntityDisplayPluginCollection.php b/drupal/core/lib/Drupal/Core/Entity/EntityDisplayPluginCollection.php new file mode 100644 index 00000000..d58e841f --- /dev/null +++ b/drupal/core/lib/Drupal/Core/Entity/EntityDisplayPluginCollection.php @@ -0,0 +1,24 @@ +configFactory = $config_factory; $this->aliasManager = $alias_manager; - $this->httpKernel = $http_kernel; - $this->logger = $logger; } /** @@ -76,17 +59,7 @@ protected static function getPriority() { } /** - * {@inheritDoc} - */ - protected function getHandledFormats() { - return ['html']; - } - - /** - * Handles a 403 error for HTML. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event - * The event to process. + * {@inheritdoc} */ public function on403(GetResponseForExceptionEvent $event) { $path = $this->aliasManager->getPathByAlias($this->configFactory->get('system.site')->get('page.403')); @@ -94,56 +67,11 @@ public function on403(GetResponseForExceptionEvent $event) { } /** - * Handles a 404 error for HTML. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event - * The event to process. + * {@inheritdoc} */ public function on404(GetResponseForExceptionEvent $event) { $path = $this->aliasManager->getPathByAlias($this->configFactory->get('system.site')->get('page.404')); $this->makeSubrequest($event, $path, Response::HTTP_NOT_FOUND); } - /** - * Makes a subrequest to retrieve a custom error page. - * - * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event - * The event to process - * @param string $path - * The path to which to make a subrequest for this error message. - * @param int $status_code - * The status code for the error being handled. - */ - protected function makeSubrequest(GetResponseForExceptionEvent $event, $path, $status_code) { - $request = $event->getRequest(); - - // @todo Remove dependency on the internal _system_path attribute: - // https://www.drupal.org/node/2293523. - $system_path = $request->attributes->get('_system_path'); - - if ($path && $path != $system_path) { - // @todo The create() method expects a slash-prefixed path, but we store a - // normal system path in the site_404 variable. - if ($request->getMethod() === 'POST') { - $sub_request = Request::create($request->getBaseUrl() . '/' . $path, 'POST', ['destination' => $system_path, '_exception_statuscode' => $status_code] + $request->request->all(), $request->cookies->all(), [], $request->server->all()); - } - else { - $sub_request = Request::create($request->getBaseUrl() . '/' . $path, 'GET', $request->query->all() + ['destination' => $system_path, '_exception_statuscode' => $status_code], $request->cookies->all(), [], $request->server->all()); - } - - try { - $response = $this->httpKernel->handle($sub_request, HttpKernelInterface::SUB_REQUEST); - $response->setStatusCode($status_code); - $event->setResponse($response); - } - catch (\Exception $e) { - // If an error happened in the subrequest we can't do much else. - // Instead, just log it. The DefaultExceptionHandler will catch the - // original exception and handle it normally. - $error = Error::decodeException($e); - $this->logger->log($error['severity_level'], '%type: !message in %function (line %line of %file).', $error); - } - } - } - } diff --git a/drupal/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php b/drupal/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php index 0df6a307..9535abf5 100644 --- a/drupal/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php +++ b/drupal/core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php @@ -7,44 +7,43 @@ namespace Drupal\Core\EventSubscriber; -use Drupal\Core\Page\HtmlFragment; -use Drupal\Core\Page\HtmlFragmentRendererInterface; -use Drupal\Core\Page\HtmlPageRendererInterface; -use Drupal\Core\StringTranslation\StringTranslationTrait; +use Drupal\Core\Utility\Error; +use Psr\Log\LoggerInterface; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; +use Symfony\Component\HttpKernel\HttpKernelInterface; /** - * Handle most HTTP errors for HTML. + * Exception subscriber for handling core default HTML error pages. */ class DefaultExceptionHtmlSubscriber extends HttpExceptionSubscriberBase { - use StringTranslationTrait; /** - * The HTML fragment renderer. + * The HTTP kernel. * - * @var \Drupal\Core\Page\HtmlFragmentRendererInterface + * @var \Symfony\Component\HttpKernel\HttpKernelInterface */ - protected $fragmentRenderer; + protected $httpKernel; /** - * The HTML page renderer. + * The logger instance. * - * @var \Drupal\Core\Page\HtmlPageRendererInterface + * @var \Psr\Log\LoggerInterface */ - protected $htmlPageRenderer; + protected $logger; /** * Constructs a new DefaultExceptionHtmlSubscriber. * - * @param \Drupal\Core\Page\HtmlFragmentRendererInterface $fragment_renderer - * The fragment renderer. - * @param \Drupal\Core\Page\HtmlPageRendererInterface $page_renderer - * The page renderer. + * @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel + * The HTTP kernel. + * @param \Psr\Log\LoggerInterface $logger + * The logger service. */ - public function __construct(HtmlFragmentRendererInterface $fragment_renderer, HtmlPageRendererInterface $page_renderer) { - $this->fragmentRenderer = $fragment_renderer; - $this->htmlPageRenderer = $page_renderer; + public function __construct(HttpKernelInterface $http_kernel, LoggerInterface $logger) { + $this->httpKernel = $http_kernel; + $this->logger = $logger; } /** @@ -70,9 +69,7 @@ protected function getHandledFormats() { * The event to process. */ public function on403(GetResponseForExceptionEvent $event) { - $response = $this->createResponse($this->t('Access denied'), $this->t('You are not authorized to access this page.'), Response::HTTP_FORBIDDEN); - $response->headers->set('Content-type', 'text/html'); - $event->setResponse($response); + $this->makeSubrequest($event, 'system/403', Response::HTTP_FORBIDDEN); } /** @@ -82,40 +79,50 @@ public function on403(GetResponseForExceptionEvent $event) { * The event to process. */ public function on404(GetResponseForExceptionEvent $event) { - $path = $event->getRequest()->getPathInfo(); - $response = $this->createResponse($this->t('Page not found'), $this->t('The requested page "@path" could not be found.', ['@path' => $path]), Response::HTTP_NOT_FOUND); - $response->headers->set('Content-type', 'text/html'); - $event->setResponse($response); + $this->makeSubrequest($event, 'system/404', Response::HTTP_NOT_FOUND); } /** - * Handles a 405 error for HTML. + * Makes a subrequest to retrieve the default error page. * * @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event - * The event to process. + * The event to process + * @param string $path + * The path to which to make a subrequest for this error message. + * @param int $status_code + * The status code for the error being handled. */ - public function on405(GetResponseForExceptionEvent $event) { - $response = new Response('Method Not Allowed', Response::HTTP_METHOD_NOT_ALLOWED); - $response->headers->set('Content-type', 'text/html'); - $event->setResponse($response); - } + protected function makeSubrequest(GetResponseForExceptionEvent $event, $path, $status_code) { + $request = $event->getRequest(); - /** - * @param $title - * The page title of the response. - * @param $body - * The body of the error page. - * @param $response_code - * The HTTP response code of the response. - * @return Response - * An error Response object ready to return to the browser. - */ - protected function createResponse($title, $body, $response_code) { - $fragment = new HtmlFragment($body); - $fragment->setTitle($title); + // @todo Remove dependency on the internal _system_path attribute: + // https://www.drupal.org/node/2293523. + $system_path = $request->attributes->get('_system_path'); + + if ($path && $path != $system_path) { + if ($request->getMethod() === 'POST') { + $sub_request = Request::create($request->getBaseUrl() . '/' . $path, 'POST', ['destination' => $system_path, '_exception_statuscode' => $status_code] + $request->request->all(), $request->cookies->all(), [], $request->server->all()); + } + else { + $sub_request = Request::create($request->getBaseUrl() . '/' . $path, 'GET', $request->query->all() + ['destination' => $system_path, '_exception_statuscode' => $status_code], $request->cookies->all(), [], $request->server->all()); + } + + try { + // Persist the 'exception' attribute to the subrequest. + $sub_request->attributes->set('exception', $request->attributes->get('exception')); - $page = $this->fragmentRenderer->render($fragment, $response_code); - return new Response($this->htmlPageRenderer->render($page), $page->getStatusCode()); + $response = $this->httpKernel->handle($sub_request, HttpKernelInterface::SUB_REQUEST); + $response->setStatusCode($status_code); + $event->setResponse($response); + } + catch (\Exception $e) { + // If an error happened in the subrequest we can't do much else. Instead, + // just log it. The DefaultExceptionSubscriber will catch the original + // exception and handle it normally. + $error = Error::decodeException($e); + $this->logger->log($error['severity_level'], '%type: !message in %function (line %line of %file).', $error); + } + } } } diff --git a/drupal/core/lib/Drupal/Core/Field/BaseFieldDefinition.php b/drupal/core/lib/Drupal/Core/Field/BaseFieldDefinition.php index 9b04e9c8..a96bdd46 100644 --- a/drupal/core/lib/Drupal/Core/Field/BaseFieldDefinition.php +++ b/drupal/core/lib/Drupal/Core/Field/BaseFieldDefinition.php @@ -438,11 +438,22 @@ public function setDefaultValueCallback($callback) { * the first item. * - a numerically indexed array of items, each item being a property/value * array. + * - a non-numerically indexed array, in which case the array is assumed to + * be a property/value array and used as the first item * - NULL or array() for no default value. * * @return $this */ public function setDefaultValue($value) { + // Unless the value is NULL or an empty array, we may need to transform it. + if (!(is_null($value) || (is_array($value) && empty($value)))) { + if (!is_array($value)) { + $value = array(array($this->getMainPropertyName() => $value)); + } + elseif (!is_numeric(array_keys($value)[0])) { + $value = array(0 => $value); + } + } $this->definition['default_value'] = $value; return $this; } diff --git a/drupal/core/lib/Drupal/Core/Field/FieldConfigBase.php b/drupal/core/lib/Drupal/Core/Field/FieldConfigBase.php index 79eb14b8..7f7e6bed 100644 --- a/drupal/core/lib/Drupal/Core/Field/FieldConfigBase.php +++ b/drupal/core/lib/Drupal/Core/Field/FieldConfigBase.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Field; +use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Config\Entity\ThirdPartySettingsTrait; use Drupal\Core\Entity\EntityStorageInterface; @@ -228,10 +229,25 @@ public function getTargetBundle() { */ public function calculateDependencies() { parent::calculateDependencies(); + // Add dependencies from the field type plugin. We can not use + // self::calculatePluginDependencies() because instantiation of a field item + // plugin requires a parent entity. + /** @var $field_type_manager \Drupal\Core\Field\FieldTypePluginManagerInterface */ + $field_type_manager = \Drupal::service('plugin.manager.field.field_type'); + $definition = $field_type_manager->getDefinition($this->getType()); + $this->addDependency('module', $definition['provider']); + // Plugins can declare additional dependencies in their definition. + if (isset($definition['config_dependencies'])) { + $this->addDependencies($definition['config_dependencies']); + } + // Let the field type plugin specify its own dependencies. + // @see \Drupal\Core\Field\FieldItemInterface::calculateDependencies() + $this->addDependencies($definition['class']::calculateDependencies($this)); + + // If the target entity type uses entities to manage its bundles then + // depend on the bundle entity. $bundle_entity_type_id = $this->entityManager()->getDefinition($this->entity_type)->getBundleEntityType(); if ($bundle_entity_type_id != 'bundle') { - // If the target entity type uses entities to manage its bundles then - // depend on the bundle entity. $bundle_entity = $this->entityManager()->getStorage($bundle_entity_type_id)->load($this->bundle); $this->addDependency('config', $bundle_entity->getConfigDependencyName()); } diff --git a/drupal/core/lib/Drupal/Core/Field/FieldItemBase.php b/drupal/core/lib/Drupal/Core/Field/FieldItemBase.php index ec0c22d7..db8601cc 100644 --- a/drupal/core/lib/Drupal/Core/Field/FieldItemBase.php +++ b/drupal/core/lib/Drupal/Core/Field/FieldItemBase.php @@ -289,4 +289,11 @@ public static function fieldSettingsFromConfigData(array $settings) { return $settings; } + /** + * {@inheritdoc} + */ + public static function calculateDependencies(FieldDefinitionInterface $field_definition) { + return array(); + } + } diff --git a/drupal/core/lib/Drupal/Core/Field/FieldItemInterface.php b/drupal/core/lib/Drupal/Core/Field/FieldItemInterface.php index 10628f5c..862b9e5a 100644 --- a/drupal/core/lib/Drupal/Core/Field/FieldItemInterface.php +++ b/drupal/core/lib/Drupal/Core/Field/FieldItemInterface.php @@ -372,4 +372,32 @@ public function storageSettingsForm(array &$form, FormStateInterface $form_state */ public function fieldSettingsForm(array $form, FormStateInterface $form_state); + /** + * Calculates dependencies for field items. + * + * Dependencies are saved in the field configuration entity and are used to + * determine configuration synchronization order. For example, if the field + * type's default value is a content entity, this method should return an + * array of dependencies listing the content entities. + * + * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition + * The field definition. + * + * @return array + * An array of dependencies grouped by type (config, content, module, + * theme). For example: + * @code + * array( + * 'config' => array('user.role.anonymous', 'user.role.authenticated'), + * 'content' => array('node:article:f0a189e6-55fb-47fb-8005-5bef81c44d6d'), + * 'module' => array('node', 'user'), + * 'theme' => array('seven'), + * ); + * @endcode + * + * @see \Drupal\Core\Config\Entity\ConfigDependencyManager + * @see \Drupal\Core\Config\Entity\ConfigEntityInterface::getConfigDependencyName() + */ + public static function calculateDependencies(FieldDefinitionInterface $field_definition); + } diff --git a/drupal/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php b/drupal/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php index 63c9a668..b31829cc 100644 --- a/drupal/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php +++ b/drupal/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; +use Drupal\Core\Config\Entity\ConfigEntityType; use Drupal\Core\Entity\Entity; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\TypedData\EntityDataDefinition; @@ -15,6 +16,7 @@ use Drupal\Core\Field\FieldItemBase; use Drupal\Core\TypedData\DataDefinition; use Drupal\Core\TypedData\DataReferenceDefinition; +use Drupal\entity_reference\Exception\MissingDefaultValueException; /** * Defines the 'entity_reference' entity field type. @@ -242,4 +244,27 @@ public function hasUnsavedEntity() { return $this->target_id === NULL && ($entity = $this->entity) && $entity->isNew(); } + /** + * {@inheritdoc} + */ + public static function calculateDependencies(FieldDefinitionInterface $field_definition) { + $dependencies = []; + + if (is_array($field_definition->default_value) && count($field_definition->default_value)) { + $target_entity_type = \Drupal::entityManager()->getDefinition($field_definition->getFieldStorageDefinition()->getSetting('target_type')); + $key = $target_entity_type instanceof ConfigEntityType ? 'config' : 'content'; + foreach ($field_definition->default_value as $default_value) { + if (is_array($default_value) && isset($default_value['target_uuid'])) { + $entity = \Drupal::entityManager()->loadEntityByUuid($target_entity_type->id(), $default_value['target_uuid']); + // If the entity does not exist do not create the dependency. + // @see \Drupal\Core\Field\EntityReferenceFieldItemList::processDefaultValue() + if ($entity) { + $dependencies[$key][] = $entity->getConfigDependencyName(); + } + } + } + } + return $dependencies; + } + } diff --git a/drupal/core/lib/Drupal/Core/Field/PluginSettingsBase.php b/drupal/core/lib/Drupal/Core/Field/PluginSettingsBase.php index 37f69f3e..9459dd14 100644 --- a/drupal/core/lib/Drupal/Core/Field/PluginSettingsBase.php +++ b/drupal/core/lib/Drupal/Core/Field/PluginSettingsBase.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Field; +use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Core\Plugin\PluginBase; /** @@ -14,7 +15,7 @@ * * This class handles lazy replacement of default settings values. */ -abstract class PluginSettingsBase extends PluginBase implements PluginSettingsInterface { +abstract class PluginSettingsBase extends PluginBase implements PluginSettingsInterface, DependentPluginInterface { /** * The plugin settings. @@ -108,4 +109,17 @@ public function setThirdPartySetting($module, $key, $value) { return $this; } + /** + * {@inheritdoc} + */ + public function calculateDependencies() { + if (!empty($this->thirdPartySettings)) { + // Create dependencies on any modules providing third party settings. + return array( + 'module' => array_keys($this->thirdPartySettings) + ); + } + return array(); + } + } diff --git a/drupal/core/lib/Drupal/Core/Field/WidgetFactory.php b/drupal/core/lib/Drupal/Core/Field/WidgetFactory.php deleted file mode 100644 index db8c2913..00000000 --- a/drupal/core/lib/Drupal/Core/Field/WidgetFactory.php +++ /dev/null @@ -1,25 +0,0 @@ -discovery->getDefinition($plugin_id); - $plugin_class = static::getPluginClass($plugin_id, $plugin_definition, $this->interface); - return new $plugin_class($plugin_id, $plugin_definition, $configuration['field_definition'], $configuration['settings']); - } -} diff --git a/drupal/core/lib/Drupal/Core/Field/WidgetPluginManager.php b/drupal/core/lib/Drupal/Core/Field/WidgetPluginManager.php index 8aa4434c..fb7abdd8 100644 --- a/drupal/core/lib/Drupal/Core/Field/WidgetPluginManager.php +++ b/drupal/core/lib/Drupal/Core/Field/WidgetPluginManager.php @@ -51,8 +51,6 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac $this->setCacheBackend($cache_backend, 'field_widget_types_plugins'); $this->alterInfo('field_widget_info'); - - $this->factory = new WidgetFactory($this); $this->fieldTypeManager = $field_type_manager; } diff --git a/drupal/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php b/drupal/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php index f3d7aafe..caa2af37 100644 --- a/drupal/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php +++ b/drupal/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Mail\Plugin\Mail; +use Drupal\Component\Utility\Unicode; use Drupal\Core\Mail\MailInterface; use Drupal\Core\Site\Settings; @@ -65,11 +66,11 @@ public function mail(array $message) { } $mimeheaders = array(); foreach ($message['headers'] as $name => $value) { - $mimeheaders[] = $name . ': ' . mime_header_encode($value); + $mimeheaders[] = $name . ': ' . Unicode::mimeHeaderEncode($value); } $line_endings = Settings::get('mail_line_endings', PHP_EOL); // Prepare mail commands. - $mail_subject = mime_header_encode($message['subject']); + $mail_subject = Unicode::mimeHeaderEncode($message['subject']); // Note: email uses CRLF for line-endings. PHP's API requires LF // on Unix and CRLF on Windows. Drupal automatically guesses the // line-ending format appropriate for your system. If you need to diff --git a/drupal/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php b/drupal/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php index 2114d38c..f9e1ad3c 100644 --- a/drupal/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php +++ b/drupal/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php @@ -7,7 +7,7 @@ namespace Drupal\Core\Plugin; -use Drupal\Component\Plugin\ConfigurablePluginInterface; +use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Component\Plugin\PluginInspectionInterface; use Drupal\Core\Entity\DependencyTrait; @@ -24,7 +24,7 @@ trait PluginDependencyTrait { * Dependencies are added for the module that provides the plugin, as well * as any dependencies declared by the instance's calculateDependencies() * method, if it implements - * \Drupal\Component\Plugin\ConfigurablePluginInterface. + * \Drupal\Component\Plugin\DependentPluginInterface. * * @param \Drupal\Component\Plugin\PluginInspectionInterface $instance * The plugin instance. @@ -36,8 +36,8 @@ protected function calculatePluginDependencies(PluginInspectionInterface $instan if (isset($definition['config_dependencies'])) { $this->addDependencies($definition['config_dependencies']); } - // If a plugin is configurable, calculate its dependencies. - if ($instance instanceof ConfigurablePluginInterface && $plugin_dependencies = $instance->calculateDependencies()) { + // If a plugin is dependent, calculate its dependencies. + if ($instance instanceof DependentPluginInterface && $plugin_dependencies = $instance->calculateDependencies()) { $this->addDependencies($plugin_dependencies); } } diff --git a/drupal/core/lib/Drupal/Core/Render/Element/HtmlTag.php b/drupal/core/lib/Drupal/Core/Render/Element/HtmlTag.php index 851bbf9d..e183c3e1 100644 --- a/drupal/core/lib/Drupal/Core/Render/Element/HtmlTag.php +++ b/drupal/core/lib/Drupal/Core/Render/Element/HtmlTag.php @@ -139,27 +139,33 @@ public static function preRenderConditionalComments($element) { $expression = '!IE'; } else { - $expression = $browsers['IE']; + // The IE expression might contain some user input data. + $expression = SafeMarkup::checkAdminXss($browsers['IE']); } - // Wrap the element's potentially existing #prefix and #suffix properties with - // conditional comment markup. The conditional comment expression is evaluated - // by Internet Explorer only. To control the rendering by other browsers, - // either the "downlevel-hidden" or "downlevel-revealed" technique must be - // used. See http://en.wikipedia.org/wiki/Conditional_comment for details. - $element += array( - '#prefix' => '', - '#suffix' => '', - ); + // If the #prefix and #suffix properties are used, wrap them with + // conditional comment markup. The conditional comment expression is + // evaluated by Internet Explorer only. To control the rendering by other + // browsers, use either the "downlevel-hidden" or "downlevel-revealed" + // technique. See http://en.wikipedia.org/wiki/Conditional_comment + // for details. + + // Ensure what we are dealing with is safe. + // This would be done later anyway in drupal_render(). + $prefix = isset($elements['#prefix']) ? SafeMarkup::checkAdminXss($elements['#prefix']) : ''; + $suffix = isset($elements['#suffix']) ? SafeMarkup::checkAdminXss($elements['#suffix']) : ''; + + // Now calling SafeMarkup::set is safe, because we ensured the + // data coming in was at least admin escaped. if (!$browsers['!IE']) { // "downlevel-hidden". - $element['#prefix'] = "\n\n"; + $element['#prefix'] = SafeMarkup::set("\n\n"); } else { // "downlevel-revealed". - $element['#prefix'] = "\n\n" . $element['#prefix']; - $element['#suffix'] .= "\n"; + $element['#prefix'] = SafeMarkup::set("\n\n" . $prefix); + $element['#suffix'] = SafeMarkup::set($suffix . "\n"); } return $element; diff --git a/drupal/core/lib/Drupal/Core/Render/Element/MachineName.php b/drupal/core/lib/Drupal/Core/Render/Element/MachineName.php index 24ac3a43..f0c37685 100644 --- a/drupal/core/lib/Drupal/Core/Render/Element/MachineName.php +++ b/drupal/core/lib/Drupal/Core/Render/Element/MachineName.php @@ -8,7 +8,6 @@ namespace Drupal\Core\Render\Element; use Drupal\Component\Utility\NestedArray; -use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageInterface; @@ -152,13 +151,13 @@ public static function processMachineName(&$element, FormStateInterface $form_st $element['#machine_name']['suffix'] = '#' . $suffix_id; if ($element['#machine_name']['standalone']) { - $element['#suffix'] = SafeMarkup::set($element['#suffix'] . '  '); + $element['#suffix'] = $element['#suffix'] . '  '; } 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'] = SafeMarkup::set($source['#field_suffix'] . '  '); + $source['#field_suffix'] = $source['#field_suffix'] . '  '; $parents = array_merge($element['#machine_name']['source'], array('#field_suffix')); NestedArray::setValue($form_state->getCompleteForm(), $parents, $source['#field_suffix']); diff --git a/drupal/core/lib/Drupal/Core/TypedData/TypedDataManager.php b/drupal/core/lib/Drupal/Core/TypedData/TypedDataManager.php index 9206d237..05e7f4c0 100644 --- a/drupal/core/lib/Drupal/Core/TypedData/TypedDataManager.php +++ b/drupal/core/lib/Drupal/Core/TypedData/TypedDataManager.php @@ -8,6 +8,7 @@ namespace Drupal\Core\TypedData; use Drupal\Component\Plugin\Exception\PluginException; +use Drupal\Component\Utility\Crypt; use Drupal\Component\Utility\String; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -255,7 +256,7 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name, } $key = $definition->getDataType(); if ($settings = $definition->getSettings()) { - $key .= ':' . implode(',', $settings); + $key .= ':' . Crypt::hashBase64(serialize($settings)); } $key .= ':' . $object->getPropertyPath() . '.'; // If we are creating list items, we always use 0 in the key as all list diff --git a/drupal/core/lib/Drupal/Core/Updater/Updater.php b/drupal/core/lib/Drupal/Core/Updater/Updater.php index 045a9818..bbaecfb5 100644 --- a/drupal/core/lib/Drupal/Core/Updater/Updater.php +++ b/drupal/core/lib/Drupal/Core/Updater/Updater.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Updater; +use Drupal\Component\Utility\Unicode; use Drupal\Core\FileTransfer\FileTransferException; use Drupal\Core\FileTransfer\FileTransferInterface; @@ -100,7 +101,7 @@ public static function findInfoFile($directory) { return FALSE; } foreach ($info_files as $info_file) { - if (drupal_substr($info_file->filename, 0, -5) == drupal_basename($directory)) { + if (Unicode::substr($info_file->filename, 0, -5) == drupal_basename($directory)) { // Info file Has the same name as the directory, return it. return $info_file->uri; } diff --git a/drupal/core/misc/tabledrag.js b/drupal/core/misc/tabledrag.js index 204a3252..de0bc5d2 100644 --- a/drupal/core/misc/tabledrag.js +++ b/drupal/core/misc/tabledrag.js @@ -564,7 +564,7 @@ if (self.indentEnabled) { var xDiff = self.currentPointerCoords.x - self.dragObject.indentPointerPos.x; // Set the number of indentations the pointer has been moved left or right. - var indentDiff = Math.round(xDiff / self.indentAmount * self.rtl); + var indentDiff = Math.round(xDiff / self.indentAmount); // Indent the row with our estimated diff, which may be further // restricted according to the rows around this row. var indentChange = self.rowObject.indent(indentDiff); diff --git a/drupal/core/modules/action/action.info.yml b/drupal/core/modules/action/action.info.yml index e99997d6..6030a7fe 100644 --- a/drupal/core/modules/action/action.info.yml +++ b/drupal/core/modules/action/action.info.yml @@ -2,6 +2,12 @@ name: Actions type: module description: 'Perform tasks on specific events triggered within the system.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: action.admin + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/action/tests/action_bulk_test/action_bulk_test.info.yml b/drupal/core/modules/action/tests/action_bulk_test/action_bulk_test.info.yml index 296a33a4..faf4a043 100644 --- a/drupal/core/modules/action/tests/action_bulk_test/action_bulk_test.info.yml +++ b/drupal/core/modules/action/tests/action_bulk_test/action_bulk_test.info.yml @@ -2,8 +2,14 @@ name: 'Action bulk form test' type: module description: 'Support module for action bulk form testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - action - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/aggregator/aggregator.info.yml b/drupal/core/modules/aggregator/aggregator.info.yml index af55280a..89807170 100644 --- a/drupal/core/modules/aggregator/aggregator.info.yml +++ b/drupal/core/modules/aggregator/aggregator.info.yml @@ -2,9 +2,16 @@ name: Aggregator type: module description: 'Aggregates syndicated content (RSS, RDF, and Atom feeds) from external sources.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: aggregator.admin_settings dependencies: + - entity_reference - file - options + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/aggregator/src/AggregatorFeedViewsData.php b/drupal/core/modules/aggregator/src/AggregatorFeedViewsData.php index cc962263..73a3871d 100644 --- a/drupal/core/modules/aggregator/src/AggregatorFeedViewsData.php +++ b/drupal/core/modules/aggregator/src/AggregatorFeedViewsData.php @@ -7,27 +7,19 @@ namespace Drupal\aggregator; +use Drupal\views\EntityViewsData; use Drupal\views\EntityViewsDataInterface; /** * Provides the views data for the aggregator feed entity type. */ -class AggregatorFeedViewsData implements EntityViewsDataInterface { +class AggregatorFeedViewsData extends EntityViewsData implements EntityViewsDataInterface { /** * {@inheritdoc} */ public function getViewsData() { - $data = array(); - - $data['aggregator_feed']['table']['group'] = t('Aggregator feed'); - - $data['aggregator_feed']['table']['base'] = array( - 'field' => 'fid', - 'title' => t('Aggregator feed'), - ); - - $data['aggregator_feed']['table']['entity type'] = 'aggregator_feed'; + $data = parent::getViewsData(); $data['aggregator_feed']['table']['join'] = array( 'aggregator_item' => array( @@ -36,128 +28,28 @@ public function getViewsData() { ), ); - $data['aggregator_feed']['fid'] = array( - 'title' => t('Feed ID'), - 'help' => t('The unique ID of the aggregator feed.'), - 'field' => array( - 'id' => 'numeric', - ), - 'argument' => array( - 'id' => 'aggregator_fid', - 'name field' => 'title', - 'numeric' => TRUE, - ), - 'filter' => array( - 'id' => 'numeric', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); + $data['aggregator_feed']['fid']['help'] = $this->t('The unique ID of the aggregator feed.'); + $data['aggregator_feed']['fid']['argument']['id'] = 'aggregator_fid'; + $data['aggregator_feed']['fid']['argument']['name field'] = 'title'; + $data['aggregator_feed']['fid']['argument']['numeric'] = TRUE; - $data['aggregator_feed']['title'] = array( - 'title' => t('Title'), - 'help' => t('The title of the aggregator feed.'), - 'field' => array( - 'id' => 'aggregator_title_link', - 'extra' => array('link'), - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - 'argument' => array( - 'id' => 'string', - ), - ); + $data['aggregator_feed']['fid']['filter']['id'] = 'numeric'; - $data['aggregator_feed']['url'] = array( - 'title' => t('URL'), - 'help' => t('The fully-qualified URL of the feed.'), - 'field' => array( - 'id' => 'url', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); + $data['aggregator_feed']['title']['help'] = $this->t('The title of the aggregator feed.'); + $data['aggregator_feed']['title']['field']['id'] = 'aggregator_title_link'; + $data['aggregator_feed']['argument']['id'] = 'string'; - $data['aggregator_feed']['link'] = array( - 'title' => t('Link'), - 'help' => t('The link to the source URL of the feed.'), - 'field' => array( - 'id' => 'url', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); + $data['aggregator_feed']['url']['help'] = $this->t('The fully-qualified URL of the feed.'); - $data['aggregator_feed']['checked'] = array( - 'title' => t('Last checked'), - 'help' => t('The date the feed was last checked for new content.'), - 'field' => array( - 'id' => 'date', - ), - 'sort' => array( - 'id' => 'date', - ), - 'filter' => array( - 'id' => 'date', - ), - 'argument' => array( - 'id' => 'date', - ), - ); + $data['aggregator_feed']['link']['help'] = $this->t('The link to the source URL of the feed.'); - $data['aggregator_feed']['description'] = array( - 'title' => t('Description'), - 'help' => t('The description of the aggregator feed.'), - 'field' => array( - 'id' => 'xss', - 'click sortable' => FALSE, - ), - 'filter' => array( - 'id' => 'string', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); + $data['aggregator_feed']['checked']['help'] = $this->t('The date the feed was last checked for new content.'); - $data['aggregator_feed']['modified'] = array( - 'title' => t('Last modified'), - 'help' => t('The date of the most recent new content on the feed.'), - 'field' => array( - 'id' => 'date', - ), - 'sort' => array( - 'id' => 'date', - ), - 'filter' => array( - 'id' => 'date', - ), - 'argument' => array( - 'id' => 'date', - ), - ); + $data['aggregator_feed']['description']['help'] = $this->t('The description of the aggregator feed.'); + $data['aggregator_feed']['description']['field']['id'] = 'xss'; + $data['aggregator_feed']['description']['field']['click sortable'] = FALSE; + + $data['aggregator_feed']['modified']['help'] = $this->t('The date of the most recent new content on the feed.'); return $data; } diff --git a/drupal/core/modules/aggregator/src/AggregatorItemViewsData.php b/drupal/core/modules/aggregator/src/AggregatorItemViewsData.php index cdaae27d..8e40930d 100644 --- a/drupal/core/modules/aggregator/src/AggregatorItemViewsData.php +++ b/drupal/core/modules/aggregator/src/AggregatorItemViewsData.php @@ -7,150 +7,44 @@ namespace Drupal\aggregator; +use Drupal\views\EntityViewsData; use Drupal\views\EntityViewsDataInterface; /** * Provides the views data for the aggregator item entity type. */ -class AggregatorItemViewsData implements EntityViewsDataInterface { +class AggregatorItemViewsData extends EntityViewsData implements EntityViewsDataInterface { /** * {@inheritdoc} */ public function getViewsData() { - $data = array(); - - $data['aggregator_item']['table']['group'] = t('Aggregator'); - - $data['aggregator_item']['table']['base'] = array( - 'field' => 'iid', - 'title' => t('Aggregator item'), - 'help' => t('Aggregator items are imported from external RSS and Atom news feeds.'), - ); - $data['aggregator_item']['table']['entity type'] = 'aggregator_item'; - - $data['aggregator_item']['iid'] = array( - 'title' => t('Item ID'), - 'help' => t('The unique ID of the aggregator item.'), - 'field' => array( - 'id' => 'numeric', - ), - 'argument' => array( - 'id' => 'aggregator_iid', - 'name field' => 'title', - 'numeric' => TRUE, - ), - 'filter' => array( - 'id' => 'numeric', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); - - $data['aggregator_item']['title'] = array( - 'title' => t('Title'), - 'help' => t('The title of the aggregator item.'), - 'field' => array( - 'id' => 'aggregator_title_link', - 'extra' => array('link'), - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_item']['link'] = array( - 'title' => t('Link'), - 'help' => t('The link to the original source URL of the item.'), - 'field' => array( - 'id' => 'url', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_item']['author'] = array( - 'title' => t('Author'), - 'help' => t('The author of the original imported item.'), - 'field' => array( - 'id' => 'aggregator_xss', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_item']['guid'] = array( - 'title' => t('GUID'), - 'help' => t('The guid of the original imported item.'), - 'field' => array( - 'id' => 'standard', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_item']['description'] = array( - 'title' => t('Body'), - 'help' => t('The actual content of the imported item.'), - 'field' => array( - 'id' => 'aggregator_xss', - 'click sortable' => FALSE, - ), - 'argument' => array( - 'id' => 'string', - ), - 'filter' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); - - $data['aggregator_item']['timestamp'] = array( - 'title' => t('Timestamp'), - 'help' => t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)'), - 'field' => array( - 'id' => 'date', - ), - 'sort' => array( - 'id' => 'date', - ), - 'filter' => array( - 'id' => 'date', - ), - 'argument' => array( - 'id' => 'date', - ), - ); + $data = parent::getViewsData(); + + $data['aggregator_item']['table']['base']['help'] = $this->t('Aggregator items are imported from external RSS and Atom news feeds.'); + + + $data['aggregator_item']['iid']['help'] = $this->t('The unique ID of the aggregator item.'); + $data['aggregator_item']['iid']['argument']['id'] = 'aggregator_iid'; + $data['aggregator_item']['iid']['argument']['name field'] = 'title'; + $data['aggregator_item']['iid']['argument']['numeric'] = TRUE; + + $data['aggregator_item']['title']['help'] = $this->t('The title of the aggregator item.'); + $data['aggregator_item']['title']['field']['id'] = 'aggregator_title_link'; + $data['aggregator_item']['title']['field']['extra'] = 'link'; + + $data['aggregator_item']['link']['help'] = $this->t('The link to the original source URL of the item.'); + + $data['aggregator_item']['author']['help'] = $this->t('The author of the original imported item.'); + $data['aggregator_item']['author']['field']['id'] = 'aggregator_xss'; + + $data['aggregator_item']['guid']['help'] = $this->t('The guid of the original imported item.'); + + $data['aggregator_item']['description']['help'] = $this->t('The actual content of the imported item.'); + $data['aggregator_item']['description']['field']['id'] = 'aggregator_xss'; + $data['aggregator_item']['description']['field']['click sortable'] = FALSE; + + $data['aggregator_item']['timestamp']['help'] = $this->t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)'); return $data; } diff --git a/drupal/core/modules/aggregator/templates/aggregator-feed.html.twig b/drupal/core/modules/aggregator/templates/aggregator-feed.html.twig index 1876c453..57f7d156 100644 --- a/drupal/core/modules/aggregator/templates/aggregator-feed.html.twig +++ b/drupal/core/modules/aggregator/templates/aggregator-feed.html.twig @@ -18,7 +18,7 @@ * @ingroup themeable */ #} - +
{{ title_prefix }} {% if not full %} diff --git a/drupal/core/modules/aggregator/templates/aggregator-item.html.twig b/drupal/core/modules/aggregator/templates/aggregator-item.html.twig index 8f31937e..1f04de5b 100644 --- a/drupal/core/modules/aggregator/templates/aggregator-item.html.twig +++ b/drupal/core/modules/aggregator/templates/aggregator-item.html.twig @@ -16,9 +16,9 @@ * @ingroup themeable */ #} - +
{{ title_prefix }} -

+

{{ title }}

{{ title_suffix }} diff --git a/drupal/core/modules/aggregator/tests/modules/aggregator_test/aggregator_test.info.yml b/drupal/core/modules/aggregator/tests/modules/aggregator_test/aggregator_test.info.yml index 3d3d0e93..31f18859 100644 --- a/drupal/core/modules/aggregator/tests/modules/aggregator_test/aggregator_test.info.yml +++ b/drupal/core/modules/aggregator/tests/modules/aggregator_test/aggregator_test.info.yml @@ -2,5 +2,11 @@ name: 'Aggregator module tests' type: module description: 'Support module for aggregator related testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/aggregator/tests/modules/aggregator_test_views/aggregator_test_views.info.yml b/drupal/core/modules/aggregator/tests/modules/aggregator_test_views/aggregator_test_views.info.yml index 58da126d..37d9c5d6 100644 --- a/drupal/core/modules/aggregator/tests/modules/aggregator_test_views/aggregator_test_views.info.yml +++ b/drupal/core/modules/aggregator/tests/modules/aggregator_test_views/aggregator_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Aggregator test views' type: module description: 'Provides default views for views aggregator tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - aggregator - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/ban/ban.info.yml b/drupal/core/modules/ban/ban.info.yml index ba6300de..85c86d40 100644 --- a/drupal/core/modules/ban/ban.info.yml +++ b/drupal/core/modules/ban/ban.info.yml @@ -2,6 +2,12 @@ name: Ban type: module description: 'Enables banning of IP addresses.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: ban.admin_page + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/basic_auth/basic_auth.info.yml b/drupal/core/modules/basic_auth/basic_auth.info.yml index 38bb7b26..95c0e173 100644 --- a/drupal/core/modules/basic_auth/basic_auth.info.yml +++ b/drupal/core/modules/basic_auth/basic_auth.info.yml @@ -2,5 +2,11 @@ name: 'HTTP Basic Authentication' type: module description: 'Provides the HTTP Basic authentication provider' package: Web services -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/block/block.info.yml b/drupal/core/modules/block/block.info.yml index 47501efb..d8961cf4 100644 --- a/drupal/core/modules/block/block.info.yml +++ b/drupal/core/modules/block/block.info.yml @@ -2,6 +2,12 @@ name: Block type: module description: 'Controls the visual building blocks a page is constructed with. Blocks are boxes of content rendered into an area, or region, of a web page.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: block.admin_display + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/block/block.module b/drupal/core/modules/block/block.module index 95e1bd6c..83f4a400 100644 --- a/drupal/core/modules/block/block.module +++ b/drupal/core/modules/block/block.module @@ -76,6 +76,7 @@ function _block_page_build(&$page) { // regions. $page += \Drupal::service('plugin.manager.display_variant') ->createInstance('full_page') + ->setMainContent(drupal_set_page_content()) ->build(); } else { diff --git a/drupal/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php b/drupal/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php index 7243362f..9ae99ed1 100644 --- a/drupal/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php +++ b/drupal/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php @@ -7,6 +7,8 @@ namespace Drupal\block\Plugin\DisplayVariant; +use Drupal\Core\Block\MainContentBlockPluginInterface; +use Drupal\Core\Display\PageVariantInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityViewBuilderInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; @@ -18,12 +20,12 @@ /** * Provides a display variant that represents the full page. * - * @DisplayVariant( + * @PageDisplayVariant( * id = "full_page", * admin_label = @Translation("Full page") * ) */ -class FullPageVariant extends VariantBase implements ContainerFactoryPluginInterface { +class FullPageVariant extends VariantBase implements PageVariantInterface, ContainerFactoryPluginInterface { /** * The block storage. @@ -60,6 +62,13 @@ class FullPageVariant extends VariantBase implements ContainerFactoryPluginInter */ protected $themeNegotiator; + /** + * The render array representing the main page content. + * + * @var array + */ + protected $mainContent; + /** * Constructs a new FullPageVariant. * @@ -101,6 +110,14 @@ public static function create(ContainerInterface $container, array $configuratio ); } + /** + * {@inheritdoc} + */ + public function setMainContent(array $main_content) { + $this->mainContent = $main_content; + return $this; + } + /** * Gets the current theme for this page. * @@ -115,12 +132,20 @@ protected function getTheme() { * {@inheritdoc} */ public function build() { + // Track whether a block that shows the main content is displayed or not. + $main_content_block_displayed = FALSE; + $build = array(); // Load all region content assigned via blocks. foreach ($this->getRegionAssignments() as $region => $blocks) { /** @var $blocks \Drupal\block\BlockInterface[] */ foreach ($blocks as $key => $block) { if ($block->access('view')) { + $block_plugin = $block->getPlugin(); + if ($block_plugin instanceof MainContentBlockPluginInterface) { + $block_plugin->setMainContent($this->mainContent); + $main_content_block_displayed = TRUE; + } $build[$region][$key] = $this->blockViewBuilder->view($block); } } @@ -129,6 +154,14 @@ public function build() { $build[$region]['#sorted'] = TRUE; } } + + // If no block that shows the main content is displayed, still show the main + // content. Otherwise the end user will see all displayed blocks, but not + // the main content they came for. + if (!$main_content_block_displayed) { + $build['content']['system_main'] = $this->mainContent; + } + return $build; } diff --git a/drupal/core/modules/block/src/Tests/BlockTest.php b/drupal/core/modules/block/src/Tests/BlockTest.php index 1996c9b4..9ce288c3 100644 --- a/drupal/core/modules/block/src/Tests/BlockTest.php +++ b/drupal/core/modules/block/src/Tests/BlockTest.php @@ -47,9 +47,6 @@ function testBlockVisibility() { $this->drupalGet('user'); $this->assertNoText($title, 'Block was not displayed according to block visibility rules.'); - $this->drupalGet('USER/' . $this->adminUser->id()); - $this->assertNoText($title, 'Block was not displayed according to block visibility rules regardless of path case.'); - // Confirm that the block is not displayed to anonymous users. $this->drupalLogout(); $this->drupalGet(''); diff --git a/drupal/core/modules/block/tests/modules/block_test/block_test.info.yml b/drupal/core/modules/block/tests/modules/block_test/block_test.info.yml index 9a8895f9..a846b9ce 100644 --- a/drupal/core/modules/block/tests/modules/block_test/block_test.info.yml +++ b/drupal/core/modules/block/tests/modules/block_test/block_test.info.yml @@ -2,5 +2,11 @@ name: 'Block test' type: module description: 'Provides test blocks.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/block/tests/modules/block_test/themes/block_test_specialchars_theme/block_test_specialchars_theme.info.yml b/drupal/core/modules/block/tests/modules/block_test/themes/block_test_specialchars_theme/block_test_specialchars_theme.info.yml index 607451ff..1125e163 100644 --- a/drupal/core/modules/block/tests/modules/block_test/themes/block_test_specialchars_theme/block_test_specialchars_theme.info.yml +++ b/drupal/core/modules/block/tests/modules/block_test/themes/block_test_specialchars_theme/block_test_specialchars_theme.info.yml @@ -1,7 +1,13 @@ name: '<"Cat" & ''Mouse''>' type: theme description: 'Theme for testing special characters in block admin.' -core: 8.x +# core: 8.x regions: content: Content help: Help + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/block/tests/modules/block_test/themes/block_test_theme/block_test_theme.info.yml b/drupal/core/modules/block/tests/modules/block_test/themes/block_test_theme/block_test_theme.info.yml index 96c76505..ca7d0b22 100644 --- a/drupal/core/modules/block/tests/modules/block_test/themes/block_test_theme/block_test_theme.info.yml +++ b/drupal/core/modules/block/tests/modules/block_test/themes/block_test_theme/block_test_theme.info.yml @@ -1,8 +1,8 @@ name: 'Block test theme' type: theme description: 'Theme for testing the block system' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x regions: sidebar_first: 'Left sidebar' sidebar_second: 'Right sidebar' @@ -14,3 +14,9 @@ regions: regions_hidden: - sidebar_first - sidebar_second + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/block/tests/modules/block_test_views/block_test_views.info.yml b/drupal/core/modules/block/tests/modules/block_test_views/block_test_views.info.yml index f7a32c08..16c82da6 100644 --- a/drupal/core/modules/block/tests/modules/block_test_views/block_test_views.info.yml +++ b/drupal/core/modules/block/tests/modules/block_test_views/block_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Block test views' type: module description: 'Provides a view and block to test block displays in views.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - block - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/FullPageVariantTest.php b/drupal/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/FullPageVariantTest.php index 1cbcfe53..783c2fa5 100644 --- a/drupal/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/FullPageVariantTest.php +++ b/drupal/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/FullPageVariantTest.php @@ -65,13 +65,78 @@ public function setUpDisplayVariant($configuration = array(), $definition = arra ->getMock(); } + public function providerBuild() { + $blocks_config = array( + 'block1' => array( + TRUE, 'top', 0, FALSE, + ), + // Test a block without access. + 'block2' => array( + FALSE, 'bottom', 0, FALSE, + ), + // Test two blocks in the same region with specific weight. + 'block3' => array( + TRUE, 'bottom', 5, FALSE, + ), + 'block4' => array( + TRUE, 'bottom', -5, FALSE, + ), + // Test a block implementing MainContentBlockPluginInterface. + 'block5' => array( + TRUE, 'center', 0, TRUE, + ), + ); + + $test_cases = []; + $test_cases[] = [$blocks_config, 4, + [ + 'top' => [ + 'block1' => [], + '#sorted' => TRUE, + ], + // The main content was rendered via a block. + 'center' => [ + 'block5' => [], + '#sorted' => TRUE, + ], + 'bottom' => [ + 'block4' => [], + 'block3' => [], + '#sorted' => TRUE, + ], + ], + ]; + unset($blocks_config['block5']); + $test_cases[] = [$blocks_config, 3, + [ + 'top' => [ + 'block1' => [], + '#sorted' => TRUE, + ], + 'bottom' => [ + 'block4' => [], + 'block3' => [], + '#sorted' => TRUE, + ], + // The main content was rendered via the fallback in case there is no + // block rendering the main content. + 'content' => [ + 'system_main' => ['#markup' => 'Hello kittens!'], + ], + ], + ]; + return $test_cases; + } + /** * Tests the building of a full page variant. * * @covers ::build * @covers ::getRegionAssignments + * + * @dataProvider providerBuild */ - public function testBuild() { + public function testBuild(array $blocks_config, $visible_block_count, array $expected_render_array) { $theme = $this->randomMachineName(); $display_variant = $this->setUpDisplayVariant(); $this->themeNegotiator->expects($this->any()) @@ -82,26 +147,14 @@ public function testBuild() { ->method('getRegionNames') ->will($this->returnValue(array( 'top' => 'Top', + 'center' => 'Center', 'bottom' => 'Bottom', ))); + $display_variant->setMainContent(['#markup' => 'Hello kittens!']); - $blocks_config = array( - 'block1' => array( - TRUE, 'top', 0, - ), - // Test a block without access. - 'block2' => array( - FALSE, 'bottom', 0, - ), - // Test two blocks in the same region with specific weight. - 'block3' => array( - TRUE, 'bottom', 5, - ), - 'block4' => array( - TRUE, 'bottom', -5, - ), - ); $blocks = array(); + $block_plugin = $this->getMock('Drupal\Core\Block\BlockPluginInterface'); + $main_content_block_plugin = $this->getMock('Drupal\Core\Block\MainContentBlockPluginInterface'); foreach ($blocks_config as $block_id => $block_config) { $block = $this->getMock('Drupal\block\BlockInterface'); $block->expects($this->once()) @@ -114,10 +167,13 @@ public function testBuild() { array('weight', $block_config[2]), array('status', TRUE), ))); + $block->expects($this->any()) + ->method('getPlugin') + ->willReturn($block_config[3] ? $main_content_block_plugin : $block_plugin); $blocks[$block_id] = $block; } - $this->blockViewBuilder->expects($this->exactly(3)) + $this->blockViewBuilder->expects($this->exactly($visible_block_count)) ->method('view') ->will($this->returnValue(array())); $this->blockStorage->expects($this->once()) @@ -125,18 +181,7 @@ public function testBuild() { ->with(array('theme' => $theme)) ->will($this->returnValue($blocks)); - $expected = array( - 'top' => array( - 'block1' => array(), - '#sorted' => TRUE, - ), - 'bottom' => array( - 'block4' => array(), - 'block3' => array(), - '#sorted' => TRUE, - ), - ); - $this->assertSame($expected, $display_variant->build()); + $this->assertSame($expected_render_array, $display_variant->build()); } } diff --git a/drupal/core/modules/block_content/block_content.info.yml b/drupal/core/modules/block_content/block_content.info.yml index e9e7afbf..31f07c7a 100644 --- a/drupal/core/modules/block_content/block_content.info.yml +++ b/drupal/core/modules/block_content/block_content.info.yml @@ -2,9 +2,15 @@ name: 'Custom Block' type: module description: 'Allows the creation of custom blocks through the user interface.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - block - text configure: block_content.list + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml b/drupal/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml index 747efa4d..e9adbbb7 100644 --- a/drupal/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml +++ b/drupal/core/modules/block_content/tests/modules/block_content_test/block_content_test.info.yml @@ -2,5 +2,11 @@ name: "Custom Block module tests" type: module description: "Support module for custom block related testing." package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/book/book.info.yml b/drupal/core/modules/book/book.info.yml index a2322e03..f46f0459 100644 --- a/drupal/core/modules/book/book.info.yml +++ b/drupal/core/modules/book/book.info.yml @@ -2,8 +2,14 @@ name: Book type: module description: 'Allows users to create and organize related content in an outline.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - node configure: book.settings + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/breakpoint/breakpoint.info.yml b/drupal/core/modules/breakpoint/breakpoint.info.yml index 256740c0..c40f59af 100644 --- a/drupal/core/modules/breakpoint/breakpoint.info.yml +++ b/drupal/core/modules/breakpoint/breakpoint.info.yml @@ -2,5 +2,11 @@ name: Breakpoint type: module description: 'Manage breakpoints and breakpoint groups for responsive designs.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/breakpoint/tests/modules/breakpoint_module_test/breakpoint_module_test.info.yml b/drupal/core/modules/breakpoint/tests/modules/breakpoint_module_test/breakpoint_module_test.info.yml index e51489a8..0a37ca93 100644 --- a/drupal/core/modules/breakpoint/tests/modules/breakpoint_module_test/breakpoint_module_test.info.yml +++ b/drupal/core/modules/breakpoint/tests/modules/breakpoint_module_test/breakpoint_module_test.info.yml @@ -2,6 +2,12 @@ name: 'Breakpoint test module' type: module description: 'Test module for breakpoint.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/breakpoint/tests/themes/breakpoint_theme_test/breakpoint_theme_test.info.yml b/drupal/core/modules/breakpoint/tests/themes/breakpoint_theme_test/breakpoint_theme_test.info.yml index 482faf5c..a1f83853 100644 --- a/drupal/core/modules/breakpoint/tests/themes/breakpoint_theme_test/breakpoint_theme_test.info.yml +++ b/drupal/core/modules/breakpoint/tests/themes/breakpoint_theme_test/breakpoint_theme_test.info.yml @@ -1,6 +1,12 @@ name: 'Breakpoint test theme' type: theme description: 'Test theme for breakpoint.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x base theme: bartik + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/ckeditor/ckeditor.info.yml b/drupal/core/modules/ckeditor/ckeditor.info.yml index 0f91ed41..6a6d3c0b 100644 --- a/drupal/core/modules/ckeditor/ckeditor.info.yml +++ b/drupal/core/modules/ckeditor/ckeditor.info.yml @@ -2,7 +2,13 @@ name: CKEditor type: module description: "WYSIWYG editing for rich text fields using CKEditor." package: Core -core: 8.x -version: VERSION +# core: 8.x +# version: VERSION dependencies: - editor + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/ckeditor/tests/modules/ckeditor_test.info.yml b/drupal/core/modules/ckeditor/tests/modules/ckeditor_test.info.yml index d7d5450e..c67f86bc 100644 --- a/drupal/core/modules/ckeditor/tests/modules/ckeditor_test.info.yml +++ b/drupal/core/modules/ckeditor/tests/modules/ckeditor_test.info.yml @@ -1,6 +1,12 @@ name: CKEditor test type: module description: Support module for the CKEditor module tests. -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/color/color.info.yml b/drupal/core/modules/color/color.info.yml index 9ea6daf6..c3114529 100644 --- a/drupal/core/modules/color/color.info.yml +++ b/drupal/core/modules/color/color.info.yml @@ -2,5 +2,11 @@ name: Color type: module description: 'Allows administrators to change the color scheme of compatible themes.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/color/tests/modules/color_test/color_test.info.yml b/drupal/core/modules/color/tests/modules/color_test/color_test.info.yml index 05d954ff..83f44ddf 100644 --- a/drupal/core/modules/color/tests/modules/color_test/color_test.info.yml +++ b/drupal/core/modules/color/tests/modules/color_test/color_test.info.yml @@ -2,5 +2,11 @@ name: 'Color test' type: module description: 'Provides test helpers for color module.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/color/tests/modules/color_test/themes/color_test_theme/color_test_theme.info.yml b/drupal/core/modules/color/tests/modules/color_test/themes/color_test_theme/color_test_theme.info.yml index 4fbd9bf3..f3ef32a9 100644 --- a/drupal/core/modules/color/tests/modules/color_test/themes/color_test_theme/color_test_theme.info.yml +++ b/drupal/core/modules/color/tests/modules/color_test/themes/color_test_theme/color_test_theme.info.yml @@ -1,7 +1,13 @@ name: 'Color test theme' type: theme description: 'Theme for testing the color module' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x libraries: - color_test_theme/base + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/comment/comment.info.yml b/drupal/core/modules/comment/comment.info.yml index c8419818..ea4dedba 100644 --- a/drupal/core/modules/comment/comment.info.yml +++ b/drupal/core/modules/comment/comment.info.yml @@ -2,9 +2,15 @@ name: Comment type: module description: 'Allows users to comment on and discuss published content.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - datetime - text configure: comment.admin + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.info.yml b/drupal/core/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.info.yml index 94e6af2f..0fc5764a 100644 --- a/drupal/core/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.info.yml +++ b/drupal/core/modules/comment/tests/modules/comment_empty_title_test/comment_empty_title_test.info.yml @@ -2,7 +2,13 @@ name: 'Comment empty titles test' type: module description: 'Support module for testing empty title accessibility with Comment module.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - comment + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/comment/tests/modules/comment_test/comment_test.info.yml b/drupal/core/modules/comment/tests/modules/comment_test/comment_test.info.yml index 712037fe..cf89ad1d 100644 --- a/drupal/core/modules/comment/tests/modules/comment_test/comment_test.info.yml +++ b/drupal/core/modules/comment/tests/modules/comment_test/comment_test.info.yml @@ -2,7 +2,13 @@ name: 'Comment test' type: module description: 'Support module for Comment module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - comment + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/comment/tests/modules/comment_test_views/comment_test_views.info.yml b/drupal/core/modules/comment/tests/modules/comment_test_views/comment_test_views.info.yml index dfce66dc..bb0332b9 100644 --- a/drupal/core/modules/comment/tests/modules/comment_test_views/comment_test_views.info.yml +++ b/drupal/core/modules/comment/tests/modules/comment_test_views/comment_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Comment test views' type: module description: 'Provides default views for views comment tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - comment - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/config.info.yml b/drupal/core/modules/config/config.info.yml index 88821cea..f246f722 100644 --- a/drupal/core/modules/config/config.info.yml +++ b/drupal/core/modules/config/config.info.yml @@ -2,6 +2,12 @@ name: 'Configuration Manager' type: module description: 'Allows administrators to manage configuration changes.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: config.sync + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/src/Tests/AssertConfigEntityImportTrait.php b/drupal/core/modules/config/src/Tests/AssertConfigEntityImportTrait.php new file mode 100644 index 00000000..0f8ad2b3 --- /dev/null +++ b/drupal/core/modules/config/src/Tests/AssertConfigEntityImportTrait.php @@ -0,0 +1,42 @@ +uuid(); + $entity_type_id = $entity->getEntityTypeId(); + $original_data = $entity->toArray(); + // Copy everything to staging. + $this->copyConfig(\Drupal::service('config.storage'), \Drupal::service('config.storage.staging')); + // Delete the configuration from active. Don't worry about side effects of + // deleting config like fields cleaning up field storages. The coming import + // should recreate everything as necessary. + $entity->delete(); + $this->configImporter()->reset()->import(); + $imported_entity = \Drupal::entityManager()->loadEntityByUuid($entity_type_id, $entity_uuid); + $this->assertIdentical($original_data, $imported_entity->toArray()); + } + +} diff --git a/drupal/core/modules/config/src/Tests/ConfigImportRecreateTest.php b/drupal/core/modules/config/src/Tests/ConfigImportRecreateTest.php index b569c5f1..964128fd 100644 --- a/drupal/core/modules/config/src/Tests/ConfigImportRecreateTest.php +++ b/drupal/core/modules/config/src/Tests/ConfigImportRecreateTest.php @@ -31,7 +31,7 @@ class ConfigImportRecreateTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('system', 'entity', 'field', 'text', 'user', 'node'); + public static $modules = array('system', 'entity', 'field', 'text', 'user', 'node', 'entity_reference'); protected function setUp() { parent::setUp(); diff --git a/drupal/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php b/drupal/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php index fc0d0ed5..7dc7cd6d 100644 --- a/drupal/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php +++ b/drupal/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php @@ -34,7 +34,7 @@ class ConfigImportRenameValidationTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('system', 'user', 'node', 'field', 'text', 'entity', 'config_test'); + public static $modules = array('system', 'user', 'node', 'field', 'text', 'entity', 'config_test', 'entity_reference'); /** * {@inheritdoc} diff --git a/drupal/core/modules/config/tests/config_collection_install_test/config_collection_install_test.info.yml b/drupal/core/modules/config/tests/config_collection_install_test/config_collection_install_test.info.yml index 95c6799f..99660e3f 100644 --- a/drupal/core/modules/config/tests/config_collection_install_test/config_collection_install_test.info.yml +++ b/drupal/core/modules/config/tests/config_collection_install_test/config_collection_install_test.info.yml @@ -1,5 +1,11 @@ name: 'Configuration events test' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.info.yml b/drupal/core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.info.yml index 561d537d..ed8dbeb3 100644 --- a/drupal/core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.info.yml +++ b/drupal/core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.info.yml @@ -1,5 +1,11 @@ name: 'Configuration entity static cache test' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_events_test/config_events_test.info.yml b/drupal/core/modules/config/tests/config_events_test/config_events_test.info.yml index 95c6799f..99660e3f 100644 --- a/drupal/core/modules/config/tests/config_events_test/config_events_test.info.yml +++ b/drupal/core/modules/config/tests/config_events_test/config_events_test.info.yml @@ -1,5 +1,11 @@ name: 'Configuration events test' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_export_test/config_export_test.info.yml b/drupal/core/modules/config/tests/config_export_test/config_export_test.info.yml index d0ceccdb..4d0577ce 100644 --- a/drupal/core/modules/config/tests/config_export_test/config_export_test.info.yml +++ b/drupal/core/modules/config/tests/config_export_test/config_export_test.info.yml @@ -1,5 +1,11 @@ name: 'Configuration export test' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_import_test/config_import_test.info.yml b/drupal/core/modules/config/tests/config_import_test/config_import_test.info.yml index 01d2d1db..5fd46c3e 100644 --- a/drupal/core/modules/config/tests/config_import_test/config_import_test.info.yml +++ b/drupal/core/modules/config/tests/config_import_test/config_import_test.info.yml @@ -1,5 +1,11 @@ name: 'Configuration import test' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_integration_test/config_integration_test.info.yml b/drupal/core/modules/config/tests/config_integration_test/config_integration_test.info.yml index 2c4caa1c..3870df26 100644 --- a/drupal/core/modules/config/tests/config_integration_test/config_integration_test.info.yml +++ b/drupal/core/modules/config/tests/config_integration_test/config_integration_test.info.yml @@ -1,7 +1,13 @@ name: 'ConfigTest integration' type: module package: 'Testing' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - config_test + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml b/drupal/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml index 0c332c24..0dac371e 100644 --- a/drupal/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml +++ b/drupal/core/modules/config/tests/config_other_module_config_test/config_other_module_config_test.info.yml @@ -1,5 +1,11 @@ name: 'Config other module config' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_override_test/config_override_test.info.yml b/drupal/core/modules/config/tests/config_override_test/config_override_test.info.yml index f1f1109c..e61b5604 100644 --- a/drupal/core/modules/config/tests/config_override_test/config_override_test.info.yml +++ b/drupal/core/modules/config/tests/config_override_test/config_override_test.info.yml @@ -1,5 +1,11 @@ name: 'Configuration override test' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_schema_test/config_schema_test.info.yml b/drupal/core/modules/config/tests/config_schema_test/config_schema_test.info.yml index 9836e8b5..d728f327 100644 --- a/drupal/core/modules/config/tests/config_schema_test/config_schema_test.info.yml +++ b/drupal/core/modules/config/tests/config_schema_test/config_schema_test.info.yml @@ -1,6 +1,12 @@ name: 'Configuration schema test' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x hidden: true + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config/tests/config_test/config_test.info.yml b/drupal/core/modules/config/tests/config_test/config_test.info.yml index a4d7b0c4..44d96c5c 100644 --- a/drupal/core/modules/config/tests/config_test/config_test.info.yml +++ b/drupal/core/modules/config/tests/config_test/config_test.info.yml @@ -1,5 +1,11 @@ name: 'Configuration test' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config_translation/config_translation.info.yml b/drupal/core/modules/config_translation/config_translation.info.yml index aebc7f45..4b1b0ad0 100644 --- a/drupal/core/modules/config_translation/config_translation.info.yml +++ b/drupal/core/modules/config_translation/config_translation.info.yml @@ -2,7 +2,13 @@ name: 'Configuration Translation' type: module description: 'Provides a translation interface for configuration.' package: Multilingual -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - locale + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/drupal/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php index bb8d3590..0fde6bc0 100644 --- a/drupal/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php +++ b/drupal/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php @@ -71,6 +71,7 @@ protected function setUp() { 'access site-wide contact form', 'access contextual links', 'administer views', + 'administer account settings', ) ); // Create and login user. @@ -251,12 +252,17 @@ public function testContactConfigEntityTranslation() { $translation_base_url = 'admin/structure/contact/manage/feedback/translate'; $this->assertLinkByHref($translation_base_url); + // Make sure translate tab is present. + $this->drupalGet('admin/structure/contact/manage/feedback'); + $this->assertLink(t('Translate @type', array('@type' => 'contact form'))); + // Visit the form to confirm the changes. $this->drupalGet('contact/feedback'); $this->assertText($label); foreach ($this->langcodes as $langcode) { $this->drupalGet($translation_base_url); + $this->assertLink(t('Translate @type', array('@type' => 'contact form'))); // 'Add' link should be present for $langcode translation. $translation_page_url = "$translation_base_url/$langcode/add"; @@ -429,7 +435,11 @@ public function testDateFormatTranslation() { public function testAccountSettingsConfigurationTranslation() { $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/config/people/accounts'); + $this->assertLink(t('Translate @type', array('@type' => 'account settings'))); + $this->drupalGet('admin/config/people/accounts/translate'); + $this->assertLink(t('Translate @type', array('@type' => 'account settings'))); $this->assertLinkByHref('admin/config/people/accounts/translate/fr/add'); // Update account settings fields for French. diff --git a/drupal/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.info.yml b/drupal/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.info.yml index d9308c37..e297225b 100644 --- a/drupal/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.info.yml +++ b/drupal/core/modules/config_translation/tests/modules/config_translation_test/config_translation_test.info.yml @@ -2,7 +2,13 @@ name: 'Configuration Translation Test' description: 'Helpers to test the configuration translation system' type: module package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - config_test + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/config_translation/tests/themes/config_translation_test_theme/config_translation_test_theme.info.yml b/drupal/core/modules/config_translation/tests/themes/config_translation_test_theme/config_translation_test_theme.info.yml index f46d8a05..7b60e7d7 100644 --- a/drupal/core/modules/config_translation/tests/themes/config_translation_test_theme/config_translation_test_theme.info.yml +++ b/drupal/core/modules/config_translation/tests/themes/config_translation_test_theme/config_translation_test_theme.info.yml @@ -1,5 +1,11 @@ name: 'Configuration Translation Test Theme' type: theme description: 'Theme for testing the configuration translation mapper system' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/contact/contact.info.yml b/drupal/core/modules/contact/contact.info.yml index a50d17dd..e48b961b 100644 --- a/drupal/core/modules/contact/contact.info.yml +++ b/drupal/core/modules/contact/contact.info.yml @@ -2,6 +2,12 @@ name: Contact type: module description: 'Enables the use of both personal and site-wide contact forms.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: contact.form_list + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/contact/src/MessageInterface.php b/drupal/core/modules/contact/src/MessageInterface.php index 224564e6..7ae39c84 100644 --- a/drupal/core/modules/contact/src/MessageInterface.php +++ b/drupal/core/modules/contact/src/MessageInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\contact\Entity\MessageInterface. + * Contains \Drupal\contact\MessageInterface. */ namespace Drupal\contact; diff --git a/drupal/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.info.yml b/drupal/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.info.yml index f590c3fd..f28d86ca 100644 --- a/drupal/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.info.yml +++ b/drupal/core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.info.yml @@ -2,8 +2,14 @@ name: 'Contact test storage' type: module description: 'Tests that contact messages can be stored.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - contact - user + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/contact/tests/modules/contact_test/contact_test.info.yml b/drupal/core/modules/contact/tests/modules/contact_test/contact_test.info.yml index 6750f456..6faa3605 100644 --- a/drupal/core/modules/contact/tests/modules/contact_test/contact_test.info.yml +++ b/drupal/core/modules/contact/tests/modules/contact_test/contact_test.info.yml @@ -2,7 +2,13 @@ name: 'Contact test module' type: module description: 'Contains test contact form.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - contact + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/contact/tests/modules/contact_test_views/contact_test_views.info.yml b/drupal/core/modules/contact/tests/modules/contact_test_views/contact_test_views.info.yml index b30ad411..cb2922e1 100644 --- a/drupal/core/modules/contact/tests/modules/contact_test_views/contact_test_views.info.yml +++ b/drupal/core/modules/contact/tests/modules/contact_test_views/contact_test_views.info.yml @@ -2,9 +2,15 @@ name: 'Contact test views' type: module description: 'Provides default views for views contact tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - contact - views - user + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/content_translation/content_translation.info.yml b/drupal/core/modules/content_translation/content_translation.info.yml index ff744adb..a199dddc 100644 --- a/drupal/core/modules/content_translation/content_translation.info.yml +++ b/drupal/core/modules/content_translation/content_translation.info.yml @@ -4,6 +4,12 @@ description: 'Allows users to translate content entities.' dependencies: - language package: Multilingual -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: language.content_settings_page + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php b/drupal/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php index 98ea255f..ea28195e 100644 --- a/drupal/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php +++ b/drupal/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php @@ -8,6 +8,7 @@ namespace Drupal\content_translation\Tests; use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; +use Drupal\config\Tests\SchemaCheckTestTrait; use Drupal\Core\Field\Entity\BaseFieldOverride; use Drupal\Core\Language\Language; use Drupal\field\Entity\FieldConfig; @@ -20,6 +21,8 @@ */ class ContentTranslationSettingsTest extends WebTestBase { + use SchemaCheckTestTrait; + /** * Modules to enable. * @@ -178,6 +181,8 @@ function testSettingsUI() { $this->assertEqual($definitions['body']->isTranslatable(), $translatable, 'Field translatability correctly switched.'); $this->assertEqual($field->isTranslatable(), $definitions['body']->isTranslatable(), 'Configurable field translatability correctly switched.'); } + + $this->assertConfigSchemas(); } /** @@ -269,4 +274,22 @@ protected function entityManager() { return $this->container->get('entity.manager'); } + /** + * Asserts all active configuration matches schemas. + */ + protected function assertConfigSchemas() { + $names = $this->container->get('config.storage')->listAll(); + $factory = $this->container->get('config.factory'); + /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */ + $typed_config = $this->container->get('config.typed'); + foreach ($names as $name) { + // It is not possible to provide schema due to https://www.drupal.org/node/2248709 + // @todo Refactor settings in https://www.drupal.org/node/2363155 + if ($name != 'content_translation.settings') { + $config = $factory->get($name); + $this->assertConfigSchema($typed_config, $name, $config->get()); + } + } + } + } diff --git a/drupal/core/modules/content_translation/tests/modules/content_translation_test_views/content_translation_test_views.info.yml b/drupal/core/modules/content_translation/tests/modules/content_translation_test_views/content_translation_test_views.info.yml index 0e6574e0..fedfddd0 100644 --- a/drupal/core/modules/content_translation/tests/modules/content_translation_test_views/content_translation_test_views.info.yml +++ b/drupal/core/modules/content_translation/tests/modules/content_translation_test_views/content_translation_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Content translation test views' type: module description: 'Provides default views for views content translation tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - content_translation - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/contextual/contextual.info.yml b/drupal/core/modules/contextual/contextual.info.yml index 4e11bb96..d80fd3c4 100644 --- a/drupal/core/modules/contextual/contextual.info.yml +++ b/drupal/core/modules/contextual/contextual.info.yml @@ -2,5 +2,11 @@ name: 'Contextual Links' type: module description: 'Provides contextual links to perform actions related to elements on a page.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/datetime/datetime.info.yml b/drupal/core/modules/datetime/datetime.info.yml index ee170e9a..184a572e 100644 --- a/drupal/core/modules/datetime/datetime.info.yml +++ b/drupal/core/modules/datetime/datetime.info.yml @@ -2,7 +2,13 @@ name: Datetime type: module description: Defines datetime form elements and a datetime field type. package: Field types -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/dblog/dblog.info.yml b/drupal/core/modules/dblog/dblog.info.yml index f9432d60..224ef5ae 100644 --- a/drupal/core/modules/dblog/dblog.info.yml +++ b/drupal/core/modules/dblog/dblog.info.yml @@ -2,5 +2,11 @@ name: 'Database Logging' type: module description: 'Logs and records system events to the database.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/dblog/src/Tests/DbLogTest.php b/drupal/core/modules/dblog/src/Tests/DbLogTest.php index d3974937..925e31ae 100644 --- a/drupal/core/modules/dblog/src/Tests/DbLogTest.php +++ b/drupal/core/modules/dblog/src/Tests/DbLogTest.php @@ -7,6 +7,7 @@ namespace Drupal\dblog\Tests; +use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\Xss; use Drupal\Core\Logger\RfcLogLevel; use Drupal\dblog\Controller\DbLogController; @@ -305,7 +306,7 @@ private function doUser() { foreach ($links->attributes() as $attr => $value) { if ($attr == 'href') { // Extract link to details page. - $link = drupal_substr($value, strpos($value, 'admin/reports/dblog/event/')); + $link = Unicode::substr($value, strpos($value, 'admin/reports/dblog/event/')); $this->drupalGet($link); // Check for full message text on the details page. $this->assertRaw($message, 'DBLog event details was found: [delete user]'); diff --git a/drupal/core/modules/dblog/tests/modules/dblog_test_views/dblog_test_views.info.yml b/drupal/core/modules/dblog/tests/modules/dblog_test_views/dblog_test_views.info.yml index e0209738..9056ac8c 100644 --- a/drupal/core/modules/dblog/tests/modules/dblog_test_views/dblog_test_views.info.yml +++ b/drupal/core/modules/dblog/tests/modules/dblog_test_views/dblog_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Dblog test views' type: module description: 'Provides default views for views dblog tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - dblog - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/editor/editor.admin.inc b/drupal/core/modules/editor/editor.admin.inc index 85006ebb..83bc2cf3 100644 --- a/drupal/core/modules/editor/editor.admin.inc +++ b/drupal/core/modules/editor/editor.admin.inc @@ -6,7 +6,6 @@ */ use Drupal\Core\StreamWrapper\StreamWrapperInterface; -use Drupal\Component\Utility\SafeMarkup; use Drupal\editor\Entity\Editor; /** @@ -93,8 +92,8 @@ function editor_image_upload_settings_form(Editor $editor) { $form['max_dimensions'] = array( '#type' => 'item', '#title' => t('Maximum dimensions'), - '#field_prefix' => SafeMarkup::set('
'), - '#field_suffix' => SafeMarkup::set('
'), + '#field_prefix' => '
', + '#field_suffix' => '
', '#description' => t('Images larger than these dimensions will be scaled down.'), '#states' => $show_if_image_uploads_enabled, ); diff --git a/drupal/core/modules/editor/editor.info.yml b/drupal/core/modules/editor/editor.info.yml index 0c8ff38a..d05d8476 100644 --- a/drupal/core/modules/editor/editor.info.yml +++ b/drupal/core/modules/editor/editor.info.yml @@ -2,9 +2,15 @@ name: 'Text Editor' type: module description: 'Provides a means to associate text formats with text editor libraries such as WYSIWYGs or toolbars.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - filter - file configure: filter.admin_overview + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/editor/tests/modules/editor_test.info.yml b/drupal/core/modules/editor/tests/modules/editor_test.info.yml index 40b6ff07..3f98f47a 100644 --- a/drupal/core/modules/editor/tests/modules/editor_test.info.yml +++ b/drupal/core/modules/editor/tests/modules/editor_test.info.yml @@ -1,6 +1,12 @@ name: 'Text Editor test' type: module description: 'Support module for the Text Editor module tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/entity_reference/config/schema/entity_reference.schema.yml b/drupal/core/modules/entity_reference/config/schema/entity_reference.schema.yml index de964437..5404963f 100644 --- a/drupal/core/modules/entity_reference/config/schema/entity_reference.schema.yml +++ b/drupal/core/modules/entity_reference/config/schema/entity_reference.schema.yml @@ -1,35 +1,5 @@ # Schema for the configuration files of the Entity Reference module. -field.entity_reference.storage_settings: - type: mapping - label: 'Entity reference settings' - mapping: - target_type: - type: string - label: 'Type of item to reference' - -field.entity_reference.field_settings: - type: mapping - label: 'Entity reference settings' - mapping: - handler: - type: string - label: 'Reference method' - handler_settings: - type: entity_reference.[%parent.handler].handler_settings - label: 'Reference method settings' - -field.entity_reference.value: - type: sequence - label: 'Default value' - sequence: - - type: mapping - label: 'Default' - mapping: - target_id: - type: integer - label: 'Value' - entity_reference.default.handler_settings: type: mapping label: 'View handler settings' diff --git a/drupal/core/modules/entity_reference/entity_reference.info.yml b/drupal/core/modules/entity_reference/entity_reference.info.yml index 0ff6b025..dd4ca46a 100644 --- a/drupal/core/modules/entity_reference/entity_reference.info.yml +++ b/drupal/core/modules/entity_reference/entity_reference.info.yml @@ -2,7 +2,13 @@ name: 'Entity Reference' type: module description: 'Provides a field that can reference other entities.' package: Field types -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php b/drupal/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php index 26724c0c..69a19242 100644 --- a/drupal/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php +++ b/drupal/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php @@ -77,6 +77,9 @@ function testEntityReferenceDefaultValue() { $config_entity = $this->container->get('config.factory')->get('field.field.node.reference_content.' . $field_name)->get(); $this->assertTrue(isset($config_entity['default_value'][0]['target_uuid']), 'Default value contains target_uuid property'); $this->assertEqual($config_entity['default_value'][0]['target_uuid'], $referenced_node->uuid(), 'Content uuid and config entity uuid are the same'); + // Ensure the configuration has the expected dependency on the entity that + // is being used a default value. + $this->assertEqual(array($referenced_node->getConfigDependencyName()), $config_entity['dependencies']['content']); // Clear field definitions cache in order to avoid stale cache values. \Drupal::entityManager()->clearCachedFieldDefinitions(); diff --git a/drupal/core/modules/entity_reference/src/Tests/EntityReferenceIntegrationTest.php b/drupal/core/modules/entity_reference/src/Tests/EntityReferenceIntegrationTest.php index e30a4117..2f03ed1d 100644 --- a/drupal/core/modules/entity_reference/src/Tests/EntityReferenceIntegrationTest.php +++ b/drupal/core/modules/entity_reference/src/Tests/EntityReferenceIntegrationTest.php @@ -7,6 +7,10 @@ namespace Drupal\entity_reference\Tests; +use Drupal\Component\Utility\String; +use Drupal\config\Tests\AssertConfigEntityImportTrait; +use Drupal\entity_reference\Exception\MissingDefaultValueException; +use Drupal\field\Entity\FieldConfig; use Drupal\simpletest\WebTestBase; /** @@ -15,6 +19,7 @@ * @group entity_reference */ class EntityReferenceIntegrationTest extends WebTestBase { + use AssertConfigEntityImportTrait; /** * The entity type used in this test. @@ -42,7 +47,7 @@ class EntityReferenceIntegrationTest extends WebTestBase { * * @var array */ - public static $modules = array('config_test', 'entity_test', 'entity_reference'); + public static $modules = array('config_test', 'entity_test', 'entity_reference', 'field_ui'); /** * {@inheritdoc} @@ -51,7 +56,7 @@ protected function setUp() { parent::setUp(); // Create a test user. - $web_user = $this->drupalCreateUser(array('administer entity_test content')); + $web_user = $this->drupalCreateUser(array('administer entity_test content', 'administer entity_test fields')); $this->drupalLogin($web_user); } @@ -59,7 +64,7 @@ protected function setUp() { * Tests the entity reference field with all its supported field widgets. */ public function testSupportedEntityTypesAndWidgets() { - foreach ($this->getTestEntities() as $referenced_entities) { + foreach ($this->getTestEntities() as $key => $referenced_entities) { $this->fieldName = 'field_test_' . $referenced_entities[0]->getEntityTypeId(); // Create an Entity reference field. @@ -122,6 +127,33 @@ public function testSupportedEntityTypesAndWidgets() { $this->drupalPostForm($this->entityType . '/manage/' . $entity->id(), array(), t('Save')); $this->assertFieldValues($entity_name, $referenced_entities); } + + // Reset to the default 'entity_reference_autocomplete' widget. + entity_get_form_display($this->entityType, $this->bundle, 'default')->setComponent($this->fieldName)->save(); + + // Set first entity as the default_value. + $field_edit = array( + 'default_value_input[' . $this->fieldName . '][0][target_id]' => $referenced_entities[0]->label() . ' (' . $referenced_entities[0]->id() . ')', + ); + if ($key == 'content') { + $field_edit['field[settings][handler_settings][target_bundles][' . $referenced_entities[0]->getEntityTypeId() . ']'] = TRUE; + } + $this->drupalPostForm($this->entityType . '/structure/' . $this->bundle .'/fields/' . $this->entityType . '.' . $this->bundle . '.' . $this->fieldName, $field_edit, t('Save settings')); + // Ensure the configuration has the expected dependency on the entity that + // is being used a default value. + $field = FieldConfig::loadByName($this->entityType, $this->bundle, $this->fieldName); + $this->assertTrue(in_array($referenced_entities[0]->getConfigDependencyName(), $field->getDependencies()[$key]), String::format('Expected @type dependency @name found', ['@type' => $key, '@name' => $referenced_entities[0]->getConfigDependencyName()])); + // Ensure that the field can be imported without change even after the + // default value deleted. + $referenced_entities[0]->delete(); + $this->assertConfigEntityImport($field); + + // Once the default value has been removed after saving the dependency + // should be removed. + $field = FieldConfig::loadByName($this->entityType, $this->bundle, $this->fieldName); + $field->save(); + $dependencies = $field->getDependencies(); + $this->assertFalse(isset($dependencies[$key]) && in_array($referenced_entities[0]->getConfigDependencyName(), $dependencies[$key]), String::format('@type dependency @name does not exist.', ['@type' => $key, '@name' => $referenced_entities[0]->getConfigDependencyName()])); } } diff --git a/drupal/core/modules/entity_reference/tests/modules/entity_reference_test/entity_reference_test.info.yml b/drupal/core/modules/entity_reference/tests/modules/entity_reference_test/entity_reference_test.info.yml index 67a5f487..829f1941 100644 --- a/drupal/core/modules/entity_reference/tests/modules/entity_reference_test/entity_reference_test.info.yml +++ b/drupal/core/modules/entity_reference/tests/modules/entity_reference_test/entity_reference_test.info.yml @@ -1,8 +1,14 @@ name: "Entity Reference Test" type: module description: "Support module for the Entity Reference tests." -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION dependencies: - entity_reference + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/entity_reference/tests/modules/entity_reference_test_views/entity_reference_test_views.info.yml b/drupal/core/modules/entity_reference/tests/modules/entity_reference_test_views/entity_reference_test_views.info.yml index 04fb33b3..ff31ea5a 100644 --- a/drupal/core/modules/entity_reference/tests/modules/entity_reference_test_views/entity_reference_test_views.info.yml +++ b/drupal/core/modules/entity_reference/tests/modules/entity_reference_test_views/entity_reference_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Entity reference test views' type: module description: 'Provides default views for views entity reference tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - entity_reference - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/field/field.info.yml b/drupal/core/modules/field/field.info.yml index 13b5da00..874da0e9 100644 --- a/drupal/core/modules/field/field.info.yml +++ b/drupal/core/modules/field/field.info.yml @@ -2,5 +2,11 @@ name: Field type: module description: 'Field API to add fields to entities like nodes and users.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/field/src/Tests/Boolean/BooleanItemTest.php b/drupal/core/modules/field/src/Tests/Boolean/BooleanItemTest.php index 479fc204..e9d76052 100644 --- a/drupal/core/modules/field/src/Tests/Boolean/BooleanItemTest.php +++ b/drupal/core/modules/field/src/Tests/Boolean/BooleanItemTest.php @@ -39,7 +39,7 @@ protected function setUp() { // Create a form display for the default form mode. entity_get_form_display('entity_test', 'entity_test', 'default') ->setComponent('field_boolean', array( - 'type' => 'boolean', + 'type' => 'boolean_checkbox', )) ->save(); } diff --git a/drupal/core/modules/field/src/Tests/FieldAttachOtherTest.php b/drupal/core/modules/field/src/Tests/FieldAttachOtherTest.php index ff8569c3..d3e65b3a 100644 --- a/drupal/core/modules/field/src/Tests/FieldAttachOtherTest.php +++ b/drupal/core/modules/field/src/Tests/FieldAttachOtherTest.php @@ -20,6 +20,8 @@ class FieldAttachOtherTest extends FieldUnitTestBase { protected function setUp() { parent::setUp(); + $this->installSchema('system', array('router')); + $this->container->get('router.builder')->rebuild(); $this->installEntitySchema('entity_test_rev'); $this->createFieldWithStorage(); } diff --git a/drupal/core/modules/field/src/Tests/FieldUnitTestBase.php b/drupal/core/modules/field/src/Tests/FieldUnitTestBase.php index e89147b8..5fadfde1 100644 --- a/drupal/core/modules/field/src/Tests/FieldUnitTestBase.php +++ b/drupal/core/modules/field/src/Tests/FieldUnitTestBase.php @@ -21,7 +21,7 @@ abstract class FieldUnitTestBase extends KernelTestBase { * * @var array */ - public static $modules = array('user', 'entity', 'system', 'field', 'text', 'entity_test', 'field_test'); + public static $modules = array('user', 'entity', 'system', 'field', 'text', 'entity_test', 'field_test', 'entity_reference'); /** * Bag of created field storages and fields. diff --git a/drupal/core/modules/field/src/Tests/TestItemWithDependenciesTest.php b/drupal/core/modules/field/src/Tests/TestItemWithDependenciesTest.php new file mode 100644 index 00000000..b5ad7e12 --- /dev/null +++ b/drupal/core/modules/field/src/Tests/TestItemWithDependenciesTest.php @@ -0,0 +1,57 @@ + $this->field_name, + 'entity_type' => 'entity_test', + 'type' => 'test_field_with_dependencies', + ))->save(); + $field = entity_create('field_config', array( + 'entity_type' => 'entity_test', + 'field_name' => $this->field_name, + 'bundle' => 'entity_test', + )); + $field->save(); + + // Validate that the field configuration entity has the expected + // dependencies. + $this->assertEqual([ + 'content' => ['node:article:uuid'], + 'config' => ['field.storage.entity_test.field_test'], + 'module' => ['field_test', 'test_module'] + ], $field->getDependencies()); + } + +} diff --git a/drupal/core/modules/field/tests/modules/field_plugins_test/field_plugins_test.info.yml b/drupal/core/modules/field/tests/modules/field_plugins_test/field_plugins_test.info.yml index 86a6ec8b..cd635b3d 100644 --- a/drupal/core/modules/field/tests/modules/field_plugins_test/field_plugins_test.info.yml +++ b/drupal/core/modules/field/tests/modules/field_plugins_test/field_plugins_test.info.yml @@ -1,8 +1,14 @@ name: 'Field Plugins Test' type: module description: 'Support module for the field and entity display tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION dependencies: - text + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/field/tests/modules/field_test/field_test.info.yml b/drupal/core/modules/field/tests/modules/field_test/field_test.info.yml index 4ede4776..e377d2dd 100644 --- a/drupal/core/modules/field/tests/modules/field_test/field_test.info.yml +++ b/drupal/core/modules/field/tests/modules/field_test/field_test.info.yml @@ -1,8 +1,14 @@ name: 'Field API Test' type: module description: 'Support module for the Field API tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION dependencies: - entity_test + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItemWithDependencies.php b/drupal/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItemWithDependencies.php new file mode 100644 index 00000000..c1fa21a3 --- /dev/null +++ b/drupal/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItemWithDependencies.php @@ -0,0 +1,39 @@ + ['node:article:uuid']]; + } + +} diff --git a/drupal/core/modules/field/tests/modules/field_test_config/field_test_config.info.yml b/drupal/core/modules/field/tests/modules/field_test_config/field_test_config.info.yml index e3cb0e89..87c573ba 100644 --- a/drupal/core/modules/field/tests/modules/field_test_config/field_test_config.info.yml +++ b/drupal/core/modules/field/tests/modules/field_test_config/field_test_config.info.yml @@ -1,6 +1,12 @@ name: 'Field API configuration tests' type: module description: 'Support module for the Field API configuration tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/field/tests/modules/field_test_views/field_test_views.info.yml b/drupal/core/modules/field/tests/modules/field_test_views/field_test_views.info.yml index 18287b61..200f8969 100644 --- a/drupal/core/modules/field/tests/modules/field_test_views/field_test_views.info.yml +++ b/drupal/core/modules/field/tests/modules/field_test_views/field_test_views.info.yml @@ -2,7 +2,13 @@ name: 'User test views' type: module description: 'Provides default views for views user tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/field/tests/modules/field_third_party_test/field_third_party_test.info.yml b/drupal/core/modules/field/tests/modules/field_third_party_test/field_third_party_test.info.yml index 6fd7f39e..437346d7 100644 --- a/drupal/core/modules/field/tests/modules/field_third_party_test/field_third_party_test.info.yml +++ b/drupal/core/modules/field/tests/modules/field_third_party_test/field_third_party_test.info.yml @@ -1,9 +1,15 @@ name: 'Field Third Party Settings Test' type: module description: 'Support module for the Field API tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION dependencies: - entity_test - field_test + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php b/drupal/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php index 63f2d4b1..fd401fa4 100644 --- a/drupal/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php +++ b/drupal/core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php @@ -7,6 +7,7 @@ namespace Drupal\Tests\field\Unit; +use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\field\Entity\FieldConfig; @@ -53,6 +54,20 @@ class FieldConfigEntityUnitTest extends UnitTestCase { */ protected $fieldStorage; + /** + * The typed configuration manager used for testing. + * + * @var \Drupal\Core\Config\TypedConfigManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $typedConfigManager; + + /** + * The mock field type plugin manager; + * + * @var \Drupal\Core\Field\FieldTypePluginManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $fieldTypePluginManager; + /** * {@inheritdoc} */ @@ -66,10 +81,13 @@ protected function setUp() { $this->typedConfigManager = $this->getMock('Drupal\Core\Config\TypedConfigManagerInterface'); + $this->fieldTypePluginManager = $this->getMock('Drupal\Core\Field\FieldTypePluginManagerInterface'); + $container = new ContainerBuilder(); $container->set('entity.manager', $this->entityManager); $container->set('uuid', $this->uuid); $container->set('config.typed', $this->typedConfigManager); + $container->set('plugin.manager.field.field_type', $this->fieldTypePluginManager); \Drupal::setContainer($container); // Create a mock FieldStorageConfig object. @@ -80,7 +98,9 @@ protected function setUp() { $this->fieldStorage->expects($this->any()) ->method('getName') ->will($this->returnValue('field_test')); - + $this->fieldStorage->expects($this->any()) + ->method('getSettings') + ->willReturn(array()); // Place the field in the mocked entity manager's field registry. $this->entityManager->expects($this->any()) ->method('getFieldStorageDefinitions') @@ -116,10 +136,27 @@ public function testCalculateDependencies() { ->method('getBundleEntityType') ->will($this->returnValue('bundle_entity_type')); - $this->entityManager->expects($this->any()) + $this->entityManager->expects($this->at(0)) + ->method('getDefinition') + ->with($this->entityTypeId) + ->willReturn($this->entityType); + $this->entityManager->expects($this->at(1)) + ->method('getDefinition') + ->with($this->entityTypeId) + ->willReturn($this->entityType); + $this->entityManager->expects($this->at(2)) + ->method('getDefinition') + ->with($this->entityTypeId) + ->willReturn($this->entityType); + $this->entityManager->expects($this->at(3)) ->method('getDefinition') ->with('test_entity_type') - ->will($this->returnValue($target_entity_type)); + ->willReturn($target_entity_type); + + $this->fieldTypePluginManager->expects($this->any()) + ->method('getDefinition') + ->with('test_field') + ->willReturn(['provider' => 'test_module', 'config_dependencies' =>['module' => ['test_module2']], 'class' => '\Drupal\Tests\field\Unit\DependencyFieldItem']); $this->fieldStorage->expects($this->once()) ->method('getConfigDependencyName') @@ -134,6 +171,7 @@ public function testCalculateDependencies() { $dependencies = $field->calculateDependencies(); $this->assertContains('field.storage.test_entity_type.test_field', $dependencies['config']); $this->assertContains('test.test_entity_type.id', $dependencies['config']); + $this->assertEquals(['test_module', 'test_module2', 'test_module3'], $dependencies['module']); } /** @@ -202,3 +240,16 @@ public function testGetType() { } } + +/** + * A test class. + * + * @see \Drupal\Tests\field\Unit\FieldConfigEntityUnitTest::testCalculateDependencies() + */ +class DependencyFieldItem { + + public static function calculateDependencies(FieldDefinitionInterface $definition) { + return ['module' => ['test_module3']]; + } + +} diff --git a/drupal/core/modules/field_ui/field_ui.info.yml b/drupal/core/modules/field_ui/field_ui.info.yml index b4f4260d..63b8cebf 100644 --- a/drupal/core/modules/field_ui/field_ui.info.yml +++ b/drupal/core/modules/field_ui/field_ui.info.yml @@ -2,7 +2,13 @@ name: 'Field UI' type: module description: 'User interface for the Field API.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/field_ui/src/Form/FieldStorageEditForm.php b/drupal/core/modules/field_ui/src/Form/FieldStorageEditForm.php index c3cca593..d2118c32 100644 --- a/drupal/core/modules/field_ui/src/Form/FieldStorageEditForm.php +++ b/drupal/core/modules/field_ui/src/Form/FieldStorageEditForm.php @@ -98,6 +98,18 @@ public function buildForm(array $form, FormStateInterface $form_state, FieldConf $form['field_storage']['#prefix'] = '
' . $this->t('There is data for this field in the database. The field settings can no longer be changed.') . '
' . $form['field_storage']['#prefix']; } + // Add settings provided by the field module. The field module is + // responsible for not returning settings that cannot be changed if + // the field already has data. + $form['field_storage']['settings'] = array( + '#weight' => -10, + ); + // Create an arbitrary entity object, so that we can have an instantiated + // FieldItem. + $ids = (object) array('entity_type' => $this->field->entity_type, 'bundle' => $this->field->bundle, 'entity_id' => NULL); + $entity = _field_create_entity_from_ids($ids); + $form['field_storage']['settings'] += $entity->get($field_storage->getName())->first()->storageSettingsForm($form, $form_state, $field_storage->hasData()); + // Build the configurable field values. $cardinality = $field_storage->getCardinality(); $form['field_storage']['cardinality_container'] = array( @@ -141,18 +153,6 @@ public function buildForm(array $form, FormStateInterface $form_state, FieldConf $form['field_storage']['module'] = array('#type' => 'value', '#value' => $field_storage->module); $form['field_storage']['translatable'] = array('#type' => 'value', '#value' => $field_storage->isTranslatable()); - // Add settings provided by the field module. The field module is - // responsible for not returning settings that cannot be changed if - // the field already has data. - $form['field_storage']['settings'] = array( - '#weight' => 10, - ); - // Create an arbitrary entity object, so that we can have an instantiated - // FieldItem. - $ids = (object) array('entity_type' => $this->field->entity_type, 'bundle' => $this->field->bundle, 'entity_id' => NULL); - $entity = _field_create_entity_from_ids($ids); - $form['field_storage']['settings'] += $entity->get($field_storage->getName())->first()->storageSettingsForm($form, $form_state, $field_storage->hasData()); - $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->t('Save field settings')); return $form; diff --git a/drupal/core/modules/field_ui/src/Tests/EntityDisplayTest.php b/drupal/core/modules/field_ui/src/Tests/EntityDisplayTest.php index 3a76027f..5150f584 100644 --- a/drupal/core/modules/field_ui/src/Tests/EntityDisplayTest.php +++ b/drupal/core/modules/field_ui/src/Tests/EntityDisplayTest.php @@ -17,7 +17,7 @@ */ class EntityDisplayTest extends KernelTestBase { - public static $modules = array('field_ui', 'field', 'entity_test', 'user', 'text', 'field_test', 'node', 'system'); + public static $modules = array('field_ui', 'field', 'entity_test', 'user', 'text', 'field_test', 'node', 'system', 'entity_reference'); protected function setUp() { parent::setUp(); @@ -305,7 +305,7 @@ public function testRenameDeleteBundle() { $dependencies = $new_form_display->calculateDependencies(); $expected_form_dependencies = array( 'config' => array('field.field.node.article_rename.body', 'node.type.article_rename'), - 'module' => array('text') + 'module' => array('entity_reference', 'text') ); $this->assertEqual($expected_form_dependencies, $dependencies); diff --git a/drupal/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php b/drupal/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php index 12b41c72..768c1421 100644 --- a/drupal/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php +++ b/drupal/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php @@ -17,7 +17,7 @@ */ class EntityFormDisplayTest extends KernelTestBase { - public static $modules = array('field_ui', 'field', 'entity_test', 'field_test', 'user', 'text'); + public static $modules = array('field_ui', 'field', 'entity_test', 'field_test', 'user', 'text', 'entity_reference'); protected function setUp() { parent::setUp(); diff --git a/drupal/core/modules/field_ui/src/Tests/FieldUiTestBase.php b/drupal/core/modules/field_ui/src/Tests/FieldUiTestBase.php index 962aceca..314cf5b8 100644 --- a/drupal/core/modules/field_ui/src/Tests/FieldUiTestBase.php +++ b/drupal/core/modules/field_ui/src/Tests/FieldUiTestBase.php @@ -105,6 +105,7 @@ function fieldUIAddExistingField($bundle_path, $initial_edit, $field_edit = arra // First step : 'Re-use existing field' on the 'Manage fields' page. $this->drupalPostForm("$bundle_path/fields", $initial_edit, t('Save')); + $this->assertNoRaw('&lt;', 'The page does not have double escaped HTML tags.'); // Second step : 'Field settings' form. $this->drupalPostForm(NULL, $field_edit, t('Save settings')); diff --git a/drupal/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.info.yml b/drupal/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.info.yml index 9d7a5d13..2982f967 100644 --- a/drupal/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.info.yml +++ b/drupal/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.info.yml @@ -2,9 +2,15 @@ name: "Field UI tests" type: module description: "Support module for Field UI testing." package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field_ui - entity_test + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/file/file.info.yml b/drupal/core/modules/file/file.info.yml index d219c76f..4d633c85 100644 --- a/drupal/core/modules/file/file.info.yml +++ b/drupal/core/modules/file/file.info.yml @@ -2,7 +2,13 @@ name: File type: module description: 'Defines a file field type.' package: Field types -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/file/file.module b/drupal/core/modules/file/file.module index 06e71ae6..9f83add3 100644 --- a/drupal/core/modules/file/file.module +++ b/drupal/core/modules/file/file.module @@ -532,7 +532,7 @@ function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAM * \Symfony\Component\HttpFoundation\StreamedResponse. */ function file_get_content_headers(FileInterface $file) { - $type = mime_header_encode($file->getMimeType()); + $type = Unicode::mimeHeaderEncode($file->getMimeType()); return array( 'Content-Type' => $type, diff --git a/drupal/core/modules/file/tests/file_module_test/file_module_test.info.yml b/drupal/core/modules/file/tests/file_module_test/file_module_test.info.yml index 097b0a5c..ad183670 100644 --- a/drupal/core/modules/file/tests/file_module_test/file_module_test.info.yml +++ b/drupal/core/modules/file/tests/file_module_test/file_module_test.info.yml @@ -2,5 +2,11 @@ name: 'File test' type: module description: 'Provides hooks for testing File module functionality.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/file/tests/file_test/file_test.info.yml b/drupal/core/modules/file/tests/file_test/file_test.info.yml index d5ebfdfd..a735a8b0 100644 --- a/drupal/core/modules/file/tests/file_test/file_test.info.yml +++ b/drupal/core/modules/file/tests/file_test/file_test.info.yml @@ -2,5 +2,11 @@ name: 'File test' type: module description: 'Support module for file handling tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/file/tests/modules/file_test_views/file_test_views.info.yml b/drupal/core/modules/file/tests/modules/file_test_views/file_test_views.info.yml index 41726c7e..3e9ec44b 100644 --- a/drupal/core/modules/file/tests/modules/file_test_views/file_test_views.info.yml +++ b/drupal/core/modules/file/tests/modules/file_test_views/file_test_views.info.yml @@ -2,8 +2,14 @@ name: 'File test views' type: module description: 'Provides default views for views file tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - file - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/filter/filter.info.yml b/drupal/core/modules/filter/filter.info.yml index bfc49545..5b9c61bd 100644 --- a/drupal/core/modules/filter/filter.info.yml +++ b/drupal/core/modules/filter/filter.info.yml @@ -2,8 +2,14 @@ name: Filter type: module description: 'Filters content in preparation for display.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: filter.admin_overview dependencies: - user + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/filter/filter.module b/drupal/core/modules/filter/filter.module index e0b98ee9..bf121b4b 100644 --- a/drupal/core/modules/filter/filter.module +++ b/drupal/core/modules/filter/filter.module @@ -800,11 +800,11 @@ function _filter_html_image_secure_process($text) { // Verify that $src starts with $base_path. // This also ensures that external images cannot be referenced. $src = $image->getAttribute('src'); - if (drupal_substr($src, 0, $base_path_length) === $base_path) { + if (Unicode::substr($src, 0, $base_path_length) === $base_path) { // Remove the $base_path to get the path relative to the Drupal root. // Ensure the path refers to an actual image by prefixing the image source // with the Drupal root and running getimagesize() on it. - $local_image_path = $local_dir . drupal_substr($src, $base_path_length); + $local_image_path = $local_dir . Unicode::substr($src, $base_path_length); $local_image_path = rawurldecode($local_image_path); if (@getimagesize($local_image_path)) { // The image has the right path. Erroneous images are dealt with below. diff --git a/drupal/core/modules/filter/src/Tests/FilterCrudTest.php b/drupal/core/modules/filter/src/Tests/FilterCrudTest.php index 37d1232c..70ea342d 100644 --- a/drupal/core/modules/filter/src/Tests/FilterCrudTest.php +++ b/drupal/core/modules/filter/src/Tests/FilterCrudTest.php @@ -7,14 +7,14 @@ namespace Drupal\filter\Tests; -use Drupal\simpletest\DrupalUnitTestBase; +use Drupal\simpletest\KernelTestBase; /** * Tests creation, loading, updating, deleting of text formats and filters. * * @group filter */ -class FilterCrudTest extends DrupalUnitTestBase { +class FilterCrudTest extends KernelTestBase { /** * Modules to enable. diff --git a/drupal/core/modules/filter/src/Tests/FilterDefaultConfigTest.php b/drupal/core/modules/filter/src/Tests/FilterDefaultConfigTest.php index 5af47582..84ea0b9c 100644 --- a/drupal/core/modules/filter/src/Tests/FilterDefaultConfigTest.php +++ b/drupal/core/modules/filter/src/Tests/FilterDefaultConfigTest.php @@ -7,14 +7,14 @@ namespace Drupal\filter\Tests; -use Drupal\simpletest\DrupalUnitTestBase; +use Drupal\simpletest\KernelTestBase; /** * Tests text format default configuration. * * @group filter */ -class FilterDefaultConfigTest extends DrupalUnitTestBase { +class FilterDefaultConfigTest extends KernelTestBase { public static $modules = array('system', 'user', 'filter', 'filter_test', 'entity'); diff --git a/drupal/core/modules/filter/src/Tests/FilterSettingsTest.php b/drupal/core/modules/filter/src/Tests/FilterSettingsTest.php index a3fd53dc..b88fcec5 100644 --- a/drupal/core/modules/filter/src/Tests/FilterSettingsTest.php +++ b/drupal/core/modules/filter/src/Tests/FilterSettingsTest.php @@ -7,14 +7,14 @@ namespace Drupal\filter\Tests; -use Drupal\simpletest\DrupalUnitTestBase; +use Drupal\simpletest\KernelTestBase; /** * Tests filter settings. * * @group filter */ -class FilterSettingsTest extends DrupalUnitTestBase { +class FilterSettingsTest extends KernelTestBase { /** * Modules to enable. diff --git a/drupal/core/modules/filter/src/Tests/FilterUnitTest.php b/drupal/core/modules/filter/src/Tests/FilterUnitTest.php index 50813eab..faf7e276 100644 --- a/drupal/core/modules/filter/src/Tests/FilterUnitTest.php +++ b/drupal/core/modules/filter/src/Tests/FilterUnitTest.php @@ -9,15 +9,15 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Utility\String; -use Drupal\simpletest\DrupalUnitTestBase; use Drupal\filter\FilterPluginCollection; +use Drupal\simpletest\KernelTestBase; /** * Tests Filter module filters individually. * * @group filter */ -class FilterUnitTest extends DrupalUnitTestBase { +class FilterUnitTest extends KernelTestBase { /** * Modules to enable. diff --git a/drupal/core/modules/filter/tests/filter_test/filter_test.info.yml b/drupal/core/modules/filter/tests/filter_test/filter_test.info.yml index dcefe8ee..82b90de9 100644 --- a/drupal/core/modules/filter/tests/filter_test/filter_test.info.yml +++ b/drupal/core/modules/filter/tests/filter_test/filter_test.info.yml @@ -2,5 +2,11 @@ name: 'Filter test module' type: module description: 'Tests filter hooks and functions.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/forum/forum.info.yml b/drupal/core/modules/forum/forum.info.yml index 43e660f7..3b1b2566 100644 --- a/drupal/core/modules/forum/forum.info.yml +++ b/drupal/core/modules/forum/forum.info.yml @@ -8,6 +8,12 @@ dependencies: - comment - options package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: forum.overview + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/forum/tests/modules/forum_test_views/forum_test_views.info.yml b/drupal/core/modules/forum/tests/modules/forum_test_views/forum_test_views.info.yml index f31f030d..2b2a2ff3 100644 --- a/drupal/core/modules/forum/tests/modules/forum_test_views/forum_test_views.info.yml +++ b/drupal/core/modules/forum/tests/modules/forum_test_views/forum_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Forum test views' type: module description: 'Provides default views for views forum tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - forum - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/hal/hal.info.yml b/drupal/core/modules/hal/hal.info.yml index 4cf0c7ea..a4a7e640 100644 --- a/drupal/core/modules/hal/hal.info.yml +++ b/drupal/core/modules/hal/hal.info.yml @@ -2,8 +2,14 @@ name: 'HAL' type: module description: 'Serializes entities using Hypertext Application Language.' package: Web services -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - rest - serialization + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/help/help.info.yml b/drupal/core/modules/help/help.info.yml index ee4c6433..4ebc0c9e 100644 --- a/drupal/core/modules/help/help.info.yml +++ b/drupal/core/modules/help/help.info.yml @@ -2,5 +2,11 @@ name: Help type: module description: 'Manages the display of online help.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/history/history.info.yml b/drupal/core/modules/history/history.info.yml index aeb678c3..d36900ba 100644 --- a/drupal/core/modules/history/history.info.yml +++ b/drupal/core/modules/history/history.info.yml @@ -2,7 +2,13 @@ name: History type: module description: 'Records which user has read which content.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - node + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/image/image.info.yml b/drupal/core/modules/image/image.info.yml index 4a704cca..1f06c72e 100644 --- a/drupal/core/modules/image/image.info.yml +++ b/drupal/core/modules/image/image.info.yml @@ -2,8 +2,14 @@ name: Image type: module description: 'Defines an image field type and provides image manipulation tools.' package: Field types -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - file configure: image.style_list + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/image/tests/modules/image_module_test/image_module_test.info.yml b/drupal/core/modules/image/tests/modules/image_module_test/image_module_test.info.yml index 7c4d3ace..38cf9157 100644 --- a/drupal/core/modules/image/tests/modules/image_module_test/image_module_test.info.yml +++ b/drupal/core/modules/image/tests/modules/image_module_test/image_module_test.info.yml @@ -2,5 +2,11 @@ name: 'Image test' type: module description: 'Provides hook implementations for testing Image module functionality.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/language/language.info.yml b/drupal/core/modules/language/language.info.yml index c1cf7ffb..5682fa0e 100644 --- a/drupal/core/modules/language/language.info.yml +++ b/drupal/core/modules/language/language.info.yml @@ -2,6 +2,12 @@ name: Language type: module description: 'Allows users to configure languages and apply them to content.' package: Multilingual -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: language.admin_overview + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/language/src/Form/NegotiationSessionForm.php b/drupal/core/modules/language/src/Form/NegotiationSessionForm.php index ce971070..a0bd7779 100644 --- a/drupal/core/modules/language/src/Form/NegotiationSessionForm.php +++ b/drupal/core/modules/language/src/Form/NegotiationSessionForm.php @@ -43,7 +43,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $this->config('language.settings') + $this->config('language.negotiation') ->set('session.parameter', $form_state->getValue('language_negotiation_session_param')) ->save(); diff --git a/drupal/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/drupal/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php index 9ec78f4c..21dd72eb 100644 --- a/drupal/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php +++ b/drupal/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php @@ -10,6 +10,7 @@ use Drupal\language\Entity\ConfigurableLanguage; use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationBrowser; use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSelected; +use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationSession; use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl; use Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUser; use Drupal\user\Plugin\LanguageNegotiation\LanguageNegotiationUserAdmin; @@ -317,9 +318,37 @@ function testUILanguageNegotiation() { 'message' => 'USER ADMIN > DEFAULT: defined prefereed user admin language setting, the UI language is based on user setting', ); $this->runTest($test); + + // Go by session preference. + $language_negotiation_session_param = $this->randomMachineName(); + $edit = array('language_negotiation_session_param' => $language_negotiation_session_param); + $this->drupalPostForm('admin/config/regional/language/detection/session', $edit, t('Save configuration')); + $tests = array( + array( + 'language_negotiation' => array(LanguageNegotiationSession::METHOD_ID), + 'path' => "admin/config", + 'expect' => $default_string, + 'expected_method_id' => LanguageNegotiatorInterface::METHOD_ID, + 'http_header' => $http_header_browser_fallback, + 'message' => 'SESSION > DEFAULT: no language given, the UI language is default', + ), + array( + 'language_negotiation' => array(LanguageNegotiationSession::METHOD_ID), + 'path' => 'admin/config', + 'path_options' => ['query' => [$language_negotiation_session_param => $langcode]], + 'expect' => $language_string, + 'expected_method_id' => LanguageNegotiationSession::METHOD_ID, + 'http_header' => $http_header_browser_fallback, + 'message' => 'SESSION > DEFAULT: language given, UI language is determined by session language preference', + ), + ); + foreach ($tests as $test) { + $this->runTest($test); + } } protected function runTest($test) { + $test += array('path_options' => []); if (!empty($test['language_negotiation'])) { $method_weights = array_flip($test['language_negotiation']); $this->container->get('language_negotiator')->saveConfiguration(LanguageInterface::TYPE_INTERFACE, $method_weights); @@ -333,7 +362,7 @@ protected function runTest($test) { \Drupal::state()->set('language_test.domain', $test['language_test_domain']); } $this->container->get('language_manager')->reset(); - $this->drupalGet($test['path'], array(), $test['http_header']); + $this->drupalGet($test['path'], $test['path_options'], $test['http_header']); $this->assertText($test['expect'], $test['message']); $this->assertText(t('Language negotiation method: @name', array('@name' => $test['expected_method_id']))); } diff --git a/drupal/core/modules/language/tests/language_config_override_test/language_config_override_test.info.yml b/drupal/core/modules/language/tests/language_config_override_test/language_config_override_test.info.yml index 4345db5a..c72fac15 100644 --- a/drupal/core/modules/language/tests/language_config_override_test/language_config_override_test.info.yml +++ b/drupal/core/modules/language/tests/language_config_override_test/language_config_override_test.info.yml @@ -1,6 +1,12 @@ name: 'Language config overridetest' type: module description: 'Support module for the language config override test.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/language/tests/language_elements_test/language_elements_test.info.yml b/drupal/core/modules/language/tests/language_elements_test/language_elements_test.info.yml index d8a3da1f..2153eef6 100644 --- a/drupal/core/modules/language/tests/language_elements_test/language_elements_test.info.yml +++ b/drupal/core/modules/language/tests/language_elements_test/language_elements_test.info.yml @@ -1,6 +1,12 @@ name: 'Language form elements test' type: module description: 'Support module for the language form elements tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/language/tests/language_test/language_test.info.yml b/drupal/core/modules/language/tests/language_test/language_test.info.yml index 03051cd8..944385ad 100644 --- a/drupal/core/modules/language/tests/language_test/language_test.info.yml +++ b/drupal/core/modules/language/tests/language_test/language_test.info.yml @@ -1,6 +1,12 @@ name: 'Language test' type: module description: 'Support module for the language layer tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/link/link.info.yml b/drupal/core/modules/link/link.info.yml index 509d2ba2..d4e8d7e8 100644 --- a/drupal/core/modules/link/link.info.yml +++ b/drupal/core/modules/link/link.info.yml @@ -1,8 +1,14 @@ name: Link type: module description: 'Provides a simple link field type.' -core: 8.x +# core: 8.x package: Field types -version: VERSION +# version: VERSION dependencies: - field + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/locale/locale.info.yml b/drupal/core/modules/locale/locale.info.yml index e260822e..65dbf6a5 100644 --- a/drupal/core/modules/locale/locale.info.yml +++ b/drupal/core/modules/locale/locale.info.yml @@ -3,8 +3,14 @@ type: module description: 'Translates the built-in user interface.' configure: locale.translate_page package: Multilingual -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - language - file + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/locale/tests/modules/early_translation_test/early_translation_test.info.yml b/drupal/core/modules/locale/tests/modules/early_translation_test/early_translation_test.info.yml index cfc6f7ea..9ed36d26 100644 --- a/drupal/core/modules/locale/tests/modules/early_translation_test/early_translation_test.info.yml +++ b/drupal/core/modules/locale/tests/modules/early_translation_test/early_translation_test.info.yml @@ -1,7 +1,13 @@ name: 'Early translation test' type: module description: 'Support module for testing early bootstrap getting of annotations with translations.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/locale/tests/modules/locale_test/locale_test.info.yml b/drupal/core/modules/locale/tests/modules/locale_test/locale_test.info.yml index ca4211d4..00627a55 100644 --- a/drupal/core/modules/locale/tests/modules/locale_test/locale_test.info.yml +++ b/drupal/core/modules/locale/tests/modules/locale_test/locale_test.info.yml @@ -2,8 +2,14 @@ name: 'Locale test' type: module description: 'Support module for locale module testing.' package: Testing -version: '1.2' -core: 8.x +# version: '1.2' +# core: 8.x hidden: true 'interface translation project': locale_test 'interface translation server pattern': core/modules/locale/test/test.%language.po + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/locale/tests/modules/locale_test_not_development_release/locale_test_not_development_release.info.yml b/drupal/core/modules/locale/tests/modules/locale_test_not_development_release/locale_test_not_development_release.info.yml index 7acf9a02..774f9a3e 100644 --- a/drupal/core/modules/locale/tests/modules/locale_test_not_development_release/locale_test_not_development_release.info.yml +++ b/drupal/core/modules/locale/tests/modules/locale_test_not_development_release/locale_test_not_development_release.info.yml @@ -2,6 +2,12 @@ name: 'Locale Test Not Development Release' type: module description: 'The first release with the same major release number which is not a development release.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x hidden: true + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/locale/tests/modules/locale_test_translate/locale_test_translate.info.yml b/drupal/core/modules/locale/tests/modules/locale_test_translate/locale_test_translate.info.yml index d703b0d2..986c466a 100644 --- a/drupal/core/modules/locale/tests/modules/locale_test_translate/locale_test_translate.info.yml +++ b/drupal/core/modules/locale/tests/modules/locale_test_translate/locale_test_translate.info.yml @@ -2,8 +2,14 @@ name: 'Locale test translate' type: module description: 'Translation test module for locale module testing.' package: Testing -version: '1.3' -core: 8.x +# version: '1.3' +# core: 8.x hidden: true 'interface translation project': locale_test_translate 'interface translation server pattern': core/modules/locale/tests/test.%language.po + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/menu_link_content/menu_link_content.info.yml b/drupal/core/modules/menu_link_content/menu_link_content.info.yml index 5ea5cc71..818bee74 100644 --- a/drupal/core/modules/menu_link_content/menu_link_content.info.yml +++ b/drupal/core/modules/menu_link_content/menu_link_content.info.yml @@ -2,5 +2,11 @@ name: 'Custom Menu Links' type: module description: 'Allows administrators to create custom menu links.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/drupal/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index e9aa9c00..9b44af03 100644 --- a/drupal/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/drupal/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -359,7 +359,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { 'weight' => 0, )) ->setDisplayOptions('form', array( - 'type' => 'integer', + 'type' => 'number', 'weight' => 20, )); diff --git a/drupal/core/modules/menu_ui/menu_ui.info.yml b/drupal/core/modules/menu_ui/menu_ui.info.yml index f3bf1beb..457c9288 100644 --- a/drupal/core/modules/menu_ui/menu_ui.info.yml +++ b/drupal/core/modules/menu_ui/menu_ui.info.yml @@ -2,8 +2,14 @@ name: Menu UI type: module description: 'Allows administrators to customize the site navigation menu.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: menu_ui.overview_page dependencies: - menu_link_content + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/menu_ui/menu_ui.libraries.yml b/drupal/core/modules/menu_ui/menu_ui.libraries.yml index a4e381c5..c5f95948 100644 --- a/drupal/core/modules/menu_ui/menu_ui.libraries.yml +++ b/drupal/core/modules/menu_ui/menu_ui.libraries.yml @@ -14,3 +14,9 @@ drupal.menu_ui.admin: dependencies: - core/jquery - core/drupal + +drupal.menu_ui.adminforms: + version: VERSION + css: + theme: + css/menu_ui.admin.css: {} diff --git a/drupal/core/modules/menu_ui/src/MenuForm.php b/drupal/core/modules/menu_ui/src/MenuForm.php index d0b904ed..a8083680 100644 --- a/drupal/core/modules/menu_ui/src/MenuForm.php +++ b/drupal/core/modules/menu_ui/src/MenuForm.php @@ -128,7 +128,7 @@ public function form(array $form, FormStateInterface $form_state) { '#type' => 'textfield', '#title' => t('Administrative summary'), '#maxlength' => 512, - '#default_value' => $menu->description, + '#default_value' => $menu->getDescription(), ); $form['langcode'] = array( @@ -220,7 +220,7 @@ protected function buildOverviewForm(array &$form, FormStateInterface $form_stat $form_state->set('menu_overview_form_parents', []); } - $form['#attached']['css'] = array(drupal_get_path('module', 'menu') . '/css/menu.admin.css'); + $form['#attached']['library'][] = 'menu_ui/drupal.menu_ui.adminforms'; $tree = $this->menuTree->load($this->entity->id(), new MenuTreeParameters()); diff --git a/drupal/core/modules/menu_ui/src/MenuListBuilder.php b/drupal/core/modules/menu_ui/src/MenuListBuilder.php index 7e987f1e..d93f9451 100644 --- a/drupal/core/modules/menu_ui/src/MenuListBuilder.php +++ b/drupal/core/modules/menu_ui/src/MenuListBuilder.php @@ -39,7 +39,7 @@ public function buildRow(EntityInterface $entity) { 'data' => $this->getLabel($entity), 'class' => array('menu-label'), ); - $row['description'] = Xss::filterAdmin($entity->description); + $row['description'] = Xss::filterAdmin($entity->getDescription()); return $row + parent::buildRow($entity); } @@ -68,7 +68,7 @@ public function getDefaultOperations(EntityInterface $entity) { */ public function render() { $build = parent::render(); - $build['#attached']['css'][] = drupal_get_path('module', 'menu') . '/css/menu.admin.css'; + $build['#attached']['library'][] = "menu_ui/drupal.menu_ui.adminforms"; return $build; } diff --git a/drupal/core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php b/drupal/core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php index a465fc16..0614cd41 100644 --- a/drupal/core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php +++ b/drupal/core/modules/menu_ui/src/Tests/MenuCacheTagsTest.php @@ -60,7 +60,7 @@ public function testMenuBlock() { // Verify that after modifying the menu, there is a cache miss. $this->pass('Test modification of menu.', 'Debug'); - $menu->label = 'Awesome llama'; + $menu->set('label', 'Awesome llama'); $menu->save(); $this->verifyPageCache($path, 'MISS'); diff --git a/drupal/core/modules/migrate/config/schema/migrate.source.schema.yml b/drupal/core/modules/migrate/config/schema/migrate.source.schema.yml index b3314a45..c7903ccf 100644 --- a/drupal/core/modules/migrate/config/schema/migrate.source.schema.yml +++ b/drupal/core/modules/migrate/config/schema/migrate.source.schema.yml @@ -4,235 +4,9 @@ migrate.source.*: type: migrate_source label: 'Default source' -migrate.source.variable: - type: migrate_source_sql - label: 'Variable' - mapping: - variables: - type: sequence - label: 'Variables' - sequence: - - type: string - label: 'Variable' - constants: - type: mapping - label: 'Constants' - mapping: - entity_type: - type: string - label: 'Entity type' - id: - type: string - label: 'ID' - label: - type: label - label: 'Label' - description: - type: text - label: 'Description' - path: - type: string - label: 'Path' - plugin: - type: string - label: 'Plugin' - -migrate.source.d6_comment: - type: migrate_source_sql - label: 'Drupal 6 comment' - mapping: - constants: - type: mapping - label: 'Constants' - mapping: - entity_type: - type: string - label: 'Entity type' - -migrate.source.d6_comment_variable_per_comment_type: - type: migrate_source_sql - label: 'Drupal 6 comment variable' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_comment_entity_form_display_subject: - type: migrate_source_sql - label: 'Drupal 6 comment subject entity form display' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_box: - type: migrate_source_sql - label: 'Drupal 6 box' - mapping: - constants: - type: mapping - label: 'Constants' - mapping: - type: - type: string - label: 'Type' - -migrate.source.d6_taxonomy_vocabulary: - type: migrate_source_sql - label: 'Drupal 6 field instance form display' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_field_instance_per_form_display: - type: migrate_source_sql - label: 'Drupal 6 field instance form display' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_taxonomy_vocabulary_per_type: - type: migrate_source_sql - label: 'Drupal 6 field instance form display' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_taxonomy_vocabulary_per_type: - type: migrate_source_sql - label: 'Drupal 6 field instance form display' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_field: - type: migrate_source_sql - label: 'Drupal 6 box' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.variable_multirow: - type: migrate_source_sql - label: 'Drupal 6 box' - mapping: - variables: - type: sequence - label: 'Variables' - sequence: - - type: string - label: 'Variable' - -migrate.source.d6_comment_variable: - type: migrate_source_sql - label: 'Drupal 6 comment variable' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_contact_settings: - type: migrate_source_sql - label: 'Drupal 6 contact settings' - mapping: - variables: - type: sequence - label: 'Variables' - sequence: - - type: string - label: 'Variable' - -migrate.source.d6_view_mode: - type: migrate_source_sql - label: 'Drupal 6 view mode' - mapping: - constants: - type: mapping - label: 'Constants' - mapping: - targetEntityType: - type: string - label: 'Target entity type' - status: - type: boolean - label: 'Status' - -migrate.source.d6_profile_field: - type: migrate_source_sql - label: 'Drupal 6 profile field' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_field_formatter_settings: - type: migrate_source_sql - label: 'Drupal 6 field formatter settings' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_node_type: - type: migrate_source_sql - label: 'Drupal 6 node type' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_node: - type: migrate_source_sql - label: 'Drupal 6 node' - mapping: - node_type: - # The node type can be specified both as a string ID of a node type or an - # array of node type IDs, so there is no way to consistently parse this. - type: ignore - label: 'Node type' - -migrate.source.d6_node_revision: - type: migrate_source_sql - label: 'Drupal 6 node' - mapping: - node_type: - # The node type can be specified both as a string ID of a node type or an - # array of node type IDs, so there is no way to consistently parse this. - type: ignore - label: 'Node type' - -migrate.source.d6_upload_instance: - type: migrate_source_sql - label: 'Drupal 6 upload form display' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_field_instance: - type: migrate_source_sql - label: 'Drupal 6 field instance' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate.source.d6_field_instance_per_view_mode: - type: migrate_source_sql - label: 'Drupal 6 field formatter' - mapping: - constants: - type: migrate_entity_constant - label: 'Constants' - migrate.source.empty: type: migrate_source_sql - label: 'Drupal 6 field formatter' + label: 'Empty source' mapping: provider: type: string @@ -256,129 +30,3 @@ migrate.source.empty: display_field: type: boolean label: 'Display field' - -migrate.source.d6_user: - type: migrate_source_sql - label: 'Drupal 6 user' - mapping: - constants: - type: mapping - label: 'Constants' - mapping: - key: - type: string - label: 'User data key' - module: - type: string - label: 'Module name' - -migrate.source.d6_user_picture_file: - type: migrate_source_sql - label: 'Drupal 6 user picure display' - mapping: - constants: - type: mapping - label: 'Constant' - mapping: - is_public: - type: boolean - label: 'Public' - -migrate.source.d6_user_picture_instance: - type: migrate_source_sql - label: 'Drupal 6 user picure display' - mapping: - provider: - type: string - label: 'Provider' - constants: - type: migrate_entity_constant - label: 'Constants' - -migrate_entity_constant: - type: mapping - mapping: - entity_type: - type: string - label: 'Entity type' - bundle: - type: string - label: 'Bundle' - label: - type: label - label: 'Label' - id: - type: string - label: 'ID' - view_mode: - type: string - label: 'View mode' - form_mode: - type: string - label: 'Form mode' - field_name: - type: string - label: 'Field name' - empty: - type: sequence - label: 'Empty' - sequence: - - type: string - label: 'Empty' - name: - type: string - label: 'Name' - preview: - type: integer - label: 'Preview' - create_body: - type: boolean - label: 'create body' - required: - type: boolean - label: 'Required' - type: - type: string - label: 'Type' - cardinality: - type: integer - label: 'Cardinality' - parent: - type: integer - label: 'Parent' - langcode: - type: string - label: 'Type' - third_party_settings: - type: sequence - label: 'Settings' - sequence: - - type: ignore - label: 'Settings' - settings: - type: sequence - label: 'Settings' - sequence: - - type: ignore - label: 'Settings' - options: - type: mapping - label: 'Options' - mapping: - label: - type: string - label: 'label' - type: - type: string - label: 'Type' - weight: - type: integer - label: 'Weight' - settings: - type: sequence - label: 'Settings' - sequence: - - type: string - label: 'Settings' - - diff --git a/drupal/core/modules/migrate/migrate.info.yml b/drupal/core/modules/migrate/migrate.info.yml index 460f66b7..24c0e17e 100644 --- a/drupal/core/modules/migrate/migrate.info.yml +++ b/drupal/core/modules/migrate/migrate.info.yml @@ -2,6 +2,12 @@ name: Migrate type: module description: 'Handles migrations' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x ;configure: admin/structure/migrate + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php b/drupal/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php index 074184fa..a008568d 100644 --- a/drupal/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php +++ b/drupal/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php @@ -155,10 +155,11 @@ protected function runQuery() { $map_key = 'sourceid' . $count; $this->query->addField($alias, $map_key, "migrate_map_$map_key"); } - $n = count($this->migration->get('destinationIds')); - for ($count = 1; $count <= $n; $count++) { - $map_key = 'destid' . $count++; - $this->query->addField($alias, $map_key, "migrate_map_$map_key"); + if ($n = count($this->migration->get('destinationIds'))) { + for ($count = 1; $count <= $n; $count++) { + $map_key = 'destid' . $count++; + $this->query->addField($alias, $map_key, "migrate_map_$map_key"); + } } $this->query->addField($alias, 'source_row_status', 'migrate_map_source_row_status'); } diff --git a/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_entity_form_display_subject.yml b/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_entity_form_display_subject.yml index 54efa181..785dfb5a 100644 --- a/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_entity_form_display_subject.yml +++ b/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_entity_form_display_subject.yml @@ -9,7 +9,7 @@ source: field_name: subject form_mode: default options: - type: string + type: string_textfield weight: 10 process: entity_type: 'constants/entity_type' diff --git a/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_field_instance_widget_settings.yml b/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_field_instance_widget_settings.yml index db62fd70..de743091 100644 --- a/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_field_instance_widget_settings.yml +++ b/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_field_instance_widget_settings.yml @@ -44,7 +44,7 @@ process: filefield_widget: file_generic imagefield_widget: image_image phone_textfield: telephone_default - optionwidgets_onoff: checkbox + optionwidgets_onoff: boolean_checkbox optionwidgets_buttons: options_buttons optionwidgets_select: options_select 'options/settings': diff --git a/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_forum_settings.yml b/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_forum_settings.yml index cee5a69d..30d229c3 100644 --- a/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_forum_settings.yml +++ b/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_forum_settings.yml @@ -10,12 +10,20 @@ source: - forum_order - forum_block_num_0 - forum_block_num_1 + - forum_nav_vocabulary process: 'block/active/limit': forum_block_num_0 'block/new/limit': forum_block_num_1 'topics/hot_threshold': forum_hot_topic 'topics/page_limit': forum_per_page 'topics/order': forum_order + vocabulary: + plugin: migration + migration: d6_taxonomy_vocabulary + source: forum_nav_vocabulary destination: plugin: config config_name: forum.settings +migration_dependencies: + required: + - d6_taxonomy_vocabulary diff --git a/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml b/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml index 10a72539..487a4c42 100644 --- a/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml +++ b/drupal/core/modules/migrate_drupal/config/install/migrate.migration.d6_node_settings.yml @@ -6,11 +6,10 @@ source: plugin: variable variables: - node_admin_theme + - default_nodes_main process: use_admin_theme: node_admin_theme + items_per_page: default_nodes_main destination: plugin: config config_name: node.settings -migration_dependencies: - required: - - d6_node_type diff --git a/drupal/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml b/drupal/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml new file mode 100644 index 00000000..5cd5619b --- /dev/null +++ b/drupal/core/modules/migrate_drupal/config/schema/migrate_drupal.source.schema.yml @@ -0,0 +1,351 @@ +# Schema for the migrate_drupal source plugins. + +migrate.source.variable: + type: migrate_source_sql + label: 'Variable' + mapping: + variables: + type: sequence + label: 'Variables' + sequence: + - type: string + label: 'Variable' + constants: + type: mapping + label: 'Constants' + mapping: + entity_type: + type: string + label: 'Entity type' + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' + description: + type: text + label: 'Description' + path: + type: string + label: 'Path' + plugin: + type: string + label: 'Plugin' + +migrate.source.d6_comment: + type: migrate_source_sql + label: 'Drupal 6 comment' + mapping: + constants: + type: mapping + label: 'Constants' + mapping: + entity_type: + type: string + label: 'Entity type' + +migrate.source.d6_comment_variable_per_comment_type: + type: migrate_source_sql + label: 'Drupal 6 comment variable' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_comment_entity_form_display_subject: + type: migrate_source_sql + label: 'Drupal 6 comment subject entity form display' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_box: + type: migrate_source_sql + label: 'Drupal 6 box' + mapping: + constants: + type: mapping + label: 'Constants' + mapping: + type: + type: string + label: 'Type' + +migrate.source.d6_taxonomy_vocabulary: + type: migrate_source_sql + label: 'Drupal 6 field instance form display' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_field_instance_per_form_display: + type: migrate_source_sql + label: 'Drupal 6 field instance form display' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_taxonomy_vocabulary_per_type: + type: migrate_source_sql + label: 'Drupal 6 field instance form display' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_taxonomy_vocabulary_per_type: + type: migrate_source_sql + label: 'Drupal 6 field instance form display' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_field: + type: migrate_source_sql + label: 'Drupal 6 field' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.variable_multirow: + type: migrate_source_sql + label: 'Drupal variable multirow' + mapping: + variables: + type: sequence + label: 'Variables' + sequence: + - type: string + label: 'Variable' + +migrate.source.d6_comment_variable: + type: migrate_source_sql + label: 'Drupal 6 comment variable' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_contact_settings: + type: migrate_source_sql + label: 'Drupal 6 contact settings' + mapping: + variables: + type: sequence + label: 'Variables' + sequence: + - type: string + label: 'Variable' + +migrate.source.d6_view_mode: + type: migrate_source_sql + label: 'Drupal 6 view mode' + mapping: + constants: + type: mapping + label: 'Constants' + mapping: + targetEntityType: + type: string + label: 'Target entity type' + status: + type: boolean + label: 'Status' + +migrate.source.d6_profile_field: + type: migrate_source_sql + label: 'Drupal 6 profile field' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_field_formatter_settings: + type: migrate_source_sql + label: 'Drupal 6 field formatter settings' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_node_type: + type: migrate_source_sql + label: 'Drupal 6 node type' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_node: + type: migrate_source_sql + label: 'Drupal 6 node' + mapping: + node_type: + # The node type can be specified both as a string ID of a node type or an + # array of node type IDs, so there is no way to consistently parse this. + type: ignore + label: 'Node type' + +migrate.source.d6_node_revision: + type: migrate_source_sql + label: 'Drupal 6 node' + mapping: + node_type: + # The node type can be specified both as a string ID of a node type or an + # array of node type IDs, so there is no way to consistently parse this. + type: ignore + label: 'Node type' + +migrate.source.d6_upload_instance: + type: migrate_source_sql + label: 'Drupal 6 upload form display' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_field_instance: + type: migrate_source_sql + label: 'Drupal 6 field instance' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_field_instance_per_view_mode: + type: migrate_source_sql + label: 'Drupal 6 field formatter' + mapping: + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate.source.d6_user: + type: migrate_source_sql + label: 'Drupal 6 user' + mapping: + constants: + type: mapping + label: 'Constants' + mapping: + key: + type: string + label: 'User data key' + module: + type: string + label: 'Module name' + +migrate.source.d6_user_picture_file: + type: migrate_source_sql + label: 'Drupal 6 user picure display' + mapping: + constants: + type: mapping + label: 'Constant' + mapping: + is_public: + type: boolean + label: 'Public' + +migrate.source.d6_user_picture_instance: + type: migrate_source_sql + label: 'Drupal 6 user picure display' + mapping: + provider: + type: string + label: 'Provider' + constants: + type: migrate_entity_constant + label: 'Constants' + +migrate_entity_constant: + type: mapping + mapping: + entity_type: + type: string + label: 'Entity type' + bundle: + type: string + label: 'Bundle' + label: + type: label + label: 'Label' + id: + type: string + label: 'ID' + view_mode: + type: string + label: 'View mode' + form_mode: + type: string + label: 'Form mode' + field_name: + type: string + label: 'Field name' + empty: + type: sequence + label: 'Empty' + sequence: + - type: string + label: 'Empty' + name: + type: string + label: 'Name' + preview: + type: integer + label: 'Preview' + create_body: + type: boolean + label: 'create body' + required: + type: boolean + label: 'Required' + type: + type: string + label: 'Type' + cardinality: + type: integer + label: 'Cardinality' + parent: + type: integer + label: 'Parent' + langcode: + type: string + label: 'Type' + third_party_settings: + type: sequence + label: 'Settings' + sequence: + - type: ignore + label: 'Settings' + settings: + type: sequence + label: 'Settings' + sequence: + - type: ignore + label: 'Settings' + options: + type: mapping + label: 'Options' + mapping: + label: + type: string + label: 'label' + type: + type: string + label: 'Type' + weight: + type: integer + label: 'Weight' + settings: + type: sequence + label: 'Settings' + sequence: + - type: string + label: 'Settings' diff --git a/drupal/core/modules/migrate_drupal/migrate_drupal.info.yml b/drupal/core/modules/migrate_drupal/migrate_drupal.info.yml index a0bdaf65..97dde13f 100644 --- a/drupal/core/modules/migrate_drupal/migrate_drupal.info.yml +++ b/drupal/core/modules/migrate_drupal/migrate_drupal.info.yml @@ -2,7 +2,13 @@ name: Migrate Drupal type: module description: 'Contains migrations from older Drupal versions.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - migrate + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldInstanceDefaults.php b/drupal/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldInstanceDefaults.php index c7b3cd59..320dae20 100644 --- a/drupal/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldInstanceDefaults.php +++ b/drupal/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/FieldInstanceDefaults.php @@ -30,7 +30,9 @@ public function transform($value, MigrateExecutable $migrate_executable, Row $ro case 'text_textfield': case 'number': case 'phone_textfield': - $default['value'] = $widget_settings['default_value'][0]['value']; + if (!empty($widget_settings['default_value'][0]['value'])) { + $default['value'] = $widget_settings['default_value'][0]['value']; + } break; case 'imagefield_widget': @@ -39,19 +41,28 @@ public function transform($value, MigrateExecutable $migrate_executable, Row $ro break; case 'date_select': - $default['value'] = $widget_settings['default_value']; + if (!empty($widget_settings['default_value'])) { + $default['value'] = $widget_settings['default_value']; + } break; case 'email_textfield': - $default['value'] = $widget_settings['default_value'][0]['email']; + if (!empty($widget_settings['default_value'][0]['email'])) { + $default['value'] = $widget_settings['default_value'][0]['email']; + } break; case 'link': - $default['title'] = $widget_settings['default_value'][0]['title']; - $default['url'] = $widget_settings['default_value'][0]['url']; + if (!empty($widget_settings['default_value'][0]['url'])) { + $default['title'] = $widget_settings['default_value'][0]['title']; + $default['url'] = $widget_settings['default_value'][0]['url']; + } break; } - return array($default); + if (!empty($default)) { + $default = array($default); + } + return $default; } } diff --git a/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6NodeSettings.php b/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6NodeSettings.php index 4fb67b9e..eb4353e4 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6NodeSettings.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6NodeSettings.php @@ -25,6 +25,10 @@ public function load() { 'name' => 'node_admin_theme', 'value' => 'i:0;', )) + ->values(array( + 'name' => 'default_nodes_main', + 'value' => 's:1:"3";', + )) ->execute(); } } diff --git a/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6User.php b/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6User.php index f8892c33..d30c6974 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6User.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6User.php @@ -449,21 +449,21 @@ public static function getData($table) { array('fid' => 8, 'uid' => 2, 'value' => 'red'), array('fid' => 9, 'uid' => 2, 'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nulla sapien, congue nec risus ut, adipiscing aliquet felis. Maecenas quis justo vel nulla varius euismod. Quisque metus metus, cursus sit amet sem non, bibendum vehicula elit. Cras dui nisl, eleifend at iaculis vitae, lacinia ut felis. Nullam aliquam ligula volutpat nulla consectetur accumsan. Maecenas tincidunt molestie diam, a accumsan enim fringilla sit amet. Morbi a tincidunt tellus. Donec imperdiet scelerisque porta. Sed quis sem bibendum eros congue sodales. Vivamus vel fermentum est, at rutrum orci. Nunc consectetur purus ut dolor pulvinar, ut volutpat felis congue. Cras tincidunt odio sed neque sollicitudin, vehicula tempor metus scelerisque.'), array('fid' => 10, 'uid' => 2, 'value' => '1'), - array('fid' => 11, 'uid' => 2, 'value' => 'Fitness spammers'), + array('fid' => 11, 'uid' => 2, 'value' => 'Back\slash'), array('fid' => 12, 'uid' => 2, 'value' => "AC/DC\n,,Eagles\r\nElton John,Lemonheads\r\n\r\nRolling Stones\rQueen\nThe White Stripes"), array('fid' => 13, 'uid' => 2, 'value' => "http://example.com/blog"), array('fid' => 14, 'uid' => 2, 'value' => 'a:3:{s:5:"month";s:1:"6";s:3:"day";s:1:"2";s:4:"year";s:4:"1974";}'), array('fid' => 8, 'uid' => 8, 'value' => 'brown'), array('fid' => 9, 'uid' => 8, 'value' => 'Nunc condimentum ligula felis, eget lacinia purus accumsan at. Pellentesque eu lobortis felis. Duis at accumsan nisl, vel pulvinar risus. Nullam venenatis, tellus non eleifend hendrerit, augue nulla rhoncus leo, eget convallis enim sem ut velit. Mauris tincidunt enim ut eros volutpat dapibus. Curabitur augue libero, imperdiet eget orci sed, malesuada dapibus tellus. Nam lacus sapien, convallis vitae quam vel, bibendum commodo odio.'), array('fid' => 10, 'uid' => 8, 'value' => '0'), - array('fid' => 11, 'uid' => 8, 'value' => 'Spammers'), + array('fid' => 11, 'uid' => 8, 'value' => 'Forward/slash'), array('fid' => 12, 'uid' => 8, 'value' => "Deep Purple\nWho\nThe Beatles"), array('fid' => 13, 'uid' => 8, 'value' => "http://blog.example.com"), array('fid' => 14, 'uid' => 8, 'value' => 'a:3:{s:5:"month";s:1:"9";s:3:"day";s:1:"9";s:4:"year";s:4:"1980";}'), array('fid' => 8, 'uid' => 15, 'value' => 'orange'), array('fid' => 9, 'uid' => 15, 'value' => 'Donec a diam volutpat augue fringilla fringilla. Mauris ultricies turpis ut lacus tempus, vitae pharetra lacus mattis. Nulla semper dui euismod sem bibendum, in eleifend nisi malesuada. Vivamus orci mauris, volutpat vitae enim ac, aliquam tempus lectus.'), array('fid' => 10, 'uid' => 15, 'value' => '1'), - array('fid' => 11, 'uid' => 15, 'value' => 'Pill spammers'), + array('fid' => 11, 'uid' => 15, 'value' => 'Dot.in.the.middle'), array('fid' => 12, 'uid' => 15, 'value' => "ABBA\nBoney M"), array('fid' => 13, 'uid' => 15, 'value' => "http://example.com/journal"), array('fid' => 14, 'uid' => 15, 'value' => 'a:3:{s:5:"month";s:2:"11";s:3:"day";s:2:"25";s:4:"year";s:4:"1982";}'), diff --git a/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6UserProfileFields.php b/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6UserProfileFields.php index 3df09a0b..90a37628 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6UserProfileFields.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/Dump/Drupal6UserProfileFields.php @@ -186,7 +186,7 @@ public static function getData($table) { 'register' => '0', 'visibility' => '4', 'autocomplete' => '0', - 'options' => "Pill spammers\r\nFitness spammers", + 'options' => "Pill spammers\r\nFitness spammers\r\nBack\slash\r\nForward/slash\r\nDot.in.the.middle", ), array( 'fid' => '12', diff --git a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php index 11bb90a0..67539b6c 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php @@ -59,7 +59,7 @@ protected function setUp() { public function testCommentEntityFormDisplay() { $component = entity_get_form_display('comment', 'comment', 'default') ->getComponent('subject'); - $this->assertEqual($component['type'], 'string'); + $this->assertEqual($component['type'], 'string_textfield'); $this->assertEqual($component['weight'], 10); $component = entity_get_form_display('comment', 'comment_no_subject', 'default') ->getComponent('subject'); diff --git a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php index cb4268c7..e8e34455 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php @@ -258,7 +258,7 @@ protected function getTestClassesList() { __NAMESPACE__ . '\MigrateNodeRevisionTest', __NAMESPACE__ . '\MigrateNodeTest', __NAMESPACE__ . '\MigrateNodeTypeTest', - __NAMESPACE__ . '\MigrateProfileValuesTest', + __NAMESPACE__ . '\MigrateUserProfileValuesTest', __NAMESPACE__ . '\MigrateSearchConfigsTest', __NAMESPACE__ . '\MigrateSearchPageTest', __NAMESPACE__ . '\MigrateSimpletestConfigsTest', diff --git a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php index 095254e2..6f3c2bc7 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php @@ -32,6 +32,11 @@ class MigrateForumConfigsTest extends MigrateDrupalTestBase { */ protected function setUp() { parent::setUp(); + $this->prepareMigrations(array( + 'd6_taxonomy_vocabulary' => array( + array(array(1), array('vocabulary_1_i_0_')), + ) + )); $migration = entity_load('migration', 'd6_forum_settings'); $dumps = array( $this->getDumpDirectory() . '/Drupal6ForumSettings.php', @@ -49,8 +54,7 @@ public function testForumSettings() { $this->assertIdentical($config->get('topics.hot_threshold'), 15); $this->assertIdentical($config->get('topics.page_limit'), 25); $this->assertIdentical($config->get('topics.order'), 1); - // The vocabulary vid depends on existing vids when the Forum module was enabled. This would have to be user-selectable based on a query to the D6 vocabulary table. - //$this->assertIdentical($config->get('forum_nav_vocabulary'), '1'); + $this->assertIdentical($config->get('vocabulary'), 'vocabulary_1_i_0_'); // This is 'forum_block_num_0' in D6, but block:active:limit' in D8. $this->assertIdentical($config->get('block.active.limit'), 5); // This is 'forum_block_num_1' in D6, but 'block:new:limit' in D8. diff --git a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php index 969d0426..a786eca0 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php @@ -41,7 +41,7 @@ public function testMenu() { $navigation_menu = Menu::load('navigation'); $this->assertEqual($navigation_menu->id(), 'navigation'); $this->assertEqual($navigation_menu->label(), 'Navigation'); - $this->assertEqual($navigation_menu->description , 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.'); + $this->assertEqual($navigation_menu->getDescription() , 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.'); // Test that we can re-import using the ConfigEntityBase destination. Database::getConnection('default', 'migrate') diff --git a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php index 0f3d5395..d2675f2b 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php @@ -47,7 +47,8 @@ protected function setUp() { */ public function testNodeSettings() { $config = \Drupal::config('node.settings'); - $this->assertIdentical($config->get('use_admin_theme'), false); + $this->assertIdentical($config->get('use_admin_theme'), FALSE); + $this->assertIdentical($config->get('items_per_page'), 3); $this->assertConfigSchema(\Drupal::service('config.typed'), 'node.settings', $config->get()); } diff --git a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php index 3f89a9b0..735e045d 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php @@ -57,8 +57,10 @@ public function testUserProfileFields() { $settings = $field_storage->getSettings(); $this->assertEqual($settings['allowed_values'], array( 'Pill spammers' => 'Pill spammers', - 'Spammers' => 'Spammers', 'Fitness spammers' => 'Fitness spammers', + 'Back\slash' => 'Back\slash', + 'Forward/slash' => 'Forward/slash', + 'Dot.in.the.middle' => 'Dot.in.the.middle', 'Faithful servant' => 'Faithful servant', 'Anonymous donor' => 'Anonymous donor', )); diff --git a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateProfileValuesTest.php b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php similarity index 93% rename from drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateProfileValuesTest.php rename to drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php index 00dbce16..1e6b5866 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateProfileValuesTest.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\migrate_drupal\Tests\d6\MigrateProfileValuesTest. + * Contains \Drupal\migrate_drupal\Tests\d6\MigrateUserProfileValuesTest. */ namespace Drupal\migrate_drupal\Tests\d6; @@ -18,7 +18,7 @@ * * @group migrate_drupal */ -class MigrateProfileValuesTest extends MigrateDrupalTestBase { +class MigrateUserProfileValuesTest extends MigrateDrupalTestBase { /** * The modules to be enabled during the test. @@ -147,7 +147,7 @@ public function testUserProfileValues() { $this->assertEqual($user->profile_color->value, 'red'); $this->assertEqual($user->profile_biography->value, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nulla sapien, congue nec risus ut, adipiscing aliquet felis. Maecenas quis justo vel nulla varius euismod. Quisque metus metus, cursus sit amet sem non, bibendum vehicula elit. Cras dui nisl, eleifend at iaculis vitae, lacinia ut felis. Nullam aliquam ligula volutpat nulla consectetur accumsan. Maecenas tincidunt molestie diam, a accumsan enim fringilla sit amet. Morbi a tincidunt tellus. Donec imperdiet scelerisque porta. Sed quis sem bibendum eros congue sodales. Vivamus vel fermentum est, at rutrum orci. Nunc consectetur purus ut dolor pulvinar, ut volutpat felis congue. Cras tincidunt odio sed neque sollicitudin, vehicula tempor metus scelerisque.'); $this->assertEqual($user->profile_sell_address->value, '1'); - $this->assertEqual($user->profile_sold_to->value, 'Fitness spammers'); + $this->assertEqual($user->profile_sold_to->value, 'Back\slash'); $this->assertEqual($user->profile_bands[0]->value, 'AC/DC'); $this->assertEqual($user->profile_bands[1]->value, 'Eagles'); $this->assertEqual($user->profile_bands[2]->value, 'Elton John'); @@ -156,6 +156,12 @@ public function testUserProfileValues() { $this->assertEqual($user->profile_bands[5]->value, 'Queen'); $this->assertEqual($user->profile_bands[6]->value, 'The White Stripes'); $this->assertEqual($user->profile_birthdate->value, '1974-06-02'); + + $user = User::load(8); + $this->assertEqual($user->profile_sold_to->value, 'Forward/slash'); + + $user = User::load(15); + $this->assertEqual($user->profile_sold_to->value, 'Dot.in.the.middle'); } } diff --git a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php index 82f60f03..4a187bc3 100644 --- a/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php +++ b/drupal/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php @@ -7,6 +7,8 @@ namespace Drupal\migrate_drupal\Tests\d6; +use Drupal\user\Entity\User; +use Drupal\file\Entity\File; use Drupal\Core\Database\Database; use Drupal\migrate\MigrateExecutable; use Drupal\migrate_drupal\Tests\MigrateDrupalTestBase; @@ -151,7 +153,7 @@ public function testUser() { $migration_format = entity_load('migration', 'd6_filter_format'); $signature_format = $migration_format->getIdMap()->lookupDestinationId(array($source->signature_format)); - $user = user_load($source->uid); + $user = User::load($source->uid); $this->assertEqual($user->id(), $source->uid); $this->assertEqual($user->label(), $source->name); $this->assertEqual($user->getEmail(), $source->mail); @@ -174,7 +176,7 @@ public function testUser() { // We have one empty picture in the data so don't try load that. if (!empty($source->picture)) { // Test the user picture. - $file = file_load($user->user_picture->target_id); + $file = File::load($user->user_picture->target_id); $this->assertEqual($file->getFilename(), basename($source->picture)); } diff --git a/drupal/core/modules/node/node.info.yml b/drupal/core/modules/node/node.info.yml index ab8e3c3c..c0ceea76 100644 --- a/drupal/core/modules/node/node.info.yml +++ b/drupal/core/modules/node/node.info.yml @@ -2,9 +2,15 @@ name: Node type: module description: 'Allows content to be submitted to the site and displayed on pages.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: node.overview_types dependencies: - text - entity_reference + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/node/src/Tests/Config/NodeImportChangeTest.php b/drupal/core/modules/node/src/Tests/Config/NodeImportChangeTest.php index 015c0089..2b05d025 100644 --- a/drupal/core/modules/node/src/Tests/Config/NodeImportChangeTest.php +++ b/drupal/core/modules/node/src/Tests/Config/NodeImportChangeTest.php @@ -21,7 +21,7 @@ class NodeImportChangeTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('node', 'entity', 'field', 'text', 'system', 'node_test_config', 'user'); + public static $modules = array('node', 'entity', 'field', 'text', 'system', 'node_test_config', 'user', 'entity_reference'); /** * Set the default field storage backend for fields created during tests. diff --git a/drupal/core/modules/node/src/Tests/Config/NodeImportCreateTest.php b/drupal/core/modules/node/src/Tests/Config/NodeImportCreateTest.php index ffcafcb9..033143fe 100644 --- a/drupal/core/modules/node/src/Tests/Config/NodeImportCreateTest.php +++ b/drupal/core/modules/node/src/Tests/Config/NodeImportCreateTest.php @@ -22,7 +22,7 @@ class NodeImportCreateTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('node', 'entity', 'field', 'text', 'system', 'user'); + public static $modules = array('node', 'entity', 'field', 'text', 'system', 'user', 'entity_reference'); /** * Set the default field storage backend for fields created during tests. diff --git a/drupal/core/modules/node/tests/modules/node_access_test/node_access_test.info.yml b/drupal/core/modules/node/tests/modules/node_access_test/node_access_test.info.yml index f63cdd65..56a3ae6f 100644 --- a/drupal/core/modules/node/tests/modules/node_access_test/node_access_test.info.yml +++ b/drupal/core/modules/node/tests/modules/node_access_test/node_access_test.info.yml @@ -2,5 +2,11 @@ name: 'Node module access tests' type: module description: 'Support module for node permission testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/node/tests/modules/node_access_test_language/node_access_test_language.info.yml b/drupal/core/modules/node/tests/modules/node_access_test_language/node_access_test_language.info.yml index 64055ac1..cf6b9902 100644 --- a/drupal/core/modules/node/tests/modules/node_access_test_language/node_access_test_language.info.yml +++ b/drupal/core/modules/node/tests/modules/node_access_test_language/node_access_test_language.info.yml @@ -2,7 +2,13 @@ name: 'Node module access tests language' type: module description: 'Support module for language-aware node access testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - options + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/node/tests/modules/node_test/node_test.info.yml b/drupal/core/modules/node/tests/modules/node_test/node_test.info.yml index 952456fe..5b609799 100644 --- a/drupal/core/modules/node/tests/modules/node_test/node_test.info.yml +++ b/drupal/core/modules/node/tests/modules/node_test/node_test.info.yml @@ -2,5 +2,11 @@ name: 'Node module tests' type: module description: 'Support module for node related testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/node/tests/modules/node_test_config/node_test_config.info.yml b/drupal/core/modules/node/tests/modules/node_test_config/node_test_config.info.yml index c7e76657..afe41f94 100644 --- a/drupal/core/modules/node/tests/modules/node_test_config/node_test_config.info.yml +++ b/drupal/core/modules/node/tests/modules/node_test_config/node_test_config.info.yml @@ -1,6 +1,12 @@ name: 'Node configuration tests' type: module description: 'Support module for node configuration tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/node/tests/modules/node_test_exception/node_test_exception.info.yml b/drupal/core/modules/node/tests/modules/node_test_exception/node_test_exception.info.yml index fac3fe79..139a1a59 100644 --- a/drupal/core/modules/node/tests/modules/node_test_exception/node_test_exception.info.yml +++ b/drupal/core/modules/node/tests/modules/node_test_exception/node_test_exception.info.yml @@ -2,5 +2,11 @@ name: 'Node module exception tests' type: module description: 'Support module for node related exception testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/node/tests/modules/node_test_views/node_test_views.info.yml b/drupal/core/modules/node/tests/modules/node_test_views/node_test_views.info.yml index 194168fa..90fbf6e2 100644 --- a/drupal/core/modules/node/tests/modules/node_test_views/node_test_views.info.yml +++ b/drupal/core/modules/node/tests/modules/node_test_views/node_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Node test views' type: module description: 'Provides default views for views node tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - node - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/options/options.info.yml b/drupal/core/modules/options/options.info.yml index 60e6043b..888dfba5 100644 --- a/drupal/core/modules/options/options.info.yml +++ b/drupal/core/modules/options/options.info.yml @@ -2,8 +2,14 @@ name: Options type: module description: 'Defines selection, check box and radio button widgets for text and numeric fields.' package: Field types -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field - text + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/options/src/Tests/OptionsFieldUITest.php b/drupal/core/modules/options/src/Tests/OptionsFieldUITest.php index e3b46848..40343bf7 100644 --- a/drupal/core/modules/options/src/Tests/OptionsFieldUITest.php +++ b/drupal/core/modules/options/src/Tests/OptionsFieldUITest.php @@ -278,6 +278,7 @@ protected function createOptionsField($type) { function assertAllowedValuesInput($input_string, $result, $message) { $edit = array('field_storage[settings][allowed_values]' => $input_string); $this->drupalPostForm($this->admin_path, $edit, t('Save field settings')); + $this->assertNoRaw('&lt;', 'The page does not have double escaped HTML tags.'); if (is_string($result)) { $this->assertText($result, $message); diff --git a/drupal/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php b/drupal/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php index d71a1527..a254a0a2 100644 --- a/drupal/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php +++ b/drupal/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php @@ -56,6 +56,7 @@ abstract class OptionsFieldUnitTestBase extends FieldUnitTestBase { protected function setUp() { parent::setUp(); $this->installSchema('system', array('router')); + $this->container->get('router.builder')->rebuild(); $this->fieldStorageDefinition = array( 'field_name' => $this->fieldName, diff --git a/drupal/core/modules/options/tests/options_config_install_test/options_config_install_test.info.yml b/drupal/core/modules/options/tests/options_config_install_test/options_config_install_test.info.yml index d9f40863..c2c157a8 100644 --- a/drupal/core/modules/options/tests/options_config_install_test/options_config_install_test.info.yml +++ b/drupal/core/modules/options/tests/options_config_install_test/options_config_install_test.info.yml @@ -1,9 +1,15 @@ name: 'Options config install test' type: module description: 'Support module for the Options module tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION dependencies: - node - options + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/options/tests/options_test/options_test.info.yml b/drupal/core/modules/options/tests/options_test/options_test.info.yml index add43a42..3ee4c917 100644 --- a/drupal/core/modules/options/tests/options_test/options_test.info.yml +++ b/drupal/core/modules/options/tests/options_test/options_test.info.yml @@ -1,6 +1,12 @@ name: 'Options test' type: module description: 'Support module for the Options module tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/path/path.info.yml b/drupal/core/modules/path/path.info.yml index ba2c759c..27a5d8e2 100644 --- a/drupal/core/modules/path/path.info.yml +++ b/drupal/core/modules/path/path.info.yml @@ -2,6 +2,12 @@ name: Path type: module description: 'Allows users to rename URLs.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: path.admin_overview + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/path/path.routing.yml b/drupal/core/modules/path/path.routing.yml index d3e44c3f..e6adc565 100644 --- a/drupal/core/modules/path/path.routing.yml +++ b/drupal/core/modules/path/path.routing.yml @@ -16,7 +16,7 @@ path.admin_overview: _permission: 'administer url aliases' path.admin_overview_filter: - path: '/admin/config/search/path/list/{keys}' + path: '/admin/config/search/path/filter' defaults: _title: 'URL aliases' _content: '\Drupal\path\Controller\PathController::adminOverview' diff --git a/drupal/core/modules/path/src/Controller/PathController.php b/drupal/core/modules/path/src/Controller/PathController.php index 5f6f3c6b..ffabbde2 100644 --- a/drupal/core/modules/path/src/Controller/PathController.php +++ b/drupal/core/modules/path/src/Controller/PathController.php @@ -12,6 +12,7 @@ use Drupal\Core\Path\AliasManagerInterface; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\HttpFoundation\Request; /** * Controller routines for path routes. @@ -55,7 +56,17 @@ public static function create(ContainerInterface $container) { ); } - public function adminOverview($keys) { + /** + * Displays the path administration overview page. + * + * @param \Symfony\Component\HttpFoundation\Request $request + * The request object. + * + * @return array + * A render array as expected by drupal_render(). + */ + public function adminOverview(Request $request) { + $keys = $request->query->get('search'); // Add the filter form above the overview table. $build['path_admin_filter_form'] = $this->formBuilder()->getForm('Drupal\path\Form\PathFilterForm', $keys); // Enable language column if language.module is enabled or if we have any diff --git a/drupal/core/modules/path/src/Form/PathFilterForm.php b/drupal/core/modules/path/src/Form/PathFilterForm.php index 30374be5..7c9a3f72 100644 --- a/drupal/core/modules/path/src/Form/PathFilterForm.php +++ b/drupal/core/modules/path/src/Form/PathFilterForm.php @@ -60,8 +60,8 @@ public function buildForm(array $form, FormStateInterface $form_state, $keys = N * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $form_state->setRedirect('path.admin_overview_filter', array( - 'keys' => trim($form_state->getValue('filter')), + $form_state->setRedirect('path.admin_overview_filter', array(), array( + 'query' => array('search' => trim($form_state->getValue('filter'))), )); } diff --git a/drupal/core/modules/path/src/Tests/PathAdminTest.php b/drupal/core/modules/path/src/Tests/PathAdminTest.php index ef1d3e74..9073d7fd 100644 --- a/drupal/core/modules/path/src/Tests/PathAdminTest.php +++ b/drupal/core/modules/path/src/Tests/PathAdminTest.php @@ -36,6 +36,7 @@ public function testPathFiltering() { // Create test nodes. $node1 = $this->drupalCreateNode(); $node2 = $this->drupalCreateNode(); + $node3 = $this->drupalCreateNode(); // Create aliases. $alias1 = $this->randomMachineName(8); @@ -52,6 +53,13 @@ public function testPathFiltering() { ); $this->drupalPostForm('admin/config/search/path/add', $edit, t('Save')); + $alias3 = $this->randomMachineName(4) . '/' . $this->randomMachineName(4); + $edit = array( + 'source' => 'node/' . $node3->id(), + 'alias' => $alias3, + ); + $this->drupalPostForm('admin/config/search/path/add', $edit, t('Save')); + // Filter by the first alias. $edit = array( 'filter' => $alias1, @@ -59,6 +67,7 @@ public function testPathFiltering() { $this->drupalPostForm(NULL, $edit, t('Filter')); $this->assertLinkByHref($alias1); $this->assertNoLinkByHref($alias2); + $this->assertNoLinkByHref($alias3); // Filter by the second alias. $edit = array( @@ -67,6 +76,16 @@ public function testPathFiltering() { $this->drupalPostForm(NULL, $edit, t('Filter')); $this->assertNoLinkByHref($alias1); $this->assertLinkByHref($alias2); + $this->assertNoLinkByHref($alias3); + + // Filter by the third alias which has a slash. + $edit = array( + 'filter' => $alias3, + ); + $this->drupalPostForm(NULL, $edit, t('Filter')); + $this->assertNoLinkByHref($alias1); + $this->assertNoLinkByHref($alias2); + $this->assertLinkByHref($alias3); // Filter by a random string with a different length. $edit = array( diff --git a/drupal/core/modules/quickedit/quickedit.info.yml b/drupal/core/modules/quickedit/quickedit.info.yml index cf7d0fd2..8d85aec3 100644 --- a/drupal/core/modules/quickedit/quickedit.info.yml +++ b/drupal/core/modules/quickedit/quickedit.info.yml @@ -2,9 +2,15 @@ name: Quick Edit type: module description: 'In-place content editing.' package: Core -core: 8.x -version: VERSION +# core: 8.x +# version: VERSION dependencies: - contextual - field - filter + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/quickedit/src/Tests/EditorSelectionTest.php b/drupal/core/modules/quickedit/src/Tests/EditorSelectionTest.php index 1db8ab77..336fbecb 100644 --- a/drupal/core/modules/quickedit/src/Tests/EditorSelectionTest.php +++ b/drupal/core/modules/quickedit/src/Tests/EditorSelectionTest.php @@ -58,7 +58,7 @@ public function testText() { // Instance settings. array(), // Widget type & settings. - 'string', + 'string_textfield', array('size' => 42), // 'default' formatter type & settings. 'string', diff --git a/drupal/core/modules/quickedit/src/Tests/MetadataGeneratorTest.php b/drupal/core/modules/quickedit/src/Tests/MetadataGeneratorTest.php index 32b3d26a..072d8885 100644 --- a/drupal/core/modules/quickedit/src/Tests/MetadataGeneratorTest.php +++ b/drupal/core/modules/quickedit/src/Tests/MetadataGeneratorTest.php @@ -73,7 +73,7 @@ public function testSimpleEntityType() { // Instance settings. array(), // Widget type & settings. - 'string', + 'string_textfield', array('size' => 42), // 'default' formatter type & settings. 'string', diff --git a/drupal/core/modules/quickedit/src/Tests/QuickEditTestBase.php b/drupal/core/modules/quickedit/src/Tests/QuickEditTestBase.php index a9e80383..8b590e02 100644 --- a/drupal/core/modules/quickedit/src/Tests/QuickEditTestBase.php +++ b/drupal/core/modules/quickedit/src/Tests/QuickEditTestBase.php @@ -19,7 +19,7 @@ abstract class QuickEditTestBase extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('system', 'entity', 'entity_test', 'field', 'field_test', 'filter', 'user', 'text', 'quickedit'); + public static $modules = array('system', 'entity', 'entity_test', 'field', 'field_test', 'filter', 'user', 'text', 'quickedit', 'entity_reference'); /** * Bag of created fields. diff --git a/drupal/core/modules/quickedit/tests/modules/quickedit_test.info.yml b/drupal/core/modules/quickedit/tests/modules/quickedit_test.info.yml index fe21dc5b..b535f1cc 100644 --- a/drupal/core/modules/quickedit/tests/modules/quickedit_test.info.yml +++ b/drupal/core/modules/quickedit/tests/modules/quickedit_test.info.yml @@ -1,6 +1,12 @@ name: 'Quick Edit test' type: module description: 'Support module for the Quick Edit module tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/rdf/rdf.info.yml b/drupal/core/modules/rdf/rdf.info.yml index ec1b5090..e4c0d193 100644 --- a/drupal/core/modules/rdf/rdf.info.yml +++ b/drupal/core/modules/rdf/rdf.info.yml @@ -2,5 +2,11 @@ name: RDF type: module description: 'Enriches your content with metadata to let other applications (e.g. search engines, aggregators) better understand its relationships and attributes.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/rdf/rdf.module b/drupal/core/modules/rdf/rdf.module index 371be2c1..c3fce4f9 100644 --- a/drupal/core/modules/rdf/rdf.module +++ b/drupal/core/modules/rdf/rdf.module @@ -498,14 +498,14 @@ function rdf_preprocess_comment(&$variables) { } // Adds RDF metadata markup above comment body. if (!empty($variables['rdf_metadata_attributes'])) { - if (!isset($variables['content']['comment_body']['#prefix'])) { - $variables['content']['comment_body']['#prefix'] = ''; - } $rdf_metadata = array( '#theme' => 'rdf_metadata', '#metadata' => $variables['rdf_metadata_attributes'], ); - $variables['content']['comment_body']['#prefix'] = drupal_render($rdf_metadata) . $variables['content']['comment_body']['#prefix']; + if (!empty($variables['content']['comment_body']['#prefix'])) { + $rdf_metadata['#suffix'] = $variables['content']['comment_body']['#prefix']; + } + $variables['content']['comment_body']['#prefix'] = drupal_render($rdf_metadata); } } diff --git a/drupal/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php b/drupal/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php index 8478baec..e806a60a 100644 --- a/drupal/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php +++ b/drupal/core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php @@ -114,7 +114,7 @@ public function runTestAllFormatters($expected_rdf, $type = NULL) { // Test the link formatter: trim at 80, no other settings. $formatter = array( - 'type' => $type . ' link', + 'type' => 'link', 'settings' => array( 'trim_length' => 80, 'url_only' => FALSE, @@ -127,7 +127,7 @@ public function runTestAllFormatters($expected_rdf, $type = NULL) { // Test the link formatter: trim at 40, nofollow, new window. $formatter = array( - 'type' => $type . ' link', + 'type' => 'link', 'settings' => array( 'trim_length' => 40, 'url_only' => FALSE, @@ -141,7 +141,7 @@ public function runTestAllFormatters($expected_rdf, $type = NULL) { // Test the link formatter: trim at 40, URL only (not plaintext) nofollow, // new window. $formatter = array( - 'type' => $type . ' link', + 'type' => 'link', 'settings' => array( 'trim_length' => 40, 'url_only' => TRUE, @@ -154,7 +154,7 @@ public function runTestAllFormatters($expected_rdf, $type = NULL) { // Test the link_separate formatter: trim at 40, nofollow, new window. $formatter = array( - 'type' => $type . ' link_separate', + 'type' => 'link_separate', 'settings' => array( 'trim_length' => 40, 'rel' => 'nofollow', @@ -171,7 +171,7 @@ public function runTestAllFormatters($expected_rdf, $type = NULL) { ); // Test the link formatter: trim at 20, url only (as plaintext.) $formatter = array( - 'type' => $type . ' link', + 'type' => 'link', 'settings' => array( 'trim_length' => 20, 'url_only' => TRUE, @@ -184,7 +184,7 @@ public function runTestAllFormatters($expected_rdf, $type = NULL) { // Test the link formatter: do not trim, url only (as plaintext.) $formatter = array( - 'type' => $type . ' link', + 'type' => 'link', 'settings' => array( 'trim_length' => 0, 'url_only' => TRUE, diff --git a/drupal/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php b/drupal/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php index e6a0de75..f5974bb3 100644 --- a/drupal/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php +++ b/drupal/core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php @@ -21,7 +21,7 @@ public function testIntegerFormatter() { $testValue = 3; $this->createTestField(); $this->createTestEntity($testValue); - $this->assertFormatterRdfa(array('type' => $this->fieldType), 'http://schema.org/baseSalary', array('value' => $testValue)); + $this->assertFormatterRdfa(array('type' => 'number_integer'), 'http://schema.org/baseSalary', array('value' => $testValue)); // Test that the content attribute is not created. $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]'); @@ -34,7 +34,7 @@ public function testIntegerFormatter() { public function testIntegerFormatterWithSettings() { $this->fieldType = 'integer'; $formatter = array( - 'type' => $this->fieldType, + 'type' => 'number_integer', 'settings' => array( 'thousand_separator' => '.', 'prefix_suffix' => TRUE, @@ -62,7 +62,7 @@ public function testFloatFormatter() { $testValue = 3.33; $this->createTestField(); $this->createTestEntity($testValue); - $this->assertFormatterRdfa(array('type' => $this->fieldType), 'http://schema.org/baseSalary', array('value' => $testValue)); + $this->assertFormatterRdfa(array('type' => 'number_unformatted'), 'http://schema.org/baseSalary', array('value' => $testValue)); // Test that the content attribute is not created. $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]'); @@ -75,7 +75,7 @@ public function testFloatFormatter() { public function testFloatFormatterWithSettings() { $this->fieldType = 'float'; $formatter = array( - 'type' => $this->fieldType, + 'type' => 'number_decimal', 'settings' => array( 'thousand_separator' => '.', 'decimal_separator' => ',', @@ -102,7 +102,7 @@ public function testFloatFormatterWithSettings() { public function testFloatFormatterWithScale() { $this->fieldType = 'float'; $formatter = array( - 'type' => $this->fieldType, + 'type' => 'number_decimal', 'settings' => array( 'scale' => 5, ), @@ -123,7 +123,7 @@ public function testFloatFormatterWithScale() { public function testFloatFormatterWithScaleExercised() { $this->fieldType = 'float'; $formatter = array( - 'type' => $this->fieldType, + 'type' => 'number_decimal', 'settings' => array( 'scale' => 5, ), @@ -146,7 +146,7 @@ public function testDecimalFormatter() { $testValue = 3.33; $this->createTestField(); $this->createTestEntity($testValue); - $this->assertFormatterRdfa(array('type' => $this->fieldType), 'http://schema.org/baseSalary', array('value' => $testValue)); + $this->assertFormatterRdfa(array('type' => 'number_decimal'), 'http://schema.org/baseSalary', array('value' => $testValue)); // Test that the content attribute is not created. $result = $this->xpathContent($this->getRawContent(), '//div[contains(@class, "field-item") and @content]'); @@ -159,7 +159,7 @@ public function testDecimalFormatter() { public function testDecimalFormatterWithSettings() { $this->fieldType = 'decimal'; $formatter = array( - 'type' => $this->fieldType, + 'type' => 'number_decimal', 'settings' => array( 'thousand_separator' => 't', 'decimal_separator' => '#', diff --git a/drupal/core/modules/rdf/src/Tests/Field/TelephoneFieldRdfaTest.php b/drupal/core/modules/rdf/src/Tests/Field/TelephoneFieldRdfaTest.php index 85662d21..002db43a 100644 --- a/drupal/core/modules/rdf/src/Tests/Field/TelephoneFieldRdfaTest.php +++ b/drupal/core/modules/rdf/src/Tests/Field/TelephoneFieldRdfaTest.php @@ -52,7 +52,7 @@ protected function setUp() { */ public function testAllFormatters() { // Tests the plain formatter. - $this->assertFormatterRdfa(array('type' => 'text_plain'), 'http://schema.org/telephone', array('value' => $this->testValue)); + $this->assertFormatterRdfa(array('type' => 'string'), 'http://schema.org/telephone', array('value' => $this->testValue)); // Tests the telephone link formatter. $this->assertFormatterRdfa(array('type' => 'telephone_link'), 'http://schema.org/telephone', array('value' => 'tel:' . $this->testValue, 'type' => 'uri')); diff --git a/drupal/core/modules/rdf/templates/rdf-metadata.html.twig b/drupal/core/modules/rdf/templates/rdf-metadata.html.twig index 4f652944..4d96136b 100644 --- a/drupal/core/modules/rdf/templates/rdf-metadata.html.twig +++ b/drupal/core/modules/rdf/templates/rdf-metadata.html.twig @@ -18,5 +18,5 @@ */ #} {% for attributes in metadata %} - + {% endfor %} diff --git a/drupal/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.info.yml b/drupal/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.info.yml index 65d06dbf..e015ef4b 100644 --- a/drupal/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.info.yml +++ b/drupal/core/modules/rdf/tests/rdf_conflicting_namespaces/rdf_conflicting_namespaces.info.yml @@ -2,7 +2,13 @@ name: 'RDF module conflicting namespaces test' type: module description: 'Test conflicting namespace declaration.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - rdf + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/rdf/tests/rdf_test_namespaces/rdf_test_namespaces.info.yml b/drupal/core/modules/rdf/tests/rdf_test_namespaces/rdf_test_namespaces.info.yml index 84cd9744..ea1d07b8 100644 --- a/drupal/core/modules/rdf/tests/rdf_test_namespaces/rdf_test_namespaces.info.yml +++ b/drupal/core/modules/rdf/tests/rdf_test_namespaces/rdf_test_namespaces.info.yml @@ -2,7 +2,13 @@ name: 'RDF module namespaces test' type: module description: 'Test namespace declaration.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - rdf + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/responsive_image/responsive_image.info.yml b/drupal/core/modules/responsive_image/responsive_image.info.yml index 1991dc33..e6284fbb 100644 --- a/drupal/core/modules/responsive_image/responsive_image.info.yml +++ b/drupal/core/modules/responsive_image/responsive_image.info.yml @@ -2,9 +2,15 @@ name: Responsive Image type: module description: 'Provides an image formatter and breakpoint mappings to output responsive images using the HTML5 picture tag.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - breakpoint - image configure: responsive_image.mapping_page + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/responsive_image/tests/modules/responsive_image_test_module/responsive_image_test_module.info.yml b/drupal/core/modules/responsive_image/tests/modules/responsive_image_test_module/responsive_image_test_module.info.yml index 34c280e7..7e49720c 100644 --- a/drupal/core/modules/responsive_image/tests/modules/responsive_image_test_module/responsive_image_test_module.info.yml +++ b/drupal/core/modules/responsive_image/tests/modules/responsive_image_test_module/responsive_image_test_module.info.yml @@ -2,6 +2,12 @@ name: 'Responsive image test theme' type: module description: 'Test theme for responsive image.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/rest/rest.info.yml b/drupal/core/modules/rest/rest.info.yml index 0de95275..5757d33f 100644 --- a/drupal/core/modules/rest/rest.info.yml +++ b/drupal/core/modules/rest/rest.info.yml @@ -2,7 +2,13 @@ name: 'RESTful Web Services' type: module description: 'Exposes entities and other resources as RESTful web API' package: Web services -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - serialization + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/rest/src/Tests/DeleteTest.php b/drupal/core/modules/rest/src/Tests/DeleteTest.php index 402325c4..6456df14 100644 --- a/drupal/core/modules/rest/src/Tests/DeleteTest.php +++ b/drupal/core/modules/rest/src/Tests/DeleteTest.php @@ -55,7 +55,7 @@ public function testDelete() { // Try to delete an entity that does not exist. $response = $this->httpRequest($entity_type . '/9999', 'DELETE'); $this->assertResponse(404); - $this->assertText('The requested page "/' . $entity_type . '/9999" could not be found.'); + $this->assertText('The requested page could not be found.'); // Try to delete an entity without proper permissions. $this->drupalLogout(); diff --git a/drupal/core/modules/rest/tests/modules/rest_test_views/rest_test_views.info.yml b/drupal/core/modules/rest/tests/modules/rest_test_views/rest_test_views.info.yml index 662ad1bb..08b3e591 100644 --- a/drupal/core/modules/rest/tests/modules/rest_test_views/rest_test_views.info.yml +++ b/drupal/core/modules/rest/tests/modules/rest_test_views/rest_test_views.info.yml @@ -2,8 +2,14 @@ name: 'REST test views' type: module description: 'Provides default views for views REST tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - rest - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/search/search.info.yml b/drupal/core/modules/search/search.info.yml index 4675b0ba..dec01c21 100644 --- a/drupal/core/modules/search/search.info.yml +++ b/drupal/core/modules/search/search.info.yml @@ -2,6 +2,12 @@ name: Search type: module description: 'Enables site-wide keyword searching.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: search.settings + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/search/search.module b/drupal/core/modules/search/search.module index c622556c..91afbc1a 100644 --- a/drupal/core/modules/search/search.module +++ b/drupal/core/modules/search/search.module @@ -316,7 +316,7 @@ function search_expand_cjk($matches) { $chars = array(); for ($i = 0; $i < $length; $i++) { // Add the next character off the beginning of the string to the queue. - $current = drupal_substr($str, 0, 1); + $current = Unicode::substr($str, 0, 1); $str = substr($str, strlen($current)); $chars[] = $current; if ($i >= $min - 1) { diff --git a/drupal/core/modules/search/src/Tests/SearchSimplifyTest.php b/drupal/core/modules/search/src/Tests/SearchSimplifyTest.php index a850750f..848f7b7e 100644 --- a/drupal/core/modules/search/src/Tests/SearchSimplifyTest.php +++ b/drupal/core/modules/search/src/Tests/SearchSimplifyTest.php @@ -6,6 +6,7 @@ */ namespace Drupal\search\Tests; +use Drupal\Component\Utility\Unicode; /** * Tests that the search_simply() function works as intended. @@ -39,7 +40,7 @@ function testSearchSimplifyUnicode() { // of truncation in search_simplify(). $start = 0; while ($start < drupal_strlen($string)) { - $newstr = drupal_substr($string, $start, 30); + $newstr = Unicode::substr($string, $start, 30); // Special case: leading zeros are removed from numeric strings, // and there's one string in this file that is numbers starting with // zero, so prepend a 1 on that string. diff --git a/drupal/core/modules/search/templates/search-result.html.twig b/drupal/core/modules/search/templates/search-result.html.twig index 732489be..4847c9ce 100644 --- a/drupal/core/modules/search/templates/search-result.html.twig +++ b/drupal/core/modules/search/templates/search-result.html.twig @@ -59,15 +59,15 @@ */ #} {{ title_prefix }} -

+ {{ title }}

{{ title_suffix }} -
+
{% if snippet %} -

{{ snippet }}

+ {{ snippet }}

{% endif %} {% if info %} -

{{ info }}

+

{{ info }}

{% endif %}
diff --git a/drupal/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.info.yml b/drupal/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.info.yml index 0df41aa0..3077f778 100644 --- a/drupal/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.info.yml +++ b/drupal/core/modules/search/tests/modules/search_embedded_form/search_embedded_form.info.yml @@ -2,5 +2,11 @@ name: 'Search Embedded Form' type: module description: 'Support module for Search module testing of embedded forms.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/search/tests/modules/search_extra_type/search_extra_type.info.yml b/drupal/core/modules/search/tests/modules/search_extra_type/search_extra_type.info.yml index caea321b..37fb08f9 100644 --- a/drupal/core/modules/search/tests/modules/search_extra_type/search_extra_type.info.yml +++ b/drupal/core/modules/search/tests/modules/search_extra_type/search_extra_type.info.yml @@ -2,5 +2,11 @@ name: 'Test Search Type' type: module description: 'Support module for Search module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/search/tests/modules/search_langcode_test/search_langcode_test.info.yml b/drupal/core/modules/search/tests/modules/search_langcode_test/search_langcode_test.info.yml index da34c5fa..42c7a5b7 100644 --- a/drupal/core/modules/search/tests/modules/search_langcode_test/search_langcode_test.info.yml +++ b/drupal/core/modules/search/tests/modules/search_langcode_test/search_langcode_test.info.yml @@ -2,5 +2,11 @@ name: 'Test search entity langcode' type: module description: 'Support module for search module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/search/tests/modules/search_query_alter/search_query_alter.info.yml b/drupal/core/modules/search/tests/modules/search_query_alter/search_query_alter.info.yml index 8c6a3d82..4b982273 100644 --- a/drupal/core/modules/search/tests/modules/search_query_alter/search_query_alter.info.yml +++ b/drupal/core/modules/search/tests/modules/search_query_alter/search_query_alter.info.yml @@ -2,5 +2,11 @@ name: 'Test Search Query Alter' type: module description: 'Support module for Search module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/serialization/serialization.info.yml b/drupal/core/modules/serialization/serialization.info.yml index 7c4eb523..4111fbd0 100644 --- a/drupal/core/modules/serialization/serialization.info.yml +++ b/drupal/core/modules/serialization/serialization.info.yml @@ -2,5 +2,11 @@ name: Serialization type: module description: Provides a service for (de)serializing data to/from formats such as JSON and XML package: Web services -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/serialization/tests/serialization_test/serialization_test.info.yml b/drupal/core/modules/serialization/tests/serialization_test/serialization_test.info.yml index d6c01304..109ff37c 100644 --- a/drupal/core/modules/serialization/tests/serialization_test/serialization_test.info.yml +++ b/drupal/core/modules/serialization/tests/serialization_test/serialization_test.info.yml @@ -2,5 +2,11 @@ name: Serialization test module type: module description: "Support module for serialization tests." package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/shortcut/css/shortcut.icons.css b/drupal/core/modules/shortcut/css/shortcut.icons.css index 658ef8ae..18b15d7c 100644 --- a/drupal/core/modules/shortcut/css/shortcut.icons.css +++ b/drupal/core/modules/shortcut/css/shortcut.icons.css @@ -22,6 +22,9 @@ width: 20px; height: 20px; } +[dir="rtl"] .add-or-remove-shortcuts .icon { + background-image: url(../images/favstar-rtl.svg); +} .add-shortcut a:hover .icon, .add-shortcut a:focus .icon { background-position: -20px top; @@ -31,5 +34,5 @@ } .remove-shortcut a:focus .icon, .remove-shortcut a:hover .icon { - background-position: -60px top; /* LTR */ + background-position: -60px top; } diff --git a/drupal/core/modules/shortcut/css/shortcut.theme.css b/drupal/core/modules/shortcut/css/shortcut.theme.css index fc9ed736..1d1405f1 100644 --- a/drupal/core/modules/shortcut/css/shortcut.theme.css +++ b/drupal/core/modules/shortcut/css/shortcut.theme.css @@ -10,9 +10,12 @@ display: block; } .toolbar .toolbar-tray-vertical .edit-shortcuts { - text-align: right; + text-align: right; /* LTR */ padding: 1em; } +[dir="rtl"] .toolbar .toolbar-tray-vertical .edit-shortcuts { + text-align: left; +} .toolbar .toolbar-tray-horizontal .edit-shortcuts { float: right; /* LTR */ } @@ -25,7 +28,11 @@ */ .add-or-remove-shortcuts { display: inline-block; - margin-left: 0.3em; + margin-left: 0.3em; /* LTR */ +} +[dir="rtl"] .add-or-remove-shortcuts { + margin-left: 0; + margin-right: 0.3em; } .add-or-remove-shortcuts .text { background: #000000; @@ -34,7 +41,7 @@ padding: 0 5px; color: #ffffff; display: inline-block; - margin-left: 0.3em; + margin-left: 0.3em; /* LTR */ opacity: 0; -ms-transform: translateY(-12px); -webkit-transform: translateY(-12px); @@ -45,6 +52,10 @@ -webkit-backface-visibility: hidden; backface-visibility: hidden; } +[dir="rtl"] .add-or-remove-shortcuts .text { + margin-left: 0; + margin-right: 0.3em; +} .add-or-remove-shortcuts a:hover .text, .add-or-remove-shortcuts a:focus .text { opacity: 1; diff --git a/drupal/core/modules/shortcut/images/favstar-rtl.svg b/drupal/core/modules/shortcut/images/favstar-rtl.svg new file mode 100644 index 00000000..8adec7d3 --- /dev/null +++ b/drupal/core/modules/shortcut/images/favstar-rtl.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/drupal/core/modules/shortcut/shortcut.info.yml b/drupal/core/modules/shortcut/shortcut.info.yml index dde0e9c6..edec0c47 100644 --- a/drupal/core/modules/shortcut/shortcut.info.yml +++ b/drupal/core/modules/shortcut/shortcut.info.yml @@ -2,6 +2,12 @@ name: Shortcut type: module description: 'Allows users to manage customizable lists of shortcut links.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: shortcut.set_admin + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/shortcut/shortcut.module b/drupal/core/modules/shortcut/shortcut.module index a90b79e3..601a149b 100644 --- a/drupal/core/modules/shortcut/shortcut.module +++ b/drupal/core/modules/shortcut/shortcut.module @@ -298,10 +298,7 @@ function shortcut_preprocess_page(&$variables) { // pages). if (shortcut_set_edit_access()->isAllowed() && !\Drupal::request()->attributes->has('exception')) { $link = current_path(); - if (!($url = \Drupal::pathValidator()->getUrlIfValid($link))) { - // Bail out early if we couldn't find a matching route. - return; - } + $route_match = \Drupal::routeMatch(); $query = array( 'link' => $link, @@ -314,7 +311,7 @@ function shortcut_preprocess_page(&$variables) { // Check if $link is already a shortcut and set $link_mode accordingly. $shortcuts = \Drupal::entityManager()->getStorage('shortcut')->loadByProperties(array('shortcut_set' => $shortcut_set->id())); foreach ($shortcuts as $shortcut) { - if ($shortcut->getRouteName() == $url->getRouteName() && $shortcut->getRouteParameters() == $url->getRouteParameters()) { + if ($shortcut->getRouteName() == $route_match->getRouteName() && $shortcut->getRouteParameters() == $route_match->getParameters()->all()) { $shortcut_id = $shortcut->id(); break; } diff --git a/drupal/core/modules/simpletest/simpletest.info.yml b/drupal/core/modules/simpletest/simpletest.info.yml index 232680e7..77d7e06b 100644 --- a/drupal/core/modules/simpletest/simpletest.info.yml +++ b/drupal/core/modules/simpletest/simpletest.info.yml @@ -2,6 +2,12 @@ name: Testing type: module description: 'Provides a framework for unit and functional testing.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: simpletest.settings + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/simpletest/src/WebTestBase.php b/drupal/core/modules/simpletest/src/WebTestBase.php index e44979ff..fcc6b97c 100644 --- a/drupal/core/modules/simpletest/src/WebTestBase.php +++ b/drupal/core/modules/simpletest/src/WebTestBase.php @@ -80,7 +80,7 @@ abstract class WebTestBase extends TestBase { /** * The current user logged in using the internal browser. * - * @var bool + * @var \Drupal\Core\Session\AccountInterface|bool */ protected $loggedInUser = FALSE; diff --git a/drupal/core/modules/simpletest/tests/modules/phpunit_test/phpunit_test.info.yml b/drupal/core/modules/simpletest/tests/modules/phpunit_test/phpunit_test.info.yml index e0a4c6e8..0ede5441 100644 --- a/drupal/core/modules/simpletest/tests/modules/phpunit_test/phpunit_test.info.yml +++ b/drupal/core/modules/simpletest/tests/modules/phpunit_test/phpunit_test.info.yml @@ -2,5 +2,11 @@ name: PHPUnit Test type: module description: 'Provides dummy classes for use by SimpleTest tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/statistics/statistics.info.yml b/drupal/core/modules/statistics/statistics.info.yml index 6582bec1..b70cc3b1 100644 --- a/drupal/core/modules/statistics/statistics.info.yml +++ b/drupal/core/modules/statistics/statistics.info.yml @@ -2,6 +2,12 @@ name: Statistics type: module description: 'Logs content statistics for your site.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: statistics.settings + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/statistics/tests/modules/statistics_test_views/statistics_test_views.info.yml b/drupal/core/modules/statistics/tests/modules/statistics_test_views/statistics_test_views.info.yml index df9a43ab..a8051332 100644 --- a/drupal/core/modules/statistics/tests/modules/statistics_test_views/statistics_test_views.info.yml +++ b/drupal/core/modules/statistics/tests/modules/statistics_test_views/statistics_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Statistics test views' type: module description: 'Provides default views for views statistics tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - statistics - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/syslog/syslog.info.yml b/drupal/core/modules/syslog/syslog.info.yml index 1d8dc8f1..f9a76083 100644 --- a/drupal/core/modules/syslog/syslog.info.yml +++ b/drupal/core/modules/syslog/syslog.info.yml @@ -2,6 +2,12 @@ name: Syslog type: module description: 'Logs and records system events to syslog.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: system.logging_settings + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/entity.api.php b/drupal/core/modules/system/entity.api.php index 5974440d..9c590b3a 100644 --- a/drupal/core/modules/system/entity.api.php +++ b/drupal/core/modules/system/entity.api.php @@ -1948,3 +1948,7 @@ function hook_entity_extra_field_info_alter(&$info) { } } } + +/** + * @} End of "addtogroup hooks". + */ diff --git a/drupal/core/modules/system/file.api.php b/drupal/core/modules/system/file.api.php new file mode 100644 index 00000000..65a6051a --- /dev/null +++ b/drupal/core/modules/system/file.api.php @@ -0,0 +1,212 @@ + 'attachment; filename="config.tar.gz"', + ); + } +} + +/** + * Alter the URL to a file. + * + * This hook is called from file_create_url(), and is called fairly + * frequently (10+ times per page), depending on how many files there are in a + * given page. + * If CSS and JS aggregation are disabled, this can become very frequently + * (50+ times per page) so performance is critical. + * + * This function should alter the URI, if it wants to rewrite the file URL. + * + * @param $uri + * The URI to a file for which we need an external URL, or the path to a + * shipped file. + */ +function hook_file_url_alter(&$uri) { + $user = \Drupal::currentUser(); + + // User 1 will always see the local file in this example. + if ($user->id() == 1) { + return; + } + + $cdn1 = 'http://cdn1.example.com'; + $cdn2 = 'http://cdn2.example.com'; + $cdn_extensions = array('css', 'js', 'gif', 'jpg', 'jpeg', 'png'); + + // Most CDNs don't support private file transfers without a lot of hassle, + // so don't support this in the common case. + $schemes = array('public'); + + $scheme = file_uri_scheme($uri); + + // Only serve shipped files and public created files from the CDN. + if (!$scheme || in_array($scheme, $schemes)) { + // Shipped files. + if (!$scheme) { + $path = $uri; + } + // Public created files. + else { + $wrapper = file_stream_wrapper_get_instance_by_scheme($scheme); + $path = $wrapper->getDirectoryPath() . '/' . file_uri_target($uri); + } + + // Clean up Windows paths. + $path = str_replace('\\', '/', $path); + + // Serve files with one of the CDN extensions from CDN 1, all others from + // CDN 2. + $pathinfo = pathinfo($path); + if (isset($pathinfo['extension']) && in_array($pathinfo['extension'], $cdn_extensions)) { + $uri = $cdn1 . '/' . $path; + } + else { + $uri = $cdn2 . '/' . $path; + } + } +} + +/** + * Alter MIME type mappings used to determine MIME type from a file extension. + * + * Invoked by \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::guess(). It + * is used to allow modules to add to or modify the default mapping from + * \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::$defaultMapping. + * + * @param $mapping + * An array of mimetypes correlated to the extensions that relate to them. + * The array has 'mimetypes' and 'extensions' elements, each of which is an + * array. + * + * @see \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::guess() + * @see \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::$defaultMapping + */ +function hook_file_mimetype_mapping_alter(&$mapping) { + // Add new MIME type 'drupal/info'. + $mapping['mimetypes']['example_info'] = 'drupal/info'; + // Add new extension '.info.yml' and map it to the 'drupal/info' MIME type. + $mapping['extensions']['info'] = 'example_info'; + // Override existing extension mapping for '.ogg' files. + $mapping['extensions']['ogg'] = 189; +} + +/** + * Alter archiver information declared by other modules. + * + * See hook_archiver_info() for a description of archivers and the archiver + * information structure. + * + * @param $info + * Archiver information to alter (return values from hook_archiver_info()). + */ +function hook_archiver_info_alter(&$info) { + $info['tar']['extensions'][] = 'tgz'; +} + +/** + * Register information about FileTransfer classes provided by a module. + * + * The FileTransfer class allows transferring files over a specific type of + * connection. Core provides classes for FTP and SSH. Contributed modules are + * free to extend the FileTransfer base class to add other connection types, + * and if these classes are registered via hook_filetransfer_info(), those + * connection types will be available to site administrators using the Update + * manager when they are redirected to the authorize.php script to authorize + * the file operations. + * + * @return array + * Nested array of information about FileTransfer classes. Each key is a + * FileTransfer type (not human readable, used for form elements and + * variable names, etc), and the values are subarrays that define properties + * of that type. The keys in each subarray are: + * - 'title': Required. The human-readable name of the connection type. + * - 'class': Required. The name of the FileTransfer class. The constructor + * will always be passed the full path to the root of the site that should + * be used to restrict where file transfer operations can occur (the $jail) + * and an array of settings values returned by the settings form. + * - 'file': Required. The include file containing the FileTransfer class. + * This should be a separate .inc file, not just the .module file, so that + * the minimum possible code is loaded when authorize.php is running. + * - 'file path': Optional. The directory (relative to the Drupal root) + * where the include file lives. If not defined, defaults to the base + * directory of the module implementing the hook. + * - 'weight': Optional. Integer weight used for sorting connection types on + * the authorize.php form. + * + * @see \Drupal\Core\FileTransfer\FileTransfer + * @see authorize.php + * @see hook_filetransfer_info_alter() + * @see drupal_get_filetransfer_info() + */ +function hook_filetransfer_info() { + $info['sftp'] = array( + 'title' => t('SFTP (Secure FTP)'), + 'class' => 'Drupal\Core\FileTransfer\SFTP', + 'weight' => 10, + ); + return $info; +} + +/** + * Alter the FileTransfer class registry. + * + * @param array $filetransfer_info + * Reference to a nested array containing information about the FileTransfer + * class registry. + * + * @see hook_filetransfer_info() + */ +function hook_filetransfer_info_alter(&$filetransfer_info) { + // Remove the FTP option entirely. + unset($filetransfer_info['ftp']); + // Make sure the SSH option is listed first. + $filetransfer_info['ssh']['weight'] = -10; +} + +/** + * @} End of "addtogroup hooks". + */ diff --git a/drupal/core/modules/system/form.api.php b/drupal/core/modules/system/form.api.php index 3a328636..b8d88d46 100644 --- a/drupal/core/modules/system/form.api.php +++ b/drupal/core/modules/system/form.api.php @@ -2,7 +2,7 @@ /** * @file - * Callbacks provided by the form system. + * Callbacks and hooks related to form system. */ use Drupal\Component\Utility\String; @@ -130,3 +130,184 @@ function callback_batch_finished($success, $results, $operations) { drupal_set_message($message, 'error'); } } + +/** + * @} End of "addtogroup callbacks". + */ + +/** + * @addtogroup hooks + * @{ + */ + +/** + * Alter the Ajax command data that is sent to the client. + * + * @param \Drupal\Core\Ajax\CommandInterface[] $data + * An array of all the rendered commands that will be sent to the client. + * + * @see \Drupal\Core\Ajax\AjaxResponse::ajaxRender() + */ +function hook_ajax_render_alter(array &$data) { + // Inject any new status messages into the content area. + $status_messages = array('#theme' => 'status_messages'); + $command = new \Drupal\Core\Ajax\PrependCommand('#block-system-main .content', drupal_render($status_messages)); + $data[] = $command->render(); +} + +/** + * Perform alterations before a form is rendered. + * + * One popular use of this hook is to add form elements to the node form. When + * altering a node form, the node entity can be retrieved by invoking + * $form_state->getFormObject()->getEntity(). + * + * In addition to hook_form_alter(), which is called for all forms, there are + * two more specific form hooks available. The first, + * hook_form_BASE_FORM_ID_alter(), allows targeting of a form/forms via a base + * form (if one exists). The second, hook_form_FORM_ID_alter(), can be used to + * target a specific form directly. + * + * The call order is as follows: all existing form alter functions are called + * for module A, then all for module B, etc., followed by all for any base + * theme(s), and finally for the theme itself. The module order is determined + * by system weight, then by module name. + * + * Within each module, form alter hooks are called in the following order: + * first, hook_form_alter(); second, hook_form_BASE_FORM_ID_alter(); third, + * hook_form_FORM_ID_alter(). So, for each module, the more general hooks are + * called first followed by the more specific. + * + * @param $form + * Nested array of form elements that comprise the form. + * @param $form_state + * The current state of the form. The arguments that + * \Drupal::formBuilder()->getForm() was originally called with are available + * in the array $form_state->getBuildInfo()['args']. + * @param $form_id + * String representing the name of the form itself. Typically this is the + * name of the function that generated the form. + * + * @see hook_form_BASE_FORM_ID_alter() + * @see hook_form_FORM_ID_alter() + * @see forms_api_reference.html + */ +function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { + if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) { + $upload_enabled_types = \Drupal::config('mymodule.settings')->get('upload_enabled_types'); + $form['workflow']['upload_' . $form['type']['#value']] = array( + '#type' => 'radios', + '#title' => t('Attachments'), + '#default_value' => in_array($form['type']['#value'], $upload_enabled_types) ? 1 : 0, + '#options' => array(t('Disabled'), t('Enabled')), + ); + // Add a custom submit handler to save the array of types back to the config file. + $form['actions']['submit']['#submit'][] = 'mymodule_upload_enabled_types_submit'; + } +} + +/** + * Provide a form-specific alteration instead of the global hook_form_alter(). + * + * Modules can implement hook_form_FORM_ID_alter() to modify a specific form, + * rather than implementing hook_form_alter() and checking the form ID, or + * using long switch statements to alter multiple forms. + * + * Form alter hooks are called in the following order: hook_form_alter(), + * hook_form_BASE_FORM_ID_alter(), hook_form_FORM_ID_alter(). See + * hook_form_alter() for more details. + * + * @param $form + * Nested array of form elements that comprise the form. + * @param $form_state + * The current state of the form. The arguments that + * \Drupal::formBuilder()->getForm() was originally called with are available + * in the array $form_state->getBuildInfo()['args']. + * @param $form_id + * String representing the name of the form itself. Typically this is the + * name of the function that generated the form. + * + * @see hook_form_alter() + * @see hook_form_BASE_FORM_ID_alter() + * @see \Drupal\Core\Form\FormBuilderInterface::prepareForm() + * @see forms_api_reference.html + */ +function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { + // Modification for the form with the given form ID goes here. For example, if + // FORM_ID is "user_register_form" this code would run only on the user + // registration form. + + // Add a checkbox to registration form about agreeing to terms of use. + $form['terms_of_use'] = array( + '#type' => 'checkbox', + '#title' => t("I agree with the website's terms and conditions."), + '#required' => TRUE, + ); +} + +/** + * Provide a form-specific alteration for shared ('base') forms. + * + * By default, when \Drupal::formBuilder()->getForm() is called, Drupal looks + * for a function with the same name as the form ID, and uses that function to + * build the form. In contrast, base forms allow multiple form IDs to be mapped + * to a single base (also called 'factory') form function. + * + * Modules can implement hook_form_BASE_FORM_ID_alter() to modify a specific + * base form, rather than implementing hook_form_alter() and checking for + * conditions that would identify the shared form constructor. + * + * To identify the base form ID for a particular form (or to determine whether + * one exists) check the $form_state. The base form ID is stored under + * $form_state->getBuildInfo()['base_form_id']. + * + * Form alter hooks are called in the following order: hook_form_alter(), + * hook_form_BASE_FORM_ID_alter(), hook_form_FORM_ID_alter(). See + * hook_form_alter() for more details. + * + * @param $form + * Nested array of form elements that comprise the form. + * @param $form_state + * The current state of the form. + * @param $form_id + * String representing the name of the form itself. Typically this is the + * name of the function that generated the form. + * + * @see hook_form_alter() + * @see hook_form_FORM_ID_alter() + * @see \Drupal\Core\Form\FormBuilderInterface::prepareForm() + */ +function hook_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { + // Modification for the form with the given BASE_FORM_ID goes here. For + // example, if BASE_FORM_ID is "node_form", this code would run on every + // node form, regardless of node type. + + // Add a checkbox to the node form about agreeing to terms of use. + $form['terms_of_use'] = array( + '#type' => 'checkbox', + '#title' => t("I agree with the website's terms and conditions."), + '#required' => TRUE, + ); +} + +/** + * Alter batch information before a batch is processed. + * + * Called by batch_process() to allow modules to alter a batch before it is + * processed. + * + * @param $batch + * The associative array of batch information. See batch_set() for details on + * what this could contain. + * + * @see batch_set() + * @see batch_process() + * + * @ingroup batch + */ +function hook_batch_alter(&$batch) { +} + +/** + * @} End of "addtogroup hooks". + */ diff --git a/drupal/core/modules/system/module.api.php b/drupal/core/modules/system/module.api.php new file mode 100644 index 00000000..29a9bf3a --- /dev/null +++ b/drupal/core/modules/system/module.api.php @@ -0,0 +1,775 @@ + 'tokens', + ); + $hooks['tokens'] = array( + 'group' => 'tokens', + ); + return $hooks; +} + +/** + * Alter the registry of modules implementing a hook. + * + * This hook is invoked during \Drupal::moduleHandler()->getImplementations(). + * A module may implement this hook in order to reorder the implementing + * modules, which are otherwise ordered by the module's system weight. + * + * Note that hooks invoked using \Drupal::moduleHandler->alter() can have + * multiple variations(such as hook_form_alter() and hook_form_FORM_ID_alter()). + * \Drupal::moduleHandler->alter() will call all such variants defined by a + * single module in turn. For the purposes of hook_module_implements_alter(), + * these variants are treated as a single hook. Thus, to ensure that your + * implementation of hook_form_FORM_ID_alter() is called at the right time, + * you will have to change the order of hook_form_alter() implementation in + * hook_module_implements_alter(). + * + * @param $implementations + * An array keyed by the module's name. The value of each item corresponds + * to a $group, which is usually FALSE, unless the implementation is in a + * file named $module.$group.inc. + * @param $hook + * The name of the module hook being implemented. + */ +function hook_module_implements_alter(&$implementations, $hook) { + if ($hook == 'rdf_mapping') { + // Move my_module_rdf_mapping() to the end of the list. + // \Drupal::moduleHandler()->getImplementations() + // iterates through $implementations with a foreach loop which PHP iterates + // in the order that the items were added, so to move an item to the end of + // the array, we remove it and then add it. + $group = $implementations['my_module']; + unset($implementations['my_module']); + $implementations['my_module'] = $group; + } +} + +/** + * Alter the information parsed from module and theme .info.yml files + * + * This hook is invoked in _system_rebuild_module_data() and in + * _system_rebuild_theme_data(). A module may implement this hook in order to + * add to or alter the data generated by reading the .info.yml file with + * \Drupal\Core\Extension\InfoParser. + * + * @param array $info + * The .info.yml file contents, passed by reference so that it can be altered. + * @param \Drupal\Core\Extension\Extension $file + * Full information about the module or theme. + * @param string $type + * Either 'module' or 'theme', depending on the type of .info.yml file that + * was passed. + */ +function hook_system_info_alter(array &$info, \Drupal\Core\Extension\Extension $file, $type) { + // Only fill this in if the .info.yml file does not define a 'datestamp'. + if (empty($info['datestamp'])) { + $info['datestamp'] = $file->getMTime(); + } +} + +/** + * Perform necessary actions before a module is installed. + * + * @param string $module + * The name of the module about to be installed. + */ +function hook_module_preinstall($module) { + mymodule_cache_clear(); +} + +/** + * Perform necessary actions after modules are installed. + * + * This function differs from hook_install() in that it gives all other modules + * a chance to perform actions when a module is installed, whereas + * hook_install() is only called on the module actually being installed. See + * \Drupal\Core\Extension\ModuleHandler::install() for a detailed description of + * the order in which install hooks are invoked. + * + * @param $modules + * An array of the modules that were installed. + * + * @see \Drupal\Core\Extension\ModuleHandler::install() + * @see hook_install() + */ +function hook_modules_installed($modules) { + if (in_array('lousy_module', $modules)) { + \Drupal::state()->set('mymodule.lousy_module_compatibility', TRUE); + } +} + +/** + * Perform setup tasks when the module is installed. + * + * If the module implements hook_schema(), the database tables will + * be created before this hook is fired. + * + * Implementations of this hook are by convention declared in the module's + * .install file. The implementation can rely on the .module file being loaded. + * The hook will only be called when a module is installed. The module's schema + * version will be set to the module's greatest numbered update hook. Because of + * this, any time a hook_update_N() is added to the module, this function needs + * to be updated to reflect the current version of the database schema. + * + * See the @link http://drupal.org/node/146843 Schema API documentation @endlink + * for details on hook_schema and how database tables are defined. + * + * Note that since this function is called from a full bootstrap, all functions + * (including those in modules enabled by the current page request) are + * available when this hook is called. Use cases could be displaying a user + * message, or calling a module function necessary for initial setup, etc. + * + * Please be sure that anything added or modified in this function that can + * be removed during uninstall should be removed with hook_uninstall(). + * + * @see hook_schema() + * @see \Drupal\Core\Extension\ModuleHandler::install() + * @see hook_uninstall() + * @see hook_modules_installed() + */ +function hook_install() { + // Create the styles directory and ensure it's writable. + $directory = file_default_scheme() . '://styles'; + $mode = isset($GLOBALS['install_state']['mode']) ? $GLOBALS['install_state']['mode'] : NULL; + file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS, $mode); +} + +/** + * Perform necessary actions before a module is uninstalled. + * + * @param string $module + * The name of the module about to be uninstalled. + */ +function hook_module_preuninstall($module) { + mymodule_cache_clear(); +} + +/** + * Perform necessary actions after modules are uninstalled. + * + * This function differs from hook_uninstall() in that it gives all other + * modules a chance to perform actions when a module is uninstalled, whereas + * hook_uninstall() is only called on the module actually being uninstalled. + * + * It is recommended that you implement this hook if your module stores + * data that may have been set by other modules. + * + * @param $modules + * An array of the modules that were uninstalled. + * + * @see hook_uninstall() + * @see hook_modules_disabled() + */ +function hook_modules_uninstalled($modules) { + if (in_array('lousy_module', $modules)) { + \Drupal::state()->delete('mymodule.lousy_module_compatibility'); + } + mymodule_cache_rebuild(); +} + +/** + * Remove any information that the module sets. + * + * The information that the module should remove includes: + * - state that the module has set using \Drupal::state() + * - modifications to existing tables + * + * The module should not remove its entry from the module configuration. + * Database tables defined by hook_schema() will be removed automatically. + * + * The uninstall hook must be implemented in the module's .install file. It + * will fire when the module gets uninstalled but before the module's database + * tables are removed, allowing your module to query its own tables during + * this routine. + * + * @see hook_install() + * @see hook_schema() + * @see hook_disable() + * @see hook_modules_uninstalled() + */ +function hook_uninstall() { + // Remove the styles directory and generated images. + file_unmanaged_delete_recursive(file_default_scheme() . '://styles'); +} + +/** + * Return an array of tasks to be performed by an installation profile. + * + * Any tasks you define here will be run, in order, after the installer has + * finished the site configuration step but before it has moved on to the + * final import of languages and the end of the installation. You can have any + * number of custom tasks to perform during this phase. + * + * Each task you define here corresponds to a callback function which you must + * separately define and which is called when your task is run. This function + * will receive the global installation state variable, $install_state, as + * input, and has the opportunity to access or modify any of its settings. See + * the install_state_defaults() function in the installer for the list of + * $install_state settings used by Drupal core. + * + * At the end of your task function, you can indicate that you want the + * installer to pause and display a page to the user by returning any themed + * output that should be displayed on that page (but see below for tasks that + * use the form API or batch API; the return values of these task functions are + * handled differently). You should also use #title within the task + * callback function to set a custom page title. For some tasks, however, you + * may want to simply do some processing and pass control to the next task + * without ending the page request; to indicate this, simply do not send back + * a return value from your task function at all. This can be used, for + * example, by installation profiles that need to configure certain site + * settings in the database without obtaining any input from the user. + * + * The task function is treated specially if it defines a form or requires + * batch processing; in that case, you should return either the form API + * definition or batch API array, as appropriate. See below for more + * information on the 'type' key that you must define in the task definition + * to inform the installer that your task falls into one of those two + * categories. It is important to use these APIs directly, since the installer + * may be run non-interactively (for example, via a command line script), all + * in one page request; in that case, the installer will automatically take + * care of submitting forms and processing batches correctly for both types of + * installations. You can inspect the $install_state['interactive'] boolean to + * see whether or not the current installation is interactive, if you need + * access to this information. + * + * Remember that a user installing Drupal interactively will be able to reload + * an installation page multiple times, so you should use \Drupal::state() to + * store any data that you may need later in the installation process. Any + * temporary state must be removed using \Drupal::state()->delete() before + * your last task has completed and control is handed back to the installer. + * + * @param array $install_state + * An array of information about the current installation state. + * + * @return array + * A keyed array of tasks the profile will perform during the final stage of + * the installation. Each key represents the name of a function (usually a + * function defined by this profile, although that is not strictly required) + * that is called when that task is run. The values are associative arrays + * containing the following key-value pairs (all of which are optional): + * - display_name: The human-readable name of the task. This will be + * displayed to the user while the installer is running, along with a list + * of other tasks that are being run. Leave this unset to prevent the task + * from appearing in the list. + * - display: This is a boolean which can be used to provide finer-grained + * control over whether or not the task will display. This is mostly useful + * for tasks that are intended to display only under certain conditions; + * for these tasks, you can set 'display_name' to the name that you want to + * display, but then use this boolean to hide the task only when certain + * conditions apply. + * - type: A string representing the type of task. This parameter has three + * possible values: + * - normal: (default) This indicates that the task will be treated as a + * regular callback function, which does its processing and optionally + * returns HTML output. + * - batch: This indicates that the task function will return a batch API + * definition suitable for batch_set(). The installer will then take care + * of automatically running the task via batch processing. + * - form: This indicates that the task function will return a standard + * form API definition (and separately define validation and submit + * handlers, as appropriate). The installer will then take care of + * automatically directing the user through the form submission process. + * - run: A constant representing the manner in which the task will be run. + * This parameter has three possible values: + * - INSTALL_TASK_RUN_IF_NOT_COMPLETED: (default) This indicates that the + * task will run once during the installation of the profile. + * - INSTALL_TASK_SKIP: This indicates that the task will not run during + * the current installation page request. It can be used to skip running + * an installation task when certain conditions are met, even though the + * task may still show on the list of installation tasks presented to the + * user. + * - INSTALL_TASK_RUN_IF_REACHED: This indicates that the task will run on + * each installation page request that reaches it. This is rarely + * necessary for an installation profile to use; it is primarily used by + * the Drupal installer for bootstrap-related tasks. + * - function: Normally this does not need to be set, but it can be used to + * force the installer to call a different function when the task is run + * (rather than the function whose name is given by the array key). This + * could be used, for example, to allow the same function to be called by + * two different tasks. + * + * @see install_state_defaults() + * @see batch_set() + */ +function hook_install_tasks(&$install_state) { + // Here, we define a variable to allow tasks to indicate that a particular, + // processor-intensive batch process needs to be triggered later on in the + // installation. + $myprofile_needs_batch_processing = \Drupal::state()->get('myprofile.needs_batch_processing', FALSE); + $tasks = array( + // This is an example of a task that defines a form which the user who is + // installing the site will be asked to fill out. To implement this task, + // your profile would define a function named myprofile_data_import_form() + // as a normal form API callback function, with associated validation and + // submit handlers. In the submit handler, in addition to saving whatever + // other data you have collected from the user, you might also call + // \Drupal::state()->set('myprofile.needs_batch_processing', TRUE) if the + // user has entered data which requires that batch processing will need to + // occur later on. + 'myprofile_data_import_form' => array( + 'display_name' => t('Data import options'), + 'type' => 'form', + ), + // Similarly, to implement this task, your profile would define a function + // named myprofile_settings_form() with associated validation and submit + // handlers. This form might be used to collect and save additional + // information from the user that your profile needs. There are no extra + // steps required for your profile to act as an "installation wizard"; you + // can simply define as many tasks of type 'form' as you wish to execute, + // and the forms will be presented to the user, one after another. + 'myprofile_settings_form' => array( + 'display_name' => t('Additional options'), + 'type' => 'form', + ), + // This is an example of a task that performs batch operations. To + // implement this task, your profile would define a function named + // myprofile_batch_processing() which returns a batch API array definition + // that the installer will use to execute your batch operations. Due to the + // 'myprofile.needs_batch_processing' variable used here, this task will be + // hidden and skipped unless your profile set it to TRUE in one of the + // previous tasks. + 'myprofile_batch_processing' => array( + 'display_name' => t('Import additional data'), + 'display' => $myprofile_needs_batch_processing, + 'type' => 'batch', + 'run' => $myprofile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP, + ), + // This is an example of a task that will not be displayed in the list that + // the user sees. To implement this task, your profile would define a + // function named myprofile_final_site_setup(), in which additional, + // automated site setup operations would be performed. Since this is the + // last task defined by your profile, you should also use this function to + // call \Drupal::state()->delete('myprofile.needs_batch_processing') and + // clean up the state that was used above. If you want the user to pass + // to the final Drupal installation tasks uninterrupted, return no output + // from this function. Otherwise, return themed output that the user will + // see (for example, a confirmation page explaining that your profile's + // tasks are complete, with a link to reload the current page and therefore + // pass on to the final Drupal installation tasks when the user is ready to + // do so). + 'myprofile_final_site_setup' => array( + ), + ); + return $tasks; +} + +/** + * Alter the full list of installation tasks. + * + * You can use this hook to change or replace any part of the Drupal + * installation process that occurs after the installation profile is selected. + * + * @param $tasks + * An array of all available installation tasks, including those provided by + * Drupal core. You can modify this array to change or replace individual + * steps within the installation process. + * @param $install_state + * An array of information about the current installation state. + */ +function hook_install_tasks_alter(&$tasks, $install_state) { + // Replace the entire site configuration form provided by Drupal core + // with a custom callback function defined by this installation profile. + $tasks['install_configure_form']['function'] = 'myprofile_install_configure_form'; +} + +/** + * Perform a single update. + * + * For each change that requires one or more actions to be performed when + * updating a site, add a new hook_update_N(), which will be called by + * update.php. The documentation block preceding this function is stripped of + * newlines and used as the description for the update on the pending updates + * task list. Schema updates should adhere to the + * @link http://drupal.org/node/150215 Schema API. @endlink + * + * Implementations of hook_update_N() are named (module name)_update_(number). + * The numbers are composed of three parts: + * - 1 digit for Drupal core compatibility. + * - 1 digit for your module's major release version (e.g., is this the 8.x-1.* + * (1) or 8.x-2.* (2) series of your module). + * - 2 digits for sequential counting, starting with 01. + * + * Examples: + * - mymodule_update_8100(): This is the first update to get the database ready + * to run mymodule 8.x-1.*. + * - mymodule_update_8200(): This is the first update to get the database ready + * to run mymodule 8.x-2.*. + * + * As of Drupal 8.0, the database upgrade system no longer supports updating a + * database from an earlier major version of Drupal: update.php can be used to + * upgrade from 7.x-1.x to 7.x-2.x, or 8.x-1.x to 8.x-2.x, but not from 7.x to + * 8.x. Therefore, only update hooks numbered 8001 or later will run for + * Drupal 8. 8000 is reserved for the minimum core schema version and defining + * mymodule_update_8000() will result in an exception. Use the + * @link https://drupal.org/node/2127611 Migration API @endlink instead to + * migrate data from an earlier major version of Drupal. + * + * For further information about releases and release numbers see: + * @link http://drupal.org/node/711070 Maintaining a drupal.org project with Git @endlink + * + * Never renumber update functions. + * + * Implementations of this hook should be placed in a mymodule.install file in + * the same directory as mymodule.module. Drupal core's updates are implemented + * using the system module as a name and stored in database/updates.inc. + * + * Not all module functions are available from within a hook_update_N() function. + * In order to call a function from your mymodule.module or an include file, + * you need to explicitly load that file first. + * + * During database updates the schema of any module could be out of date. For + * this reason, caution is needed when using any API function within an update + * function - particularly CRUD functions, functions that depend on the schema + * (for example by using drupal_write_record()), and any functions that invoke + * hooks. + * + * The $sandbox parameter should be used when a multipass update is needed, in + * circumstances where running the whole update at once could cause PHP to + * timeout. Each pass is run in a way that avoids PHP timeouts, provided each + * pass remains under the timeout limit. To signify that an update requires + * at least one more pass, set $sandbox['#finished'] to a number less than 1 + * (you need to do this each pass). The value of $sandbox['#finished'] will be + * unset between passes but all other data in $sandbox will be preserved. The + * system will stop iterating this update when $sandbox['#finished'] is left + * unset or set to a number higher than 1. It is recommended that + * $sandbox['#finished'] is initially set to 0, and then updated each pass to a + * number between 0 and 1 that represents the overall % completed for this + * update, finishing with 1. + * + * See the @link batch Batch operations topic @endlink for more information on + * how to use the Batch API. + * + * @param array $sandbox + * Stores information for multipass updates. See above for more information. + * + * @throws \Drupal\Core\Utility\UpdateException|PDOException + * In case of error, update hooks should throw an instance of + * Drupal\Core\Utility\UpdateException with a meaningful message for the user. + * If a database query fails for whatever reason, it will throw a + * PDOException. + * + * @return string|null + * Optionally, update hooks may return a translated string that will be + * displayed to the user after the update has completed. If no message is + * returned, no message will be presented to the user. + * + * @see batch + * @see schemaapi + * @see hook_update_last_removed() + * @see update_get_update_list() + */ +function hook_update_N(&$sandbox) { + // For non-multipass updates, the signature can simply be; + // function hook_update_N() { + + // For most updates, the following is sufficient. + db_add_field('mytable1', 'newcol', array('type' => 'int', 'not null' => TRUE, 'description' => 'My new integer column.')); + + // However, for more complex operations that may take a long time, + // you may hook into Batch API as in the following example. + + // Update 3 users at a time to have an exclamation point after their names. + // (They're really happy that we can do batch API in this hook!) + if (!isset($sandbox['progress'])) { + $sandbox['progress'] = 0; + $sandbox['current_uid'] = 0; + // We'll -1 to disregard the uid 0... + $sandbox['max'] = db_query('SELECT COUNT(DISTINCT uid) FROM {users}')->fetchField() - 1; + } + + $users = db_select('users', 'u') + ->fields('u', array('uid', 'name')) + ->condition('uid', $sandbox['current_uid'], '>') + ->range(0, 3) + ->orderBy('uid', 'ASC') + ->execute(); + + foreach ($users as $user) { + $user->setUsername($user->getUsername() . '!'); + db_update('users') + ->fields(array('name' => $user->getUsername())) + ->condition('uid', $user->id()) + ->execute(); + + $sandbox['progress']++; + $sandbox['current_uid'] = $user->id(); + } + + $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); + + if ($some_error_condition_met) { + // In case of an error, simply throw an exception with an error message. + throw new UpdateException('Something went wrong; here is what you should do.'); + } + + // To display a message to the user when the update is completed, return it. + // If you do not want to display a completion message, simply return nothing. + return t('The update did what it was supposed to do.'); +} + +/** + * Return an array of information about module update dependencies. + * + * This can be used to indicate update functions from other modules that your + * module's update functions depend on, or vice versa. It is used by the update + * system to determine the appropriate order in which updates should be run, as + * well as to search for missing dependencies. + * + * Implementations of this hook should be placed in a mymodule.install file in + * the same directory as mymodule.module. + * + * @return + * A multidimensional array containing information about the module update + * dependencies. The first two levels of keys represent the module and update + * number (respectively) for which information is being returned, and the + * value is an array of information about that update's dependencies. Within + * this array, each key represents a module, and each value represents the + * number of an update function within that module. In the event that your + * update function depends on more than one update from a particular module, + * you should always list the highest numbered one here (since updates within + * a given module always run in numerical order). + * + * @see update_resolve_dependencies() + * @see hook_update_N() + */ +function hook_update_dependencies() { + // Indicate that the mymodule_update_8001() function provided by this module + // must run after the another_module_update_8003() function provided by the + // 'another_module' module. + $dependencies['mymodule'][8001] = array( + 'another_module' => 8003, + ); + // Indicate that the mymodule_update_8002() function provided by this module + // must run before the yet_another_module_update_8005() function provided by + // the 'yet_another_module' module. (Note that declaring dependencies in this + // direction should be done only in rare situations, since it can lead to the + // following problem: If a site has already run the yet_another_module + // module's database updates before it updates its codebase to pick up the + // newest mymodule code, then the dependency declared here will be ignored.) + $dependencies['yet_another_module'][8005] = array( + 'mymodule' => 8002, + ); + return $dependencies; +} + +/** + * Return a number which is no longer available as hook_update_N(). + * + * If you remove some update functions from your mymodule.install file, you + * should notify Drupal of those missing functions. This way, Drupal can + * ensure that no update is accidentally skipped. + * + * Implementations of this hook should be placed in a mymodule.install file in + * the same directory as mymodule.module. + * + * @return + * An integer, corresponding to hook_update_N() which has been removed from + * mymodule.install. + * + * @see hook_update_N() + */ +function hook_update_last_removed() { + // We've removed the 8.x-1.x version of mymodule, including database updates. + // The next update function is mymodule_update_8200(). + return 8103; +} + +/** + * Provide information on Updaters (classes that can update Drupal). + * + * Drupal\Core\Updater\Updater is a class that knows how to update various parts + * of the Drupal file system, for example to update modules that have newer + * releases, or to install a new theme. + * + * @return + * An associative array of information about the updater(s) being provided. + * This array is keyed by a unique identifier for each updater, and the + * values are subarrays that can contain the following keys: + * - class: The name of the PHP class which implements this updater. + * - name: Human-readable name of this updater. + * - weight: Controls what order the Updater classes are consulted to decide + * which one should handle a given task. When an update task is being run, + * the system will loop through all the Updater classes defined in this + * registry in weight order and let each class respond to the task and + * decide if each Updater wants to handle the task. In general, this + * doesn't matter, but if you need to override an existing Updater, make + * sure your Updater has a lighter weight so that it comes first. + * + * @see drupal_get_updaters() + * @see hook_updater_info_alter() + */ +function hook_updater_info() { + return array( + 'module' => array( + 'class' => 'Drupal\Core\Updater\Module', + 'name' => t('Update modules'), + 'weight' => 0, + ), + 'theme' => array( + 'class' => 'Drupal\Core\Updater\Theme', + 'name' => t('Update themes'), + 'weight' => 0, + ), + ); +} + +/** + * Alter the Updater information array. + * + * An Updater is a class that knows how to update various parts of the Drupal + * file system, for example to update modules that have newer releases, or to + * install a new theme. + * + * @param array $updaters + * Associative array of updaters as defined through hook_updater_info(). + * Alter this array directly. + * + * @see drupal_get_updaters() + * @see hook_updater_info() + */ +function hook_updater_info_alter(&$updaters) { + // Adjust weight so that the theme Updater gets a chance to handle a given + // update task before module updaters. + $updaters['theme']['weight'] = -1; +} + +/** + * Check installation requirements and do status reporting. + * + * This hook has three closely related uses, determined by the $phase argument: + * - Checking installation requirements ($phase == 'install'). + * - Checking update requirements ($phase == 'update'). + * - Status reporting ($phase == 'runtime'). + * + * Note that this hook, like all others dealing with installation and updates, + * must reside in a module_name.install file, or it will not properly abort + * the installation of the module if a critical requirement is missing. + * + * During the 'install' phase, modules can for example assert that + * library or server versions are available or sufficient. + * Note that the installation of a module can happen during installation of + * Drupal itself (by install.php) with an installation profile or later by hand. + * As a consequence, install-time requirements must be checked without access + * to the full Drupal API, because it is not available during install.php. + * If a requirement has a severity of REQUIREMENT_ERROR, install.php will abort + * or at least the module will not install. + * Other severity levels have no effect on the installation. + * Module dependencies do not belong to these installation requirements, + * but should be defined in the module's .info.yml file. + * + * The 'runtime' phase is not limited to pure installation requirements + * but can also be used for more general status information like maintenance + * tasks and security issues. + * The returned 'requirements' will be listed on the status report in the + * administration section, with indication of the severity level. + * Moreover, any requirement with a severity of REQUIREMENT_ERROR severity will + * result in a notice on the administration configuration page. + * + * @param $phase + * The phase in which requirements are checked: + * - install: The module is being installed. + * - update: The module is enabled and update.php is run. + * - runtime: The runtime requirements are being checked and shown on the + * status report page. + * + * @return + * An associative array where the keys are arbitrary but must be unique (it + * is suggested to use the module short name as a prefix) and the values are + * themselves associative arrays with the following elements: + * - title: The name of the requirement. + * - value: The current value (e.g., version, time, level, etc). During + * install phase, this should only be used for version numbers, do not set + * it if not applicable. + * - description: The description of the requirement/status. + * - severity: The requirement's result/severity level, one of: + * - REQUIREMENT_INFO: For info only. + * - REQUIREMENT_OK: The requirement is satisfied. + * - REQUIREMENT_WARNING: The requirement failed with a warning. + * - REQUIREMENT_ERROR: The requirement failed with an error. + */ +function hook_requirements($phase) { + $requirements = array(); + + // Report Drupal version + if ($phase == 'runtime') { + $requirements['drupal'] = array( + 'title' => t('Drupal'), + 'value' => \Drupal::VERSION, + 'severity' => REQUIREMENT_INFO + ); + } + + // Test PHP version + $requirements['php'] = array( + 'title' => t('PHP'), + 'value' => ($phase == 'runtime') ? \Drupal::l(phpversion(), new Url('system.php')) : phpversion(), + ); + if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) { + $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); + $requirements['php']['severity'] = REQUIREMENT_ERROR; + } + + // Report cron status + if ($phase == 'runtime') { + $cron_last = \Drupal::state()->get('system.cron_last'); + + if (is_numeric($cron_last)) { + $requirements['cron']['value'] = t('Last run !time ago', array('!time' => \Drupal::service('date.formatter')->formatInterval(REQUEST_TIME - $cron_last))); + } + else { + $requirements['cron'] = array( + 'description' => t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for configuring cron jobs.', array('@url' => 'http://drupal.org/cron')), + 'severity' => REQUIREMENT_ERROR, + 'value' => t('Never run'), + ); + } + + $requirements['cron']['description'] .= ' ' . t('You can run cron manually.', array('@cron' => \Drupal::url('system.run_cron'))); + + $requirements['cron']['title'] = t('Cron maintenance tasks'); + } + + return $requirements; +} + +/** + * @} End of "addtogroup hooks". + */ diff --git a/drupal/core/modules/system/src/Controller/Http4xxController.php b/drupal/core/modules/system/src/Controller/Http4xxController.php new file mode 100644 index 00000000..7add79e0 --- /dev/null +++ b/drupal/core/modules/system/src/Controller/Http4xxController.php @@ -0,0 +1,41 @@ + $this->t('You are not authorized to access this page.'), + ]; + } + + /** + * The default 404 content. + * + * @return array + * A render array containing the message to display for 404 pages. + */ + public function on404() { + return [ + '#markup' => $this->t('The requested page could not be found.'), + ]; + } + +} diff --git a/drupal/core/modules/system/src/Entity/Menu.php b/drupal/core/modules/system/src/Entity/Menu.php index d44b6988..bf5d77d5 100644 --- a/drupal/core/modules/system/src/Entity/Menu.php +++ b/drupal/core/modules/system/src/Entity/Menu.php @@ -34,21 +34,21 @@ class Menu extends ConfigEntityBase implements MenuInterface { * * @var string */ - public $id; + protected $id; /** * The human-readable name of the menu entity. * * @var string */ - public $label; + protected $label; /** * The menu description. * * @var string */ - public $description; + protected $description; /** * The locked status of this menu. @@ -57,6 +57,13 @@ class Menu extends ConfigEntityBase implements MenuInterface { */ protected $locked = FALSE; + /** + * {@inheritdoc} + */ + public function getDescription() { + return $this->description; + } + /** * {@inheritdoc} */ diff --git a/drupal/core/modules/system/src/MenuInterface.php b/drupal/core/modules/system/src/MenuInterface.php index d9375c07..340d9ed6 100644 --- a/drupal/core/modules/system/src/MenuInterface.php +++ b/drupal/core/modules/system/src/MenuInterface.php @@ -14,6 +14,14 @@ */ interface MenuInterface extends ConfigEntityInterface { + /** + * Returns the description of the menu. + * + * @return string + * Description of the menu. + */ + public function getDescription(); + /** * Determines if this menu is locked. * diff --git a/drupal/core/modules/system/src/Plugin/Block/SystemMainBlock.php b/drupal/core/modules/system/src/Plugin/Block/SystemMainBlock.php index 4504081e..caa1bdf1 100644 --- a/drupal/core/modules/system/src/Plugin/Block/SystemMainBlock.php +++ b/drupal/core/modules/system/src/Plugin/Block/SystemMainBlock.php @@ -8,6 +8,7 @@ namespace Drupal\system\Plugin\Block; use Drupal\Core\Block\BlockBase; +use Drupal\Core\Block\MainContentBlockPluginInterface; use Drupal\Core\Form\FormStateInterface; /** @@ -18,15 +19,27 @@ * admin_label = @Translation("Main page content") * ) */ -class SystemMainBlock extends BlockBase { +class SystemMainBlock extends BlockBase implements MainContentBlockPluginInterface { + + /** + * The render array representing the main page content. + * + * @var array + */ + protected $mainContent; + + /** + * {@inheritdoc} + */ + public function setMainContent(array $main_content) { + $this->mainContent = $main_content; + } /** * {@inheritdoc} */ public function build() { - return array( - drupal_set_page_content() - ); + return $this->mainContent; } /** diff --git a/drupal/core/modules/system/src/Tests/Common/JavaScriptTest.php b/drupal/core/modules/system/src/Tests/Common/JavaScriptTest.php index 86807657..a8a48742 100644 --- a/drupal/core/modules/system/src/Tests/Common/JavaScriptTest.php +++ b/drupal/core/modules/system/src/Tests/Common/JavaScriptTest.php @@ -8,6 +8,7 @@ namespace Drupal\system\Tests\Common; use Drupal\Component\Serialization\Json; +use Drupal\Component\Utility\Unicode; use Drupal\simpletest\DrupalUnitTestBase; use Drupal\Component\Utility\Crypt; @@ -233,7 +234,7 @@ function testHeaderSetting() { $endToken = '}'; $start = strpos($javascript, $startToken) + strlen($startToken); $end = strrpos($javascript, $endToken); - $json = drupal_substr($javascript, $start, $end - $start + 1); + $json = Unicode::substr($javascript, $start, $end - $start + 1); $parsed_settings = Json::decode($json); // Test whether the two real world cases are handled correctly. diff --git a/drupal/core/modules/system/src/Tests/Common/RenderTest.php b/drupal/core/modules/system/src/Tests/Common/RenderTest.php index 381ff8d0..739e3b5d 100644 --- a/drupal/core/modules/system/src/Tests/Common/RenderTest.php +++ b/drupal/core/modules/system/src/Tests/Common/RenderTest.php @@ -808,10 +808,10 @@ function testDrupalRenderRenderCachePlaceholder() { ), ), '#markup' => $placeholder, - '#prefix' => '', - '#suffix' => '' + '#prefix' => '
',
+      '#suffix' => '
', ); - $expected_output = '' . $context['bar'] . ''; + $expected_output = '
' . $context['bar'] . '
'; // #cache disabled. $element = $test_element; @@ -852,7 +852,7 @@ function testDrupalRenderRenderCachePlaceholder() { $this->assertIdentical($token, $expected_token, 'The tokens are identical'); // Verify the token is in the cached element. $expected_element = array( - '#markup' => '', + '#markup' => '
', '#attached' => array(), '#post_render_cache' => array( 'common_test_post_render_cache_placeholder' => array( @@ -895,11 +895,11 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { ], ], '#markup' => $placeholder, - '#prefix' => '', - '#suffix' => '' + '#prefix' => '
',
+        '#suffix' => '
' ], ]; - $expected_output = '' . $context['bar'] . '' . "\n"; + $expected_output = '
' . $context['bar'] . '
' . "\n"; // #cache disabled. $element = $test_element; @@ -943,7 +943,7 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { $this->assertIdentical($token, $expected_token, 'The tokens are identical for the child element'); // Verify the token is in the cached element. $expected_element = array( - '#markup' => '', + '#markup' => '
', '#attached' => array(), '#post_render_cache' => array( 'common_test_post_render_cache_placeholder' => array( @@ -969,7 +969,7 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { $this->assertIdentical($token, $expected_token, 'The tokens are identical for the parent element'); // Verify the token is in the cached element. $expected_element = array( - '#markup' => '' . "\n", + '#markup' => '
' . "\n", '#attached' => array(), '#post_render_cache' => array( 'common_test_post_render_cache_placeholder' => array( @@ -999,7 +999,7 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { $this->assertIdentical($token, $expected_token, 'The tokens are identical for the child element'); // Verify the token is in the cached element. $expected_element = array( - '#markup' => '', + '#markup' => '
', '#attached' => array(), '#post_render_cache' => array( 'common_test_post_render_cache_placeholder' => array( diff --git a/drupal/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php b/drupal/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php index b79eb36f..3c43f184 100644 --- a/drupal/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php +++ b/drupal/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php @@ -71,7 +71,7 @@ protected function getTestKernel(Request $request, array $modules_enabled = NULL /** * Tests DIC compilation. */ - function testCompileDIC() { + public function testCompileDIC() { // @todo: write a memory based storage backend for testing. $modules_enabled = array( 'system' => 'system', diff --git a/drupal/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php b/drupal/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php index ada31f20..c1dc0fff 100644 --- a/drupal/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php +++ b/drupal/core/modules/system/src/Tests/Entity/EntityUnitTestBase.php @@ -20,7 +20,7 @@ abstract class EntityUnitTestBase extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('entity', 'user', 'system', 'field', 'text', 'filter', 'entity_test'); + public static $modules = array('entity', 'user', 'system', 'field', 'text', 'filter', 'entity_test', 'entity_reference'); /** * The entity manager service. diff --git a/drupal/core/modules/system/src/Tests/Entity/FieldAccessTest.php b/drupal/core/modules/system/src/Tests/Entity/FieldAccessTest.php index e87eb44e..33d0e394 100644 --- a/drupal/core/modules/system/src/Tests/Entity/FieldAccessTest.php +++ b/drupal/core/modules/system/src/Tests/Entity/FieldAccessTest.php @@ -22,7 +22,7 @@ class FieldAccessTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('entity', 'entity_test', 'field', 'system', 'text', 'filter', 'user'); + public static $modules = array('entity', 'entity_test', 'field', 'system', 'text', 'filter', 'user', 'entity_reference'); /** * Holds the currently active global user ID that initiated the test run. diff --git a/drupal/core/modules/system/src/Tests/File/UrlRewritingTest.php b/drupal/core/modules/system/src/Tests/File/UrlRewritingTest.php index 2c428aef..8b2f4551 100644 --- a/drupal/core/modules/system/src/Tests/File/UrlRewritingTest.php +++ b/drupal/core/modules/system/src/Tests/File/UrlRewritingTest.php @@ -56,6 +56,18 @@ function testShippedFileURL() { $filepath = 'core/misc/favicon.ico'; $url = file_create_url($filepath); $this->assertEqual('/' . base_path() . '/' . $filepath, $url, 'Correctly generated a protocol-relative URL for a shipped file.'); + + // Test alteration of file URLs with query strings and/or fragment. + \Drupal::state()->delete('file_test.hook_file_url_alter'); + $filepath = 'core/misc/favicon.ico'; + $url = file_create_url($filepath . '?foo'); + $this->assertEqual($GLOBALS['base_url'] . '/' . $filepath . '?foo=', $url, 'Correctly generated url. The query string is present.'); + $url = file_create_url($filepath . '?foo=bar'); + $this->assertEqual($GLOBALS['base_url'] . '/' . $filepath . '?foo=bar', $url, 'Correctly generated url. The query string is present.'); + $url = file_create_url($filepath . '#v1.2'); + $this->assertEqual($GLOBALS['base_url'] . '/' . $filepath . '#v1.2', $url, 'Correctly generated url. The fragment is present.'); + $url = file_create_url($filepath . '?foo=bar#v1.2'); + $this->assertEqual($GLOBALS['base_url'] . '/' . $filepath . '?foo=bar#v1.2', $url, 'Correctly generated url. The query string amd fragment is present.'); } /** diff --git a/drupal/core/modules/system/src/Tests/Form/FormCacheTest.php b/drupal/core/modules/system/src/Tests/Form/FormCacheTest.php index 79bf6809..21244044 100644 --- a/drupal/core/modules/system/src/Tests/Form/FormCacheTest.php +++ b/drupal/core/modules/system/src/Tests/Form/FormCacheTest.php @@ -61,7 +61,7 @@ function testCacheToken() { \Drupal::formBuilder()->setCache($this->form_build_id, $this->form, $this->form_state); $cached_form_state = new FormState(); - $cached_form = form_get_cache($this->form_build_id, $cached_form_state); + $cached_form = \Drupal::formBuilder()->getCache($this->form_build_id, $cached_form_state); $this->assertEqual($this->form['#property'], $cached_form['#property']); $this->assertTrue(!empty($cached_form['#cache_token']), 'Form has a cache token'); $this->assertEqual($this->form_state->get('example'), $cached_form_state->get('example')); diff --git a/drupal/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php b/drupal/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php index b6ed513a..0d925b78 100644 --- a/drupal/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php +++ b/drupal/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php @@ -77,14 +77,14 @@ public function testHtml403() { /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $kernel */ $kernel = \Drupal::getContainer()->get('http_kernel'); - $response = $kernel->handle($request); + $response = $kernel->handle($request)->prepare($request); $this->assertEqual($response->getStatusCode(), Response::HTTP_FORBIDDEN); - $this->assertEqual($response->headers->get('Content-type'), 'text/html'); + $this->assertEqual($response->headers->get('Content-type'), 'text/html; charset=UTF-8'); } /** - * Tests the exception handling for HTML and 403 status code. + * Tests the exception handling for HTML and 404 status code. */ public function testHtml404() { $request = Request::create('/not-found'); @@ -93,27 +93,10 @@ public function testHtml404() { /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $kernel */ $kernel = \Drupal::getContainer()->get('http_kernel'); - $response = $kernel->handle($request); + $response = $kernel->handle($request)->prepare($request); $this->assertEqual($response->getStatusCode(), Response::HTTP_NOT_FOUND); - $this->assertEqual($response->headers->get('Content-type'), 'text/html'); - } - - /** - * Tests the exception handling for HTML and 405 status code. - */ - public function testHtml405() { - $request = Request::create('/admin', 'NOT_EXISTING'); - $request->headers->set('Accept', 'text/html'); - $request->setFormat('html', ['text/html']); - - /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $kernel */ - $kernel = \Drupal::getContainer()->get('http_kernel'); - $response = $kernel->handle($request); - - $this->assertEqual($response->getStatusCode(), Response::HTTP_METHOD_NOT_ALLOWED); - $this->assertEqual($response->headers->get('Content-type'), 'text/html'); - $this->assertEqual($response->getContent(), 'Method Not Allowed'); + $this->assertEqual($response->headers->get('Content-type'), 'text/html; charset=UTF-8'); } } diff --git a/drupal/core/modules/system/system.admin.inc b/drupal/core/modules/system/system.admin.inc index 02316677..bc83598f 100644 --- a/drupal/core/modules/system/system.admin.inc +++ b/drupal/core/modules/system/system.admin.inc @@ -7,6 +7,7 @@ use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\Xss; +use Drupal\Component\Utility\Html; use Drupal\Core\Cache\Cache; use Drupal\Core\Extension\Extension; use Drupal\Core\Render\Element; @@ -227,7 +228,8 @@ function theme_system_modules_details($variables) { $row[] = array('class' => array('checkbox'), 'data' => drupal_render($module['enable'])); // Add the module label and expand/collapse functionalty. - $col2 = ''; + $id = Html::getUniqueId('module-' . $key); + $col2 = ''; $row[] = array('class' => array('module'), 'data' => SafeMarkup::set($col2)); // Add the description, along with any modules it requires. @@ -259,7 +261,7 @@ function theme_system_modules_details($variables) { '#type' => 'details', '#title' => SafeMarkup::set(' ' . drupal_render($module['description']) . ''), '#attributes' => array('id' => $module['enable']['#id'] . '-description'), - '#description' => SafeMarkup::set($description), + '#description' => $description, ); $col4 = drupal_render($details); $row[] = array('class' => array('description', 'expand'), 'data' => $col4); diff --git a/drupal/core/modules/system/system.api.php b/drupal/core/modules/system/system.api.php index bdbc03f3..e306b092 100644 --- a/drupal/core/modules/system/system.api.php +++ b/drupal/core/modules/system/system.api.php @@ -7,47 +7,12 @@ use Drupal\Component\Utility\String; use Drupal\Core\Url; -use Drupal\Core\Utility\UpdateException; /** * @addtogroup hooks * @{ */ -/** - * Defines one or more hooks that are exposed by a module. - * - * Normally hooks do not need to be explicitly defined. However, by declaring a - * hook explicitly, a module may define a "group" for it. Modules that implement - * a hook may then place their implementation in either $module.module or in - * $module.$group.inc. If the hook is located in $module.$group.inc, then that - * file will be automatically loaded when needed. - * In general, hooks that are rarely invoked and/or are very large should be - * placed in a separate include file, while hooks that are very short or very - * frequently called should be left in the main module file so that they are - * always available. - * - * @return - * An associative array whose keys are hook names and whose values are an - * associative array containing: - * - group: A string defining the group to which the hook belongs. The module - * system will determine whether a file with the name $module.$group.inc - * exists, and automatically load it when required. - * - * See system_hook_info() for all hook groups defined by Drupal core. - * - * @see hook_hook_info_alter(). - */ -function hook_hook_info() { - $hooks['token_info'] = array( - 'group' => 'tokens', - ); - $hooks['tokens'] = array( - 'group' => 'tokens', - ); - return $hooks; -} - /** * Perform periodic actions. * @@ -118,271 +83,6 @@ function hook_queue_info_alter(&$queues) { $queues['aggregator_feeds']['cron']['time'] = 90; } -/** - * Allows modules to declare their own Form API element types and specify their - * default values. - * - * This hook allows modules to declare their own form element types and to - * specify their default values. The values returned by this hook will be - * merged with the elements returned by form constructor implementations and so - * can return defaults for any Form APIs keys in addition to those explicitly - * documented by \Drupal\Core\Render\ElementInfoManagerInterface::getInfo(). - * - * @return array - * An associative array with structure identical to that of the return value - * of \Drupal\Core\Render\ElementInfoManagerInterface::getInfo(). - * - * @deprecated Use an annotated class instead, see - * \Drupal\Core\Render\Element\ElementInterface. - * - * @see hook_element_info_alter() - */ -function hook_element_info() { - $types['filter_format'] = array( - '#input' => TRUE, - ); - return $types; -} - -/** - * Alter the element type information returned from modules. - * - * A module may implement this hook in order to alter the element type defaults - * defined by a module. - * - * @param array $types - * An associative array with structure identical to that of the return value - * of \Drupal\Core\Render\ElementInfoManagerInterface::getInfo(). - * - * @see hook_element_info() - */ -function hook_element_info_alter(array &$types) { - // Decrease the default size of textfields. - if (isset($types['textfield']['#size'])) { - $types['textfield']['#size'] = 40; - } -} - -/** - * Perform necessary alterations to the JavaScript before it is presented on - * the page. - * - * @param $javascript - * An array of all JavaScript being presented on the page. - * - * @see _drupal_add_js() - * @see drupal_get_js() - * @see drupal_js_defaults() - */ -function hook_js_alter(&$javascript) { - // Swap out jQuery to use an updated version of the library. - $javascript['core/assets/vendor/jquery/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js'; -} - -/** - * Alters the JavaScript/CSS library registry. - * - * Allows certain, contributed modules to update libraries to newer versions - * while ensuring backwards compatibility. In general, such manipulations should - * only be done by designated modules, since most modules that integrate with a - * certain library also depend on the API of a certain library version. - * - * @param $libraries - * The JavaScript/CSS libraries provided by $module. Keyed by internal library - * name and passed by reference. - * @param $module - * The name of the module that registered the libraries. - */ -function hook_library_info_alter(&$libraries, $module) { - // Update Farbtastic to version 2.0. - if ($module == 'core' && isset($libraries['jquery.farbtastic'])) { - // Verify existing version is older than the one we are updating to. - if (version_compare($libraries['jquery.farbtastic']['version'], '2.0', '<')) { - // Update the existing Farbtastic to version 2.0. - $libraries['jquery.farbtastic']['version'] = '2.0'; - // To accurately replace library files, the order of files and the options - // of each file have to be retained; e.g., like this: - $old_path = 'assets/vendor/farbtastic'; - // Since the replaced library files are no longer located in a directory - // relative to the original extension, specify an absolute path (relative - // to DRUPAL_ROOT / base_path()) to the new location. - $new_path = '/' . drupal_get_path('module', 'farbtastic_update') . '/js'; - $new_js = array(); - $replacements = array( - $old_path . '/farbtastic.js' => $new_path . '/farbtastic-2.0.js', - ); - foreach ($libraries['jquery.farbtastic']['js'] as $source => $options) { - if (isset($replacements[$source])) { - $new_js[$replacements[$source]] = $options; - } - else { - $new_js[$source] = $options; - } - } - $libraries['jquery.farbtastic']['js'] = $new_js; - } - } -} - -/** - * Alters a JavaScript/CSS library before it is attached. - * - * Allows modules and themes to dynamically attach further assets to a library - * when it is added to the page; e.g., to add JavaScript settings. - * - * This hook is only invoked once per library and page. - * - * @param array $library - * The JavaScript/CSS library that is being added. - * @param string $name - * The name of the library. - * - * @see _drupal_add_library() - */ -function hook_library_alter(array &$library, $name) { - if ($name == 'core/jquery.ui.datepicker') { - // Note: If the added assets do not depend on additional request-specific - // data supplied here, consider to statically register it directly via - // hook_library_info_alter() already. - $library['dependencies'][] = 'locale/drupal.locale.datepicker'; - - $language_interface = \Drupal::languageManager()->getCurrentLanguage(); - $settings['jquery']['ui']['datepicker'] = array( - 'isRTL' => $language_interface->getDirection() == LanguageInterface::DIRECTION_RTL, - 'firstDay' => \Drupal::config('system.date')->get('first_day'), - ); - $library['js'][] = array( - 'type' => 'setting', - 'data' => $settings, - ); - } -} - -/** - * Alter CSS files before they are output on the page. - * - * @param $css - * An array of all CSS items (files and inline CSS) being requested on the page. - * - * @see _drupal_add_css() - * @see drupal_get_css() - */ -function hook_css_alter(&$css) { - // Remove defaults.css file. - unset($css[drupal_get_path('module', 'system') . '/defaults.css']); -} - -/** - * Alter the Ajax command data that is sent to the client. - * - * @param \Drupal\Core\Ajax\CommandInterface[] $data - * An array of all the rendered commands that will be sent to the client. - * - * @see \Drupal\Core\Ajax\AjaxResponse::ajaxRender() - */ -function hook_ajax_render_alter(array &$data) { - // Inject any new status messages into the content area. - $status_messages = array('#theme' => 'status_messages'); - $command = new \Drupal\Core\Ajax\PrependCommand('#block-system-main .content', drupal_render($status_messages)); - $data[] = $command->render(); -} - -/** - * Add attachments (typically assets) to a page before it is rendered. - * - * Kept around for backwards compatibility, but now allows only attachments to - * be added, adding renderable arrays is no longer allowed. - * - * @deprecated in Drupal 8.x, will be removed before Drupal 9.0. Successor: - * hook_page_attachments(). Is now effectively an alias of that hook. - * - * @param $page - * The page to which to add attachments. - * - * @see hook_page_attachments() - */ -function hook_page_build(&$page) { - $path = drupal_get_path('module', 'foo'); - // Add JavaScript/CSS assets to all pages. - // @see drupal_process_attached() - $page['#attached']['js'][$path . '/foo.js'] = array('every_page' => TRUE); - $page['#attached']['css'][$path . '/foo.base.css'] = array('every_page' => TRUE); - $page['#attached']['css'][$path . '/foo.theme.css'] = array('every_page' => TRUE); - - // Add a special CSS file to a certain page only. - if (drupal_is_front_page()) { - $page['#attached']['css'][] = $path . '/foo.front.css'; - } -} - -/** - * Add attachments (typically assets) to a page before it is rendered. - * - * Use this hook when you want to conditionally add attachments to a page. - * - * If you want to alter the attachments added by other modules or if your module - * depends on the elements of other modules, use hook_page_attachments_alter() - * instead, which runs after this hook. - * - * @param array &$page - * An empty renderable array representing the page. - * - * @see hook_page_attachments_alter() - */ -function hook_page_attachments(array &$page) { - // Unconditionally attach an asset to the page. - $page['#attached']['library'][] = 'core/domready'; - - // Conditionally attach an asset to the page. - if (!\Drupal::currentUser()->hasPermission('may pet kittens')) { - $page['#attached']['library'][] = 'core/jquery'; - } -} - -/** - * Alter attachments (typically assets) to a page before it is rendered. - * - * Use this hook when you want to remove or alter attachments on the page, or - * add attachments to the page that depend on aonther module's attachments (this - * hook runs after hook_page_attachments(). - * - * If you want to alter the attachments added by other modules or if your module - * depends on the elements of other modules, use hook_page_attachments_alter() - * instead, which runs after this hook. - * - * @param array &$page - * An empty renderable array representing the page. - * - * @see hook_page_attachments_alter() - */ -function hook_page_attachments_alter(array &$page) { - // Conditionally remove an asset. - if (in_array('core/jquery', $page['#attached']['library'])) { - $index = array_search('core/jquery', $page['#attached']['library']); - unset($page['#attached']['library'][$index]); - } -} - -/** - * Add a renderable array to the top of the page. - * - * @param array $page_top - * A renderable array representing the top of the page. - */ -function hook_page_top(array &$page_top) { - $page_top['mymodule'] = ['#markup' => 'This is the top.']; -} - -/** - * Add a renderable array to the bottom of the page. - * - * @param array $page_top - * A renderable array representing the bottom of the page. - */ -function hook_page_bottom(array &$page) { - $page_bottom['mymodule'] = ['#markup' => 'This is the bottom.']; -} - /** * Alters all the menu links discovered by the menu link plugin manager. * @@ -595,167 +295,6 @@ function hook_contextual_links_plugins_alter(array &$contextual_links) { $contextual_links['menu_edit']['title'] = 'Edit the menu'; } -/** - * Perform alterations before a page is rendered. - * - * Kept around for backwards compatibility, but now allows only attachments to - * be added, altering the renderable array for the page is no longer allowed. - * - * @deprecated in Drupal 8.x, will be removed before Drupal 9.0. Successor: - * hook_page_attachments_alter(). Is now effectively an alias of that hook. - * - * Use this hook when you want to remove or alter attachments at the page - * level, or add attachments at the page level that depend on an other module's - * attachments (this hook runs after hook_page_build(). - * - * @param $page - * An empty renderable array representing the page. - * - * @see hook_page_build() - */ -function hook_page_alter(&$page) { - // Conditionally remove an asset. - if (in_array('core/jquery', $page['#attached']['library'])) { - $index = array_search('core/jquery', $page['#attached']['library']); - unset($page['#attached']['library'][$index]); - } -} - -/** - * Perform alterations before a form is rendered. - * - * One popular use of this hook is to add form elements to the node form. When - * altering a node form, the node entity can be retrieved by invoking - * $form_state->getFormObject()->getEntity(). - * - * In addition to hook_form_alter(), which is called for all forms, there are - * two more specific form hooks available. The first, - * hook_form_BASE_FORM_ID_alter(), allows targeting of a form/forms via a base - * form (if one exists). The second, hook_form_FORM_ID_alter(), can be used to - * target a specific form directly. - * - * The call order is as follows: all existing form alter functions are called - * for module A, then all for module B, etc., followed by all for any base - * theme(s), and finally for the theme itself. The module order is determined - * by system weight, then by module name. - * - * Within each module, form alter hooks are called in the following order: - * first, hook_form_alter(); second, hook_form_BASE_FORM_ID_alter(); third, - * hook_form_FORM_ID_alter(). So, for each module, the more general hooks are - * called first followed by the more specific. - * - * @param $form - * Nested array of form elements that comprise the form. - * @param $form_state - * The current state of the form. The arguments that - * \Drupal::formBuilder()->getForm() was originally called with are available - * in the array $form_state->getBuildInfo()['args']. - * @param $form_id - * String representing the name of the form itself. Typically this is the - * name of the function that generated the form. - * - * @see hook_form_BASE_FORM_ID_alter() - * @see hook_form_FORM_ID_alter() - * @see forms_api_reference.html - */ -function hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { - if (isset($form['type']) && $form['type']['#value'] . '_node_settings' == $form_id) { - $upload_enabled_types = \Drupal::config('mymodule.settings')->get('upload_enabled_types'); - $form['workflow']['upload_' . $form['type']['#value']] = array( - '#type' => 'radios', - '#title' => t('Attachments'), - '#default_value' => in_array($form['type']['#value'], $upload_enabled_types) ? 1 : 0, - '#options' => array(t('Disabled'), t('Enabled')), - ); - // Add a custom submit handler to save the array of types back to the config file. - $form['actions']['submit']['#submit'][] = 'mymodule_upload_enabled_types_submit'; - } -} - -/** - * Provide a form-specific alteration instead of the global hook_form_alter(). - * - * Modules can implement hook_form_FORM_ID_alter() to modify a specific form, - * rather than implementing hook_form_alter() and checking the form ID, or - * using long switch statements to alter multiple forms. - * - * Form alter hooks are called in the following order: hook_form_alter(), - * hook_form_BASE_FORM_ID_alter(), hook_form_FORM_ID_alter(). See - * hook_form_alter() for more details. - * - * @param $form - * Nested array of form elements that comprise the form. - * @param $form_state - * The current state of the form. The arguments that - * \Drupal::formBuilder()->getForm() was originally called with are available - * in the array $form_state->getBuildInfo()['args']. - * @param $form_id - * String representing the name of the form itself. Typically this is the - * name of the function that generated the form. - * - * @see hook_form_alter() - * @see hook_form_BASE_FORM_ID_alter() - * @see \Drupal\Core\Form\FormBuilderInterface::prepareForm() - * @see forms_api_reference.html - */ -function hook_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { - // Modification for the form with the given form ID goes here. For example, if - // FORM_ID is "user_register_form" this code would run only on the user - // registration form. - - // Add a checkbox to registration form about agreeing to terms of use. - $form['terms_of_use'] = array( - '#type' => 'checkbox', - '#title' => t("I agree with the website's terms and conditions."), - '#required' => TRUE, - ); -} - -/** - * Provide a form-specific alteration for shared ('base') forms. - * - * By default, when \Drupal::formBuilder()->getForm() is called, Drupal looks - * for a function with the same name as the form ID, and uses that function to - * build the form. In contrast, base forms allow multiple form IDs to be mapped - * to a single base (also called 'factory') form function. - * - * Modules can implement hook_form_BASE_FORM_ID_alter() to modify a specific - * base form, rather than implementing hook_form_alter() and checking for - * conditions that would identify the shared form constructor. - * - * To identify the base form ID for a particular form (or to determine whether - * one exists) check the $form_state. The base form ID is stored under - * $form_state->getBuildInfo()['base_form_id']. - * - * Form alter hooks are called in the following order: hook_form_alter(), - * hook_form_BASE_FORM_ID_alter(), hook_form_FORM_ID_alter(). See - * hook_form_alter() for more details. - * - * @param $form - * Nested array of form elements that comprise the form. - * @param $form_state - * The current state of the form. - * @param $form_id - * String representing the name of the form itself. Typically this is the - * name of the function that generated the form. - * - * @see hook_form_alter() - * @see hook_form_FORM_ID_alter() - * @see \Drupal\Core\Form\FormBuilderInterface::prepareForm() - */ -function hook_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { - // Modification for the form with the given BASE_FORM_ID goes here. For - // example, if BASE_FORM_ID is "node_form", this code would run on every - // node form, regardless of node type. - - // Add a checkbox to the node form about agreeing to terms of use. - $form['terms_of_use'] = array( - '#type' => 'checkbox', - '#title' => t("I agree with the website's terms and conditions."), - '#required' => TRUE, - ); -} - /** * Alter an email message created with the drupal_mail() function. * @@ -813,42 +352,6 @@ function hook_mail_alter(&$message) { } } -/** - * Alter the registry of modules implementing a hook. - * - * This hook is invoked during \Drupal::moduleHandler()->getImplementations(). - * A module may implement this hook in order to reorder the implementing - * modules, which are otherwise ordered by the module's system weight. - * - * Note that hooks invoked using \Drupal::moduleHandler->alter() can have - * multiple variations(such as hook_form_alter() and hook_form_FORM_ID_alter()). - * \Drupal::moduleHandler->alter() will call all such variants defined by a - * single module in turn. For the purposes of hook_module_implements_alter(), - * these variants are treated as a single hook. Thus, to ensure that your - * implementation of hook_form_FORM_ID_alter() is called at the right time, - * you will have to change the order of hook_form_alter() implementation in - * hook_module_implements_alter(). - * - * @param $implementations - * An array keyed by the module's name. The value of each item corresponds - * to a $group, which is usually FALSE, unless the implementation is in a - * file named $module.$group.inc. - * @param $hook - * The name of the module hook being implemented. - */ -function hook_module_implements_alter(&$implementations, $hook) { - if ($hook == 'rdf_mapping') { - // Move my_module_rdf_mapping() to the end of the list. - // \Drupal::moduleHandler()->getImplementations() - // iterates through $implementations with a foreach loop which PHP iterates - // in the order that the items were added, so to move an item to the end of - // the array, we remove it and then add it. - $group = $implementations['my_module']; - unset($implementations['my_module']); - $implementations['my_module'] = $group; - } -} - /** * Perform alterations to the breadcrumb built by the BreadcrumbManager. * @@ -871,29 +374,6 @@ function hook_system_breadcrumb_alter(array &$breadcrumb, \Drupal\Core\Routing\R $breadcrumb[] = Drupal::l(t('Text'), 'example_route_name'); } -/** - * Alter the information parsed from module and theme .info.yml files - * - * This hook is invoked in _system_rebuild_module_data() and in - * _system_rebuild_theme_data(). A module may implement this hook in order to - * add to or alter the data generated by reading the .info.yml file with - * \Drupal\Core\Extension\InfoParser. - * - * @param array $info - * The .info.yml file contents, passed by reference so that it can be altered. - * @param \Drupal\Core\Extension\Extension $file - * Full information about the module or theme. - * @param string $type - * Either 'module' or 'theme', depending on the type of .info.yml file that - * was passed. - */ -function hook_system_info_alter(array &$info, \Drupal\Core\Extension\Extension $file, $type) { - // Only fill this in if the .info.yml file does not define a 'datestamp'. - if (empty($info['datestamp'])) { - $info['datestamp'] = $file->getMTime(); - } -} - /** * Provide online user help. * @@ -937,212 +417,6 @@ function hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_ } } -/** - * Register a module or theme's theme implementations. - * - * The implementations declared by this hook have several purposes: - * - They can specify how a particular render array is to be rendered as HTML. - * This is usually the case if the theme function is assigned to the render - * array's #theme property. - * - They can return HTML for default calls to _theme(). - * - They can return HTML for calls to _theme() for a theme suggestion. - * - * @param array $existing - * An array of existing implementations that may be used for override - * purposes. This is primarily useful for themes that may wish to examine - * existing implementations to extract data (such as arguments) so that - * it may properly register its own, higher priority implementations. - * @param $type - * Whether a theme, module, etc. is being processed. This is primarily useful - * so that themes tell if they are the actual theme being called or a parent - * theme. May be one of: - * - 'module': A module is being checked for theme implementations. - * - 'base_theme_engine': A theme engine is being checked for a theme that is - * a parent of the actual theme being used. - * - 'theme_engine': A theme engine is being checked for the actual theme - * being used. - * - 'base_theme': A base theme is being checked for theme implementations. - * - 'theme': The actual theme in use is being checked. - * @param $theme - * The actual name of theme, module, etc. that is being being processed. - * @param $path - * The directory path of the theme or module, so that it doesn't need to be - * looked up. - * - * @return array - * An associative array of information about theme implementations. The keys - * on the outer array are known as "theme hooks". For simple theme - * implementations for regular calls to _theme(), the theme hook is the first - * argument. For theme suggestions, instead of the array key being the base - * theme hook, the key is a theme suggestion name with the format - * 'base_hook_name__sub_hook_name'. For render elements, the key is the - * machine name of the render element. The array values are themselves arrays - * containing information about the theme hook and its implementation. Each - * information array must contain either a 'variables' element (for _theme() - * calls) or a 'render element' element (for render elements), but not both. - * The following elements may be part of each information array: - * - variables: Used for _theme() call items only: an array of variables, - * where the array keys are the names of the variables, and the array - * values are the default values if they are not passed into _theme(). - * Template implementations receive each array key as a variable in the - * template file (so they must be legal PHP/Twig variable names). Function - * implementations are passed the variables in a single $variables function - * argument. - * - render element: Used for render element items only: the name of the - * renderable element or element tree to pass to the theme function. This - * name is used as the name of the variable that holds the renderable - * element or tree in preprocess and process functions. - * - file: The file the implementation resides in. This file will be included - * prior to the theme being rendered, to make sure that the function or - * preprocess function (as needed) is actually loaded; this makes it - * possible to split theme functions out into separate files quite easily. - * - path: Override the path of the file to be used. Ordinarily the module or - * theme path will be used, but if the file will not be in the default - * path, include it here. This path should be relative to the Drupal root - * directory. - * - template: If specified, the theme implementation is a template file, and - * this is the template name. Do not add 'html.twig' on the end of the - * template name. The extension will be added automatically by the default - * rendering engine (which is Twig.) If 'path' is specified, 'template' - * should also be specified. If neither 'template' nor 'function' are - * specified, a default template name will be assumed. For example, if a - * module registers the 'search_result' theme hook, 'search-result' will be - * assigned as its template name. - * - function: If specified, this will be the function name to invoke for - * this implementation. If neither 'template' nor 'function' are specified, - * a default template name will be assumed. See above for more details. - * - base hook: Used for _theme() suggestions only: the base theme hook name. - * Instead of this suggestion's implementation being used directly, the base - * hook will be invoked with this implementation as its first suggestion. - * The base hook's files will be included and the base hook's preprocess - * functions will be called in place of any suggestion's preprocess - * functions. If an implementation of hook_theme_suggestions_HOOK() (where - * HOOK is the base hook) changes the suggestion order, a different - * suggestion may be used in place of this suggestion. If after - * hook_theme_suggestions_HOOK() this suggestion remains the first - * suggestion, then this suggestion's function or template will be used to - * generate the output for _theme(). - * - pattern: A regular expression pattern to be used to allow this theme - * implementation to have a dynamic name. The convention is to use __ to - * differentiate the dynamic portion of the theme. For example, to allow - * forums to be themed individually, the pattern might be: 'forum__'. Then, - * when the forum is themed, call: - * @code - * _theme(array('forum__' . $tid, 'forum'), $forum) - * @endcode - * - preprocess functions: A list of functions used to preprocess this data. - * Ordinarily this won't be used; it's automatically filled in. By default, - * for a module this will be filled in as template_preprocess_HOOK. For - * a theme this will be filled in as twig_preprocess and - * twig_preprocess_HOOK as well as themename_preprocess and - * themename_preprocess_HOOK. - * - override preprocess functions: Set to TRUE when a theme does NOT want - * the standard preprocess functions to run. This can be used to give a - * theme FULL control over how variables are set. For example, if a theme - * wants total control over how certain variables in the page.html.twig are - * set, this can be set to true. Please keep in mind that when this is used - * by a theme, that theme becomes responsible for making sure necessary - * variables are set. - * - type: (automatically derived) Where the theme hook is defined: - * 'module', 'theme_engine', or 'theme'. - * - theme path: (automatically derived) The directory path of the theme or - * module, so that it doesn't need to be looked up. - * - * @see hook_theme_registry_alter() - */ -function hook_theme($existing, $type, $theme, $path) { - return array( - 'forum_display' => array( - 'variables' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), - ), - 'forum_list' => array( - 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), - ), - 'forum_icon' => array( - 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), - ), - 'status_report' => array( - 'render element' => 'requirements', - 'file' => 'system.admin.inc', - ), - ); -} - -/** - * Alter the theme registry information returned from hook_theme(). - * - * The theme registry stores information about all available theme hooks, - * including which callback functions those hooks will call when triggered, - * what template files are exposed by these hooks, and so on. - * - * Note that this hook is only executed as the theme cache is re-built. - * Changes here will not be visible until the next cache clear. - * - * The $theme_registry array is keyed by theme hook name, and contains the - * information returned from hook_theme(), as well as additional properties - * added by \Drupal\Core\Theme\Registry::processExtension(). - * - * For example: - * @code - * $theme_registry['user'] = array( - * 'variables' => array( - * 'account' => NULL, - * ), - * 'template' => 'core/modules/user/user', - * 'file' => 'core/modules/user/user.pages.inc', - * 'type' => 'module', - * 'theme path' => 'core/modules/user', - * 'preprocess functions' => array( - * 0 => 'template_preprocess', - * 1 => 'template_preprocess_user_profile', - * ), - * ); - * @endcode - * - * @param $theme_registry - * The entire cache of theme registry information, post-processing. - * - * @see hook_theme() - * @see \Drupal\Core\Theme\Registry::processExtension() - */ -function hook_theme_registry_alter(&$theme_registry) { - // Kill the next/previous forum topic navigation links. - foreach ($theme_registry['forum_topic_navigation']['preprocess functions'] as $key => $value) { - if ($value == 'template_preprocess_forum_topic_navigation') { - unset($theme_registry['forum_topic_navigation']['preprocess functions'][$key]); - } - } -} - -/** - * Alter the default, hook-independent variables for all templates. - * - * Allows modules to provide additional default template variables or manipulate - * existing. This hook is invoked from template_preprocess() after basic default - * template variables have been set up and before the next template preprocess - * function is invoked. - * - * Note that the default template variables are statically cached within a - * request. When adding a template variable that depends on other context, it is - * your responsibility to appropriately reset the static cache in - * template_preprocess() when needed: - * @code - * drupal_static_reset('template_preprocess'); - * @endcode - * - * See user_template_preprocess_default_variables_alter() for an example. - * - * @param array $variables - * An associative array of default template variables, as set up by - * _template_preprocess_default_variables(). Passed by reference. - * - * @see template_preprocess() - * @see _template_preprocess_default_variables() - */ -function hook_template_preprocess_default_variables_alter(&$variables) { - $variables['is_admin'] = \Drupal::currentUser()->hasPermission('access administration pages'); -} - /** * Prepare a message based on parameters; called from drupal_mail(). * @@ -1259,292 +533,6 @@ function hook_rebuild() { } } -/** - * Perform necessary actions before a module is installed. - * - * @param string $module - * The name of the module about to be installed. - */ -function hook_module_preinstall($module) { - mymodule_cache_clear(); -} - -/** - * Perform necessary actions after modules are installed. - * - * This function differs from hook_install() in that it gives all other modules - * a chance to perform actions when a module is installed, whereas - * hook_install() is only called on the module actually being installed. See - * \Drupal\Core\Extension\ModuleHandler::install() for a detailed description of - * the order in which install hooks are invoked. - * - * @param $modules - * An array of the modules that were installed. - * - * @see \Drupal\Core\Extension\ModuleHandler::install() - * @see hook_install() - */ -function hook_modules_installed($modules) { - if (in_array('lousy_module', $modules)) { - \Drupal::state()->set('mymodule.lousy_module_compatibility', TRUE); - } -} - -/** - * Perform necessary actions before a module is uninstalled. - * - * @param string $module - * The name of the module about to be uninstalled. - */ -function hook_module_preuninstall($module) { - mymodule_cache_clear(); -} - -/** - * Perform necessary actions when themes are installed. - * - * @param array $themes - * An array of theme names which are installed. - */ -function hook_themes_installed(array $themes) { - // Add some state entries depending on the theme. - foreach ($themes as $theme) { - \Drupal::state()->set('example.' . $theme, 'some-value'); - } -} - -/** - * Perform necessary actions when themes are uninstalled. - */ -function hook_themes_uninstalled(array $themes) { - // Remove some state entries depending on the theme. - foreach ($themes as $theme) { - \Drupal::state()->delete('example.' . $theme); - } -} - -/** - * Perform necessary actions after modules are uninstalled. - * - * This function differs from hook_uninstall() in that it gives all other - * modules a chance to perform actions when a module is uninstalled, whereas - * hook_uninstall() is only called on the module actually being uninstalled. - * - * It is recommended that you implement this hook if your module stores - * data that may have been set by other modules. - * - * @param $modules - * An array of the modules that were uninstalled. - * - * @see hook_uninstall() - * @see hook_modules_disabled() - */ -function hook_modules_uninstalled($modules) { - if (in_array('lousy_module', $modules)) { - \Drupal::state()->delete('mymodule.lousy_module_compatibility'); - } - mymodule_cache_rebuild(); -} - -/** - * Alters the list of PHP stream wrapper implementations. - * - * @see file_get_stream_wrappers() - * @see \Drupal\Core\StreamWrapper\StreamWrapperManager - */ -function hook_stream_wrappers_alter(&$wrappers) { - // Change the name of private files to reflect the performance. - $wrappers['private']['name'] = t('Slow files'); -} - -/** - * Control access to private file downloads and specify HTTP headers. - * - * This hook allows modules to enforce permissions on file downloads whenever - * Drupal is handling file download, as opposed to the web server bypassing - * Drupal and returning the file from a public directory. Modules can also - * provide headers to specify information like the file's name or MIME type. - * - * @param $uri - * The URI of the file. - * @return - * If the user does not have permission to access the file, return -1. If the - * user has permission, return an array with the appropriate headers. If the - * file is not controlled by the current module, the return value should be - * NULL. - * - * @see file_download() - */ -function hook_file_download($uri) { - // Check to see if this is a config download. - $scheme = file_uri_scheme($uri); - $target = file_uri_target($uri); - if ($scheme == 'temporary' && $target == 'config.tar.gz') { - return array( - 'Content-disposition' => 'attachment; filename="config.tar.gz"', - ); - } -} - -/** - * Alter the URL to a file. - * - * This hook is called from file_create_url(), and is called fairly - * frequently (10+ times per page), depending on how many files there are in a - * given page. - * If CSS and JS aggregation are disabled, this can become very frequently - * (50+ times per page) so performance is critical. - * - * This function should alter the URI, if it wants to rewrite the file URL. - * - * @param $uri - * The URI to a file for which we need an external URL, or the path to a - * shipped file. - */ -function hook_file_url_alter(&$uri) { - $user = \Drupal::currentUser(); - - // User 1 will always see the local file in this example. - if ($user->id() == 1) { - return; - } - - $cdn1 = 'http://cdn1.example.com'; - $cdn2 = 'http://cdn2.example.com'; - $cdn_extensions = array('css', 'js', 'gif', 'jpg', 'jpeg', 'png'); - - // Most CDNs don't support private file transfers without a lot of hassle, - // so don't support this in the common case. - $schemes = array('public'); - - $scheme = file_uri_scheme($uri); - - // Only serve shipped files and public created files from the CDN. - if (!$scheme || in_array($scheme, $schemes)) { - // Shipped files. - if (!$scheme) { - $path = $uri; - } - // Public created files. - else { - $wrapper = file_stream_wrapper_get_instance_by_scheme($scheme); - $path = $wrapper->getDirectoryPath() . '/' . file_uri_target($uri); - } - - // Clean up Windows paths. - $path = str_replace('\\', '/', $path); - - // Serve files with one of the CDN extensions from CDN 1, all others from - // CDN 2. - $pathinfo = pathinfo($path); - if (isset($pathinfo['extension']) && in_array($pathinfo['extension'], $cdn_extensions)) { - $uri = $cdn1 . '/' . $path; - } - else { - $uri = $cdn2 . '/' . $path; - } - } -} - -/** - * Check installation requirements and do status reporting. - * - * This hook has three closely related uses, determined by the $phase argument: - * - Checking installation requirements ($phase == 'install'). - * - Checking update requirements ($phase == 'update'). - * - Status reporting ($phase == 'runtime'). - * - * Note that this hook, like all others dealing with installation and updates, - * must reside in a module_name.install file, or it will not properly abort - * the installation of the module if a critical requirement is missing. - * - * During the 'install' phase, modules can for example assert that - * library or server versions are available or sufficient. - * Note that the installation of a module can happen during installation of - * Drupal itself (by install.php) with an installation profile or later by hand. - * As a consequence, install-time requirements must be checked without access - * to the full Drupal API, because it is not available during install.php. - * If a requirement has a severity of REQUIREMENT_ERROR, install.php will abort - * or at least the module will not install. - * Other severity levels have no effect on the installation. - * Module dependencies do not belong to these installation requirements, - * but should be defined in the module's .info.yml file. - * - * The 'runtime' phase is not limited to pure installation requirements - * but can also be used for more general status information like maintenance - * tasks and security issues. - * The returned 'requirements' will be listed on the status report in the - * administration section, with indication of the severity level. - * Moreover, any requirement with a severity of REQUIREMENT_ERROR severity will - * result in a notice on the administration configuration page. - * - * @param $phase - * The phase in which requirements are checked: - * - install: The module is being installed. - * - update: The module is enabled and update.php is run. - * - runtime: The runtime requirements are being checked and shown on the - * status report page. - * - * @return - * An associative array where the keys are arbitrary but must be unique (it - * is suggested to use the module short name as a prefix) and the values are - * themselves associative arrays with the following elements: - * - title: The name of the requirement. - * - value: The current value (e.g., version, time, level, etc). During - * install phase, this should only be used for version numbers, do not set - * it if not applicable. - * - description: The description of the requirement/status. - * - severity: The requirement's result/severity level, one of: - * - REQUIREMENT_INFO: For info only. - * - REQUIREMENT_OK: The requirement is satisfied. - * - REQUIREMENT_WARNING: The requirement failed with a warning. - * - REQUIREMENT_ERROR: The requirement failed with an error. - */ -function hook_requirements($phase) { - $requirements = array(); - - // Report Drupal version - if ($phase == 'runtime') { - $requirements['drupal'] = array( - 'title' => t('Drupal'), - 'value' => \Drupal::VERSION, - 'severity' => REQUIREMENT_INFO - ); - } - - // Test PHP version - $requirements['php'] = array( - 'title' => t('PHP'), - 'value' => ($phase == 'runtime') ? \Drupal::l(phpversion(), new Url('system.php')) : phpversion(), - ); - if (version_compare(phpversion(), DRUPAL_MINIMUM_PHP) < 0) { - $requirements['php']['description'] = t('Your PHP installation is too old. Drupal requires at least PHP %version.', array('%version' => DRUPAL_MINIMUM_PHP)); - $requirements['php']['severity'] = REQUIREMENT_ERROR; - } - - // Report cron status - if ($phase == 'runtime') { - $cron_last = \Drupal::state()->get('system.cron_last'); - - if (is_numeric($cron_last)) { - $requirements['cron']['value'] = t('Last run !time ago', array('!time' => \Drupal::service('date.formatter')->formatInterval(REQUEST_TIME - $cron_last))); - } - else { - $requirements['cron'] = array( - 'description' => t('Cron has not run. It appears cron jobs have not been setup on your system. Check the help pages for configuring cron jobs.', array('@url' => 'http://drupal.org/cron')), - 'severity' => REQUIREMENT_ERROR, - 'value' => t('Never run'), - ); - } - - $requirements['cron']['description'] .= ' ' . t('You can run cron manually.', array('@cron' => \Drupal::url('system.run_cron'))); - - $requirements['cron']['title'] = t('Cron maintenance tasks'); - } - - return $requirements; -} - /** * Define the current version of the database schema. * @@ -1719,486 +707,6 @@ function hook_query_TAG_alter(Drupal\Core\Database\Query\AlterableInterface $que } } -/** - * Perform setup tasks when the module is installed. - * - * If the module implements hook_schema(), the database tables will - * be created before this hook is fired. - * - * Implementations of this hook are by convention declared in the module's - * .install file. The implementation can rely on the .module file being loaded. - * The hook will only be called when a module is installed. The module's schema - * version will be set to the module's greatest numbered update hook. Because of - * this, any time a hook_update_N() is added to the module, this function needs - * to be updated to reflect the current version of the database schema. - * - * See the @link http://drupal.org/node/146843 Schema API documentation @endlink - * for details on hook_schema and how database tables are defined. - * - * Note that since this function is called from a full bootstrap, all functions - * (including those in modules enabled by the current page request) are - * available when this hook is called. Use cases could be displaying a user - * message, or calling a module function necessary for initial setup, etc. - * - * Please be sure that anything added or modified in this function that can - * be removed during uninstall should be removed with hook_uninstall(). - * - * @see hook_schema() - * @see \Drupal\Core\Extension\ModuleHandler::install() - * @see hook_uninstall() - * @see hook_modules_installed() - */ -function hook_install() { - // Create the styles directory and ensure it's writable. - $directory = file_default_scheme() . '://styles'; - $mode = isset($GLOBALS['install_state']['mode']) ? $GLOBALS['install_state']['mode'] : NULL; - file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS, $mode); -} - -/** - * Perform a single update. - * - * For each change that requires one or more actions to be performed when - * updating a site, add a new hook_update_N(), which will be called by - * update.php. The documentation block preceding this function is stripped of - * newlines and used as the description for the update on the pending updates - * task list. Schema updates should adhere to the - * @link http://drupal.org/node/150215 Schema API. @endlink - * - * Implementations of hook_update_N() are named (module name)_update_(number). - * The numbers are composed of three parts: - * - 1 digit for Drupal core compatibility. - * - 1 digit for your module's major release version (e.g., is this the 8.x-1.* - * (1) or 8.x-2.* (2) series of your module). - * - 2 digits for sequential counting, starting with 01. - * - * Examples: - * - mymodule_update_8100(): This is the first update to get the database ready - * to run mymodule 8.x-1.*. - * - mymodule_update_8200(): This is the first update to get the database ready - * to run mymodule 8.x-2.*. - * - * As of Drupal 8.0, the database upgrade system no longer supports updating a - * database from an earlier major version of Drupal: update.php can be used to - * upgrade from 7.x-1.x to 7.x-2.x, or 8.x-1.x to 8.x-2.x, but not from 7.x to - * 8.x. Therefore, only update hooks numbered 8001 or later will run for - * Drupal 8. 8000 is reserved for the minimum core schema version and defining - * mymodule_update_8000() will result in an exception. Use the - * @link https://drupal.org/node/2127611 Migration API @endlink instead to - * migrate data from an earlier major version of Drupal. - * - * For further information about releases and release numbers see: - * @link http://drupal.org/node/711070 Maintaining a drupal.org project with Git @endlink - * - * Never renumber update functions. - * - * Implementations of this hook should be placed in a mymodule.install file in - * the same directory as mymodule.module. Drupal core's updates are implemented - * using the system module as a name and stored in database/updates.inc. - * - * Not all module functions are available from within a hook_update_N() function. - * In order to call a function from your mymodule.module or an include file, - * you need to explicitly load that file first. - * - * During database updates the schema of any module could be out of date. For - * this reason, caution is needed when using any API function within an update - * function - particularly CRUD functions, functions that depend on the schema - * (for example by using drupal_write_record()), and any functions that invoke - * hooks. - * - * The $sandbox parameter should be used when a multipass update is needed, in - * circumstances where running the whole update at once could cause PHP to - * timeout. Each pass is run in a way that avoids PHP timeouts, provided each - * pass remains under the timeout limit. To signify that an update requires - * at least one more pass, set $sandbox['#finished'] to a number less than 1 - * (you need to do this each pass). The value of $sandbox['#finished'] will be - * unset between passes but all other data in $sandbox will be preserved. The - * system will stop iterating this update when $sandbox['#finished'] is left - * unset or set to a number higher than 1. It is recommended that - * $sandbox['#finished'] is initially set to 0, and then updated each pass to a - * number between 0 and 1 that represents the overall % completed for this - * update, finishing with 1. - * - * See the @link batch Batch operations topic @endlink for more information on - * how to use the Batch API. - * - * @param array $sandbox - * Stores information for multipass updates. See above for more information. - * - * @throws \Drupal\Core\Utility\UpdateException|PDOException - * In case of error, update hooks should throw an instance of - * Drupal\Core\Utility\UpdateException with a meaningful message for the user. - * If a database query fails for whatever reason, it will throw a - * PDOException. - * - * @return string|null - * Optionally, update hooks may return a translated string that will be - * displayed to the user after the update has completed. If no message is - * returned, no message will be presented to the user. - * - * @see batch - * @see schemaapi - * @see hook_update_last_removed() - * @see update_get_update_list() - */ -function hook_update_N(&$sandbox) { - // For non-multipass updates, the signature can simply be; - // function hook_update_N() { - - // For most updates, the following is sufficient. - db_add_field('mytable1', 'newcol', array('type' => 'int', 'not null' => TRUE, 'description' => 'My new integer column.')); - - // However, for more complex operations that may take a long time, - // you may hook into Batch API as in the following example. - - // Update 3 users at a time to have an exclamation point after their names. - // (They're really happy that we can do batch API in this hook!) - if (!isset($sandbox['progress'])) { - $sandbox['progress'] = 0; - $sandbox['current_uid'] = 0; - // We'll -1 to disregard the uid 0... - $sandbox['max'] = db_query('SELECT COUNT(DISTINCT uid) FROM {users}')->fetchField() - 1; - } - - $users = db_select('users', 'u') - ->fields('u', array('uid', 'name')) - ->condition('uid', $sandbox['current_uid'], '>') - ->range(0, 3) - ->orderBy('uid', 'ASC') - ->execute(); - - foreach ($users as $user) { - $user->setUsername($user->getUsername() . '!'); - db_update('users') - ->fields(array('name' => $user->getUsername())) - ->condition('uid', $user->id()) - ->execute(); - - $sandbox['progress']++; - $sandbox['current_uid'] = $user->id(); - } - - $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); - - if ($some_error_condition_met) { - // In case of an error, simply throw an exception with an error message. - throw new UpdateException('Something went wrong; here is what you should do.'); - } - - // To display a message to the user when the update is completed, return it. - // If you do not want to display a completion message, simply return nothing. - return t('The update did what it was supposed to do.'); -} - -/** - * Return an array of information about module update dependencies. - * - * This can be used to indicate update functions from other modules that your - * module's update functions depend on, or vice versa. It is used by the update - * system to determine the appropriate order in which updates should be run, as - * well as to search for missing dependencies. - * - * Implementations of this hook should be placed in a mymodule.install file in - * the same directory as mymodule.module. - * - * @return - * A multidimensional array containing information about the module update - * dependencies. The first two levels of keys represent the module and update - * number (respectively) for which information is being returned, and the - * value is an array of information about that update's dependencies. Within - * this array, each key represents a module, and each value represents the - * number of an update function within that module. In the event that your - * update function depends on more than one update from a particular module, - * you should always list the highest numbered one here (since updates within - * a given module always run in numerical order). - * - * @see update_resolve_dependencies() - * @see hook_update_N() - */ -function hook_update_dependencies() { - // Indicate that the mymodule_update_8001() function provided by this module - // must run after the another_module_update_8003() function provided by the - // 'another_module' module. - $dependencies['mymodule'][8001] = array( - 'another_module' => 8003, - ); - // Indicate that the mymodule_update_8002() function provided by this module - // must run before the yet_another_module_update_8005() function provided by - // the 'yet_another_module' module. (Note that declaring dependencies in this - // direction should be done only in rare situations, since it can lead to the - // following problem: If a site has already run the yet_another_module - // module's database updates before it updates its codebase to pick up the - // newest mymodule code, then the dependency declared here will be ignored.) - $dependencies['yet_another_module'][8005] = array( - 'mymodule' => 8002, - ); - return $dependencies; -} - -/** - * Return a number which is no longer available as hook_update_N(). - * - * If you remove some update functions from your mymodule.install file, you - * should notify Drupal of those missing functions. This way, Drupal can - * ensure that no update is accidentally skipped. - * - * Implementations of this hook should be placed in a mymodule.install file in - * the same directory as mymodule.module. - * - * @return - * An integer, corresponding to hook_update_N() which has been removed from - * mymodule.install. - * - * @see hook_update_N() - */ -function hook_update_last_removed() { - // We've removed the 8.x-1.x version of mymodule, including database updates. - // The next update function is mymodule_update_8200(). - return 8103; -} - -/** - * Remove any information that the module sets. - * - * The information that the module should remove includes: - * - state that the module has set using \Drupal::state() - * - modifications to existing tables - * - * The module should not remove its entry from the module configuration. - * Database tables defined by hook_schema() will be removed automatically. - * - * The uninstall hook must be implemented in the module's .install file. It - * will fire when the module gets uninstalled but before the module's database - * tables are removed, allowing your module to query its own tables during - * this routine. - * - * @see hook_install() - * @see hook_schema() - * @see hook_disable() - * @see hook_modules_uninstalled() - */ -function hook_uninstall() { - // Remove the styles directory and generated images. - file_unmanaged_delete_recursive(file_default_scheme() . '://styles'); -} - -/** - * Return an array of tasks to be performed by an installation profile. - * - * Any tasks you define here will be run, in order, after the installer has - * finished the site configuration step but before it has moved on to the - * final import of languages and the end of the installation. You can have any - * number of custom tasks to perform during this phase. - * - * Each task you define here corresponds to a callback function which you must - * separately define and which is called when your task is run. This function - * will receive the global installation state variable, $install_state, as - * input, and has the opportunity to access or modify any of its settings. See - * the install_state_defaults() function in the installer for the list of - * $install_state settings used by Drupal core. - * - * At the end of your task function, you can indicate that you want the - * installer to pause and display a page to the user by returning any themed - * output that should be displayed on that page (but see below for tasks that - * use the form API or batch API; the return values of these task functions are - * handled differently). You should also use #title within the task - * callback function to set a custom page title. For some tasks, however, you - * may want to simply do some processing and pass control to the next task - * without ending the page request; to indicate this, simply do not send back - * a return value from your task function at all. This can be used, for - * example, by installation profiles that need to configure certain site - * settings in the database without obtaining any input from the user. - * - * The task function is treated specially if it defines a form or requires - * batch processing; in that case, you should return either the form API - * definition or batch API array, as appropriate. See below for more - * information on the 'type' key that you must define in the task definition - * to inform the installer that your task falls into one of those two - * categories. It is important to use these APIs directly, since the installer - * may be run non-interactively (for example, via a command line script), all - * in one page request; in that case, the installer will automatically take - * care of submitting forms and processing batches correctly for both types of - * installations. You can inspect the $install_state['interactive'] boolean to - * see whether or not the current installation is interactive, if you need - * access to this information. - * - * Remember that a user installing Drupal interactively will be able to reload - * an installation page multiple times, so you should use \Drupal::state() to - * store any data that you may need later in the installation process. Any - * temporary state must be removed using \Drupal::state()->delete() before - * your last task has completed and control is handed back to the installer. - * - * @param array $install_state - * An array of information about the current installation state. - * - * @return array - * A keyed array of tasks the profile will perform during the final stage of - * the installation. Each key represents the name of a function (usually a - * function defined by this profile, although that is not strictly required) - * that is called when that task is run. The values are associative arrays - * containing the following key-value pairs (all of which are optional): - * - display_name: The human-readable name of the task. This will be - * displayed to the user while the installer is running, along with a list - * of other tasks that are being run. Leave this unset to prevent the task - * from appearing in the list. - * - display: This is a boolean which can be used to provide finer-grained - * control over whether or not the task will display. This is mostly useful - * for tasks that are intended to display only under certain conditions; - * for these tasks, you can set 'display_name' to the name that you want to - * display, but then use this boolean to hide the task only when certain - * conditions apply. - * - type: A string representing the type of task. This parameter has three - * possible values: - * - normal: (default) This indicates that the task will be treated as a - * regular callback function, which does its processing and optionally - * returns HTML output. - * - batch: This indicates that the task function will return a batch API - * definition suitable for batch_set(). The installer will then take care - * of automatically running the task via batch processing. - * - form: This indicates that the task function will return a standard - * form API definition (and separately define validation and submit - * handlers, as appropriate). The installer will then take care of - * automatically directing the user through the form submission process. - * - run: A constant representing the manner in which the task will be run. - * This parameter has three possible values: - * - INSTALL_TASK_RUN_IF_NOT_COMPLETED: (default) This indicates that the - * task will run once during the installation of the profile. - * - INSTALL_TASK_SKIP: This indicates that the task will not run during - * the current installation page request. It can be used to skip running - * an installation task when certain conditions are met, even though the - * task may still show on the list of installation tasks presented to the - * user. - * - INSTALL_TASK_RUN_IF_REACHED: This indicates that the task will run on - * each installation page request that reaches it. This is rarely - * necessary for an installation profile to use; it is primarily used by - * the Drupal installer for bootstrap-related tasks. - * - function: Normally this does not need to be set, but it can be used to - * force the installer to call a different function when the task is run - * (rather than the function whose name is given by the array key). This - * could be used, for example, to allow the same function to be called by - * two different tasks. - * - * @see install_state_defaults() - * @see batch_set() - */ -function hook_install_tasks(&$install_state) { - // Here, we define a variable to allow tasks to indicate that a particular, - // processor-intensive batch process needs to be triggered later on in the - // installation. - $myprofile_needs_batch_processing = \Drupal::state()->get('myprofile.needs_batch_processing', FALSE); - $tasks = array( - // This is an example of a task that defines a form which the user who is - // installing the site will be asked to fill out. To implement this task, - // your profile would define a function named myprofile_data_import_form() - // as a normal form API callback function, with associated validation and - // submit handlers. In the submit handler, in addition to saving whatever - // other data you have collected from the user, you might also call - // \Drupal::state()->set('myprofile.needs_batch_processing', TRUE) if the - // user has entered data which requires that batch processing will need to - // occur later on. - 'myprofile_data_import_form' => array( - 'display_name' => t('Data import options'), - 'type' => 'form', - ), - // Similarly, to implement this task, your profile would define a function - // named myprofile_settings_form() with associated validation and submit - // handlers. This form might be used to collect and save additional - // information from the user that your profile needs. There are no extra - // steps required for your profile to act as an "installation wizard"; you - // can simply define as many tasks of type 'form' as you wish to execute, - // and the forms will be presented to the user, one after another. - 'myprofile_settings_form' => array( - 'display_name' => t('Additional options'), - 'type' => 'form', - ), - // This is an example of a task that performs batch operations. To - // implement this task, your profile would define a function named - // myprofile_batch_processing() which returns a batch API array definition - // that the installer will use to execute your batch operations. Due to the - // 'myprofile.needs_batch_processing' variable used here, this task will be - // hidden and skipped unless your profile set it to TRUE in one of the - // previous tasks. - 'myprofile_batch_processing' => array( - 'display_name' => t('Import additional data'), - 'display' => $myprofile_needs_batch_processing, - 'type' => 'batch', - 'run' => $myprofile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP, - ), - // This is an example of a task that will not be displayed in the list that - // the user sees. To implement this task, your profile would define a - // function named myprofile_final_site_setup(), in which additional, - // automated site setup operations would be performed. Since this is the - // last task defined by your profile, you should also use this function to - // call \Drupal::state()->delete('myprofile.needs_batch_processing') and - // clean up the state that was used above. If you want the user to pass - // to the final Drupal installation tasks uninterrupted, return no output - // from this function. Otherwise, return themed output that the user will - // see (for example, a confirmation page explaining that your profile's - // tasks are complete, with a link to reload the current page and therefore - // pass on to the final Drupal installation tasks when the user is ready to - // do so). - 'myprofile_final_site_setup' => array( - ), - ); - return $tasks; -} - -/** - * Alter the full list of installation tasks. - * - * You can use this hook to change or replace any part of the Drupal - * installation process that occurs after the installation profile is selected. - * - * @param $tasks - * An array of all available installation tasks, including those provided by - * Drupal core. You can modify this array to change or replace individual - * steps within the installation process. - * @param $install_state - * An array of information about the current installation state. - */ -function hook_install_tasks_alter(&$tasks, $install_state) { - // Replace the entire site configuration form provided by Drupal core - // with a custom callback function defined by this installation profile. - $tasks['install_configure_form']['function'] = 'myprofile_install_configure_form'; -} - -/** - * Alter MIME type mappings used to determine MIME type from a file extension. - * - * Invoked by \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::guess(). It - * is used to allow modules to add to or modify the default mapping from - * \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::$defaultMapping. - * - * @param $mapping - * An array of mimetypes correlated to the extensions that relate to them. - * The array has 'mimetypes' and 'extensions' elements, each of which is an - * array. - * - * @see \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::guess() - * @see \Drupal\Core\File\MimeType\ExtensionMimeTypeGuesser::$defaultMapping - */ -function hook_file_mimetype_mapping_alter(&$mapping) { - // Add new MIME type 'drupal/info'. - $mapping['mimetypes']['example_info'] = 'drupal/info'; - // Add new extension '.info.yml' and map it to the 'drupal/info' MIME type. - $mapping['extensions']['info'] = 'example_info'; - // Override existing extension mapping for '.ogg' files. - $mapping['extensions']['ogg'] = 189; -} - -/** - * Alter archiver information declared by other modules. - * - * See hook_archiver_info() for a description of archivers and the archiver - * information structure. - * - * @param $info - * Archiver information to alter (return values from hook_archiver_info()). - */ -function hook_archiver_info_alter(&$info) { - $info['tar']['extensions'][] = 'tgz'; -} - /** * Alter the list of mail backend plugin definitions. * @@ -2476,83 +984,6 @@ function hook_token_info_alter(&$data) { ); } -/** - * Alter batch information before a batch is processed. - * - * Called by batch_process() to allow modules to alter a batch before it is - * processed. - * - * @param $batch - * The associative array of batch information. See batch_set() for details on - * what this could contain. - * - * @see batch_set() - * @see batch_process() - * - * @ingroup batch - */ -function hook_batch_alter(&$batch) { -} - -/** - * Provide information on Updaters (classes that can update Drupal). - * - * Drupal\Core\Updater\Updater is a class that knows how to update various parts - * of the Drupal file system, for example to update modules that have newer - * releases, or to install a new theme. - * - * @return - * An associative array of information about the updater(s) being provided. - * This array is keyed by a unique identifier for each updater, and the - * values are subarrays that can contain the following keys: - * - class: The name of the PHP class which implements this updater. - * - name: Human-readable name of this updater. - * - weight: Controls what order the Updater classes are consulted to decide - * which one should handle a given task. When an update task is being run, - * the system will loop through all the Updater classes defined in this - * registry in weight order and let each class respond to the task and - * decide if each Updater wants to handle the task. In general, this - * doesn't matter, but if you need to override an existing Updater, make - * sure your Updater has a lighter weight so that it comes first. - * - * @see drupal_get_updaters() - * @see hook_updater_info_alter() - */ -function hook_updater_info() { - return array( - 'module' => array( - 'class' => 'Drupal\Core\Updater\Module', - 'name' => t('Update modules'), - 'weight' => 0, - ), - 'theme' => array( - 'class' => 'Drupal\Core\Updater\Theme', - 'name' => t('Update themes'), - 'weight' => 0, - ), - ); -} - -/** - * Alter the Updater information array. - * - * An Updater is a class that knows how to update various parts of the Drupal - * file system, for example to update modules that have newer releases, or to - * install a new theme. - * - * @param array $updaters - * Associative array of updaters as defined through hook_updater_info(). - * Alter this array directly. - * - * @see drupal_get_updaters() - * @see hook_updater_info() - */ -function hook_updater_info_alter(&$updaters) { - // Adjust weight so that the theme Updater gets a chance to handle a given - // update task before module updaters. - $updaters['theme']['weight'] = -1; -} - /** * Alter the default country list. * @@ -2566,66 +997,6 @@ function hook_countries_alter(&$countries) { $countries['EB'] = 'Elbonia'; } -/** - * Register information about FileTransfer classes provided by a module. - * - * The FileTransfer class allows transferring files over a specific type of - * connection. Core provides classes for FTP and SSH. Contributed modules are - * free to extend the FileTransfer base class to add other connection types, - * and if these classes are registered via hook_filetransfer_info(), those - * connection types will be available to site administrators using the Update - * manager when they are redirected to the authorize.php script to authorize - * the file operations. - * - * @return array - * Nested array of information about FileTransfer classes. Each key is a - * FileTransfer type (not human readable, used for form elements and - * variable names, etc), and the values are subarrays that define properties - * of that type. The keys in each subarray are: - * - 'title': Required. The human-readable name of the connection type. - * - 'class': Required. The name of the FileTransfer class. The constructor - * will always be passed the full path to the root of the site that should - * be used to restrict where file transfer operations can occur (the $jail) - * and an array of settings values returned by the settings form. - * - 'file': Required. The include file containing the FileTransfer class. - * This should be a separate .inc file, not just the .module file, so that - * the minimum possible code is loaded when authorize.php is running. - * - 'file path': Optional. The directory (relative to the Drupal root) - * where the include file lives. If not defined, defaults to the base - * directory of the module implementing the hook. - * - 'weight': Optional. Integer weight used for sorting connection types on - * the authorize.php form. - * - * @see \Drupal\Core\FileTransfer\FileTransfer - * @see authorize.php - * @see hook_filetransfer_info_alter() - * @see drupal_get_filetransfer_info() - */ -function hook_filetransfer_info() { - $info['sftp'] = array( - 'title' => t('SFTP (Secure FTP)'), - 'class' => 'Drupal\Core\FileTransfer\SFTP', - 'weight' => 10, - ); - return $info; -} - -/** - * Alter the FileTransfer class registry. - * - * @param array $filetransfer_info - * Reference to a nested array containing information about the FileTransfer - * class registry. - * - * @see hook_filetransfer_info() - */ -function hook_filetransfer_info_alter(&$filetransfer_info) { - // Remove the FTP option entirely. - unset($filetransfer_info['ftp']); - // Make sure the SSH option is listed first. - $filetransfer_info['ssh']['weight'] = -10; -} - /** * Alter the parameters for links. * diff --git a/drupal/core/modules/system/system.info.yml b/drupal/core/modules/system/system.info.yml index 1f2a0644..1986123f 100644 --- a/drupal/core/modules/system/system.info.yml +++ b/drupal/core/modules/system/system.info.yml @@ -2,7 +2,13 @@ name: System type: module description: 'Handles general site configuration for administrators.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x required: true configure: system.admin_config_system + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/system.routing.yml b/drupal/core/modules/system/system.routing.yml index b285bcf6..4d54d003 100644 --- a/drupal/core/modules/system/system.routing.yml +++ b/drupal/core/modules/system/system.routing.yml @@ -7,6 +7,22 @@ system.ajax: requirements: _access: 'TRUE' +system.403: + path: '/system/403' + defaults: + _content: '\Drupal\system\Controller\Http4xxController:on403' + _title: 'Access denied' + requirements: + _access: 'TRUE' + +system.404: + path: '/system/404' + defaults: + _content: '\Drupal\system\Controller\Http4xxController:on404' + _title: 'Page not found' + requirements: + _access: 'TRUE' + system.admin: path: '/admin' defaults: diff --git a/drupal/core/modules/system/tests/modules/action_test/action_test.info.yml b/drupal/core/modules/system/tests/modules/action_test/action_test.info.yml index 7cefe06e..e0a4e5d7 100644 --- a/drupal/core/modules/system/tests/modules/action_test/action_test.info.yml +++ b/drupal/core/modules/system/tests/modules/action_test/action_test.info.yml @@ -2,5 +2,11 @@ name: 'Action test' type: module description: 'Support module for action testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.info.yml b/drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.info.yml index ba31a29d..5e0f6b0f 100644 --- a/drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.info.yml +++ b/drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.info.yml @@ -1,6 +1,12 @@ name: 'AJAX form test mock module' type: module description: 'Test for AJAX form calls.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module index 9a7fb8ae..2ecbe2a0 100644 --- a/drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module +++ b/drupal/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module @@ -194,7 +194,7 @@ function ajax_forms_test_advanced_commands_settings_with_merging_callback($form, function ajax_forms_test_validation_form_callback($form, FormStateInterface $form_state) { drupal_set_message("ajax_forms_test_validation_form_callback invoked"); drupal_set_message(t("Callback: drivertext=%drivertext, spare_required_field=%spare_required_field", array('%drivertext' => $form_state->getValue('drivertext'), '%spare_required_field' => $form_state->getValue('spare_required_field')))); - return '
ajax_forms_test_validation_form_callback at ' . date('c') . '
'; + return ['#markup' => '
ajax_forms_test_validation_form_callback at ' . date('c') . '
']; } /** @@ -203,7 +203,7 @@ function ajax_forms_test_validation_form_callback($form, FormStateInterface $for function ajax_forms_test_validation_number_form_callback($form, FormStateInterface $form_state) { drupal_set_message("ajax_forms_test_validation_number_form_callback invoked"); drupal_set_message(t("Callback: drivernumber=%drivernumber, spare_required_field=%spare_required_field", array('%drivernumber' => $form_state->getValue('drivernumber'), '%spare_required_field' => $form_state->getValue('spare_required_field')))); - return '
ajax_forms_test_validation_number_form_callback at ' . date('c') . '
'; + return ['#markup' => '
ajax_forms_test_validation_number_form_callback at ' . date('c') . '
']; } /** diff --git a/drupal/core/modules/system/tests/modules/ajax_test/ajax_test.info.yml b/drupal/core/modules/system/tests/modules/ajax_test/ajax_test.info.yml index f1517488..fe11cea0 100644 --- a/drupal/core/modules/system/tests/modules/ajax_test/ajax_test.info.yml +++ b/drupal/core/modules/system/tests/modules/ajax_test/ajax_test.info.yml @@ -2,7 +2,13 @@ name: 'AJAX Test' type: module description: 'Support module for AJAX framework tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - contact + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/batch_test/batch_test.info.yml b/drupal/core/modules/system/tests/modules/batch_test/batch_test.info.yml index 072017e7..cf53add4 100644 --- a/drupal/core/modules/system/tests/modules/batch_test/batch_test.info.yml +++ b/drupal/core/modules/system/tests/modules/batch_test/batch_test.info.yml @@ -2,5 +2,11 @@ name: 'Batch API test' type: module description: 'Support module for Batch API tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/bc_test/bc_test.info.yml b/drupal/core/modules/system/tests/modules/bc_test/bc_test.info.yml index 20dbd821..9dd26dc0 100644 --- a/drupal/core/modules/system/tests/modules/bc_test/bc_test.info.yml +++ b/drupal/core/modules/system/tests/modules/bc_test/bc_test.info.yml @@ -2,5 +2,11 @@ name: 'Backwards Compatibility Test' type: module description: 'Support module for backwards compatibility tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/cache_test/cache_test.info.yml b/drupal/core/modules/system/tests/modules/cache_test/cache_test.info.yml index 329e0d66..6a303f6b 100644 --- a/drupal/core/modules/system/tests/modules/cache_test/cache_test.info.yml +++ b/drupal/core/modules/system/tests/modules/cache_test/cache_test.info.yml @@ -2,5 +2,11 @@ name: 'Cache test' type: module description: 'Support module for cache system testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/common_test/common_test.info.yml b/drupal/core/modules/system/tests/modules/common_test/common_test.info.yml index 2efb155b..944d1632 100644 --- a/drupal/core/modules/system/tests/modules/common_test/common_test.info.yml +++ b/drupal/core/modules/system/tests/modules/common_test/common_test.info.yml @@ -2,5 +2,11 @@ name: 'Common Test' type: module description: 'Support module for Common tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/common_test_cron_helper/common_test_cron_helper.info.yml b/drupal/core/modules/system/tests/modules/common_test_cron_helper/common_test_cron_helper.info.yml index 5d1ab7f6..11b58840 100644 --- a/drupal/core/modules/system/tests/modules/common_test_cron_helper/common_test_cron_helper.info.yml +++ b/drupal/core/modules/system/tests/modules/common_test_cron_helper/common_test_cron_helper.info.yml @@ -2,5 +2,11 @@ name: 'Common Test Cron Helper' type: module description: 'Helper module for CronRunTestCase::testCronExceptions().' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/condition_test/condition_test.info.yml b/drupal/core/modules/system/tests/modules/condition_test/condition_test.info.yml index b6645024..3ee45a91 100644 --- a/drupal/core/modules/system/tests/modules/condition_test/condition_test.info.yml +++ b/drupal/core/modules/system/tests/modules/condition_test/condition_test.info.yml @@ -2,5 +2,11 @@ name: "Condition Test Support" type: module description: "Test general form component for condition plugins." package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/cron_queue_test/cron_queue_test.info.yml b/drupal/core/modules/system/tests/modules/cron_queue_test/cron_queue_test.info.yml index 014e9188..9d017e35 100644 --- a/drupal/core/modules/system/tests/modules/cron_queue_test/cron_queue_test.info.yml +++ b/drupal/core/modules/system/tests/modules/cron_queue_test/cron_queue_test.info.yml @@ -2,5 +2,11 @@ name: 'Cron Queue test' type: module description: 'Support module for the cron queue runner.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/database_test/database_test.info.yml b/drupal/core/modules/system/tests/modules/database_test/database_test.info.yml index 92cea84c..db0966c9 100644 --- a/drupal/core/modules/system/tests/modules/database_test/database_test.info.yml +++ b/drupal/core/modules/system/tests/modules/database_test/database_test.info.yml @@ -1,6 +1,12 @@ name: 'Database Test' type: module description: 'Support module for Database layer tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info.yml b/drupal/core/modules/system/tests/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info.yml index 30bccf71..7fee3ff2 100644 --- a/drupal/core/modules/system/tests/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info.yml +++ b/drupal/core/modules/system/tests/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info.yml @@ -2,5 +2,11 @@ name: 'Drupal system listing compatible test' type: module description: 'Support module for testing the drupal_system_listing function.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.info.yml b/drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.info.yml index 7d355039..dcc7d365 100644 --- a/drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.info.yml +++ b/drupal/core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.info.yml @@ -1,6 +1,12 @@ name: 'Entity CRUD Hooks Test' type: module description: 'Support module for CRUD hook tests.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.info.yml b/drupal/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.info.yml index 646717dd..e9bea716 100644 --- a/drupal/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.info.yml +++ b/drupal/core/modules/system/tests/modules/entity_schema_test/entity_schema_test.info.yml @@ -2,7 +2,13 @@ name: 'Entity schema test module' type: module description: 'Provides entity and field definitions to test entity schema.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - entity_test + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/entity_test/entity_test.info.yml b/drupal/core/modules/system/tests/modules/entity_test/entity_test.info.yml index 8d3200cd..303b8d34 100644 --- a/drupal/core/modules/system/tests/modules/entity_test/entity_test.info.yml +++ b/drupal/core/modules/system/tests/modules/entity_test/entity_test.info.yml @@ -2,9 +2,15 @@ name: 'Entity CRUD test module' type: module description: 'Provides entity types based upon the CRUD API.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field - text - entity_reference + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php b/drupal/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php index 75fa1c17..00619ef2 100644 --- a/drupal/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php +++ b/drupal/core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php @@ -88,7 +88,7 @@ public function testEdit(Request $request, $entity_type_id) { * @see \Drupal\entity_test\Routing\EntityTestRoutes::routes() */ public function testAdmin() { - return ''; + return []; } /** diff --git a/drupal/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php b/drupal/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php index b4cb26e5..c583c46f 100644 --- a/drupal/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php +++ b/drupal/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php @@ -90,7 +90,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { 'weight' => -5, )) ->setDisplayOptions('form', array( - 'type' => 'string', + 'type' => 'string_textfield', 'weight' => -5, )); @@ -107,7 +107,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setSetting('handler', 'default') // Default EntityTest entities to have the root user as the owner, to // simplify testing. - ->setDefaultValue(array(0 => 1)) + ->setDefaultValue(array(0 => array('target_id' => 1))) ->setTranslatable(TRUE) ->setDisplayOptions('form', array( 'type' => 'entity_reference_autocomplete', diff --git a/drupal/core/modules/system/tests/modules/error_test/error_test.info.yml b/drupal/core/modules/system/tests/modules/error_test/error_test.info.yml index f91c7b35..bfdbcfaf 100644 --- a/drupal/core/modules/system/tests/modules/error_test/error_test.info.yml +++ b/drupal/core/modules/system/tests/modules/error_test/error_test.info.yml @@ -2,5 +2,11 @@ name: 'Error test' type: module description: 'Support module for error and exception testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php b/drupal/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php index 7a4bf905..8ba584a0 100644 --- a/drupal/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php +++ b/drupal/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php @@ -53,7 +53,7 @@ public function generateWarnings($collect_errors = FALSE) { $awesomely_big = 1/0; // This will generate a user error. trigger_error("Drupal is awesome", E_USER_WARNING); - return ""; + return []; } /** diff --git a/drupal/core/modules/system/tests/modules/form_test/form_test.info.yml b/drupal/core/modules/system/tests/modules/form_test/form_test.info.yml index 39d45eaa..f75ffdc8 100644 --- a/drupal/core/modules/system/tests/modules/form_test/form_test.info.yml +++ b/drupal/core/modules/system/tests/modules/form_test/form_test.info.yml @@ -2,5 +2,11 @@ name: 'FormAPI Test' type: module description: 'Support module for Form API tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/form_test/src/Controller/FormTestController.php b/drupal/core/modules/system/tests/modules/form_test/src/Controller/FormTestController.php index 1950076b..89cfcc07 100644 --- a/drupal/core/modules/system/tests/modules/form_test/src/Controller/FormTestController.php +++ b/drupal/core/modules/system/tests/modules/form_test/src/Controller/FormTestController.php @@ -41,9 +41,10 @@ public function twoFormInstances() { * Emulate legacy AHAH-style ajax callback. * * Drupal 6 AHAH callbacks used to operate directly on forms retrieved using - * form_get_cache and stored using form_set_cache after manipulation. This - * callback helps testing whether \Drupal::formBuilder()->setCache() prevents - * resaving of immutable forms. + * \Drupal::formBuilder()->getCache() and stored using + * \Drupal::formBuilder()->setCache() after manipulation. This callback helps + * testing whether \Drupal::formBuilder()->setCache() prevents resaving of + * immutable forms. */ public function storageLegacyHandler($form_build_id) { $form_state = new FormState(); diff --git a/drupal/core/modules/system/tests/modules/httpkernel_test/httpkernel_test.info.yml b/drupal/core/modules/system/tests/modules/httpkernel_test/httpkernel_test.info.yml index 5f1375f2..eefc7ec4 100644 --- a/drupal/core/modules/system/tests/modules/httpkernel_test/httpkernel_test.info.yml +++ b/drupal/core/modules/system/tests/modules/httpkernel_test/httpkernel_test.info.yml @@ -2,5 +2,11 @@ name: 'HttpKernel test' type: module description: 'Support module for httpkernel tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/image_test/image_test.info.yml b/drupal/core/modules/system/tests/modules/image_test/image_test.info.yml index 2e54287d..2870fc58 100644 --- a/drupal/core/modules/system/tests/modules/image_test/image_test.info.yml +++ b/drupal/core/modules/system/tests/modules/image_test/image_test.info.yml @@ -2,5 +2,11 @@ name: 'Image test' type: module description: 'Support module for image toolkit tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/invalid_module_name_over_the_maximum_allowed_character_length/invalid_module_name_over_the_maximum_allowed_character_length.info.yml b/drupal/core/modules/system/tests/modules/invalid_module_name_over_the_maximum_allowed_character_length/invalid_module_name_over_the_maximum_allowed_character_length.info.yml index db5cdcc5..1c79db1a 100644 --- a/drupal/core/modules/system/tests/modules/invalid_module_name_over_the_maximum_allowed_character_length/invalid_module_name_over_the_maximum_allowed_character_length.info.yml +++ b/drupal/core/modules/system/tests/modules/invalid_module_name_over_the_maximum_allowed_character_length/invalid_module_name_over_the_maximum_allowed_character_length.info.yml @@ -2,5 +2,11 @@ name: 'Module name length test' type: module description: 'Test module with a name over the maximum allowed characters.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.info.yml b/drupal/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.info.yml index 41cfb33c..14a4401c 100644 --- a/drupal/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.info.yml +++ b/drupal/core/modules/system/tests/modules/keyvalue_test/keyvalue_test.info.yml @@ -1,10 +1,16 @@ name: 'KeyValue tests' type: module description: 'A support module to test key value storage.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION hidden: true dependencies: - config_test - entity_test + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/menu_test/menu_test.info.yml b/drupal/core/modules/system/tests/modules/menu_test/menu_test.info.yml index dbba9b86..e21fef51 100644 --- a/drupal/core/modules/system/tests/modules/menu_test/menu_test.info.yml +++ b/drupal/core/modules/system/tests/modules/menu_test/menu_test.info.yml @@ -2,8 +2,14 @@ name: 'Hook menu tests' type: module description: 'Support module for menu hook testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - test_page_test - menu_ui + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/menu_test/menu_test.module b/drupal/core/modules/system/tests/modules/menu_test/menu_test.module index a5ce74e6..a87983b0 100644 --- a/drupal/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/drupal/core/modules/system/tests/modules/menu_test/menu_test.module @@ -91,7 +91,7 @@ function menu_test_menu_local_tasks_alter(&$data, $route_name) { * @deprecated Use \Drupal\menu_test\Controller\MenuTestController::menuTestCallback() */ function menu_test_callback() { - return 'This is menu_test_callback().'; + return ['#markup' => 'This is menu_test_callback().']; } /** @@ -117,7 +117,7 @@ function menu_test_theme_page_callback($inherited = FALSE) { if ($inherited) { $output .= ' Theme negotiation inheritance is being tested.'; } - return $output; + return ['#markup' => $output]; } /** diff --git a/drupal/core/modules/system/tests/modules/menu_test/src/TestControllers.php b/drupal/core/modules/system/tests/modules/menu_test/src/TestControllers.php index 608e0c78..bbc4f1f9 100644 --- a/drupal/core/modules/system/tests/modules/menu_test/src/TestControllers.php +++ b/drupal/core/modules/system/tests/modules/menu_test/src/TestControllers.php @@ -19,28 +19,28 @@ class TestControllers { * Returns page to be used as a login path. */ public function testLogin() { - return 'This is TestControllers::testLogin.'; + return ['#markup' => 'This is TestControllers::testLogin.']; } /** * Prints out test data. */ public function test1() { - return 'test1'; + return ['#markup' => 'test1']; } /** * Prints out test data. */ public function test2() { - return 'test2'; + return ['#markup' => 'test2']; } /** * Prints out test data. */ public function testDerived() { - return 'testDerived'; + return ['#markup' => 'testDerived']; } /** @@ -54,10 +54,10 @@ public function testDerived() { */ public function testDefaults($placeholder = NULL) { if ($placeholder) { - return String::format("Sometimes there is a placeholder: '@placeholder'.", array('@placeholder' => $placeholder)); + return ['#markup' => String::format("Sometimes there is a placeholder: '@placeholder'.", array('@placeholder' => $placeholder))]; } else { - return String::format('Sometimes there is no placeholder.'); + return ['#markup' => String::format('Sometimes there is no placeholder.')]; } } diff --git a/drupal/core/modules/system/tests/modules/module_autoload_test/module_autoload_test.info.yml b/drupal/core/modules/system/tests/modules/module_autoload_test/module_autoload_test.info.yml index 18051859..c930c005 100644 --- a/drupal/core/modules/system/tests/modules/module_autoload_test/module_autoload_test.info.yml +++ b/drupal/core/modules/system/tests/modules/module_autoload_test/module_autoload_test.info.yml @@ -2,5 +2,11 @@ name: 'Module autoload test' type: module description: 'Support module for module system tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/module_test/module_test.info.yml b/drupal/core/modules/system/tests/modules/module_test/module_test.info.yml index 025525cc..dab8241e 100644 --- a/drupal/core/modules/system/tests/modules/module_test/module_test.info.yml +++ b/drupal/core/modules/system/tests/modules/module_test/module_test.info.yml @@ -2,10 +2,16 @@ name: 'Module test' type: module description: 'Support module for module system testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x # Depends on the Node module to test making a module required using # hook_system_info_alter() and ensuring that its dependencies also become # required. dependencies: - node + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/module_test/src/Controller/ModuleTestController.php b/drupal/core/modules/system/tests/modules/module_test/src/Controller/ModuleTestController.php index df3b8f7f..3a2532ed 100644 --- a/drupal/core/modules/system/tests/modules/module_test/src/Controller/ModuleTestController.php +++ b/drupal/core/modules/system/tests/modules/module_test/src/Controller/ModuleTestController.php @@ -30,7 +30,7 @@ public function hookDynamicLoadingInvokeAll() { * @todo Remove module_test_class_loading(). */ public function testClassLoading() { - return module_test_class_loading(); + return ['#markup' => module_test_class_loading()]; } } diff --git a/drupal/core/modules/system/tests/modules/paramconverter_test/paramconverter_test.info.yml b/drupal/core/modules/system/tests/modules/paramconverter_test/paramconverter_test.info.yml index 1953d929..5465c27f 100644 --- a/drupal/core/modules/system/tests/modules/paramconverter_test/paramconverter_test.info.yml +++ b/drupal/core/modules/system/tests/modules/paramconverter_test/paramconverter_test.info.yml @@ -2,5 +2,11 @@ name: "ParamConverter test" type: module description: "Support module for paramconverter testing." package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php b/drupal/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php index 8b48b45b..33f52fcf 100644 --- a/drupal/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php +++ b/drupal/core/modules/system/tests/modules/paramconverter_test/src/TestControllers.php @@ -19,14 +19,14 @@ class TestControllers { public function testUserNodeFoo(EntityInterface $user, NodeInterface $node, Request $request) { $foo = $request->attributes->get('foo'); $foo = is_object($foo) ? $foo->label() : $foo; - return "user: {$user->label()}, node: {$node->label()}, foo: $foo"; + return ['#markup' => "user: {$user->label()}, node: {$node->label()}, foo: $foo"]; } public function testNodeSetParent(NodeInterface $node, NodeInterface $parent) { - return "Setting '{$parent->label()}' as parent of '{$node->label()}'."; + return ['#markup' => "Setting '{$parent->label()}' as parent of '{$node->label()}'."]; } public function testEntityLanguage(NodeInterface $node) { - return $node->label(); + return ['#markup' => $node->label()]; } } diff --git a/drupal/core/modules/system/tests/modules/path_test/path_test.info.yml b/drupal/core/modules/system/tests/modules/path_test/path_test.info.yml index ec7e4057..bb6a23a7 100644 --- a/drupal/core/modules/system/tests/modules/path_test/path_test.info.yml +++ b/drupal/core/modules/system/tests/modules/path_test/path_test.info.yml @@ -2,5 +2,11 @@ name: 'Hook path tests' type: module description: 'Support module for path hook testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/plugin_test/plugin_test.info.yml b/drupal/core/modules/system/tests/modules/plugin_test/plugin_test.info.yml index 950a1d02..e60d6f4d 100644 --- a/drupal/core/modules/system/tests/modules/plugin_test/plugin_test.info.yml +++ b/drupal/core/modules/system/tests/modules/plugin_test/plugin_test.info.yml @@ -2,5 +2,11 @@ name: 'Plugin Test Support' type: module description: 'Test that plugins can provide plugins and provide namespace discovery for plugin test implementations.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/requirements1_test/requirements1_test.info.yml b/drupal/core/modules/system/tests/modules/requirements1_test/requirements1_test.info.yml index 6288bf3e..3bf596eb 100644 --- a/drupal/core/modules/system/tests/modules/requirements1_test/requirements1_test.info.yml +++ b/drupal/core/modules/system/tests/modules/requirements1_test/requirements1_test.info.yml @@ -2,5 +2,11 @@ name: 'Requirements 1 Test' type: module description: 'Tests that a module is not installed when it fails hook_requirements(''install'').' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/requirements2_test/requirements2_test.info.yml b/drupal/core/modules/system/tests/modules/requirements2_test/requirements2_test.info.yml index 670df809..75bc8746 100644 --- a/drupal/core/modules/system/tests/modules/requirements2_test/requirements2_test.info.yml +++ b/drupal/core/modules/system/tests/modules/requirements2_test/requirements2_test.info.yml @@ -5,5 +5,11 @@ dependencies: - requirements1_test - comment package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/router_test_directory/router_test.info.yml b/drupal/core/modules/system/tests/modules/router_test_directory/router_test.info.yml index 27a08278..290547c9 100644 --- a/drupal/core/modules/system/tests/modules/router_test_directory/router_test.info.yml +++ b/drupal/core/modules/system/tests/modules/router_test_directory/router_test.info.yml @@ -2,5 +2,11 @@ name: 'Router test' type: module description: 'Support module for routing testing. In a directory that does not match the module name to test that use case.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/router_test_directory/src/TestContent.php b/drupal/core/modules/system/tests/modules/router_test_directory/src/TestContent.php index 6559c70d..dc2cacae 100644 --- a/drupal/core/modules/system/tests/modules/router_test_directory/src/TestContent.php +++ b/drupal/core/modules/system/tests/modules/router_test_directory/src/TestContent.php @@ -43,7 +43,7 @@ public static function create(ContainerInterface $container) { * Provides example content for testing route enhancers. */ public function test1() { - return 'abcde'; + return ['#markup' => 'abcde']; } /** @@ -54,13 +54,13 @@ public function test1() { */ public function test11() { $account = $this->currentUser(); - return $account->getUsername(); + return ['#markup' => $account->getUsername()]; } public function testAccount(UserInterface $user) { $current_user_name = $this->currentUser()->getUsername(); $this->currentUser()->setAccount($user); - return $current_user_name . ':' . $user->getUsername(); + return ['#markup' => $current_user_name . ':' . $user->getUsername()]; } /** diff --git a/drupal/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php b/drupal/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php index 1eec2632..10ba2ca1 100644 --- a/drupal/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php +++ b/drupal/core/modules/system/tests/modules/router_test_directory/src/TestControllers.php @@ -26,19 +26,19 @@ public function test1() { } public function test2() { - return "test2"; + return ['#markup' => "test2"]; } public function test3($value) { - return $value; + return ['#markup' => $value]; } public function test4($value) { - return $value; + return ['#markup' => $value]; } public function test5() { - return "test5"; + return ['#markup' => "test5"]; } public function test6() { diff --git a/drupal/core/modules/system/tests/modules/service_provider_test/service_provider_test.info.yml b/drupal/core/modules/system/tests/modules/service_provider_test/service_provider_test.info.yml index ba84020c..b4cfd516 100644 --- a/drupal/core/modules/system/tests/modules/service_provider_test/service_provider_test.info.yml +++ b/drupal/core/modules/system/tests/modules/service_provider_test/service_provider_test.info.yml @@ -2,5 +2,11 @@ name: 'Service Provider test' type: module description: 'Support module for service provider testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/session_test/session_test.info.yml b/drupal/core/modules/system/tests/modules/session_test/session_test.info.yml index b9abfef0..ca38095a 100644 --- a/drupal/core/modules/system/tests/modules/session_test/session_test.info.yml +++ b/drupal/core/modules/system/tests/modules/session_test/session_test.info.yml @@ -2,5 +2,11 @@ name: 'Session test' type: module description: 'Support module for session data testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/session_test/session_test.routing.yml b/drupal/core/modules/system/tests/modules/session_test/session_test.routing.yml index b044fc42..accd2c87 100644 --- a/drupal/core/modules/system/tests/modules/session_test/session_test.routing.yml +++ b/drupal/core/modules/system/tests/modules/session_test/session_test.routing.yml @@ -60,14 +60,6 @@ session_test.set_message_but_dont_save: requirements: _access: 'TRUE' -session_test.set_not_started: - path: '/session-test/set-not-started' - defaults: - _title: 'Set message when session is not started' - _content: '\Drupal\session_test\Controller\SessionTestController::setNotStarted' - requirements: - _access: 'TRUE' - session_test.is_logged_in: path: '/session-test/is-logged-in' defaults: diff --git a/drupal/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php b/drupal/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php index 5fbd4128..9deae9fe 100644 --- a/drupal/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php +++ b/drupal/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php @@ -24,8 +24,8 @@ class SessionTestController extends ControllerBase { */ public function get() { return empty($_SESSION['session_test_value']) - ? "" - : $this->t('The current value of the stored session variable is: %val', array('%val' => $_SESSION['session_test_value'])); + ? [] + : ['#markup' => $this->t('The current value of the stored session variable is: %val', array('%val' => $_SESSION['session_test_value']))]; } /** @@ -41,7 +41,7 @@ public function getId() { \Drupal::service('session_manager')->save(); - return 'session_id:' . session_id() . "\n"; + return ['#markup' => 'session_id:' . session_id() . "\n"]; } /** @@ -54,7 +54,7 @@ public function getId() { * A notification message with session ID. */ public function getIdFromCookie(Request $request) { - return 'session_id:' . $request->cookies->get(session_name()) . "\n"; + return ['#markup' => 'session_id:' . $request->cookies->get(session_name()) . "\n"]; } /** @@ -69,7 +69,7 @@ public function getIdFromCookie(Request $request) { public function set($test_value) { $_SESSION['session_test_value'] = $test_value; - return $this->t('The current value of the stored session variable has been set to %val', array('%val' => $test_value)); + return ['#markup' => $this->t('The current value of the stored session variable has been set to %val', array('%val' => $test_value))]; } /** @@ -85,7 +85,7 @@ public function set($test_value) { public function noSet($test_value) { \Drupal::service('session_manager')->disable(); $this->set($test_value); - return $this->t('session saving was disabled, and then %val was set', array('%val' => $test_value)); + return ['#markup' => $this->t('session saving was disabled, and then %val was set', array('%val' => $test_value))]; } /** @@ -111,19 +111,7 @@ public function setMessage() { public function setMessageButDontSave() { \Drupal::service('session_manager')->disable(); $this->setMessage(); - } - - /** - * Stores a value in $_SESSION['session_test_value'] without - * having started the session in advance. - * - * @return string - * A notification message. - */ - public function setNotStarted() { - if (!drupal_session_will_start()) { - $this->set($this->t('Session was not started')); - } + return ['#markup' => '']; } /** @@ -133,6 +121,6 @@ public function setNotStarted() { * A notification message. */ public function isLoggedIn() { - return $this->t('User is logged in.'); + return ['#markup' => $this->t('User is logged in.')]; } } diff --git a/drupal/core/modules/system/tests/modules/system_dependencies_test/system_dependencies_test.info.yml b/drupal/core/modules/system/tests/modules/system_dependencies_test/system_dependencies_test.info.yml index e99d48e4..23dfa660 100644 --- a/drupal/core/modules/system/tests/modules/system_dependencies_test/system_dependencies_test.info.yml +++ b/drupal/core/modules/system/tests/modules/system_dependencies_test/system_dependencies_test.info.yml @@ -2,7 +2,13 @@ name: 'System dependency test' type: module description: 'Support module for testing system dependencies.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - _missing_dependency + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/system_incompatible_core_version_dependencies_test/system_incompatible_core_version_dependencies_test.info.yml b/drupal/core/modules/system/tests/modules/system_incompatible_core_version_dependencies_test/system_incompatible_core_version_dependencies_test.info.yml index 148bd3b7..596e6e91 100644 --- a/drupal/core/modules/system/tests/modules/system_incompatible_core_version_dependencies_test/system_incompatible_core_version_dependencies_test.info.yml +++ b/drupal/core/modules/system/tests/modules/system_incompatible_core_version_dependencies_test/system_incompatible_core_version_dependencies_test.info.yml @@ -2,7 +2,13 @@ name: 'System incompatible core version dependencies test' type: module description: 'Support module for testing system dependencies.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - system_incompatible_core_version_test + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/system_incompatible_core_version_test/system_incompatible_core_version_test.info.yml b/drupal/core/modules/system/tests/modules/system_incompatible_core_version_test/system_incompatible_core_version_test.info.yml index d99300b8..3e04ecc2 100644 --- a/drupal/core/modules/system/tests/modules/system_incompatible_core_version_test/system_incompatible_core_version_test.info.yml +++ b/drupal/core/modules/system/tests/modules/system_incompatible_core_version_test/system_incompatible_core_version_test.info.yml @@ -2,5 +2,11 @@ name: 'System incompatible core version test' type: module description: 'Support module for testing system dependencies.' package: Testing -version: VERSION -core: 5.x +# version: VERSION +# core: 5.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/system_incompatible_module_version_dependencies_test/system_incompatible_module_version_dependencies_test.info.yml b/drupal/core/modules/system/tests/modules/system_incompatible_module_version_dependencies_test/system_incompatible_module_version_dependencies_test.info.yml index 55e004b0..8f398ec8 100644 --- a/drupal/core/modules/system/tests/modules/system_incompatible_module_version_dependencies_test/system_incompatible_module_version_dependencies_test.info.yml +++ b/drupal/core/modules/system/tests/modules/system_incompatible_module_version_dependencies_test/system_incompatible_module_version_dependencies_test.info.yml @@ -2,7 +2,13 @@ name: 'System incompatible module version dependencies test' type: module description: 'Support module for testing system dependencies.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - 'system_incompatible_module_version_test (>2.0)' + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/system_incompatible_module_version_test/system_incompatible_module_version_test.info.yml b/drupal/core/modules/system/tests/modules/system_incompatible_module_version_test/system_incompatible_module_version_test.info.yml index f0076b1e..27625bcf 100644 --- a/drupal/core/modules/system/tests/modules/system_incompatible_module_version_test/system_incompatible_module_version_test.info.yml +++ b/drupal/core/modules/system/tests/modules/system_incompatible_module_version_test/system_incompatible_module_version_test.info.yml @@ -2,5 +2,11 @@ name: 'System incompatible module version test' type: module description: 'Support module for testing system dependencies.' package: Testing -version: '1.0' -core: 8.x +# version: '1.0' +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/system_mail_failure_test/system_mail_failure_test.info.yml b/drupal/core/modules/system/tests/modules/system_mail_failure_test/system_mail_failure_test.info.yml index 12ad6e24..463b7c4e 100644 --- a/drupal/core/modules/system/tests/modules/system_mail_failure_test/system_mail_failure_test.info.yml +++ b/drupal/core/modules/system/tests/modules/system_mail_failure_test/system_mail_failure_test.info.yml @@ -2,5 +2,11 @@ name: 'System mail failure test' type: module description: 'Provides a malfunctioning mail service for testing purposes.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/system_module_test/system_module_test.info.yml b/drupal/core/modules/system/tests/modules/system_module_test/system_module_test.info.yml index 6b787f5e..ff348cc8 100644 --- a/drupal/core/modules/system/tests/modules/system_module_test/system_module_test.info.yml +++ b/drupal/core/modules/system/tests/modules/system_module_test/system_module_test.info.yml @@ -2,5 +2,11 @@ name: 'System test' type: module description: 'Provides hook implementations for testing System module functionality.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php b/drupal/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php index c6b6903a..d79e3f66 100644 --- a/drupal/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php +++ b/drupal/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php @@ -49,7 +49,7 @@ public static function create(ContainerInterface $container) { * The text to display. */ public function mainContentFallback() { - return $this->t('Content to test main content fallback'); + return ['#markup' => $this->t('Content to test main content fallback')]; } /** @@ -65,7 +65,7 @@ public function drupalSetMessageTest() { // Remove the first. unset($_SESSION['messages']['status'][0]); - return ''; + return []; } /** @@ -93,10 +93,10 @@ public function lockExit() { */ public function lockPersist($lock_name) { if ($this->persistentLock->acquire($lock_name)) { - return 'TRUE: Lock successfully acquired in SystemTestController::lockPersist()'; + return ['#markup' => 'TRUE: Lock successfully acquired in SystemTestController::lockPersist()']; } else { - return 'FALSE: Lock not acquired in SystemTestController::lockPersist()'; + return ['#markup' => 'FALSE: Lock not acquired in SystemTestController::lockPersist()']; } } @@ -154,8 +154,9 @@ public function shutdownFunctions($arg1, $arg2) { // @see _drupal_shutdown_function() // @see \Drupal\system\Tests\System\ShutdownFunctionsTest if (function_exists('fastcgi_finish_request')) { - return 'The function fastcgi_finish_request exists when serving the request.'; + return ['#markup' => 'The function fastcgi_finish_request exists when serving the request.']; } + return []; } /** diff --git a/drupal/core/modules/system/tests/modules/system_test/system_test.info.yml b/drupal/core/modules/system/tests/modules/system_test/system_test.info.yml index 72287094..308eb6ce 100644 --- a/drupal/core/modules/system/tests/modules/system_test/system_test.info.yml +++ b/drupal/core/modules/system/tests/modules/system_test/system_test.info.yml @@ -2,8 +2,14 @@ name: 'System test' type: module description: 'Support module for system testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: system_test.configure configure_parameters: foo: bar + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/system_test/system_test.module b/drupal/core/modules/system/tests/modules/system_test/system_test.module index 78c1504c..80246803 100644 --- a/drupal/core/modules/system/tests/modules/system_test/system_test.module +++ b/drupal/core/modules/system/tests/modules/system_test/system_test.module @@ -72,10 +72,10 @@ function system_test_system_info_alter(&$info, Extension $file, $type) { function system_test_lock_acquire() { if (\Drupal::lock()->acquire('system_test_lock_acquire')) { \Drupal::lock()->release('system_test_lock_acquire'); - return 'TRUE: Lock successfully acquired in system_test_lock_acquire()'; + return ['#markup' => 'TRUE: Lock successfully acquired in system_test_lock_acquire()']; } else { - return 'FALSE: Lock not acquired in system_test_lock_acquire()'; + return ['#markup' => 'FALSE: Lock not acquired in system_test_lock_acquire()']; } } @@ -91,7 +91,7 @@ function system_test_lock_exit() { exit(); } else { - return 'FALSE: Lock not acquired in system_test_lock_exit()'; + return ['#markup' => 'FALSE: Lock not acquired in system_test_lock_exit()']; } } diff --git a/drupal/core/modules/system/tests/modules/test_page_test/test_page_test.info.yml b/drupal/core/modules/system/tests/modules/test_page_test/test_page_test.info.yml index f01c5971..bdefc496 100644 --- a/drupal/core/modules/system/tests/modules/test_page_test/test_page_test.info.yml +++ b/drupal/core/modules/system/tests/modules/test_page_test/test_page_test.info.yml @@ -2,5 +2,11 @@ name: 'Test page' type: module description: 'Provides a test page for automated tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/theme_page_test/theme_page_test.info.yml b/drupal/core/modules/system/tests/modules/theme_page_test/theme_page_test.info.yml index da50bb11..468d4835 100644 --- a/drupal/core/modules/system/tests/modules/theme_page_test/theme_page_test.info.yml +++ b/drupal/core/modules/system/tests/modules/theme_page_test/theme_page_test.info.yml @@ -2,5 +2,11 @@ name: 'Theme page test' type: module description: 'Support module for theme system testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/theme_region_test/theme_region_test.info.yml b/drupal/core/modules/system/tests/modules/theme_region_test/theme_region_test.info.yml index 0cf5fe31..cd010012 100644 --- a/drupal/core/modules/system/tests/modules/theme_region_test/theme_region_test.info.yml +++ b/drupal/core/modules/system/tests/modules/theme_region_test/theme_region_test.info.yml @@ -2,5 +2,11 @@ name: 'Theme region test' type: module description: 'Provides hook implementations for testing regions.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.info.yml b/drupal/core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.info.yml index fe61d0d9..529332a3 100644 --- a/drupal/core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.info.yml +++ b/drupal/core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.info.yml @@ -2,5 +2,11 @@ name: 'Theme suggestions test' type: module description: 'Support module for testing theme suggestions.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/theme_test/src/ThemeTestController.php b/drupal/core/modules/system/tests/modules/theme_test/src/ThemeTestController.php index caf95333..fb8e1f98 100644 --- a/drupal/core/modules/system/tests/modules/theme_test/src/ThemeTestController.php +++ b/drupal/core/modules/system/tests/modules/theme_test/src/ThemeTestController.php @@ -56,7 +56,7 @@ public function testInfoStylesheets() { * A render array containing a theme override. */ public function testTemplate() { - return \Drupal::theme()->render('theme_test_template_test', array()); + return ['#markup' => \Drupal::theme()->render('theme_test_template_test', array())]; } /** @@ -82,7 +82,7 @@ public function testInlineTemplate() { * An HTML string containing the themed output. */ public function testSuggestion() { - return \Drupal::theme()->render(array('theme_test__suggestion', 'theme_test'), array()); + return ['#markup' => \Drupal::theme()->render(array('theme_test__suggestion', 'theme_test'), array())]; } /** @@ -92,7 +92,7 @@ public function testSuggestion() { * Content in theme_test_output GLOBAL. */ public function testRequestListener() { - return $GLOBALS['theme_test_output']; + return ['#markup' => $GLOBALS['theme_test_output']]; } /** diff --git a/drupal/core/modules/system/tests/modules/theme_test/theme_test.info.yml b/drupal/core/modules/system/tests/modules/theme_test/theme_test.info.yml index 0fe8c101..0d628824 100644 --- a/drupal/core/modules/system/tests/modules/theme_test/theme_test.info.yml +++ b/drupal/core/modules/system/tests/modules/theme_test/theme_test.info.yml @@ -2,5 +2,11 @@ name: 'Theme test' type: module description: 'Support module for theme system testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/transliterate_test/transliterate_test.info.yml b/drupal/core/modules/system/tests/modules/transliterate_test/transliterate_test.info.yml index 9eeddd5a..6073142b 100644 --- a/drupal/core/modules/system/tests/modules/transliterate_test/transliterate_test.info.yml +++ b/drupal/core/modules/system/tests/modules/transliterate_test/transliterate_test.info.yml @@ -2,5 +2,11 @@ name: 'Transliteration test' type: module description: 'Helper module for Transliteration system tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.info.yml b/drupal/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.info.yml index 5aee1e26..068dd7f6 100644 --- a/drupal/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.info.yml +++ b/drupal/core/modules/system/tests/modules/twig_extension_test/twig_extension_test.info.yml @@ -2,5 +2,11 @@ name: 'Twig Extension Test' type: module description: 'Support module for testing Twig extensions.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_a/twig_namespace_a.info.yml b/drupal/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_a/twig_namespace_a.info.yml index 7584b57c..6aee4e78 100644 --- a/drupal/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_a/twig_namespace_a.info.yml +++ b/drupal/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_a/twig_namespace_a.info.yml @@ -2,5 +2,11 @@ name: 'Twig namespace test: Module A' type: module description: 'Support module for Twig namespace testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_b/twig_namespace_b.info.yml b/drupal/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_b/twig_namespace_b.info.yml index 7584b57c..6aee4e78 100644 --- a/drupal/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_b/twig_namespace_b.info.yml +++ b/drupal/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_b/twig_namespace_b.info.yml @@ -2,5 +2,11 @@ name: 'Twig namespace test: Module A' type: module description: 'Support module for Twig namespace testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php b/drupal/core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php index 9441a50e..f657c4da 100644 --- a/drupal/core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php +++ b/drupal/core/modules/system/tests/modules/twig_theme_test/src/TwigThemeTestController.php @@ -18,7 +18,7 @@ class TwigThemeTestController { * Menu callback for testing PHP variables in a Twig template. */ public function phpVariablesRender() { - return \Drupal::theme()->render('twig_theme_test_php_variables', array()); + return ['#markup' => \Drupal::theme()->render('twig_theme_test_php_variables', array())]; } /** diff --git a/drupal/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.info.yml b/drupal/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.info.yml index 75153159..8d7d0c0e 100644 --- a/drupal/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.info.yml +++ b/drupal/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.info.yml @@ -2,5 +2,11 @@ name: 'Twig theme test' type: module description: 'Support module for Twig theme system testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/update_script_test/update_script_test.info.yml b/drupal/core/modules/system/tests/modules/update_script_test/update_script_test.info.yml index b582c1ab..b2a17af9 100644 --- a/drupal/core/modules/system/tests/modules/update_script_test/update_script_test.info.yml +++ b/drupal/core/modules/system/tests/modules/update_script_test/update_script_test.info.yml @@ -2,5 +2,11 @@ name: 'Update script test' type: module description: 'Support module for update script testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/update_test_0/update_test_0.info.yml b/drupal/core/modules/system/tests/modules/update_test_0/update_test_0.info.yml index 4162fd02..875c0e27 100644 --- a/drupal/core/modules/system/tests/modules/update_test_0/update_test_0.info.yml +++ b/drupal/core/modules/system/tests/modules/update_test_0/update_test_0.info.yml @@ -2,5 +2,11 @@ name: 'Update test 0' type: module description: 'Support module for update testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/update_test_1/update_test_1.info.yml b/drupal/core/modules/system/tests/modules/update_test_1/update_test_1.info.yml index 5a7e2e1f..53966a4f 100644 --- a/drupal/core/modules/system/tests/modules/update_test_1/update_test_1.info.yml +++ b/drupal/core/modules/system/tests/modules/update_test_1/update_test_1.info.yml @@ -2,5 +2,11 @@ name: 'Update test' type: module description: 'Support module for update testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/update_test_2/update_test_2.info.yml b/drupal/core/modules/system/tests/modules/update_test_2/update_test_2.info.yml index 5a7e2e1f..53966a4f 100644 --- a/drupal/core/modules/system/tests/modules/update_test_2/update_test_2.info.yml +++ b/drupal/core/modules/system/tests/modules/update_test_2/update_test_2.info.yml @@ -2,5 +2,11 @@ name: 'Update test' type: module description: 'Support module for update testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/update_test_3/update_test_3.info.yml b/drupal/core/modules/system/tests/modules/update_test_3/update_test_3.info.yml index 5a7e2e1f..53966a4f 100644 --- a/drupal/core/modules/system/tests/modules/update_test_3/update_test_3.info.yml +++ b/drupal/core/modules/system/tests/modules/update_test_3/update_test_3.info.yml @@ -2,5 +2,11 @@ name: 'Update test' type: module description: 'Support module for update testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/update_test_invalid_hook/update_test_invalid_hook.info.yml b/drupal/core/modules/system/tests/modules/update_test_invalid_hook/update_test_invalid_hook.info.yml index b9aefba4..2377d792 100644 --- a/drupal/core/modules/system/tests/modules/update_test_invalid_hook/update_test_invalid_hook.info.yml +++ b/drupal/core/modules/system/tests/modules/update_test_invalid_hook/update_test_invalid_hook.info.yml @@ -2,5 +2,11 @@ name: 'Update test with an invalid hook_update_8000().' type: module description: 'Support module for update testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.info.yml b/drupal/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.info.yml index 2b47a049..562a9be6 100644 --- a/drupal/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.info.yml +++ b/drupal/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.info.yml @@ -2,5 +2,11 @@ name: 'Update test with 7.x updates left in the codebase.' type: module description: 'Support module for update testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/modules/url_alter_test/url_alter_test.info.yml b/drupal/core/modules/system/tests/modules/url_alter_test/url_alter_test.info.yml index 95aba308..9610c59e 100644 --- a/drupal/core/modules/system/tests/modules/url_alter_test/url_alter_test.info.yml +++ b/drupal/core/modules/system/tests/modules/url_alter_test/url_alter_test.info.yml @@ -1,6 +1,12 @@ name: 'Url_alter tests' type: module description: 'A support module to test altering the inbound and outbound path.' -core: 8.x +# core: 8.x package: Testing -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml b/drupal/core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml index 2edc8234..c9cbb0b3 100644 --- a/drupal/core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml +++ b/drupal/core/modules/system/tests/themes/test_basetheme/test_basetheme.info.yml @@ -1,8 +1,8 @@ name: 'Theme test base theme' type: theme description: 'Test theme which acts as a base theme for other test subthemes.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x stylesheets: all: - base-add.css @@ -17,3 +17,9 @@ stylesheets-remove: settings: basetheme_only: 'base theme value' subtheme_override: 'base theme value' + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info.yml b/drupal/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info.yml index ab0b49ed..fa522c7d 100644 --- a/drupal/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info.yml +++ b/drupal/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info.yml @@ -1,6 +1,12 @@ name: 'Theme test with invalid base theme' type: theme description: 'Test theme which has a non-existent base theme.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x base theme: not_real_test_basetheme + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info.yml b/drupal/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info.yml index 229ede49..7fc559ad 100644 --- a/drupal/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info.yml +++ b/drupal/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info.yml @@ -1,6 +1,12 @@ name: 'Theme test with invalid theme engine' type: theme description: 'Test theme which has a non-existent theme engine.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x engine: not_real_engine + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml b/drupal/core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml index cdcd8f08..96e6f41d 100644 --- a/drupal/core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml +++ b/drupal/core/modules/system/tests/themes/test_subtheme/test_subtheme.info.yml @@ -1,8 +1,8 @@ name: 'Theme test subtheme' type: theme description: 'Test theme which uses test_basetheme as the base theme.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x base theme: test_basetheme stylesheets: all: @@ -17,3 +17,9 @@ stylesheets-remove: - base-override.sub-remove.css settings: subtheme_override: 'subtheme value' + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/themes/test_theme/test_theme.info.yml b/drupal/core/modules/system/tests/themes/test_theme/test_theme.info.yml index e35a15d2..3bd08a33 100644 --- a/drupal/core/modules/system/tests/themes/test_theme/test_theme.info.yml +++ b/drupal/core/modules/system/tests/themes/test_theme/test_theme.info.yml @@ -11,8 +11,8 @@ name: 'Test theme' type: theme description: 'Theme for testing the theme system' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x stylesheets-remove: - system.module.css settings: @@ -21,3 +21,9 @@ regions: content: Content left: Left right: Right + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/themes/test_theme_having_veery_long_name_which_is_too_long/test_theme_having_veery_long_name_which_is_too_long.info.yml b/drupal/core/modules/system/tests/themes/test_theme_having_veery_long_name_which_is_too_long/test_theme_having_veery_long_name_which_is_too_long.info.yml index 46432b4f..3163913a 100644 --- a/drupal/core/modules/system/tests/themes/test_theme_having_veery_long_name_which_is_too_long/test_theme_having_veery_long_name_which_is_too_long.info.yml +++ b/drupal/core/modules/system/tests/themes/test_theme_having_veery_long_name_which_is_too_long/test_theme_having_veery_long_name_which_is_too_long.info.yml @@ -1,4 +1,10 @@ type: theme -core: 8.x +# core: 8.x name: 'Test theme with a too long name' -version: VERSION +# version: VERSION + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/tests/themes/test_theme_phptemplate/test_theme_phptemplate.info.yml b/drupal/core/modules/system/tests/themes/test_theme_phptemplate/test_theme_phptemplate.info.yml index da076b1f..10357b45 100644 --- a/drupal/core/modules/system/tests/themes/test_theme_phptemplate/test_theme_phptemplate.info.yml +++ b/drupal/core/modules/system/tests/themes/test_theme_phptemplate/test_theme_phptemplate.info.yml @@ -1,6 +1,12 @@ name: 'Test theme PHPTemplate' type: theme description: 'Theme for testing the theme system with the PHPTemplate engine' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x engine: phptemplate + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/system/theme.api.php b/drupal/core/modules/system/theme.api.php index fba946fa..3087c5fc 100644 --- a/drupal/core/modules/system/theme.api.php +++ b/drupal/core/modules/system/theme.api.php @@ -307,6 +307,11 @@ * @} */ +/** + * @addtogroup hooks + * @{ + */ + /** * Allow themes to alter the theme-specific settings form. * @@ -576,3 +581,489 @@ function hook_render_template($template_file, $variables) { return $twig_service->loadTemplate($template_file)->render($variables); } + +/** + * Allows modules to declare their own Form API element types and specify their + * default values. + * + * This hook allows modules to declare their own form element types and to + * specify their default values. The values returned by this hook will be + * merged with the elements returned by form constructor implementations and so + * can return defaults for any Form APIs keys in addition to those explicitly + * documented by \Drupal\Core\Render\ElementInfoManagerInterface::getInfo(). + * + * @return array + * An associative array with structure identical to that of the return value + * of \Drupal\Core\Render\ElementInfoManagerInterface::getInfo(). + * + * @deprecated Use an annotated class instead, see + * \Drupal\Core\Render\Element\ElementInterface. + * + * @see hook_element_info_alter() + */ +function hook_element_info() { + $types['filter_format'] = array( + '#input' => TRUE, + ); + return $types; +} + +/** + * Alter the element type information returned from modules. + * + * A module may implement this hook in order to alter the element type defaults + * defined by a module. + * + * @param array $types + * An associative array with structure identical to that of the return value + * of \Drupal\Core\Render\ElementInfoManagerInterface::getInfo(). + * + * @see hook_element_info() + */ +function hook_element_info_alter(array &$types) { + // Decrease the default size of textfields. + if (isset($types['textfield']['#size'])) { + $types['textfield']['#size'] = 40; + } +} + +/** + * Perform necessary alterations to the JavaScript before it is presented on + * the page. + * + * @param $javascript + * An array of all JavaScript being presented on the page. + * + * @see _drupal_add_js() + * @see drupal_get_js() + * @see drupal_js_defaults() + */ +function hook_js_alter(&$javascript) { + // Swap out jQuery to use an updated version of the library. + $javascript['core/assets/vendor/jquery/jquery.js']['data'] = drupal_get_path('module', 'jquery_update') . '/jquery.js'; +} + +/** + * Alters the JavaScript/CSS library registry. + * + * Allows certain, contributed modules to update libraries to newer versions + * while ensuring backwards compatibility. In general, such manipulations should + * only be done by designated modules, since most modules that integrate with a + * certain library also depend on the API of a certain library version. + * + * @param $libraries + * The JavaScript/CSS libraries provided by $module. Keyed by internal library + * name and passed by reference. + * @param $module + * The name of the module that registered the libraries. + */ +function hook_library_info_alter(&$libraries, $module) { + // Update Farbtastic to version 2.0. + if ($module == 'core' && isset($libraries['jquery.farbtastic'])) { + // Verify existing version is older than the one we are updating to. + if (version_compare($libraries['jquery.farbtastic']['version'], '2.0', '<')) { + // Update the existing Farbtastic to version 2.0. + $libraries['jquery.farbtastic']['version'] = '2.0'; + // To accurately replace library files, the order of files and the options + // of each file have to be retained; e.g., like this: + $old_path = 'assets/vendor/farbtastic'; + // Since the replaced library files are no longer located in a directory + // relative to the original extension, specify an absolute path (relative + // to DRUPAL_ROOT / base_path()) to the new location. + $new_path = '/' . drupal_get_path('module', 'farbtastic_update') . '/js'; + $new_js = array(); + $replacements = array( + $old_path . '/farbtastic.js' => $new_path . '/farbtastic-2.0.js', + ); + foreach ($libraries['jquery.farbtastic']['js'] as $source => $options) { + if (isset($replacements[$source])) { + $new_js[$replacements[$source]] = $options; + } + else { + $new_js[$source] = $options; + } + } + $libraries['jquery.farbtastic']['js'] = $new_js; + } + } +} + +/** + * Alters a JavaScript/CSS library before it is attached. + * + * Allows modules and themes to dynamically attach further assets to a library + * when it is added to the page; e.g., to add JavaScript settings. + * + * This hook is only invoked once per library and page. + * + * @param array $library + * The JavaScript/CSS library that is being added. + * @param string $name + * The name of the library. + * + * @see _drupal_add_library() + */ +function hook_library_alter(array &$library, $name) { + if ($name == 'core/jquery.ui.datepicker') { + // Note: If the added assets do not depend on additional request-specific + // data supplied here, consider to statically register it directly via + // hook_library_info_alter() already. + $library['dependencies'][] = 'locale/drupal.locale.datepicker'; + + $language_interface = \Drupal::languageManager()->getCurrentLanguage(); + $settings['jquery']['ui']['datepicker'] = array( + 'isRTL' => $language_interface->getDirection() == LanguageInterface::DIRECTION_RTL, + 'firstDay' => \Drupal::config('system.date')->get('first_day'), + ); + $library['js'][] = array( + 'type' => 'setting', + 'data' => $settings, + ); + } +} + +/** + * Alter CSS files before they are output on the page. + * + * @param $css + * An array of all CSS items (files and inline CSS) being requested on the page. + * + * @see _drupal_add_css() + * @see drupal_get_css() + */ +function hook_css_alter(&$css) { + // Remove defaults.css file. + unset($css[drupal_get_path('module', 'system') . '/defaults.css']); +} + +/** + * Add attachments (typically assets) to a page before it is rendered. + * + * Kept around for backwards compatibility, but now allows only attachments to + * be added, adding renderable arrays is no longer allowed. + * + * @deprecated in Drupal 8.x, will be removed before Drupal 9.0. Successor: + * hook_page_attachments(). Is now effectively an alias of that hook. + * + * @param $page + * The page to which to add attachments. + * + * @see hook_page_attachments() + */ +function hook_page_build(&$page) { + $path = drupal_get_path('module', 'foo'); + // Add JavaScript/CSS assets to all pages. + // @see drupal_process_attached() + $page['#attached']['js'][$path . '/foo.js'] = array('every_page' => TRUE); + $page['#attached']['css'][$path . '/foo.base.css'] = array('every_page' => TRUE); + $page['#attached']['css'][$path . '/foo.theme.css'] = array('every_page' => TRUE); + + // Add a special CSS file to a certain page only. + if (drupal_is_front_page()) { + $page['#attached']['css'][] = $path . '/foo.front.css'; + } +} + +/** + * Perform alterations before a page is rendered. + * + * Kept around for backwards compatibility, but now allows only attachments to + * be added, altering the renderable array for the page is no longer allowed. + * + * @deprecated in Drupal 8.x, will be removed before Drupal 9.0. Successor: + * hook_page_attachments_alter(). Is now effectively an alias of that hook. + * + * Use this hook when you want to remove or alter attachments at the page + * level, or add attachments at the page level that depend on an other module's + * attachments (this hook runs after hook_page_build(). + * + * @param $page + * An empty renderable array representing the page. + * + * @see hook_page_build() + */ +function hook_page_alter(&$page) { + // Conditionally remove an asset. + if (in_array('core/jquery', $page['#attached']['library'])) { + $index = array_search('core/jquery', $page['#attached']['library']); + unset($page['#attached']['library'][$index]); + } +} + +/** + * Add attachments (typically assets) to a page before it is rendered. + * + * Use this hook when you want to conditionally add attachments to a page. + * + * If you want to alter the attachments added by other modules or if your module + * depends on the elements of other modules, use hook_page_attachments_alter() + * instead, which runs after this hook. + * + * @param array &$page + * An empty renderable array representing the page. + * + * @see hook_page_attachments_alter() + */ +function hook_page_attachments(array &$page) { + // Unconditionally attach an asset to the page. + $page['#attached']['library'][] = 'core/domready'; + + // Conditionally attach an asset to the page. + if (!\Drupal::currentUser()->hasPermission('may pet kittens')) { + $page['#attached']['library'][] = 'core/jquery'; + } +} + +/** + * Alter attachments (typically assets) to a page before it is rendered. + * + * Use this hook when you want to remove or alter attachments on the page, or + * add attachments to the page that depend on aonther module's attachments (this + * hook runs after hook_page_attachments(). + * + * If you want to alter the attachments added by other modules or if your module + * depends on the elements of other modules, use hook_page_attachments_alter() + * instead, which runs after this hook. + * + * @param array &$page + * An empty renderable array representing the page. + * + * @see hook_page_attachments_alter() + */ +function hook_page_attachments_alter(array &$page) { + // Conditionally remove an asset. + if (in_array('core/jquery', $page['#attached']['library'])) { + $index = array_search('core/jquery', $page['#attached']['library']); + unset($page['#attached']['library'][$index]); + } +} + +/** + * Add a renderable array to the top of the page. + * + * @param array $page_top + * A renderable array representing the top of the page. + */ +function hook_page_top(array &$page_top) { + $page_top['mymodule'] = ['#markup' => 'This is the top.']; +} + +/** + * Add a renderable array to the bottom of the page. + * + * @param array $page_top + * A renderable array representing the bottom of the page. + */ +function hook_page_bottom(array &$page) { + $page_bottom['mymodule'] = ['#markup' => 'This is the bottom.']; +} + +/** + * Register a module or theme's theme implementations. + * + * The implementations declared by this hook have several purposes: + * - They can specify how a particular render array is to be rendered as HTML. + * This is usually the case if the theme function is assigned to the render + * array's #theme property. + * - They can return HTML for default calls to _theme(). + * - They can return HTML for calls to _theme() for a theme suggestion. + * + * @param array $existing + * An array of existing implementations that may be used for override + * purposes. This is primarily useful for themes that may wish to examine + * existing implementations to extract data (such as arguments) so that + * it may properly register its own, higher priority implementations. + * @param $type + * Whether a theme, module, etc. is being processed. This is primarily useful + * so that themes tell if they are the actual theme being called or a parent + * theme. May be one of: + * - 'module': A module is being checked for theme implementations. + * - 'base_theme_engine': A theme engine is being checked for a theme that is + * a parent of the actual theme being used. + * - 'theme_engine': A theme engine is being checked for the actual theme + * being used. + * - 'base_theme': A base theme is being checked for theme implementations. + * - 'theme': The actual theme in use is being checked. + * @param $theme + * The actual name of theme, module, etc. that is being being processed. + * @param $path + * The directory path of the theme or module, so that it doesn't need to be + * looked up. + * + * @return array + * An associative array of information about theme implementations. The keys + * on the outer array are known as "theme hooks". For simple theme + * implementations for regular calls to _theme(), the theme hook is the first + * argument. For theme suggestions, instead of the array key being the base + * theme hook, the key is a theme suggestion name with the format + * 'base_hook_name__sub_hook_name'. For render elements, the key is the + * machine name of the render element. The array values are themselves arrays + * containing information about the theme hook and its implementation. Each + * information array must contain either a 'variables' element (for _theme() + * calls) or a 'render element' element (for render elements), but not both. + * The following elements may be part of each information array: + * - variables: Used for _theme() call items only: an array of variables, + * where the array keys are the names of the variables, and the array + * values are the default values if they are not passed into _theme(). + * Template implementations receive each array key as a variable in the + * template file (so they must be legal PHP/Twig variable names). Function + * implementations are passed the variables in a single $variables function + * argument. + * - render element: Used for render element items only: the name of the + * renderable element or element tree to pass to the theme function. This + * name is used as the name of the variable that holds the renderable + * element or tree in preprocess and process functions. + * - file: The file the implementation resides in. This file will be included + * prior to the theme being rendered, to make sure that the function or + * preprocess function (as needed) is actually loaded; this makes it + * possible to split theme functions out into separate files quite easily. + * - path: Override the path of the file to be used. Ordinarily the module or + * theme path will be used, but if the file will not be in the default + * path, include it here. This path should be relative to the Drupal root + * directory. + * - template: If specified, the theme implementation is a template file, and + * this is the template name. Do not add 'html.twig' on the end of the + * template name. The extension will be added automatically by the default + * rendering engine (which is Twig.) If 'path' is specified, 'template' + * should also be specified. If neither 'template' nor 'function' are + * specified, a default template name will be assumed. For example, if a + * module registers the 'search_result' theme hook, 'search-result' will be + * assigned as its template name. + * - function: If specified, this will be the function name to invoke for + * this implementation. If neither 'template' nor 'function' are specified, + * a default template name will be assumed. See above for more details. + * - base hook: Used for _theme() suggestions only: the base theme hook name. + * Instead of this suggestion's implementation being used directly, the base + * hook will be invoked with this implementation as its first suggestion. + * The base hook's files will be included and the base hook's preprocess + * functions will be called in place of any suggestion's preprocess + * functions. If an implementation of hook_theme_suggestions_HOOK() (where + * HOOK is the base hook) changes the suggestion order, a different + * suggestion may be used in place of this suggestion. If after + * hook_theme_suggestions_HOOK() this suggestion remains the first + * suggestion, then this suggestion's function or template will be used to + * generate the output for _theme(). + * - pattern: A regular expression pattern to be used to allow this theme + * implementation to have a dynamic name. The convention is to use __ to + * differentiate the dynamic portion of the theme. For example, to allow + * forums to be themed individually, the pattern might be: 'forum__'. Then, + * when the forum is themed, call: + * @code + * _theme(array('forum__' . $tid, 'forum'), $forum) + * @endcode + * - preprocess functions: A list of functions used to preprocess this data. + * Ordinarily this won't be used; it's automatically filled in. By default, + * for a module this will be filled in as template_preprocess_HOOK. For + * a theme this will be filled in as twig_preprocess and + * twig_preprocess_HOOK as well as themename_preprocess and + * themename_preprocess_HOOK. + * - override preprocess functions: Set to TRUE when a theme does NOT want + * the standard preprocess functions to run. This can be used to give a + * theme FULL control over how variables are set. For example, if a theme + * wants total control over how certain variables in the page.html.twig are + * set, this can be set to true. Please keep in mind that when this is used + * by a theme, that theme becomes responsible for making sure necessary + * variables are set. + * - type: (automatically derived) Where the theme hook is defined: + * 'module', 'theme_engine', or 'theme'. + * - theme path: (automatically derived) The directory path of the theme or + * module, so that it doesn't need to be looked up. + * + * @see hook_theme_registry_alter() + */ +function hook_theme($existing, $type, $theme, $path) { + return array( + 'forum_display' => array( + 'variables' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + ), + 'forum_list' => array( + 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), + ), + 'forum_icon' => array( + 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + ), + 'status_report' => array( + 'render element' => 'requirements', + 'file' => 'system.admin.inc', + ), + ); +} + +/** + * Alter the theme registry information returned from hook_theme(). + * + * The theme registry stores information about all available theme hooks, + * including which callback functions those hooks will call when triggered, + * what template files are exposed by these hooks, and so on. + * + * Note that this hook is only executed as the theme cache is re-built. + * Changes here will not be visible until the next cache clear. + * + * The $theme_registry array is keyed by theme hook name, and contains the + * information returned from hook_theme(), as well as additional properties + * added by \Drupal\Core\Theme\Registry::processExtension(). + * + * For example: + * @code + * $theme_registry['user'] = array( + * 'variables' => array( + * 'account' => NULL, + * ), + * 'template' => 'core/modules/user/user', + * 'file' => 'core/modules/user/user.pages.inc', + * 'type' => 'module', + * 'theme path' => 'core/modules/user', + * 'preprocess functions' => array( + * 0 => 'template_preprocess', + * 1 => 'template_preprocess_user_profile', + * ), + * ); + * @endcode + * + * @param $theme_registry + * The entire cache of theme registry information, post-processing. + * + * @see hook_theme() + * @see \Drupal\Core\Theme\Registry::processExtension() + */ +function hook_theme_registry_alter(&$theme_registry) { + // Kill the next/previous forum topic navigation links. + foreach ($theme_registry['forum_topic_navigation']['preprocess functions'] as $key => $value) { + if ($value == 'template_preprocess_forum_topic_navigation') { + unset($theme_registry['forum_topic_navigation']['preprocess functions'][$key]); + } + } +} + +/** + * Alter the default, hook-independent variables for all templates. + * + * Allows modules to provide additional default template variables or manipulate + * existing. This hook is invoked from template_preprocess() after basic default + * template variables have been set up and before the next template preprocess + * function is invoked. + * + * Note that the default template variables are statically cached within a + * request. When adding a template variable that depends on other context, it is + * your responsibility to appropriately reset the static cache in + * template_preprocess() when needed: + * @code + * drupal_static_reset('template_preprocess'); + * @endcode + * + * See user_template_preprocess_default_variables_alter() for an example. + * + * @param array $variables + * An associative array of default template variables, as set up by + * _template_preprocess_default_variables(). Passed by reference. + * + * @see template_preprocess() + * @see _template_preprocess_default_variables() + */ +function hook_template_preprocess_default_variables_alter(&$variables) { + $variables['is_admin'] = \Drupal::currentUser()->hasPermission('access administration pages'); +} + +/** + * @} End of "addtogroup hooks". + */ diff --git a/drupal/core/modules/taxonomy/src/Tests/TermTest.php b/drupal/core/modules/taxonomy/src/Tests/TermTest.php index 2915d2b6..0900dce5 100644 --- a/drupal/core/modules/taxonomy/src/Tests/TermTest.php +++ b/drupal/core/modules/taxonomy/src/Tests/TermTest.php @@ -10,6 +10,7 @@ use Drupal\Component\Serialization\Json; use Drupal\Component\Utility\String; use Drupal\Component\Utility\Tags; +use Drupal\Component\Utility\Unicode; use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\field\Entity\FieldStorageConfig; use Drupal\taxonomy\Entity\Term; @@ -535,7 +536,7 @@ function testTaxonomyGetTermByName() { $this->assertFalse($terms, 'No term loaded with an invalid name.'); // Try to load the term using a substring of the name. - $terms = taxonomy_term_load_multiple_by_name(drupal_substr($term->getName(), 2), 'No term loaded with a substring of the name.'); + $terms = taxonomy_term_load_multiple_by_name(Unicode::substr($term->getName(), 2), 'No term loaded with a substring of the name.'); $this->assertFalse($terms); // Create a new term in a different vocabulary with the same name. diff --git a/drupal/core/modules/taxonomy/taxonomy.info.yml b/drupal/core/modules/taxonomy/taxonomy.info.yml index 3add22e2..04b20835 100644 --- a/drupal/core/modules/taxonomy/taxonomy.info.yml +++ b/drupal/core/modules/taxonomy/taxonomy.info.yml @@ -2,9 +2,15 @@ name: Taxonomy type: module description: 'Enables the categorization of content.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - node - text configure: taxonomy.vocabulary_list + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/taxonomy/templates/taxonomy-term.html.twig b/drupal/core/modules/taxonomy/templates/taxonomy-term.html.twig index 76fc81cb..750fd734 100644 --- a/drupal/core/modules/taxonomy/templates/taxonomy-term.html.twig +++ b/drupal/core/modules/taxonomy/templates/taxonomy-term.html.twig @@ -13,12 +13,7 @@ * @code * {{ content|without('description') }} * @endcode - * - attributes: HTML attributes for the wrapper. The 'class' attribute - * contains the following classes by default: - * - taxonomy-term: The current template type, i.e. "theming hook". - * - vocabulary-[vocabulary-name]: The vocabulary that this term belongs to. - * For example, if the term belongs to a vocabulary called "Tags" then the - * class would be "vocabulary-tags". + * - attributes: HTML attributes for the wrapper. * - page: Flag for the full page state. * - term: The taxonomy term entity, including: * - id: The ID of the taxonomy term. @@ -30,19 +25,13 @@ * @ingroup themeable */ #} -{% - set classes = [ - 'taxonomy-term', - 'vocabulary-' ~ term.bundle|clean_class, - ] -%} -
+ {{ title_prefix }} {% if not page %}

{{ name }}

{% endif %} {{ title_suffix }} -
+
{{ content }}
diff --git a/drupal/core/modules/taxonomy/tests/modules/taxonomy_crud/taxonomy_crud.info.yml b/drupal/core/modules/taxonomy/tests/modules/taxonomy_crud/taxonomy_crud.info.yml index dd07a181..f076662f 100644 --- a/drupal/core/modules/taxonomy/tests/modules/taxonomy_crud/taxonomy_crud.info.yml +++ b/drupal/core/modules/taxonomy/tests/modules/taxonomy_crud/taxonomy_crud.info.yml @@ -2,7 +2,13 @@ name: 'Taxonomy CRUD tests' type: module description: 'Provides 3rd party settings for vocabulary.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - taxonomy + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/taxonomy/tests/modules/taxonomy_test_views/taxonomy_test_views.info.yml b/drupal/core/modules/taxonomy/tests/modules/taxonomy_test_views/taxonomy_test_views.info.yml index be879060..3c4fa45a 100644 --- a/drupal/core/modules/taxonomy/tests/modules/taxonomy_test_views/taxonomy_test_views.info.yml +++ b/drupal/core/modules/taxonomy/tests/modules/taxonomy_test_views/taxonomy_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Taxonomy test views' type: module description: 'Provides default views for views taxonomy tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - taxonomy - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/telephone/telephone.info.yml b/drupal/core/modules/telephone/telephone.info.yml index 3e27ccba..62ed79dc 100644 --- a/drupal/core/modules/telephone/telephone.info.yml +++ b/drupal/core/modules/telephone/telephone.info.yml @@ -2,7 +2,13 @@ name: Telephone type: module description: 'Defines a field type for telephone numbers.' package: Field types -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/text/text.info.yml b/drupal/core/modules/text/text.info.yml index 71f45bdc..1d902dbd 100644 --- a/drupal/core/modules/text/text.info.yml +++ b/drupal/core/modules/text/text.info.yml @@ -2,8 +2,14 @@ name: Text type: module description: 'Defines simple text field types.' package: Field types -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - field - filter + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.info.yml b/drupal/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.info.yml index 98fc607c..c152a133 100644 --- a/drupal/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.info.yml +++ b/drupal/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.info.yml @@ -2,5 +2,11 @@ name: 'Toolbar module API tests' type: module description: 'Support module for toolbar testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/toolbar/toolbar.info.yml b/drupal/core/modules/toolbar/toolbar.info.yml index 6967bf65..2299cd70 100644 --- a/drupal/core/modules/toolbar/toolbar.info.yml +++ b/drupal/core/modules/toolbar/toolbar.info.yml @@ -1,8 +1,14 @@ name: Toolbar type: module description: 'Provides a toolbar that shows the top-level administration menu items and links from other modules.' -core: 8.x +# core: 8.x package: Core -version: VERSION +# version: VERSION dependencies: - breakpoint + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/tour/tests/tour_test/tour_test.info.yml b/drupal/core/modules/tour/tests/tour_test/tour_test.info.yml index e55953ad..cb9e5f47 100644 --- a/drupal/core/modules/tour/tests/tour_test/tour_test.info.yml +++ b/drupal/core/modules/tour/tests/tour_test/tour_test.info.yml @@ -2,7 +2,13 @@ name: Tour module tests type: module description: Tests module for tour module. package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - tour + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/tour/tour.info.yml b/drupal/core/modules/tour/tour.info.yml index b9131629..d9f25293 100644 --- a/drupal/core/modules/tour/tour.info.yml +++ b/drupal/core/modules/tour/tour.info.yml @@ -2,5 +2,11 @@ name: Tour type: module description: Provides guided tours. package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/tracker/tests/modules/tracker_test_views/tracker_test_views.info.yml b/drupal/core/modules/tracker/tests/modules/tracker_test_views/tracker_test_views.info.yml index 45a64a1a..bd0bba3e 100644 --- a/drupal/core/modules/tracker/tests/modules/tracker_test_views/tracker_test_views.info.yml +++ b/drupal/core/modules/tracker/tests/modules/tracker_test_views/tracker_test_views.info.yml @@ -2,8 +2,14 @@ name: 'Tracker test views' type: module description: 'Provides default views for views tracker tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - tracker - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/tracker/tracker.info.yml b/drupal/core/modules/tracker/tracker.info.yml index 79d179d1..dc5fd7f3 100644 --- a/drupal/core/modules/tracker/tracker.info.yml +++ b/drupal/core/modules/tracker/tracker.info.yml @@ -5,5 +5,11 @@ dependencies: - node - comment package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/update/src/Tests/UpdateContribTest.php b/drupal/core/modules/update/src/Tests/UpdateContribTest.php index 118a60e2..35d25a12 100644 --- a/drupal/core/modules/update/src/Tests/UpdateContribTest.php +++ b/drupal/core/modules/update/src/Tests/UpdateContribTest.php @@ -36,7 +36,7 @@ protected function setUp() { function testNoReleasesAvailable() { $system_info = array( '#all' => array( - 'version' => '7.0', + 'version' => '8.0.0', ), 'aaa_update_test' => array( 'project' => 'aaa_update_test', @@ -45,7 +45,7 @@ function testNoReleasesAvailable() { ), ); \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); - $this->refreshUpdateStatus(array('drupal' => '0', 'aaa_update_test' => 'no-releases')); + $this->refreshUpdateStatus(array('drupal' => '0.0', 'aaa_update_test' => 'no-releases')); $this->drupalGet('admin/reports/updates'); // Cannot use $this->standardTests() because we need to check for the // 'No available releases found' string. @@ -67,7 +67,7 @@ function testNoReleasesAvailable() { function testUpdateContribBasic() { $system_info = array( '#all' => array( - 'version' => '7.0', + 'version' => '8.0.0', ), 'aaa_update_test' => array( 'project' => 'aaa_update_test', @@ -78,7 +78,7 @@ function testUpdateContribBasic() { \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $this->refreshUpdateStatus( array( - 'drupal' => '0', + 'drupal' => '0.0', 'aaa_update_test' => '1_0', ) ); @@ -103,10 +103,10 @@ function testUpdateContribBasic() { * inside system_rebuild_module_data() for example). */ function testUpdateContribOrder() { - // We want core to be version 7.0. + // We want core to be version 8.0.0. $system_info = array( '#all' => array( - 'version' => '7.0', + 'version' => '8.0.0', ), // All the rest should be visible as contrib modules at version 8.x-1.0. @@ -135,7 +135,7 @@ function testUpdateContribOrder() { ), ); \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); - $this->refreshUpdateStatus(array('drupal' => '0', '#all' => '1_0')); + $this->refreshUpdateStatus(array('drupal' => '0.0', '#all' => '1_0')); $this->standardTests(); // We're expecting the report to say all projects are up to date. $this->assertText(t('Up to date')); @@ -172,9 +172,9 @@ function testUpdateBaseThemeSecurityUpdate() { // Define the initial state for core and the subtheme. $system_info = array( - // We want core to be version 7.0. + // We want core to be version 8.0.0. '#all' => array( - 'version' => '7.0', + 'version' => '8.0.0', ), // Show the update_test_basetheme 'update_test_basetheme' => array( @@ -191,7 +191,7 @@ function testUpdateBaseThemeSecurityUpdate() { ); \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $xml_mapping = array( - 'drupal' => '0', + 'drupal' => '0.0', 'update_test_subtheme' => '1_0', 'update_test_basetheme' => '1_1-sec', ); @@ -219,9 +219,9 @@ function testUpdateShowDisabledThemes() { // Define the initial state for core and the test contrib themes. $system_info = array( - // We want core to be version 7.0. + // We want core to be version 8.0.0. '#all' => array( - 'version' => '7.0', + 'version' => '8.0.0', ), // The update_test_basetheme should be visible and up to date. 'update_test_basetheme' => array( @@ -243,7 +243,7 @@ function testUpdateShowDisabledThemes() { $update_settings->set('fetch.max_attempts', 99999)->save(); \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $xml_mapping = array( - 'drupal' => '0', + 'drupal' => '0.0', 'update_test_subtheme' => '1_0', 'update_test_basetheme' => '1_1-sec', ); @@ -305,7 +305,7 @@ function testUpdateHiddenBaseTheme() { function testUpdateBrokenFetchURL() { $system_info = array( '#all' => array( - 'version' => '7.0', + 'version' => '8.0.0', ), 'aaa_update_test' => array( 'project' => 'aaa_update_test', @@ -326,7 +326,7 @@ function testUpdateBrokenFetchURL() { \Drupal::config('update_test.settings')->set('system_info', $system_info)->save(); $xml_mapping = array( - 'drupal' => '0', + 'drupal' => '0.0', 'aaa_update_test' => '1_0', 'bbb_update_test' => 'does-not-exist', 'ccc_update_test' => '1_0', @@ -370,7 +370,7 @@ function testHookUpdateStatusAlter() { $system_info = array( '#all' => array( - 'version' => '7.0', + 'version' => '8.0.0', ), 'aaa_update_test' => array( 'project' => 'aaa_update_test', @@ -387,7 +387,7 @@ function testHookUpdateStatusAlter() { $update_test_config->set('update_status', $update_status)->save(); $this->refreshUpdateStatus( array( - 'drupal' => '0', + 'drupal' => '0.0', 'aaa_update_test' => '1_0', ) ); diff --git a/drupal/core/modules/update/src/Tests/UpdateCoreTest.php b/drupal/core/modules/update/src/Tests/UpdateCoreTest.php index 969f15c4..9000b43f 100644 --- a/drupal/core/modules/update/src/Tests/UpdateCoreTest.php +++ b/drupal/core/modules/update/src/Tests/UpdateCoreTest.php @@ -28,47 +28,135 @@ protected function setUp() { $this->drupalLogin($admin_user); } + /** + * Sets the version to x.x.x when no project-specific mapping is defined. + * + * @param string $version + * The version. + */ + protected function setSystemInfo($version) { + $setting = array( + '#all' => array( + 'version' => $version, + ), + ); + \Drupal::config('update_test.settings')->set('system_info', $setting)->save(); + } /** * Tests the Update Manager module when no updates are available. */ function testNoUpdatesAvailable() { - $this->setSystemInfo7_0(); - $this->refreshUpdateStatus(array('drupal' => '0')); - $this->standardTests(); - $this->assertText(t('Up to date')); - $this->assertNoText(t('Update available')); - $this->assertNoText(t('Security update required!')); + foreach (array(0, 1) as $minor_version) { + foreach (array(0, 1) as $patch_version) { + foreach (array('-alpha1', '-beta1', '') as $extra_version) { + $this->setSystemInfo("8.$minor_version.$patch_version" . $extra_version); + $this->refreshUpdateStatus(array('drupal' => "$minor_version.$patch_version" . $extra_version)); + $this->standardTests(); + $this->assertText(t('Up to date')); + $this->assertNoText(t('Update available')); + $this->assertNoText(t('Security update required!')); + } + } + } } /** * Tests the Update Manager module when one normal update is available. */ function testNormalUpdateAvailable() { - $this->setSystemInfo7_0(); - $this->refreshUpdateStatus(array('drupal' => '1')); - $this->standardTests(); - $this->assertNoText(t('Up to date')); - $this->assertText(t('Update available')); - $this->assertNoText(t('Security update required!')); - $this->assertRaw(_l('7.1', 'http://example.com/drupal-7-1-release'), 'Link to release appears.'); - $this->assertRaw(_l(t('Download'), 'http://example.com/drupal-7-1.tar.gz'), 'Link to download appears.'); - $this->assertRaw(_l(t('Release notes'), 'http://example.com/drupal-7-1-release'), 'Link to release notes appears.'); + $this->setSystemInfo('8.0.0'); + foreach (array(0, 1) as $minor_version) { + foreach (array('-alpha1', '-beta1', '') as $extra_version) { + $this->refreshUpdateStatus(array('drupal' => "$minor_version.1" . $extra_version)); + $this->standardTests(); + $this->drupalGet('admin/reports/updates/check'); + $this->assertNoText(t('Security update required!')); + $this->assertRaw(_l("8.$minor_version.1" . $extra_version, "http://example.com/drupal-8-$minor_version-1$extra_version-release"), 'Link to release appears.'); + $this->assertRaw(_l(t('Download'), "http://example.com/drupal-8-$minor_version-1$extra_version.tar.gz"), 'Link to download appears.'); + $this->assertRaw(_l(t('Release notes'), "http://example.com/drupal-8-$minor_version-1$extra_version-release"), 'Link to release notes appears.'); + + switch ($minor_version) { + case 0: + // Both stable and unstable releases are available. + // A stable release is the latest. + if ($extra_version == '') { + $this->assertNoText(t('Up to date')); + $this->assertText(t('Update available')); + $this->assertText(t('Recommended version:')); + $this->assertNoText(t('Latest version:')); + } + // Only unstable releases are available. + // An unstable release is the latest. + else { + $this->assertText(t('Up to date')); + $this->assertNoText(t('Update available')); + $this->assertNoText(t('Recommended version:')); + $this->assertText(t('Latest version:')); + } + break; + case 1: + // Both stable and unstable releases are available. + // A stable release is the latest. + if ($extra_version == '') { + $this->assertNoText(t('Up to date')); + $this->assertText(t('Update available')); + $this->assertText(t('Recommended version:')); + $this->assertNoText(t('Latest version:')); + } + // Both stable and unstable releases are available. + // An unstable release is the latest. + else { + $this->assertNoText(t('Up to date')); + $this->assertText(t('Update available')); + $this->assertText(t('Recommended version:')); + $this->assertText(t('Latest version:')); + } + break; + } + } + } + } + + /** + * Tests the Update Manager module when a major update is available. + */ + function testMajorUpdateAvailable() { + foreach (array(0, 1) as $minor_version) { + foreach (array(0, 1) as $patch_version) { + foreach (array('-alpha1', '-beta1', '') as $extra_version) { + $this->setSystemInfo("8.$minor_version.$patch_version" . $extra_version); + $this->refreshUpdateStatus(array('drupal' => '9')); + $this->standardTests(); + $this->drupalGet('admin/reports/updates/check'); + $this->assertNoText(t('Security update required!')); + $this->assertRaw(_l('9.0.0', "http://example.com/drupal-9-0-0-release"), 'Link to release appears.'); + $this->assertRaw(_l(t('Download'), "http://example.com/drupal-9-0-0.tar.gz"), 'Link to download appears.'); + $this->assertRaw(_l(t('Release notes'), "http://example.com/drupal-9-0-0-release"), 'Link to release notes appears.'); + $this->assertNoText(t('Up to date')); + $this->assertText(t('Not supported!')); + $this->assertText(t('Recommended version:')); + $this->assertNoText(t('Latest version:')); + } + } + } } /** * Tests the Update Manager module when a security update is available. */ function testSecurityUpdateAvailable() { - $this->setSystemInfo7_0(); - $this->refreshUpdateStatus(array('drupal' => '2-sec')); - $this->standardTests(); - $this->assertNoText(t('Up to date')); - $this->assertNoText(t('Update available')); - $this->assertText(t('Security update required!')); - $this->assertRaw(_l('7.2', 'http://example.com/drupal-7-2-release'), 'Link to release appears.'); - $this->assertRaw(_l(t('Download'), 'http://example.com/drupal-7-2.tar.gz'), 'Link to download appears.'); - $this->assertRaw(_l(t('Release notes'), 'http://example.com/drupal-7-2-release'), 'Link to release notes appears.'); + foreach (array(0, 1) as $minor_version) { + $this->setSystemInfo("8.$minor_version.0"); + $this->refreshUpdateStatus(array('drupal' => "$minor_version.2-sec")); + $this->standardTests(); + $this->assertNoText(t('Up to date')); + $this->assertNoText(t('Update available')); + $this->assertText(t('Security update required!')); + $this->assertRaw(_l("8.$minor_version.2", "http://example.com/drupal-8-$minor_version-2-release"), 'Link to release appears.'); + $this->assertRaw(_l(t('Download'), "http://example.com/drupal-8-$minor_version-2.tar.gz"), 'Link to download appears.'); + $this->assertRaw(_l(t('Release notes'), "http://example.com/drupal-8-$minor_version-2-release"), 'Link to release notes appears.'); + } } /** @@ -78,7 +166,7 @@ function testDatestampMismatch() { $system_info = array( '#all' => array( // We need to think we're running a -dev snapshot to see dates. - 'version' => '7.0-dev', + 'version' => '8.0.0-dev', 'datestamp' => time(), ), 'block' => array( @@ -98,9 +186,13 @@ function testDatestampMismatch() { * Checks that running cron updates the list of available updates. */ function testModulePageRunCron() { - $this->setSystemInfo7_0(); - \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save(); - \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save(); + $this->setSystemInfo('8.0.0'); + \Drupal::config('update.settings') + ->set('fetch.url', _url('update-test', array('absolute' => TRUE))) + ->save(); + \Drupal::config('update_test.settings') + ->set('xml_map', array('drupal' => '0.0')) + ->save(); $this->cronRun(); $this->drupalGet('admin/modules'); @@ -111,10 +203,14 @@ function testModulePageRunCron() { * Checks the messages at admin/modules when the site is up to date. */ function testModulePageUpToDate() { - $this->setSystemInfo7_0(); + $this->setSystemInfo('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. - \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save(); - \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '0'))->save(); + \Drupal::config('update.settings') + ->set('fetch.url', _url('update-test', array('absolute' => TRUE))) + ->save(); + \Drupal::config('update_test.settings') + ->set('xml_map', array('drupal' => '0.0')) + ->save(); $this->drupalGet('admin/reports/updates'); $this->clickLink(t('Check manually')); @@ -128,10 +224,14 @@ function testModulePageUpToDate() { * Checks the messages at admin/modules when an update is missing. */ function testModulePageRegularUpdate() { - $this->setSystemInfo7_0(); + $this->setSystemInfo('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. - \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save(); - \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save(); + \Drupal::config('update.settings') + ->set('fetch.url', _url('update-test', array('absolute' => TRUE))) + ->save(); + \Drupal::config('update_test.settings') + ->set('xml_map', array('drupal' => '0.1')) + ->save(); $this->drupalGet('admin/reports/updates'); $this->clickLink(t('Check manually')); @@ -145,10 +245,14 @@ function testModulePageRegularUpdate() { * Checks the messages at admin/modules when a security update is missing. */ function testModulePageSecurityUpdate() { - $this->setSystemInfo7_0(); + $this->setSystemInfo('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. - \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save(); - \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '2-sec'))->save(); + \Drupal::config('update.settings') + ->set('fetch.url', _url('update-test', array('absolute' => TRUE))) + ->save(); + \Drupal::config('update_test.settings') + ->set('xml_map', array('drupal' => '0.2-sec')) + ->save(); $this->drupalGet('admin/reports/updates'); $this->clickLink(t('Check manually')); @@ -217,27 +321,19 @@ function testFetchTasks() { * Checks language module in core package at admin/reports/updates. */ function testLanguageModuleUpdate() { - $this->setSystemInfo7_0(); + $this->setSystemInfo('8.0.0'); // Instead of using refreshUpdateStatus(), set these manually. - \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save(); - \Drupal::config('update_test.settings')->set('xml_map', array('drupal' => '1'))->save(); + \Drupal::config('update.settings') + ->set('fetch.url', _url('update-test', array('absolute' => TRUE))) + ->save(); + \Drupal::config('update_test.settings') + ->set('xml_map', array('drupal' => '0.1')) + ->save(); $this->drupalGet('admin/reports/updates'); $this->assertText(t('Language')); } - /** - * Sets the version to 7.0 when no project-specific mapping is defined. - */ - protected function setSystemInfo7_0() { - $setting = array( - '#all' => array( - 'version' => '7.0', - ), - ); - \Drupal::config('update_test.settings')->set('system_info', $setting)->save(); - } - /** * Ensures that the local actions appear. */ diff --git a/drupal/core/modules/update/src/Tests/UpdateUploadTest.php b/drupal/core/modules/update/src/Tests/UpdateUploadTest.php index fe13c08d..78a9cbd8 100644 --- a/drupal/core/modules/update/src/Tests/UpdateUploadTest.php +++ b/drupal/core/modules/update/src/Tests/UpdateUploadTest.php @@ -72,14 +72,16 @@ function testFileNameExtensionMerging() { function testUpdateManagerCoreSecurityUpdateMessages() { $setting = array( '#all' => array( - 'version' => '7.0', + 'version' => '8.0.0', ), ); \Drupal::config('update_test.settings') ->set('system_info', $setting) - ->set('xml_map', array('drupal' => '2-sec')) + ->set('xml_map', array('drupal' => '0.2-sec')) + ->save(); + \Drupal::config('update.settings') + ->set('fetch.url', _url('update-test', array('absolute' => TRUE))) ->save(); - \Drupal::config('update.settings')->set('fetch.url', _url('update-test', array('absolute' => TRUE)))->save(); // Initialize the update status. $this->drupalGet('admin/reports/updates'); diff --git a/drupal/core/modules/update/tests/aaa_update_test/aaa_update_test.info.yml b/drupal/core/modules/update/tests/aaa_update_test/aaa_update_test.info.yml index c424e74f..13564370 100644 --- a/drupal/core/modules/update/tests/aaa_update_test/aaa_update_test.info.yml +++ b/drupal/core/modules/update/tests/aaa_update_test/aaa_update_test.info.yml @@ -2,5 +2,11 @@ name: 'AAA Update test' type: module description: 'Support module for update module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/update/tests/modules/aaa_update_test/aaa_update_test.info.yml b/drupal/core/modules/update/tests/modules/aaa_update_test/aaa_update_test.info.yml index c424e74f..13564370 100644 --- a/drupal/core/modules/update/tests/modules/aaa_update_test/aaa_update_test.info.yml +++ b/drupal/core/modules/update/tests/modules/aaa_update_test/aaa_update_test.info.yml @@ -2,5 +2,11 @@ name: 'AAA Update test' type: module description: 'Support module for update module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/update/tests/modules/bbb_update_test/bbb_update_test.info.yml b/drupal/core/modules/update/tests/modules/bbb_update_test/bbb_update_test.info.yml index 0c2226bc..9678dcf5 100644 --- a/drupal/core/modules/update/tests/modules/bbb_update_test/bbb_update_test.info.yml +++ b/drupal/core/modules/update/tests/modules/bbb_update_test/bbb_update_test.info.yml @@ -2,5 +2,11 @@ name: 'BBB Update test' type: module description: 'Support module for update module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/update/tests/modules/ccc_update_test/ccc_update_test.info.yml b/drupal/core/modules/update/tests/modules/ccc_update_test/ccc_update_test.info.yml index 6fcd4ec2..a668641b 100644 --- a/drupal/core/modules/update/tests/modules/ccc_update_test/ccc_update_test.info.yml +++ b/drupal/core/modules/update/tests/modules/ccc_update_test/ccc_update_test.info.yml @@ -2,5 +2,11 @@ name: 'CCC Update test' type: module description: 'Support module for update module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/update/tests/modules/update_test/aaa_update_test.1_0.xml b/drupal/core/modules/update/tests/modules/update_test/aaa_update_test.1_0.xml index 5fc0d445..82362fe8 100644 --- a/drupal/core/modules/update/tests/modules/update_test/aaa_update_test.1_0.xml +++ b/drupal/core/modules/update/tests/modules/update_test/aaa_update_test.1_0.xml @@ -16,11 +16,11 @@ aaa_update_test 8.x-1.0 8.x-1.0 - DRUPAL-7--1-0 + DRUPAL-8--1-0 1 0 published - http://example.com/aaa_update_test-7-x-1-0-release + http://example.com/aaa_update_test-8-x-1-0-release http://example.com/aaa_update_test-8.x-1.0.tar.gz 1250424521 b966255555d9c9b86d480ca08cfaa98e diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.0.0-alpha1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.0.0-alpha1.xml new file mode 100644 index 00000000..e463b72e --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.0.0-alpha1.xml @@ -0,0 +1,36 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.0.0-beta1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.0.0-beta1.xml new file mode 100644 index 00000000..b3dc3bf2 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.0.0-beta1.xml @@ -0,0 +1,55 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.0.0.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.0.0.xml new file mode 100644 index 00000000..ac450660 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.0.0.xml @@ -0,0 +1,73 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.0.1-alpha1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.0.1-alpha1.xml new file mode 100644 index 00000000..150136c6 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.0.1-alpha1.xml @@ -0,0 +1,92 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.0.1-beta1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.0.1-beta1.xml new file mode 100644 index 00000000..25c9f702 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.0.1-beta1.xml @@ -0,0 +1,111 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.0.1-beta1 + 8.0.1-beta1 + DRUPAL-8-0-1-beta1 + 8 + 0 + 1 + beta1 + published + http://example.com/drupal-8-0-1-beta1-release + http://example.com/drupal-8-0-1-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.0.1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.0.1.xml new file mode 100644 index 00000000..ea00c15c --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.0.1.xml @@ -0,0 +1,129 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.0.1 + 8.0.1 + DRUPAL-8-0-1 + 8 + 0 + 1 + published + http://example.com/drupal-8-0-1-release + http://example.com/drupal-8-0-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-beta1 + 8.0.1-beta1 + DRUPAL-8-0-1-beta1 + 8 + 0 + 1 + beta1 + published + http://example.com/drupal-8-0-1-beta1-release + http://example.com/drupal-8-0-1-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.2-sec.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.0.2-sec.xml similarity index 61% rename from drupal/core/modules/update/tests/modules/update_test/drupal.2-sec.xml rename to drupal/core/modules/update/tests/modules/update_test/drupal.0.2-sec.xml index 8018fa2a..337600ef 100644 --- a/drupal/core/modules/update/tests/modules/update_test/drupal.2-sec.xml +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.0.2-sec.xml @@ -4,9 +4,9 @@ drupal Drupal 8.x -7 -7 -7 +8 +8 +8 published http://example.com/project/drupal @@ -14,14 +14,15 @@ - Drupal 7.2 - 7.2 - DRUPAL-7-2 - 7 + Drupal 8.0.2 + 8.0.2 + DRUPAL-8-0-2 + 8 + 0 2 published - http://example.com/drupal-7-2-release - http://example.com/drupal-7-2.tar.gz + http://example.com/drupal-8-0-2-release + http://example.com/drupal-8-0-2.tar.gz 1250424641 b966255555d9c9b86d480ca08cfaa98e 4294967296 @@ -32,14 +33,15 @@ - Drupal 7.1 - 7.1 - DRUPAL-7-1 - 7 + Drupal 8.0.1 + 8.0.1 + DRUPAL-8-0-1 + 8 + 0 1 published - http://example.com/drupal-7-1-release - http://example.com/drupal-7-1.tar.gz + http://example.com/drupal-8-0-1-release + http://example.com/drupal-8-0-1.tar.gz 1250424581 b966255555d9c9b86d480ca08cfaa98e 2147483648 @@ -49,14 +51,15 @@ - Drupal 7.0 - 7.0 - DRUPAL-7-0 - 7 + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 0 published - http://example.com/drupal-7-0-release - http://example.com/drupal-7-0.tar.gz + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz 1250424521 b966255555d9c9b86d480ca08cfaa98e 1073741824 diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.0.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.0.xml deleted file mode 100644 index 7e32072a..00000000 --- a/drupal/core/modules/update/tests/modules/update_test/drupal.0.xml +++ /dev/null @@ -1,34 +0,0 @@ - - -Drupal -drupal -Drupal -8.x -7 -7 -7 -published -http://example.com/project/drupal - - ProjectsDrupal project - - - - Drupal 7.0 - 7.0 - DRUPAL-7-0 - 7 - 0 - published - http://example.com/drupal-7-0-release - http://example.com/drupal-7-0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.1.0-alpha1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.1.0-alpha1.xml new file mode 100644 index 00000000..fe734a84 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.1.0-alpha1.xml @@ -0,0 +1,148 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.1.0-alpha1 + 8.1.0-alpha1 + DRUPAL-8-1-0-alpha1 + 8 + 1 + 0 + alpha1 + published + http://example.com/drupal-8-1-0-alpha1-release + http://example.com/drupal-8-1-0-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1 + 8.0.1 + DRUPAL-8-0-1 + 8 + 0 + 1 + published + http://example.com/drupal-8-0-1-release + http://example.com/drupal-8-0-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-beta1 + 8.0.1-beta1 + DRUPAL-8-0-1-beta1 + 8 + 0 + 1 + beta1 + published + http://example.com/drupal-8-0-1-beta1-release + http://example.com/drupal-8-0-1-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.1.0-beta1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.1.0-beta1.xml new file mode 100644 index 00000000..fa65c5e9 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.1.0-beta1.xml @@ -0,0 +1,167 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.1.0-beta1 + 8.1.0-beta1 + DRUPAL-8-1-0-beta1 + 8 + 1 + 0 + beta1 + published + http://example.com/drupal-8-1-0-beta1-release + http://example.com/drupal-8-1-0-beta1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-alpha1 + 8.1.0-alpha1 + DRUPAL-8-1-0-alpha1 + 8 + 1 + 0 + alpha1 + published + http://example.com/drupal-8-1-0-alpha1-release + http://example.com/drupal-8-1-0-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1 + 8.0.1 + DRUPAL-8-0-1 + 8 + 0 + 1 + published + http://example.com/drupal-8-0-1-release + http://example.com/drupal-8-0-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-beta1 + 8.0.1-beta1 + DRUPAL-8-0-1-beta1 + 8 + 0 + 1 + beta1 + published + http://example.com/drupal-8-0-1-beta1-release + http://example.com/drupal-8-0-1-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.1.0.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.1.0.xml new file mode 100644 index 00000000..0e6a40c7 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.1.0.xml @@ -0,0 +1,185 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.1.0 + 8.1.0 + DRUPAL-8-1-0 + 8 + 1 + 0 + published + http://example.com/drupal-8-1-0-release + http://example.com/drupal-8-1-0.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-beta1 + 8.1.0-beta1 + DRUPAL-8-1-0-beta1 + 8 + 1 + 0 + beta1 + published + http://example.com/drupal-8-1-0-beta1-release + http://example.com/drupal-8-1-0-beta1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-alpha1 + 8.1.0-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 1 + 0 + alpha1 + published + http://example.com/drupal-8-1-0-alpha1-release + http://example.com/drupal-8-1-0-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1 + 8.0.1 + DRUPAL-8-0-1 + 8 + 0 + 1 + published + http://example.com/drupal-8-0-1-release + http://example.com/drupal-8-0-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-beta1 + 8.0.1-beta1 + DRUPAL-8-0-1-beta1 + 8 + 0 + 1 + beta1 + published + http://example.com/drupal-8-0-1-beta1-release + http://example.com/drupal-8-0-1-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.1.1-alpha1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.1.1-alpha1.xml new file mode 100644 index 00000000..0356c8d9 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.1.1-alpha1.xml @@ -0,0 +1,204 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.1.1-alpha1 + 8.1.1-alpha1 + DRUPAL-8-1-1-alpha1 + 8 + 1 + 1 + alpha1 + published + http://example.com/drupal-8-1-1-alpha1-release + http://example.com/drupal-8-1-1-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0 + 8.1.0 + DRUPAL-8-1-0 + 8 + 1 + 0 + published + http://example.com/drupal-8-1-0-release + http://example.com/drupal-8-1-0.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-beta1 + 8.1.0-beta1 + DRUPAL-8-0-1-beta1 + 8 + 1 + 0 + beta1 + published + http://example.com/drupal-8-1-0-beta1-release + http://example.com/drupal-8-1-0-beta1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-alpha1 + 8.1.0-alpha1 + DRUPAL-8-1-0-alpha1 + 8 + 1 + 0 + alpha1 + published + http://example.com/drupal-8-1-0-alpha1-release + http://example.com/drupal-8-1-0-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1 + 8.0.1 + DRUPAL-8-0-1 + 8 + 0 + 1 + published + http://example.com/drupal-8-0-1-release + http://example.com/drupal-8-0-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-beta1 + 8.0.1-beta1 + DRUPAL-8-0-1-beta1 + 8 + 0 + 1 + beta1 + published + http://example.com/drupal-8-0-1-beta1-release + http://example.com/drupal-8-0-1-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.1.1-beta1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.1.1-beta1.xml new file mode 100644 index 00000000..abeef7ea --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.1.1-beta1.xml @@ -0,0 +1,223 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.1.1-beta1 + 8.1.1-beta1 + DRUPAL-8-1-1-beta1 + 8 + 1 + 1 + beta1 + published + http://example.com/drupal-8-1-1-beta1-release + http://example.com/drupal-8-1-1-beta1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.1-alpha1 + 8.1.1-alpha1 + DRUPAL-8-1-1-alpha1 + 8 + 1 + 1 + alpha1 + published + http://example.com/drupal-8-1-1-alpha1-release + http://example.com/drupal-8-1-1-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0 + 8.1.0 + DRUPAL-8-1-0 + 8 + 1 + 0 + published + http://example.com/drupal-8-1-0-release + http://example.com/drupal-8-1-0.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-beta1 + 8.1.0-beta1 + DRUPAL-8-0-1-beta1 + 8 + 1 + 0 + beta1 + published + http://example.com/drupal-8-1-0-beta1-release + http://example.com/drupal-8-1-0-beta1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-alpha1 + 8.1.0-alpha1 + DRUPAL-8-1-0-alpha1 + 8 + 1 + 0 + alpha1 + published + http://example.com/drupal-8-1-0-alpha1-release + http://example.com/drupal-8-1-0-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1 + 8.0.1 + DRUPAL-8-0-1 + 8 + 0 + 1 + published + http://example.com/drupal-8-0-1-release + http://example.com/drupal-8-0-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-beta1 + 8.0.1-beta1 + DRUPAL-8-0-1-beta1 + 8 + 0 + 1 + beta1 + published + http://example.com/drupal-8-0-1-beta1-release + http://example.com/drupal-8-0-1-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.1.1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.1.1.xml new file mode 100644 index 00000000..a588bdc4 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.1.1.xml @@ -0,0 +1,241 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.1.1 + 8.1.1 + DRUPAL-8-1-1 + 8 + 1 + 1 + published + http://example.com/drupal-8-1-1-release + http://example.com/drupal-8-1-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.1-beta1 + 8.1.1-beta1 + DRUPAL-8-1-1-beta1 + 8 + 1 + 1 + beta1 + published + http://example.com/drupal-8-1-1-beta1-release + http://example.com/drupal-8-1-1-beta1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.1-alpha1 + 8.1.1-alpha1 + DRUPAL-8-1-1-alpha1 + 8 + 1 + 1 + alpha1 + published + http://example.com/drupal-8-1-1-alpha1-release + http://example.com/drupal-8-1-1-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0 + 8.1.0 + DRUPAL-8-1-0 + 8 + 1 + 0 + published + http://example.com/drupal-8-1-0-release + http://example.com/drupal-8-1-0.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-beta1 + 8.1.0-beta1 + DRUPAL-8-0-1-beta1 + 8 + 1 + 0 + beta1 + published + http://example.com/drupal-8-1-0-beta1-release + http://example.com/drupal-8-1-0-beta1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0-alpha1 + 8.1.0-alpha1 + DRUPAL-8-1-0-alpha1 + 8 + 1 + 0 + alpha1 + published + http://example.com/drupal-8-1-0-alpha1-release + http://example.com/drupal-8-1-0-alpha1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1 + 8.0.1 + DRUPAL-8-0-1 + 8 + 0 + 1 + published + http://example.com/drupal-8-0-1-release + http://example.com/drupal-8-0-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-beta1 + 8.0.1-beta1 + DRUPAL-8-0-1-beta1 + 8 + 0 + 1 + beta1 + published + http://example.com/drupal-8-0-1-beta1-release + http://example.com/drupal-8-0-1-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.1-alpha1 + 8.0.1-alpha1 + DRUPAL-8-0-1-alpha1 + 8 + 0 + 1 + alpha1 + published + http://example.com/drupal-8-0-1-alpha1-release + http://example.com/drupal-8-0-1-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 + 0 + published + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-beta1 + 8.0.0-beta1 + DRUPAL-8-0-0-beta1 + 8 + 0 + 0 + beta1 + published + http://example.com/drupal-8-0-0-beta1-release + http://example.com/drupal-8-0-0-beta1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.0.0-alpha1 + 8.0.0-alpha1 + DRUPAL-8-0-0-alpha1 + 8 + 0 + 0 + alpha1 + published + http://example.com/drupal-8-0-0-alpha1-release + http://example.com/drupal-8-0-0-alpha1.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.1.2-sec.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.1.2-sec.xml new file mode 100644 index 00000000..f4b3f830 --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.1.2-sec.xml @@ -0,0 +1,72 @@ + + +Drupal +drupal +Drupal +8.x +8 +8 +8 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 8.1.2 + 8.1.2 + DRUPAL-8-1-2 + 8 + 1 + 2 + published + http://example.com/drupal-8-1-2-release + http://example.com/drupal-8-1-2.tar.gz + 1250424641 + b966255555d9c9b86d480ca08cfaa98e + 4294967296 + + Release typeNew features + Release typeBug fixes + Release typeSecurity update + + + + Drupal 8.1.1 + 8.1.1 + DRUPAL-8-1-1 + 8 + 1 + 1 + published + http://example.com/drupal-8-1-1-release + http://example.com/drupal-8-1-1.tar.gz + 1250424581 + b966255555d9c9b86d480ca08cfaa98e + 2147483648 + + Release typeNew features + Release typeBug fixes + + + + Drupal 8.1.0 + 8.1.0 + DRUPAL-8-1-0 + 8 + 1 + 0 + published + http://example.com/drupal-8-1-0-release + http://example.com/drupal-8-1-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.1.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.1.xml deleted file mode 100644 index c210a5a9..00000000 --- a/drupal/core/modules/update/tests/modules/update_test/drupal.1.xml +++ /dev/null @@ -1,51 +0,0 @@ - - -Drupal -drupal -Drupal -8.x -7 -7 -7 -published -http://example.com/project/drupal - - ProjectsDrupal project - - - - Drupal 7.1 - 7.1 - DRUPAL-7-1 - 7 - 1 - published - http://example.com/drupal-7-1-release - http://example.com/drupal-7-1.tar.gz - 1250424581 - b966255555d9c9b86d480ca08cfaa98e - 2147483648 - - Release typeNew features - Release typeBug fixes - - - - Drupal 7.0 - 7.0 - DRUPAL-7-0 - 7 - 0 - published - http://example.com/drupal-7-0-release - http://example.com/drupal-7-0.tar.gz - 1250424521 - b966255555d9c9b86d480ca08cfaa98e - 1073741824 - - Release typeNew features - Release typeBug fixes - - - - diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.9.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.9.xml new file mode 100644 index 00000000..c17b426a --- /dev/null +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.9.xml @@ -0,0 +1,35 @@ + + +Drupal +drupal +Drupal +9.x +9 +9 +9 +published +http://example.com/project/drupal + + ProjectsDrupal project + + + + Drupal 9.0.0 + 9.0.0 + DRUPAL-9-0-0 + 9 + 0 + 0 + published + http://example.com/drupal-9-0-0-release + http://example.com/drupal-9-0-0.tar.gz + 1250424521 + b966255555d9c9b86d480ca08cfaa98e + 1073741824 + + Release typeNew features + Release typeBug fixes + + + + diff --git a/drupal/core/modules/update/tests/modules/update_test/drupal.dev.xml b/drupal/core/modules/update/tests/modules/update_test/drupal.dev.xml index 4f707893..4ab26bd2 100644 --- a/drupal/core/modules/update/tests/modules/update_test/drupal.dev.xml +++ b/drupal/core/modules/update/tests/modules/update_test/drupal.dev.xml @@ -4,9 +4,9 @@ drupal Drupal 8.x -7 -7 -7 +8 +8 +8 published http://example.com/project/drupal @@ -14,14 +14,15 @@ - Drupal 7.0 - 7.0 - DRUPAL-7-0 - 7 + Drupal 8.0.0 + 8.0.0 + DRUPAL-8-0-0 + 8 + 0 0 published - http://example.com/drupal-7-0-release - http://example.com/drupal-7-0.tar.gz + http://example.com/drupal-8-0-0-release + http://example.com/drupal-8-0-0.tar.gz 1250424521 b966255555d9c9b86d480ca08cfaa98e 1073741824 @@ -31,14 +32,15 @@ - Drupal 8.x-dev - 8.x-dev - DRUPAL-7 - 7 + Drupal 8.0.x-dev + 8.0.x-dev + DRUPAL-8-0 + 8 + 0 dev published - http://example.com/drupal-7-x-dev-release - http://example.com/drupal-8.x-dev.tar.gz + http://example.com/drupal-8-0-x-dev-release + http://example.com/drupal-8.0.x-dev.tar.gz 1250424581 b966255555d9c9b86d480ca08cfaa98e 2147483648 diff --git a/drupal/core/modules/update/tests/modules/update_test/update_test.info.yml b/drupal/core/modules/update/tests/modules/update_test/update_test.info.yml index 053aafcf..33b8632b 100644 --- a/drupal/core/modules/update/tests/modules/update_test/update_test.info.yml +++ b/drupal/core/modules/update/tests/modules/update_test/update_test.info.yml @@ -2,5 +2,11 @@ name: 'Update test' type: module description: 'Support module for update module testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info.yml b/drupal/core/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info.yml index 91621479..6438ae9f 100644 --- a/drupal/core/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info.yml +++ b/drupal/core/modules/update/tests/themes/update_test_basetheme/update_test_basetheme.info.yml @@ -1,5 +1,11 @@ name: 'Update test base theme' type: theme description: 'Test theme which acts as a base theme for other test subthemes.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info.yml b/drupal/core/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info.yml index 0921cc79..5a62dd8e 100644 --- a/drupal/core/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info.yml +++ b/drupal/core/modules/update/tests/themes/update_test_subtheme/update_test_subtheme.info.yml @@ -1,6 +1,12 @@ name: 'Update test subtheme' type: theme description: 'Test theme which uses update_test_basetheme as the base theme.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x base theme: update_test_basetheme + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/update/update.info.yml b/drupal/core/modules/update/update.info.yml index ae94a4c6..3e3b124b 100644 --- a/drupal/core/modules/update/update.info.yml +++ b/drupal/core/modules/update/update.info.yml @@ -1,9 +1,15 @@ name: 'Update Manager' type: module description: 'Checks for available updates, and can securely install or update modules and themes via a web interface.' -version: VERSION +# version: VERSION package: Core -core: 8.x +# core: 8.x configure: update.settings dependencies: - file + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/user/src/Tests/UserAutocompleteTest.php b/drupal/core/modules/user/src/Tests/UserAutocompleteTest.php index 204c4961..a56c33c4 100644 --- a/drupal/core/modules/user/src/Tests/UserAutocompleteTest.php +++ b/drupal/core/modules/user/src/Tests/UserAutocompleteTest.php @@ -8,6 +8,7 @@ namespace Drupal\user\Tests; use Drupal\Component\Utility\String; +use Drupal\Component\Utility\Unicode; use Drupal\simpletest\WebTestBase; /** @@ -47,9 +48,9 @@ function testUserAutocomplete() { \Drupal::config('user.settings')->set('anonymous', $anonymous_name)->save(); // Test that anonymous username is in the result when requested and escaped // with \Drupal\Component\Utility\String::checkPlain(). - $users = $this->drupalGetJSON('user/autocomplete/anonymous', array('query' => array('q' => drupal_substr($anonymous_name, 0, 4)))); + $users = $this->drupalGetJSON('user/autocomplete/anonymous', array('query' => array('q' => Unicode::substr($anonymous_name, 0, 4)))); $this->assertEqual(String::checkPlain($anonymous_name), $users[0]['label'], 'The anonymous name found in autocompletion results.'); - $users = $this->drupalGetJSON('user/autocomplete', array('query' => array('q' => drupal_substr($anonymous_name, 0, 4)))); + $users = $this->drupalGetJSON('user/autocomplete', array('query' => array('q' => Unicode::substr($anonymous_name, 0, 4)))); $this->assertTrue(empty($users), 'The anonymous name not found in autocompletion results without enabling anonymous username.'); } } diff --git a/drupal/core/modules/user/templates/user.html.twig b/drupal/core/modules/user/templates/user.html.twig index c44448bd..b00a744a 100644 --- a/drupal/core/modules/user/templates/user.html.twig +++ b/drupal/core/modules/user/templates/user.html.twig @@ -23,7 +23,7 @@ * @ingroup themeable */ #} - + {% if content %} {{- content -}} {% endif %} diff --git a/drupal/core/modules/user/templates/username.html.twig b/drupal/core/modules/user/templates/username.html.twig index 78593763..5d4f2f75 100644 --- a/drupal/core/modules/user/templates/username.html.twig +++ b/drupal/core/modules/user/templates/username.html.twig @@ -19,7 +19,7 @@ */ #} {% if link_path -%} - {{ name }}{{ extra }} + {{ name }}{{ extra }} {%- else -%} {{ name }}{{ extra }} {%- endif -%} diff --git a/drupal/core/modules/user/tests/modules/user_custom_phpass_params_test/user_custom_phpass_params_test.info.yml b/drupal/core/modules/user/tests/modules/user_custom_phpass_params_test/user_custom_phpass_params_test.info.yml index 68b8ff9a..0de0c0d8 100644 --- a/drupal/core/modules/user/tests/modules/user_custom_phpass_params_test/user_custom_phpass_params_test.info.yml +++ b/drupal/core/modules/user/tests/modules/user_custom_phpass_params_test/user_custom_phpass_params_test.info.yml @@ -2,5 +2,11 @@ name: 'User custom phpass params test' type: module description: 'Support module for testing custom phpass password algorithm parameters.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/user/tests/modules/user_form_test/user_form_test.info.yml b/drupal/core/modules/user/tests/modules/user_form_test/user_form_test.info.yml index e77ebf28..7c345416 100644 --- a/drupal/core/modules/user/tests/modules/user_form_test/user_form_test.info.yml +++ b/drupal/core/modules/user/tests/modules/user_form_test/user_form_test.info.yml @@ -2,5 +2,11 @@ name: 'User module form tests' type: module description: 'Support module for user form testing.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/user/tests/modules/user_test_views/user_test_views.info.yml b/drupal/core/modules/user/tests/modules/user_test_views/user_test_views.info.yml index 2554769a..94ab2bef 100644 --- a/drupal/core/modules/user/tests/modules/user_test_views/user_test_views.info.yml +++ b/drupal/core/modules/user/tests/modules/user_test_views/user_test_views.info.yml @@ -2,8 +2,14 @@ name: 'User test views' type: module description: 'Provides default views for views user tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - user - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/user/user.info.yml b/drupal/core/modules/user/user.info.yml index 45a421a5..5f91dea7 100644 --- a/drupal/core/modules/user/user.info.yml +++ b/drupal/core/modules/user/user.info.yml @@ -2,7 +2,13 @@ name: User type: module description: 'Manages the user registration and login system.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x required: true configure: user.admin_index + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/views/config/schema/views.data_types.schema.yml b/drupal/core/modules/views/config/schema/views.data_types.schema.yml index e69060db..3e1c25bb 100644 --- a/drupal/core/modules/views/config/schema/views.data_types.schema.yml +++ b/drupal/core/modules/views/config/schema/views.data_types.schema.yml @@ -27,6 +27,9 @@ views_display: provider: type: string label: 'Provider' + dependencies: + type: config_dependencies + label: 'Dependencies' exposed_form: type: mapping label: 'Exposed form' @@ -40,6 +43,9 @@ views_display: provider: type: string label: 'Provider' + dependencies: + type: config_dependencies + label: 'Dependencies' access: type: mapping label: 'Access' @@ -52,6 +58,9 @@ views_display: provider: type: string label: 'Provider' + dependencies: + type: config_dependencies + label: 'Dependencies' cache: type: views.cache.[type] empty: @@ -99,6 +108,9 @@ views_display: provider: type: string label: 'Provider' + dependencies: + type: config_dependencies + label: 'Dependencies' row: type: mapping label: 'Row' @@ -111,6 +123,9 @@ views_display: provider: type: string label: 'Provider' + dependencies: + type: config_dependencies + label: 'Dependencies' query: type: mapping label: 'Query' @@ -123,6 +138,9 @@ views_display: provider: type: string label: 'Provider' + dependencies: + type: config_dependencies + label: 'Dependencies' defaults: type: mapping label: 'Defaults' @@ -883,3 +901,6 @@ views_cache: provider: type: string label: 'Provider' + dependencies: + type: config_dependencies + label: 'Dependencies' diff --git a/drupal/core/modules/views/js/ajax_view.js b/drupal/core/modules/views/js/ajax_view.js index 783dfe6b..2f4aae86 100644 --- a/drupal/core/modules/views/js/ajax_view.js +++ b/drupal/core/modules/views/js/ajax_view.js @@ -100,7 +100,7 @@ * Attach the ajax behavior to each link. */ Drupal.views.ajaxView.prototype.attachPagerAjax = function () { - this.$view.find('ul.pager > li > a, th.views-field a, .attachment .views-summary a') + this.$view.find('ul.pager__items > li > a, th.views-field a, .attachment .views-summary a') .each(jQuery.proxy(this.attachPagerLinkAjax, this)); }; diff --git a/drupal/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/drupal/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index 0cc56816..d8ff7ae3 100644 --- a/drupal/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/drupal/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -8,6 +8,7 @@ namespace Drupal\views\Plugin\views\display; use Drupal\Component\Utility\String; +use Drupal\Component\Utility\Unicode; use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageInterface; @@ -1124,7 +1125,7 @@ public function optionsSummary(&$categories, &$options) { ); } - $display_comment = String::checkPlain(drupal_substr($this->getOption('display_comment'), 0, 10)); + $display_comment = String::checkPlain(Unicode::substr($this->getOption('display_comment'), 0, 10)); $options['display_comment'] = array( 'category' => 'other', 'title' => $this->t('Administrative comment'), diff --git a/drupal/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/drupal/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index d5df2fc2..486ef5af 100644 --- a/drupal/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/drupal/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -10,6 +10,7 @@ use Drupal\Component\Utility\Html; use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\String; +use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\Xss; use Drupal\Core\Form\FormStateInterface; @@ -1281,7 +1282,7 @@ public function renderText($alter) { $base_path = base_path(); // Checks whether the path starts with the base_path. if (strpos($more_link_path, $base_path) === 0) { - $more_link_path = drupal_substr($more_link_path, drupal_strlen($base_path)); + $more_link_path = Unicode::substr($more_link_path, drupal_strlen($base_path)); } $more_link = _l($more_link_text, $more_link_path, array('attributes' => array('class' => array('views-more-link')))); @@ -1689,7 +1690,7 @@ public function adminLabel($short = FALSE) { */ public static function trimText($alter, $value) { if (drupal_strlen($value) > $alter['max_length']) { - $value = drupal_substr($value, 0, $alter['max_length']); + $value = Unicode::substr($value, 0, $alter['max_length']); if (!empty($alter['word_boundary'])) { $regex = "(.*)\b.+"; if (function_exists('mb_ereg')) { diff --git a/drupal/core/modules/views/src/Plugin/views/join/JoinPluginBase.php b/drupal/core/modules/views/src/Plugin/views/join/JoinPluginBase.php index d282f39a..b9ce5a51 100644 --- a/drupal/core/modules/views/src/Plugin/views/join/JoinPluginBase.php +++ b/drupal/core/modules/views/src/Plugin/views/join/JoinPluginBase.php @@ -244,13 +244,15 @@ public function buildJoin($select_query, $table, $view_query) { if (is_array($info['value'])) { // With an array of values, we need multiple placeholders and the // 'IN' operator is implicit. + $local_arguments = array(); foreach ($info['value'] as $value) { $placeholder_i = ':views_join_condition_' . $select_query->nextPlaceholder(); - $arguments[$placeholder_i] = $value; + $local_arguments[$placeholder_i] = $value; } $operator = !empty($info['operator']) ? $info['operator'] : 'IN'; - $placeholder = '( ' . implode(', ', array_keys($arguments)) . ' )'; + $placeholder = '( ' . implode(', ', array_keys($local_arguments)) . ' )'; + $arguments += $local_arguments; } else { // With a single value, the '=' operator is implicit. diff --git a/drupal/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php b/drupal/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php index e8205326..b4284b11 100644 --- a/drupal/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php +++ b/drupal/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php @@ -25,7 +25,7 @@ class RowEntityRenderersTest extends ViewUnitTestBase { * * @var array */ - public static $modules = array('entity', 'field', 'filter', 'text', 'node', 'user', 'language'); + public static $modules = array('entity', 'field', 'filter', 'text', 'node', 'user', 'language', 'entity_reference'); /** * Views used by this test. diff --git a/drupal/core/modules/views/src/Tests/Handler/FieldWebTest.php b/drupal/core/modules/views/src/Tests/Handler/FieldWebTest.php index cdb98dce..6b764222 100644 --- a/drupal/core/modules/views/src/Tests/Handler/FieldWebTest.php +++ b/drupal/core/modules/views/src/Tests/Handler/FieldWebTest.php @@ -7,6 +7,7 @@ namespace Drupal\views\Tests\Handler; +use Drupal\Component\Utility\Unicode; use Drupal\Component\Utility\UrlHelper; use Drupal\views\Views; @@ -480,7 +481,7 @@ public function testTextRendering() { // Tests for simple trimming by string length. $row->views_test_data_name = $this->randomMachineName(8); $name_field->options['alter']['max_length'] = 5; - $trimmed_name = drupal_substr($row->views_test_data_name, 0, 5); + $trimmed_name = Unicode::substr($row->views_test_data_name, 0, 5); $output = $name_field->advancedRender($row); $this->assertSubString($output, $trimmed_name, format_string('Make sure the trimmed output (!trimmed) appears in the rendered output (!output).', array('!trimmed' => $trimmed_name, '!output' => $output))); diff --git a/drupal/core/modules/views/src/Tests/Plugin/JoinTest.php b/drupal/core/modules/views/src/Tests/Plugin/JoinTest.php index 05a2fad5..c557a940 100644 --- a/drupal/core/modules/views/src/Tests/Plugin/JoinTest.php +++ b/drupal/core/modules/views/src/Tests/Plugin/JoinTest.php @@ -141,7 +141,7 @@ public function testBasePlugin() { 'field' => 'name', 'value' => $random_name_2, 'operator' => '<>' - ) + ), ); $join = $this->manager->createInstance('standard', $configuration); $table = array('alias' => 'users3'); @@ -152,6 +152,29 @@ public function testBasePlugin() { $this->assertTrue(strpos($join_info['condition'], "users3.name = :views_join_condition_0") !== FALSE, 'Make sure the first extra join condition appears in the query and uses the first placeholder.'); $this->assertTrue(strpos($join_info['condition'], "users3.name <> :views_join_condition_1") !== FALSE, 'Make sure the second extra join condition appears in the query and uses the second placeholder.'); $this->assertEqual(array_values($join_info['arguments']), array($random_name_1, $random_name_2), 'Make sure the arguments are in the right order'); + + // Test that 'IN' conditions are properly built. + $random_name_1 = $this->randomMachineName(); + $random_name_2 = $this->randomMachineName(); + $random_name_3 = $this->randomMachineName(); + $random_name_4 = $this->randomMachineName(); + $configuration['extra'] = array( + array( + 'field' => 'name', + 'value' => $random_name_1 + ), + array( + 'field' => 'name', + 'value' => array($random_name_2, $random_name_3, $random_name_4), + ), + ); + $join = $this->manager->createInstance('standard', $configuration); + $table = array('alias' => 'users4'); + $join->buildJoin($query, $table, $view->query); + + $tables = $query->getTables(); + $join_info = $tables['users4']; + $this->assertTrue(strpos($join_info['condition'], "users4.name IN ( :views_join_condition_3, :views_join_condition_4, :views_join_condition_5 )") !== FALSE, 'The IN condition for the join is properly formed.'); } } diff --git a/drupal/core/modules/views/src/Tests/ViewExecutableTest.php b/drupal/core/modules/views/src/Tests/ViewExecutableTest.php index 6ecca040..867f04cb 100644 --- a/drupal/core/modules/views/src/Tests/ViewExecutableTest.php +++ b/drupal/core/modules/views/src/Tests/ViewExecutableTest.php @@ -30,7 +30,7 @@ */ class ViewExecutableTest extends ViewUnitTestBase { - public static $modules = array('system', 'node', 'comment', 'user', 'filter', 'entity', 'field', 'text'); + public static $modules = array('system', 'node', 'comment', 'user', 'filter', 'entity', 'field', 'text', 'entity_reference'); /** * Views used by this test. diff --git a/drupal/core/modules/views/templates/views-mini-pager.html.twig b/drupal/core/modules/views/templates/views-mini-pager.html.twig index 5fd95dcf..e17311a9 100644 --- a/drupal/core/modules/views/templates/views-mini-pager.html.twig +++ b/drupal/core/modules/views/templates/views-mini-pager.html.twig @@ -11,7 +11,33 @@ * @ingroup themeable */ #} -{% if items %} -

{{ 'Pages'|t }}

- {{ items }} +{% if items.previous or items.next %} + {% endif %} diff --git a/drupal/core/modules/views/tests/modules/views_test_config/views_test_config.info.yml b/drupal/core/modules/views/tests/modules/views_test_config/views_test_config.info.yml index 33925738..808da306 100644 --- a/drupal/core/modules/views/tests/modules/views_test_config/views_test_config.info.yml +++ b/drupal/core/modules/views/tests/modules/views_test_config/views_test_config.info.yml @@ -2,7 +2,13 @@ name: 'Views Test Config' type: module description: 'Provides default views for tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/views/tests/modules/views_test_data/views_test_data.info.yml b/drupal/core/modules/views/tests/modules/views_test_data/views_test_data.info.yml index 39b72e45..d2816683 100644 --- a/drupal/core/modules/views/tests/modules/views_test_data/views_test_data.info.yml +++ b/drupal/core/modules/views/tests/modules/views_test_data/views_test_data.info.yml @@ -2,7 +2,13 @@ name: 'Views Test' type: module description: 'Test module for Views.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/views/views.info.yml b/drupal/core/modules/views/views.info.yml index 9e9b384e..be5d3c46 100644 --- a/drupal/core/modules/views/views.info.yml +++ b/drupal/core/modules/views/views.info.yml @@ -2,7 +2,13 @@ name: Views type: module description: 'Create customized lists and queries from your database.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - filter + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/views/views.theme.inc b/drupal/core/modules/views/views.theme.inc index ebef6f82..ac6999ff 100644 --- a/drupal/core/modules/views/views.theme.inc +++ b/drupal/core/modules/views/views.theme.inc @@ -1027,87 +1027,31 @@ function template_preprocess_views_mini_pager(&$variables) { $element = $variables['element']; $parameters = $variables['parameters']; - // Fill in default link labels. - $tags += array( - 1 => t('‹‹'), - 3 => t('››'), - ); - // Current is the page we are currently paged to. - $pager_current = $pager_page_array[$element] + 1; + $variables['items']['current'] = $pager_page_array[$element] + 1; - $li_previous = array(); if ($pager_total[$element] > 1 && $pager_page_array[$element] > 0) { - $li_previous = array( - '#type' => 'link', - '#title' => $tags[1], - '#url' => Url::fromRoute(''), - '#options' => array( - 'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] - 1), - 'attributes' => array( - 'title' => t('Go to previous page'), - 'rel' => 'prev', - ), - // Below is ignored by default, supplied to support hook_link_alter - // implementations. - 'pager_context' => array( - 'link_type' => 'previous', - 'element' => $element, - 'interval' => -1, - ), - ), + $options = array( + 'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] - 1), ); + $variables['items']['previous']['href'] = \Drupal::url('', [], $options); + if (isset($tags[1])) { + $variables['items']['previous']['text'] = $tags[1]; + } + $variables['items']['previous']['attributes'] = new Attribute(); } $li_next = array(); if ($pager_page_array[$element] < ($pager_total[$element] - 1)) { - $li_next = array( - '#type' => 'link', - '#title' => $tags[3], - '#url' => Url::fromRoute(''), - '#options' => array( - 'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] + 1), - 'attributes' => array( - 'title' => t('Go to next page'), - 'rel' => 'next', - ), - // Below is ignored by default, supplied to support hook_link_alter - // implementations. - 'pager_context' => array( - 'link_type' => 'next', - 'element' => $element, - 'interval' => 1, - ), - ), + $options = array( + 'query' => pager_query_add_page($parameters, $element, $pager_page_array[$element] + 1), ); + $variables['items']['next']['href'] = \Drupal::url('', [], $options); + if (isset($tags[3])) { + $variables['items']['next']['text'] = $tags[3]; + } + $variables['items']['next']['attributes'] = new Attribute(); } - - // Don't show the pager if there is neither a next page nor a previous page - // link, which means that we are on the first page and there is no next page - // available/wanted. - if (empty($li_next) && empty($li_previous)) { - return; - } - - $items = array(); - $items[] = array( - '#wrapper_attributes' => array('class' => array('pager-previous')), - ) + $li_previous; - - $items[] = array( - '#wrapper_attributes' => array('class' => array('pager-current')), - '#markup' => t('Page @current', array('@current' => $pager_current)), - ); - - $items[] = array( - '#wrapper_attributes' => array('class' => array('pager-next')), - ) + $li_next; - - $variables['items'] = array( - '#theme' => 'item_list__pager', - '#items' => $items, - '#attributes' => array('class' => array('pager')), - ); } /** diff --git a/drupal/core/modules/views_ui/src/Tests/DuplicateTest.php b/drupal/core/modules/views_ui/src/Tests/DuplicateTest.php new file mode 100644 index 00000000..e8f55b3f --- /dev/null +++ b/drupal/core/modules/views_ui/src/Tests/DuplicateTest.php @@ -0,0 +1,41 @@ +randomView(); + + // Initialize array for duplicated view. + $view = array(); + + // Generate random label and id for new view. + $view['label'] = $this->randomMachineName(255); + $view['id'] = strtolower($this->randomMachineName(128)); + + // Duplicate view. + $this->drupalPostForm('admin/structure/views/view/' . $random_view['id'] . '/duplicate', $view, t('Duplicate')); + + // Assert that the page url is correct. + $this->assertUrl('admin/structure/views/view/' . $view['id'], array(), 'Make sure the view saving was successful and the browser got redirected to the edit page.'); + + // Assert that the page title is correctly displayed. + $this->assertText($view['label']); + } +} diff --git a/drupal/core/modules/views_ui/src/Tests/FilterBooleanWebTest.php b/drupal/core/modules/views_ui/src/Tests/FilterBooleanWebTest.php index ac400e0c..acba3e41 100644 --- a/drupal/core/modules/views_ui/src/Tests/FilterBooleanWebTest.php +++ b/drupal/core/modules/views_ui/src/Tests/FilterBooleanWebTest.php @@ -52,6 +52,15 @@ public function testFilterBooleanUI() { $this->assertEqual((int) $result[2]->attributes()->checked, 'checked'); $result = $this->xpath('//input[@name="options[group_info][group_items][3][value]"]'); $this->assertEqual((int) $result[1]->attributes()->checked, 'checked'); + + // Test selecting a default and removing an item. + $edit = array(); + $edit['options[group_info][default_group]'] = 2; + $edit['options[group_info][group_items][3][remove]'] = 1; + $this->drupalPostForm(NULL, $edit, t('Apply')); + $this->drupalGet('admin/structure/views/nojs/handler/test_view/default/filter/status'); + $this->assertFieldByName('options[group_info][default_group]', 2, 'Second item was set as the default.'); + $this->assertNoField('options[group_info][group_items][3][remove]', 'Third item was removed.'); } } diff --git a/drupal/core/modules/views_ui/src/Tests/PreviewTest.php b/drupal/core/modules/views_ui/src/Tests/PreviewTest.php index 191e4b45..4b6aca28 100644 --- a/drupal/core/modules/views_ui/src/Tests/PreviewTest.php +++ b/drupal/core/modules/views_ui/src/Tests/PreviewTest.php @@ -165,40 +165,36 @@ public function testPreviewWithPagersUI() { $this->getPreviewAJAX('test_mini_pager', 'default', 3); // Test that the pager is present and rendered. - $elements = $this->xpath('//ul[@class = "pager"]/li'); + $elements = $this->xpath('//ul[contains(@class, :class)]/li', array(':class' => 'pager__items')); $this->assertTrue(!empty($elements), 'Mini pager found.'); // Verify elements and links to pages. - // We expect to find 3 elements: previous and current pages, with no link, - // and next page with a link. - $this->assertClass($elements[0], 'pager-previous', 'Element for previous page has .pager-previous class.'); - $this->assertFalse(isset($elements[0]->a), 'Element for previous page has no link.'); - - $this->assertClass($elements[1], 'pager-current', 'Element for current page has .pager-current class.'); - $this->assertFalse(isset($elements[1]->a), 'Element for current page has no link.'); + // We expect to find current pages element with no link, next page element + // with a link, and not to find previous page element. + $this->assertClass($elements[0], 'is-active', 'Element for current page has .is-active class.'); - $this->assertClass($elements[2], 'pager-next', "Element for next page has .pager-next class."); - $this->assertTrue($elements[2]->a, "Link to next page found."); + $this->assertClass($elements[1], 'pager__item--next', 'Element for next page has .pager__item--next class.'); + $this->assertTrue($elements[1]->a, 'Link to next page found.'); // Navigate to next page. - $elements = $this->xpath('//li[contains(@class, :class)]/a', array(':class' => 'pager-next')); + $elements = $this->xpath('//li[contains(@class, :class)]/a', array(':class' => 'pager__item--next')); $this->clickPreviewLinkAJAX($elements[0]['href'], 3); // Test that the pager is present and rendered. - $elements = $this->xpath('//ul[@class = "pager"]/li'); + $elements = $this->xpath('//ul[contains(@class, :class)]/li', array(':class' => 'pager__items')); $this->assertTrue(!empty($elements), 'Mini pager found.'); // Verify elements and links to pages. // We expect to find 3 elements: previous page with a link, current // page with no link, and next page with a link. - $this->assertClass($elements[0], 'pager-previous', 'Element for previous page has .pager-previous class.'); - $this->assertTrue($elements[0]->a, "Link to previous page found."); + $this->assertClass($elements[0], 'pager__item--previous', 'Element for previous page has .pager__item--previous class.'); + $this->assertTrue($elements[0]->a, 'Link to previous page found.'); - $this->assertClass($elements[1], 'pager-current', 'Element for current page has .pager-current class.'); + $this->assertClass($elements[1], 'is-active', 'Element for current page has .is-active class.'); $this->assertFalse(isset($elements[1]->a), 'Element for current page has no link.'); - $this->assertClass($elements[2], 'pager-next', "Element for next page has .pager-next class."); - $this->assertTrue($elements[2]->a, "Link to next page found."); + $this->assertClass($elements[2], 'pager__item--next', 'Element for next page has .pager__item--next class.'); + $this->assertTrue($elements[2]->a, 'Link to next page found.'); } /** diff --git a/drupal/core/modules/views_ui/src/Tests/XssTest.php b/drupal/core/modules/views_ui/src/Tests/XssTest.php new file mode 100644 index 00000000..36c00692 --- /dev/null +++ b/drupal/core/modules/views_ui/src/Tests/XssTest.php @@ -0,0 +1,34 @@ +drupalGet('admin/structure/views'); + $this->assertRaw('<script>alert("foo");</script>, <marquee>test</marquee>', 'The view tag is properly escaped.'); + + $this->drupalGet('admin/structure/views/view/sa_contrib_2013_035'); + $this->assertRaw('&lt;marquee&gt;test&lt;/marquee&gt;', 'Field admin label is properly escaped.'); + + $this->drupalGet('admin/structure/views/nojs/handler/sa_contrib_2013_035/page_1/header/area'); + $this->assertRaw('[title] == &lt;marquee&gt;test&lt;/marquee&gt;', 'Token label is properly escaped.'); + $this->assertRaw('[title_1] == &lt;script&gt;alert(&quot;XSS&quot;)&lt;/script&gt;', 'Token label is properly escaped.'); + } + +} diff --git a/drupal/core/modules/views_ui/src/ViewDuplicateForm.php b/drupal/core/modules/views_ui/src/ViewDuplicateForm.php index fc5aea56..36f1a7fc 100644 --- a/drupal/core/modules/views_ui/src/ViewDuplicateForm.php +++ b/drupal/core/modules/views_ui/src/ViewDuplicateForm.php @@ -73,6 +73,7 @@ protected function actions(array $form, FormStateInterface $form_state) { */ public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity = $this->entity->createDuplicate(); + $this->entity->set('label', $form_state->getValue('label')); $this->entity->set('id', $form_state->getValue('id')); $this->entity->save(); diff --git a/drupal/core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml b/drupal/core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml new file mode 100644 index 00000000..5972d15b --- /dev/null +++ b/drupal/core/modules/views_ui/tests/modules/views_ui_test/config/install/views.view.sa_contrib_2013_035.yml @@ -0,0 +1,215 @@ +uuid: 93005672-5b8a-4a7a-9342-6651552bb753 +langcode: en +status: true +dependencies: + module: + - node +id: sa_contrib_2013_035 +label: SA_CONTRIB_2013_035 +module: views +description: '' +tag: ', test' +base_table: node +base_field: nid +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + provider: views + display_options: + access: + type: perm + options: + perm: 'access content' + provider: user + dependencies: { } + cache: + type: none + options: { } + provider: views + dependencies: { } + query: + type: views_query + options: + disable_sql_rewrite: false + distinct: false + replica: false + query_comment: false + query_tags: { } + provider: views + dependencies: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + provider: views + dependencies: { } + pager: + type: none + options: + offset: 0 + provider: views + style: + type: default + options: + grouping: { } + row_class: '' + default_row_class: true + uses_fields: false + provider: views + dependencies: { } + row: + type: fields + options: + inline: { } + separator: '' + hide_empty: false + default_field_elements: true + provider: views + dependencies: { } + fields: + title: + id: title + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: 'test' + dependencies: + module: + - node + - node + - node + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: '' + word_boundary: false + ellipsis: false + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_node: true + plugin_id: node + provider: node + title_1: + id: title_1 + table: node_field_data + field: title + relationship: none + group_type: group + admin_label: '' + dependencies: + module: + - node + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: '' + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + link_to_node: true + plugin_id: node + provider: node + filters: { } + sorts: { } + header: + area: + id: area + table: views + field: area + plugin_id: text + provider: views + footer: { } + empty: { } + relationships: { } + arguments: { } + field_langcode: '***LANGUAGE_language_content***' + field_langcode_add_to_query: null + title: 'VIEWS TITLE' + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: 2 + provider: views + display_options: + field_langcode: '***LANGUAGE_language_content***' + field_langcode_add_to_query: null + path: foobar diff --git a/drupal/core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.info.yml b/drupal/core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.info.yml index 93ba44e6..333c2f41 100644 --- a/drupal/core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.info.yml +++ b/drupal/core/modules/views_ui/tests/modules/views_ui_test/views_ui_test.info.yml @@ -2,7 +2,13 @@ name: 'Views UI Test' type: module description: 'Test module for Views UI.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - views_ui + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/views_ui/views_ui.info.yml b/drupal/core/modules/views_ui/views_ui.info.yml index 0230b6ea..39c6c5f7 100644 --- a/drupal/core/modules/views_ui/views_ui.info.yml +++ b/drupal/core/modules/views_ui/views_ui.info.yml @@ -2,8 +2,14 @@ name: 'Views UI' type: module description: 'Administrative interface for Views.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x configure: views_ui.list dependencies: - views + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/modules/views_ui/views_ui.module b/drupal/core/modules/views_ui/views_ui.module index 94b45ea8..a6a51e34 100644 --- a/drupal/core/modules/views_ui/views_ui.module +++ b/drupal/core/modules/views_ui/views_ui.module @@ -5,6 +5,7 @@ * Provide structure for the administrative interface to Views. */ +use Drupal\Component\Utility\Unicode; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Url; use Drupal\views\Views; @@ -327,7 +328,7 @@ function views_ui_views_analyze(ViewExecutable $view) { */ function views_ui_truncate($string, $length) { if (drupal_strlen($string) > $length) { - $string = drupal_substr($string, 0, $length); + $string = Unicode::substr($string, 0, $length); $string .= '...'; } diff --git a/drupal/core/modules/views_ui/views_ui.theme.inc b/drupal/core/modules/views_ui/views_ui.theme.inc index 6e272ca1..8a55d3fb 100644 --- a/drupal/core/modules/views_ui/views_ui.theme.inc +++ b/drupal/core/modules/views_ui/views_ui.theme.inc @@ -147,12 +147,20 @@ function theme_views_ui_build_group_filter_form($variables) { foreach (Element::children($form['group_items']) as $group_id) { $form['group_items'][$group_id]['value']['#title'] = ''; $data = array( - 'default' => drupal_render($form['default_group'][$group_id]) . drupal_render($form['default_group_multiple'][$group_id]), + 'default' => array( + 'data' => array( + '#markup' => drupal_render($form['default_group'][$group_id]) . drupal_render($form['default_group_multiple'][$group_id]), + ), + ), 'weight' => drupal_render($form['group_items'][$group_id]['weight']), 'title' => drupal_render($form['group_items'][$group_id]['title']), 'operator' => drupal_render($form['group_items'][$group_id]['operator']), 'value' => drupal_render($form['group_items'][$group_id]['value']), - 'remove' => drupal_render($form['group_items'][$group_id]['remove']) . _l('' . t('Remove') . '', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $group_id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true)), + 'remove' => array( + 'data' => array( + '#markup' => drupal_render($form['group_items'][$group_id]['remove']) . _l('' . t('Remove') . '', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $group_id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true)), + ), + ), ); $rows[] = array('data' => $data, 'id' => 'views-row-' . $group_id, 'class' => array('draggable')); } diff --git a/drupal/core/profiles/minimal/minimal.info.yml b/drupal/core/profiles/minimal/minimal.info.yml index 628dcd3d..a845874c 100644 --- a/drupal/core/profiles/minimal/minimal.info.yml +++ b/drupal/core/profiles/minimal/minimal.info.yml @@ -1,9 +1,15 @@ name: Minimal type: profile description: 'Build a custom site without pre-configured functionality. Suitable for advanced users.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - node - block - dblog + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/profiles/standard/standard.info.yml b/drupal/core/profiles/standard/standard.info.yml index a1c07b23..a210ab47 100644 --- a/drupal/core/profiles/standard/standard.info.yml +++ b/drupal/core/profiles/standard/standard.info.yml @@ -1,8 +1,8 @@ name: Standard type: profile description: 'Install with commonly used features pre-configured.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x dependencies: - node - history @@ -39,3 +39,9 @@ dependencies: themes: - bartik - seven + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info.yml b/drupal/core/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info.yml index 30bccf71..7fee3ff2 100644 --- a/drupal/core/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info.yml +++ b/drupal/core/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.info.yml @@ -2,5 +2,11 @@ name: 'Drupal system listing compatible test' type: module description: 'Support module for testing the drupal_system_listing function.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/profiles/testing/testing.info.yml b/drupal/core/profiles/testing/testing.info.yml index b905706e..cff8165c 100644 --- a/drupal/core/profiles/testing/testing.info.yml +++ b/drupal/core/profiles/testing/testing.info.yml @@ -1,6 +1,12 @@ name: Testing type: profile description: 'Minimal profile for running tests. Includes absolutely required modules only.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x hidden: true + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/profiles/testing_multilingual/testing_multilingual.info.yml b/drupal/core/profiles/testing_multilingual/testing_multilingual.info.yml index c33045ae..c35da99b 100644 --- a/drupal/core/profiles/testing_multilingual/testing_multilingual.info.yml +++ b/drupal/core/profiles/testing_multilingual/testing_multilingual.info.yml @@ -1,9 +1,15 @@ name: Testing multilingual type: profile description: 'Minimal profile for running tests with a multilingual installer.' -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x hidden: true dependencies: - locale keep_english: true + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseRendererTest.php b/drupal/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseRendererTest.php deleted file mode 100644 index 2c71d871..00000000 --- a/drupal/core/tests/Drupal/Tests/Core/Ajax/AjaxResponseRendererTest.php +++ /dev/null @@ -1,132 +0,0 @@ -ajaxResponseRenderer = new TestAjaxResponseRenderer(); - } - - /** - * Tests the render method with an HtmlFragment object. - * - * @covers \Drupal\Core\Ajax\AjaxResponseRenderer::render - */ - public function testRenderWithFragmentObject() { - $html_fragment = new HtmlFragment('example content'); - /** @var \Drupal\Core\Ajax\AjaxResponse $result */ - $result = $this->ajaxResponseRenderer->render($html_fragment); - - $this->assertInstanceOf('Drupal\Core\Ajax\AjaxResponse', $result); - - $commands = $result->getCommands(); - $this->assertEquals('insert', $commands[0]['command']); - $this->assertEquals('example content', $commands[0]['data']); - - $this->assertEquals('insert', $commands[1]['command']); - $this->assertEquals('status_messages', $commands[1]['data']); - } - - /** - * Tests the render method with an HtmlFragment object. - * - * @covers \Drupal\Core\Ajax\AjaxResponseRenderer::render - */ - public function testRenderWithString() { - $html_fragment = 'example content'; - /** @var \Drupal\Core\Ajax\AjaxResponse $result */ - $result = $this->ajaxResponseRenderer->render($html_fragment); - - $this->assertInstanceOf('Drupal\Core\Ajax\AjaxResponse', $result); - - $commands = $result->getCommands(); - $this->assertEquals('insert', $commands[0]['command']); - $this->assertEquals('example content', $commands[0]['data']); - - $this->assertEquals('insert', $commands[1]['command']); - $this->assertEquals('status_messages', $commands[1]['data']); - } - - - /** - * Tests the render method with a response object. - * - * @covers \Drupal\Core\Ajax\AjaxResponseRenderer::render - */ - public function testRenderWithResponseObject() { - $json_response = new JsonResponse(array('foo' => 'bar')); - $this->assertSame($json_response, $this->ajaxResponseRenderer->render($json_response)); - } - - /** - * Tests the render method with an Ajax response object. - * - * @covers \Drupal\Core\Ajax\AjaxResponseRenderer::render - */ - public function testRenderWithAjaxResponseObject() { - $ajax_response = new AjaxResponse(array('foo' => 'bar')); - $this->assertSame($ajax_response, $this->ajaxResponseRenderer->render($ajax_response)); - } - -} - -class TestAjaxResponseRenderer extends AjaxResponseRenderer { - - /** - * {@inheritdoc} - */ - protected function drupalRenderRoot(&$elements) { - if (isset($elements['#markup'])) { - return $elements['#markup']; - } - elseif (isset($elements['#theme'])) { - return $elements['#theme']; - } - else { - return 'Markup'; - } - } - - /** - * {@inheritdoc} - */ - protected function elementInfo($type) { - if ($type == 'ajax') { - return array( - '#header' => TRUE, - '#commands' => array(), - '#error' => NULL, - ); - } - else { - return array(); - } - } - -} diff --git a/drupal/core/tests/Drupal/Tests/Core/Cache/CacheTest.php b/drupal/core/tests/Drupal/Tests/Core/Cache/CacheTest.php index e5ae63c7..5a80ae45 100644 --- a/drupal/core/tests/Drupal/Tests/Core/Cache/CacheTest.php +++ b/drupal/core/tests/Drupal/Tests/Core/Cache/CacheTest.php @@ -133,7 +133,7 @@ public function testDeleteTags() { * @expectedExceptionMessage Cache tags must be strings, array given. */ public function testInvalidateTags() { - Cache::deleteTags(['node' => [2, 3, 5, 8, 13]]); + Cache::invalidateTags(['node' => [2, 3, 5, 8, 13]]); } } diff --git a/drupal/core/tests/Drupal/Tests/Core/Controller/AjaxControllerTest.php b/drupal/core/tests/Drupal/Tests/Core/Controller/AjaxControllerTest.php new file mode 100644 index 00000000..a9870828 --- /dev/null +++ b/drupal/core/tests/Drupal/Tests/Core/Controller/AjaxControllerTest.php @@ -0,0 +1,120 @@ +getMock('Drupal\Core\Controller\ControllerResolverInterface'); + $controller_resolver->expects($this->any()) + ->method('getArguments') + ->willReturn([]); + $element_info_manager = $this->getMock('Drupal\Core\Render\ElementInfoManagerInterface'); + $element_info_manager->expects($this->any()) + ->method('getInfo') + ->with('ajax') + ->willReturn([ + '#header' => TRUE, + '#commands' => array(), + '#error' => NULL, + ]); + $this->ajaxController = new TestAjaxController($controller_resolver, $element_info_manager); + } + + /** + * Tests the renderMainContent method. + * + * @covers \Drupal\Core\Controller\AjaxController::renderContentIntoResponse + */ + public function testRenderWithFragmentObject() { + $main_content = ['#markup' => 'example content']; + $request = new Request(); + $_content = function() use ($main_content) { + return $main_content; + }; + /** @var \Drupal\Core\Ajax\AjaxResponse $result */ + $result = $this->ajaxController->content($request, $_content); + + $this->assertInstanceOf('Drupal\Core\Ajax\AjaxResponse', $result); + + $commands = $result->getCommands(); + $this->assertEquals('insert', $commands[0]['command']); + $this->assertEquals('example content', $commands[0]['data']); + + $this->assertEquals('insert', $commands[1]['command']); + $this->assertEquals('status_messages', $commands[1]['data']); + } + + /** + * Tests the handle method with a Json response object. + * + * @covers \Drupal\Core\Controller\AjaxController::handle + */ + public function testRenderWithResponseObject() { + $json_response = new JsonResponse(array('foo' => 'bar')); + $request = new Request(); + $_content = function() use ($json_response) { + return $json_response; + }; + $this->assertSame($json_response, $this->ajaxController->content($request, $_content)); + } + + /** + * Tests the handle method with an Ajax response object. + * + * @covers \Drupal\Core\Controller\AjaxController::handle + */ + public function testRenderWithAjaxResponseObject() { + $ajax_response = new AjaxResponse(array('foo' => 'bar')); + $request = new Request(); + $_content = function() use ($ajax_response) { + return $ajax_response; + }; + $this->assertSame($ajax_response, $this->ajaxController->content($request, $_content)); + } + +} + +class TestAjaxController extends AjaxController { + + /** + * {@inheritdoc} + */ + protected function drupalRenderRoot(&$elements, $is_root_call = FALSE) { + if (isset($elements['#markup'])) { + return $elements['#markup']; + } + elseif (isset($elements['#theme'])) { + return $elements['#theme']; + } + else { + return 'Markup'; + } + } + +} diff --git a/drupal/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php b/drupal/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php index bc88b218..2b1b3ce7 100644 --- a/drupal/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php +++ b/drupal/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php @@ -164,6 +164,7 @@ public function testFieldDefaultValue() { $default_value = array( 'value' => $this->randomMachineName(), ); + $expected_default_value = array($default_value); $definition->setDefaultValue($default_value); $entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase') ->disableOriginalConstructor() @@ -171,7 +172,31 @@ public function testFieldDefaultValue() { // Set the field item list class to be used to avoid requiring the typed // data manager to retrieve it. $definition->setClass('Drupal\Core\Field\FieldItemList'); - $this->assertEquals($default_value, $definition->getDefaultValue($entity)); + $this->assertEquals($expected_default_value, $definition->getDefaultValue($entity)); + + $data_definition = $this->getMockBuilder('Drupal\Core\TypedData\DataDefinition') + ->disableOriginalConstructor() + ->getMock(); + $data_definition->expects($this->any()) + ->method('getClass') + ->will($this->returnValue('Drupal\Core\Field\FieldItemBase')); + $definition->setItemDefinition($data_definition); + + // Set default value only with a literal. + $definition->setDefaultValue($default_value['value']); + $this->assertEquals($expected_default_value, $definition->getDefaultValue($entity)); + + // Set default value with an indexed array. + $definition->setDefaultValue($expected_default_value); + $this->assertEquals($expected_default_value, $definition->getDefaultValue($entity)); + + // Set default value with an empty array. + $definition->setDefaultValue(array()); + $this->assertEquals(array(), $definition->getDefaultValue($entity)); + + // Set default value with NULL. + $definition->setDefaultValue(NULL); + $this->assertEquals(NULL, $definition->getDefaultValue($entity)); } /** diff --git a/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml b/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml index 7ae9fde9..07839d8b 100644 --- a/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml +++ b/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml @@ -2,5 +2,11 @@ name: module handler test module type: module description: 'Test module enabled by default in module handler unit tests.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_added/module_handler_test_added.info.yml b/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_added/module_handler_test_added.info.yml index cb16fb73..f224253a 100644 --- a/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_added/module_handler_test_added.info.yml +++ b/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_added/module_handler_test_added.info.yml @@ -2,6 +2,12 @@ name: module handler test module type: module description: 'Test module used to test adding a module during runtime.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x hidden: true + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1/module_handler_test_all1.info.yml b/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1/module_handler_test_all1.info.yml index c6dabc6a..ad2c995a 100644 --- a/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1/module_handler_test_all1.info.yml +++ b/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all1/module_handler_test_all1.info.yml @@ -2,6 +2,12 @@ name: module handler test all1 type: module description: 'Test module used to test adding groups of modules with loadAll during runtime.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x hidden: true + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all2/module_handler_test_all2.info.yml b/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all2/module_handler_test_all2.info.yml index 38aa79bf..3ac1e997 100644 --- a/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all2/module_handler_test_all2.info.yml +++ b/drupal/core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test_all2/module_handler_test_all2.info.yml @@ -2,6 +2,12 @@ name: module handler test all2 type: module description: 'Test module used to test adding groups of modules with loadAll during runtime.' package: Testing -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x hidden: true + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/themes/bartik/bartik.info.yml b/drupal/core/themes/bartik/bartik.info.yml index 22e62b47..0e91094a 100644 --- a/drupal/core/themes/bartik/bartik.info.yml +++ b/drupal/core/themes/bartik/bartik.info.yml @@ -3,8 +3,8 @@ type: theme base theme: classy description: 'A flexible, recolorable theme with many regions and a responsive, mobile-first layout.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x libraries: - bartik/base ckeditor_stylesheets: @@ -32,3 +32,9 @@ regions: settings: shortcut_module_link: false + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/themes/classy/classy.info.yml b/drupal/core/themes/classy/classy.info.yml index d557b48c..d79d1f3f 100644 --- a/drupal/core/themes/classy/classy.info.yml +++ b/drupal/core/themes/classy/classy.info.yml @@ -2,5 +2,11 @@ name: Classy type: theme description: 'A base theme with sensible default CSS classes added. Learn how to use Classy as a base theme in the Drupal 8 Theming Guide.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/themes/classy/templates/aggregator-block-item.html.twig b/drupal/core/themes/classy/templates/aggregator-block-item.html.twig new file mode 100644 index 00000000..c5a7f3c1 --- /dev/null +++ b/drupal/core/themes/classy/templates/aggregator-block-item.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation for feed item for display in the block. + * + * Available variables: + * - url: URL to the feed item. + * - title: Title of the feed item. + * + * @see template_preprocess_aggregator_block_item() + * + * @ingroup themeable + */ +#} +{{ title }} diff --git a/drupal/core/themes/classy/templates/aggregator-feed.html.twig b/drupal/core/themes/classy/templates/aggregator-feed.html.twig new file mode 100644 index 00000000..1876c453 --- /dev/null +++ b/drupal/core/themes/classy/templates/aggregator-feed.html.twig @@ -0,0 +1,31 @@ +{# +/** + * @file + * Default theme implementation to present an aggregator feed. + * + * The contents are rendered above feed listings when browsing source feeds. + * For example, "example.com/aggregator/sources/1". + * + * Available variables: + * - title: Title of the feed item. + * - content: All field items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given element. + * + * @see template_preprocess_aggregator_feed() + * + * @ingroup themeable + */ +#} + + + {{ title_prefix }} + {% if not full %} + {{ title }} + {% endif %} + {{ title_suffix }} + + {{ content }} + +
diff --git a/drupal/core/themes/classy/templates/aggregator-item.html.twig b/drupal/core/themes/classy/templates/aggregator-item.html.twig new file mode 100644 index 00000000..8f31937e --- /dev/null +++ b/drupal/core/themes/classy/templates/aggregator-item.html.twig @@ -0,0 +1,28 @@ +{# +/** + * @file + * Default theme implementation to present a feed item in an aggregator page. + * + * Available variables: + * - url: URL to the originating feed item. + * - title: Title of the feed item. + * - content: All field items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given element. + * + * @see template_preprocess_aggregator_item() + * + * @ingroup themeable + */ +#} + + {{ title_prefix }} +

+ {{ title }} +

+ {{ title_suffix }} + + {{ content }} + +
diff --git a/drupal/core/themes/classy/templates/file-link.html.twig b/drupal/core/themes/classy/templates/file-link.html.twig new file mode 100644 index 00000000..fbbf08b4 --- /dev/null +++ b/drupal/core/themes/classy/templates/file-link.html.twig @@ -0,0 +1,16 @@ +{# +/** + * @file + * Default theme implementation for a link to a file. + * + * Available variables: + * - attributes: The HTML attributes for the containing element. + * - link: A link to the file. + * - icon: The icon image representing the file type. + * + * @see template_preprocess_file_link() + * + * @ingroup themeable + */ +#} +{{ icon }} {{ link }} diff --git a/drupal/core/themes/classy/templates/file-managed-file.html.twig b/drupal/core/themes/classy/templates/file-managed-file.html.twig new file mode 100644 index 00000000..9a33ae1f --- /dev/null +++ b/drupal/core/themes/classy/templates/file-managed-file.html.twig @@ -0,0 +1,17 @@ +{# +/** + * @file + * Default theme implementation to display a file form widget. + * + * Available variables: + * - element: Form element for the file upload. + * - attributes: HTML attributes for the containing element. + * + * @see template_preprocess_file_managed_file() + * + * @ingroup themeable + */ +#} + + {{ element }} +
diff --git a/drupal/core/themes/classy/templates/file-upload-help.html.twig b/drupal/core/themes/classy/templates/file-upload-help.html.twig new file mode 100644 index 00000000..8fa6b3ef --- /dev/null +++ b/drupal/core/themes/classy/templates/file-upload-help.html.twig @@ -0,0 +1,14 @@ +{# +/** + * @file + * Default theme implementation to display help text for file fields. + * + * Available variables: + * - descriptions: Lines of help text for uploading a file. + * + * @see template_preprocess_file_upload_help() + * + * @ingroup themeable + */ +#} +{{ descriptions|safe_join('
') }} diff --git a/drupal/core/themes/classy/templates/file-widget-multiple.html.twig b/drupal/core/themes/classy/templates/file-widget-multiple.html.twig new file mode 100644 index 00000000..25534a59 --- /dev/null +++ b/drupal/core/themes/classy/templates/file-widget-multiple.html.twig @@ -0,0 +1,16 @@ +{# +/** + * @file + * Default theme implementation to display a multi file form widget. + * + * Available variables: + * - table: Table of previously uploaded files. + * - element: The form element for uploading another file. + * + * @see template_preprocess_file_widget_multiple() + * + * @ingroup themeable + */ +#} +{{ table }} +{{ element }} diff --git a/drupal/core/themes/classy/templates/file-widget.html.twig b/drupal/core/themes/classy/templates/file-widget.html.twig new file mode 100644 index 00000000..892ed3d8 --- /dev/null +++ b/drupal/core/themes/classy/templates/file-widget.html.twig @@ -0,0 +1,17 @@ +{# +/** + * @file + * Default theme implementation to display a file widget. + * + * Available variables: + * - element: Form element for the managed file. + * - attributes: Remaining HTML attributes for the containing element. + * + * @see template_preprocess_file_widget() + * + * @ingroup themeable + */ +#} + + {{ element }} +
diff --git a/drupal/core/themes/classy/templates/rdf-metadata.html.twig b/drupal/core/themes/classy/templates/rdf-metadata.html.twig new file mode 100644 index 00000000..4f652944 --- /dev/null +++ b/drupal/core/themes/classy/templates/rdf-metadata.html.twig @@ -0,0 +1,22 @@ +{# +/** + * @file + * Default theme implementation for empty spans with RDF attributes. + * + * The XHTML+RDFa doctype allows either or syntax to + * be used, but for maximum browser compatibility, W3C recommends the + * former when serving pages using the text/html media type, see + * http://www.w3.org/TR/xhtml1/#C_3. + * + * Available variables: + * - metadata: Each item within corresponds to its own set of attributes, + * and therefore, needs its own 'attributes' element. + * + * @see template_preprocess_rdf_metadata() + * + * @ingroup themeable + */ +#} +{% for attributes in metadata %} + +{% endfor %} diff --git a/drupal/core/themes/classy/templates/search-result.html.twig b/drupal/core/themes/classy/templates/search-result.html.twig new file mode 100644 index 00000000..732489be --- /dev/null +++ b/drupal/core/themes/classy/templates/search-result.html.twig @@ -0,0 +1,73 @@ +{# +/** + * @file + * Default theme implementation for displaying a single search result. + * + * This template renders a single search result. The list of results is + * rendered using '#theme' => 'item_list', with suggestions of: + * - item_list__search_results__(plugin_id) + * - item_list__search_results + * + * Available variables: + * - url: URL of the result. + * - title: Title of the result. + * - snippet: A small preview of the result. Does not apply to user searches. + * - info: String of all the meta information ready for print. Does not apply + * to user searches. + * - plugin_id: The machine-readable name of the plugin being executed,such + * as "node_search" or "user_search". + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - info_split: Contains same data as info, but split into separate parts. + * - info_split.type: Node type (or item type string supplied by module). + * - info_split.user: Author of the node linked to users profile. Depends + * on permission. + * - info_split.date: Last update of the node. Short formatted. + * - info_split.comment: Number of comments output as "% comments", % + * being the count. (Depends on comment.module). + * @todo The info variable needs to be made drillable and each of these sub + * items should instead be within info and renamed info.foo, info.bar, etc. + * + * Other variables: + * - title_attributes: HTML attributes for the title. + * - content_attributes: HTML attributes for the content. + * + * Since info_split is keyed, a direct print of the item is possible. + * This array does not apply to user searches so it is recommended to check + * for its existence before printing. The default keys of 'type', 'user' and + * 'date' always exist for node searches. Modules may provide other data. + * @code + * {% if (info_split.comment) %} + * + * {{ info_split.comment }} + * + * {% endif %} + * @endcode + * + * To check for all available data within info_split, use the code below. + * @code + *
+ *     {{ dump(info_split) }}
+ *   
+ * @endcode + * + * @see template_preprocess_search_result() + * + * @ingroup themeable + */ +#} +{{ title_prefix }} +

+ {{ title }} +

+{{ title_suffix }} +
+ {% if snippet %} +

{{ snippet }}

+ {% endif %} + {% if info %} +

{{ info }}

+ {% endif %} +
diff --git a/drupal/core/themes/classy/templates/taxonomy-term.html.twig b/drupal/core/themes/classy/templates/taxonomy-term.html.twig new file mode 100644 index 00000000..2fbffa58 --- /dev/null +++ b/drupal/core/themes/classy/templates/taxonomy-term.html.twig @@ -0,0 +1,43 @@ +{# +/** + * @file + * Default theme implementation to display a taxonomy term. + * + * Available variables: + * - url: URL of the current term. + * - name: Name of the current term. + * - content: Items for the content of the term (fields and description). + * Use 'content' to print them all, or print a subset such as + * 'content.description'. Use the following code to exclude the + * printing of a given child element: + * @code + * {{ content|without('description') }} + * @endcode + * - attributes: HTML attributes for the wrapper. + * - page: Flag for the full page state. + * - term: The taxonomy term entity, including: + * - id: The ID of the taxonomy term. + * - bundle: Machine name of the current vocabulary. + * - view_mode: View mode, e.g. 'full', 'teaser', etc. + * + * @see template_preprocess_taxonomy_term() + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'taxonomy-term', + 'vocabulary-' ~ term.bundle|clean_class, + ] +%} +
+ {{ title_prefix }} + {% if not page %} +

{{ name }}

+ {% endif %} + {{ title_suffix }} +
+ {{ content }} +
+
diff --git a/drupal/core/themes/classy/templates/user.html.twig b/drupal/core/themes/classy/templates/user.html.twig new file mode 100644 index 00000000..c44448bd --- /dev/null +++ b/drupal/core/themes/classy/templates/user.html.twig @@ -0,0 +1,30 @@ +{# +/** + * @file + * Default theme implementation to present all user data. + * + * This template is used when viewing a registered user's page, + * e.g., example.com/user/123. 123 being the user's ID. + * + * Available variables: + * - content: A list of content items. Use 'content' to print all content, or + * print a subset such as 'content.field_example'. + * - Field variables: For each field attached to the user a corresponding + * variable is defined; e.g., account.field_example has a variable + * 'field_example' defined. When needing to access a field's raw values, + * developers/themers are strongly encouraged to use these variables. + * Otherwise they will have to explicitly specify the desired field language, + * e.g. account.field_example.en, thus overriding any language negotiation + * rule that was previously applied. + * - attributes: HTML attributes for the container element. + * + * @see template_preprocess_user() + * + * @ingroup themeable + */ +#} + + {% if content %} + {{- content -}} + {% endif %} + diff --git a/drupal/core/themes/classy/templates/username.html.twig b/drupal/core/themes/classy/templates/username.html.twig new file mode 100644 index 00000000..78593763 --- /dev/null +++ b/drupal/core/themes/classy/templates/username.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Default theme implementation for displaying a username. + * + * Available variables: + * - account: The full account information for the user. + * - name: The user's name, sanitized. + * - extra: Additional text to append to the user's name, sanitized. + * - link_path: The path or URL of the user's profile page, home page, + * or other desired page to link to for more information about the user. + * - link_options: Options to pass to the url() function's $options parameter if + * linking the user's name to the user's page. + * - attributes: HTML attributes for the containing element. + * + * @see template_preprocess_username() + * + * @ingroup themeable + */ +#} +{% if link_path -%} + {{ name }}{{ extra }} +{%- else -%} + {{ name }}{{ extra }} +{%- endif -%} diff --git a/drupal/core/themes/engines/phptemplate/phptemplate.info.yml b/drupal/core/themes/engines/phptemplate/phptemplate.info.yml index 2bea7a07..b11d9b82 100644 --- a/drupal/core/themes/engines/phptemplate/phptemplate.info.yml +++ b/drupal/core/themes/engines/phptemplate/phptemplate.info.yml @@ -1,5 +1,11 @@ type: theme_engine name: PHPTemplate -core: 8.x -version: VERSION +# core: 8.x +# version: VERSION package: Core + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/themes/engines/twig/twig.info.yml b/drupal/core/themes/engines/twig/twig.info.yml index 17673841..c7e71e09 100644 --- a/drupal/core/themes/engines/twig/twig.info.yml +++ b/drupal/core/themes/engines/twig/twig.info.yml @@ -1,5 +1,11 @@ type: theme_engine name: Twig -core: 8.x -version: VERSION +# core: 8.x +# version: VERSION package: Core + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/themes/seven/css/components/tabs.css b/drupal/core/themes/seven/css/components/tabs.css index 6f437fbf..78b6d636 100644 --- a/drupal/core/themes/seven/css/components/tabs.css +++ b/drupal/core/themes/seven/css/components/tabs.css @@ -38,7 +38,7 @@ overflow: hidden; box-sizing: border-box; margin: -1px 0 0; - padding: 9px 2em 7px 1em; + padding: 9px 2em 7px 1em; /* LTR */ width: 100%; /* 1 */ border: 1px solid #bfbfbf; background-color: rgba(242, 242, 240, 0.7); @@ -46,6 +46,10 @@ text-overflow: ellipsis; white-space: nowrap; } +[dir="rtl"] .tabs__tab { + padding-left: 2em; + padding-right: 1em; +} .tabs__tab:hover, .tabs__tab:focus { color: #008ee6; @@ -54,8 +58,17 @@ li.tabs__tab { padding: 0; } +/* This is required to win over specifity of [dir="rtl"] .tabs__tab */ +[dir="rtl"] li.tabs__tab { + padding-left: 0; + padding-right: 0; +} li.tabs__tab a { - padding: 9px 2em 7px 1em; + padding: 9px 2em 7px 1em; /* LTR */ +} +[dir="rtl"] li.tabs__tab a { + padding-left: 2em; + padding-right: 1em; } .tabs a:hover, .tabs a:focus { @@ -71,10 +84,14 @@ li.tabs__tab a { .tabs.primary .tabs__tab.active { z-index: 15; border-color: #a6a6a6; - border-radius: 4px 0 0 0; + border-radius: 4px 0 0 0; /* LTR */ background-color: #ffffff; color: #004f80; } +[dir="rtl"] .tabs.primary .tabs__tab.active { + border-top-left-radius: 0; + border-top-right-radius: 4px; +} .tabs.primary a { background: none; } @@ -110,14 +127,14 @@ li.tabs__tab a { display: block; position: absolute; z-index: 10; - right: 0; + right: 0; /* LTR */ top: 2px; - left: auto; + left: auto; /* LTR */ width: 25%; padding-right: 4px; padding-left: 4px; - border-left: 0; - border-radius: 0 4px 0 0; + border-left: 0; /* LTR */ + border-radius: 0 4px 0 0; /* LTR */ font-family: Arial, sans-serif; font-size: 1.25em; letter-spacing: 0.1em; @@ -130,7 +147,6 @@ li.tabs__tab a { border-radius: 4px 0 0 0; right: auto; left: 0; - top: 11px; } .is-collapse-enabled .tabs { padding-top: 38px; @@ -144,7 +160,7 @@ li.tabs__tab a { .is-collapse-enabled .tabs__tab.active { position: absolute; top: 2px; - left: 0; + left: 0; /* LTR */ width: 75%; border-bottom: 0; } @@ -169,7 +185,7 @@ li.tabs__tab a { overflow: visible; } .is-horizontal .tabs__tab { - float: left; + float: left; /* LTR */ height: auto; width: auto; margin: 0 0 -1px; @@ -178,18 +194,24 @@ li.tabs__tab a { } [dir="rtl"] .is-horizontal .tabs__tab { float: right; + /* This is required to win over specifity of [dir="rtl"] .tabs > li */ + margin-left: 0; } .is-horizontal .tabs__tab + .tabs__tab { - margin-left: -1px; + margin-left: -1px; /* LTR */ +} +[dir="rtl"] .is-horizontal .tabs__tab + .tabs__tab { + margin-left: 0; + margin-right: -1px; } .is-horizontal .tabs.primary .tabs__tab:first-child { - border-radius: 4px 0 0 0; + border-radius: 4px 0 0 0; /* LTR */ } [dir="rtl"] .is-horizontal .tabs.primary .tabs__tab:first-child { border-radius: 0 4px 0 0; } .is-horizontal .tabs.primary .tabs__tab:last-child { - border-radius: 0 4px 0 0; + border-radius: 0 4px 0 0; /* LTR */ } [dir="rtl"] .is-horizontal .tabs.primary .tabs__tab:last-child { border-radius: 4px 0 0 0; @@ -206,9 +228,6 @@ li.tabs__tab a { border-bottom: 0; margin: 0 -4px; } -[dir="rtl"] .is-horizontal .tabs__tab.active { - margin: 0 -6px; -} .is-horizontal .tabs.primary a { background-image: none; padding: 7px 2em 7px 2em; @@ -225,25 +244,42 @@ li.tabs__tab a { } .tabs.secondary .tabs__tab { display: block; - padding: 5px 15px 5px 16px; - margin-left: -1px; + padding: 5px 15px 5px 16px; /* LTR */ + margin-left: -1px; /* LTR */ color: #0074bd; -webkit-transition: border-color 0.2s, background-color 0.2s; transition: border-color 0.2s, background-color 0.2s; } +[dir="rtl"] .tabs.secondary .tabs__tab { + padding-left: 15px; + padding-right: 16px; + margin-left: 0; + margin-right: -1px; +} .tabs.secondary .tabs__tab + .tabs__tab { border-top: 1px solid #d9d8d4; } .tabs.secondary .tabs__tab.active { color: #004f80; - border-left: 2px solid #004f80; - padding-left: 15px; + border-left: 2px solid #004f80; /* LTR */ + padding-left: 15px; /* LTR */ +} +[dir="rtl"] .tabs.secondary .tabs__tab.active { + border-left: 1px solid #bfbfbf; + border-right: 2px solid #004f80; + padding-right: 15px; } .tabs.secondary .tabs__tab:hover, .tabs.secondary .tabs__tab:focus { color: #008ee6; - border-left: 2px solid #008ee6; - padding-left: 15px; + border-left: 2px solid #008ee6; /* LTR */ + padding-left: 15px; /* LTR */ +} +[dir="rtl"] .tabs.secondary .tabs__tab:hover, +[dir="rtl"] .tabs.secondary .tabs__tab:focus { + border-left: 1px solid #bfbfbf; + border-right: 2px solid #008ee6; + padding-right: 15px; } .tabs.secondary a { background-color: transparent; @@ -260,18 +296,29 @@ li.tabs__tab a { /* Styles for the horizontal state */ .is-horizontal .tabs.secondary .tabs__tab { background: none; - float: left; + float: left; /* LTR */ position: relative; top: 0; z-index: 15; margin-left: 1em; margin-right: 1em; border-bottom: 2px solid transparent; - border-left: 1px solid transparent; - border-right-color: transparent; + border-left: 1px solid transparent; /* LTR */ + border-right-color: transparent; /* LTR */ border-top: 0; padding: 0; } +/** + * 1. This is required to win over specifity of + * [dir="rtl"] .tabs.secondary .tabs__tab:hover, + * [dir="rtl"] .tabs.secondary .tabs__tab:focus + */ +[dir="rtl"] .is-horizontal .tabs.secondary .tabs__tab { + float: right; + border-right: 1px solid transparent; + border-left-color: transparent; + padding-right: 0; /* 1 */ +} .is-horizontal .tabs.secondary .tabs__tab.active { border-bottom-color: #004f80; } diff --git a/drupal/core/themes/seven/seven.info.yml b/drupal/core/themes/seven/seven.info.yml index 1277db9d..0c93cf53 100644 --- a/drupal/core/themes/seven/seven.info.yml +++ b/drupal/core/themes/seven/seven.info.yml @@ -5,8 +5,8 @@ description: 'The default administration theme for Drupal 8 was designed with cl alt text: 'Default administration theme for Drupal 8 with simple blocks and clean lines.' tags: 'multi-column, fluid, responsive, sans-serif, accessible' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x stylesheets: screen: - css/base/elements.css @@ -59,3 +59,9 @@ regions_hidden: settings: shortcut_module_link: true + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/themes/stark/stark.info.yml b/drupal/core/themes/stark/stark.info.yml index 6ce7cc68..7d2b68e7 100644 --- a/drupal/core/themes/stark/stark.info.yml +++ b/drupal/core/themes/stark/stark.info.yml @@ -2,10 +2,16 @@ name: Stark type: theme description: 'An intentionally plain theme with almost no styling to demonstrate default Drupal’s HTML and CSS. Learn how to build a custom theme from Stark in the Theming Guide.' package: Core -version: VERSION -core: 8.x +# version: VERSION +# core: 8.x stylesheets: all: - css/layout.css stylesheets-remove: - normalize.css + +# Information added by Drupal.org packaging script on 2014-11-01 +version: '8.0.0-beta2+126-dev' +core: '8.x' +project: 'drupal' +datestamp: 1414850443 diff --git a/drupal/core/vendor/bin/phpunit b/drupal/core/vendor/bin/phpunit deleted file mode 120000 index 2c489303..00000000 --- a/drupal/core/vendor/bin/phpunit +++ /dev/null @@ -1 +0,0 @@ -../phpunit/phpunit/phpunit \ No newline at end of file diff --git a/drupal/core/vendor/bin/phpunit b/drupal/core/vendor/bin/phpunit new file mode 100755 index 00000000..44f3c6d9 --- /dev/null +++ b/drupal/core/vendor/bin/phpunit @@ -0,0 +1,55 @@ +#!/usr/bin/env php +. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Sebastian Bergmann nor the names of his + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/vendor/autoload.php') as $file) { + if (file_exists($file)) { + define('PHPUNIT_COMPOSER_INSTALL', $file); + break; + } +} + +if (!defined('PHPUNIT_COMPOSER_INSTALL')) { + die( + 'You need to set up the project dependencies using the following commands:' . PHP_EOL . + 'wget http://getcomposer.org/composer.phar' . PHP_EOL . + 'php composer.phar install' . PHP_EOL + ); +} + +require PHPUNIT_COMPOSER_INSTALL; + +PHPUnit_TextUI_Command::main(); diff --git a/drupal/core/vendor/composer/installed.json b/drupal/core/vendor/composer/installed.json index b2274770..db7fa29b 100644 --- a/drupal/core/vendor/composer/installed.json +++ b/drupal/core/vendor/composer/installed.json @@ -1304,65 +1304,6 @@ "spl" ] }, - { - "name": "twig/twig", - "version": "v1.15.1", - "version_normalized": "1.15.1.0", - "source": { - "type": "git", - "url": "https://github.com/fabpot/Twig.git", - "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fabpot/Twig/zipball/1fb5784662f438d7d96a541e305e28b812e2eeed", - "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed", - "shasum": "" - }, - "require": { - "php": ">=5.2.4" - }, - "time": "2014-02-13 10:19:29", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.15-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Twig_": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - }, - { - "name": "Twig Team", - "homepage": "https://github.com/fabpot/Twig/graphs/contributors", - "role": "Contributors" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", - "keywords": [ - "templating" - ] - }, { "name": "doctrine/annotations", "version": "v1.2.1", @@ -2646,5 +2587,64 @@ "rest", "web service" ] + }, + { + "name": "twig/twig", + "version": "v1.16.2", + "version_normalized": "1.16.2.0", + "source": { + "type": "git", + "url": "https://github.com/fabpot/Twig.git", + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fabpot/Twig/zipball/42f758d9fe2146d1f0470604fc05ee43580873fc", + "reference": "42f758d9fe2146d1f0470604fc05ee43580873fc", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "time": "2014-10-17 12:53:44", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.16-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "https://github.com/fabpot/Twig/graphs/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ] } ] diff --git a/drupal/core/vendor/twig/twig/.travis.yml b/drupal/core/vendor/twig/twig/.travis.yml index a8d71c2c..1fbff759 100644 --- a/drupal/core/vendor/twig/twig/.travis.yml +++ b/drupal/core/vendor/twig/twig/.travis.yml @@ -5,6 +5,7 @@ php: - 5.3 - 5.4 - 5.5 + - 5.6 - hhvm env: diff --git a/drupal/core/vendor/twig/twig/CHANGELOG b/drupal/core/vendor/twig/twig/CHANGELOG index 6be2d655..33b32f83 100644 --- a/drupal/core/vendor/twig/twig/CHANGELOG +++ b/drupal/core/vendor/twig/twig/CHANGELOG @@ -1,4 +1,32 @@ -* 1.15.1 (2013-02-13) +* 1.16.2 (2014-10-17) + + * fixed timezone on dates as strings + * fixed 2-words test names when a custom node class is not used + * fixed macros when using an argument named like a PHP super global (like GET or POST) + * fixed date_modify when working with DateTimeImmutable + * optimized for loops + * fixed multi-byte characters handling in the split filter + * fixed a regression in the in operator + * fixed a regression in the slice filter + +* 1.16.1 (2014-10-10) + + * improved error reporting in a sandboxed template + * fixed missing error file/line information under certain circumstances + * fixed wrong error line number in some error messages + * fixed the in operator to use strict comparisons + * sped up the slice filter + * fixed for mb function overload mb_substr acting different + * fixed the attribute() function when passing a variable for the arguments + +* 1.16.0 (2014-07-05) + + * changed url_encode to always encode according to RFC 3986 + * fixed inheritance in a 'use'-hierarchy + * removed the __toString policy check when the sandbox is disabled + * fixed recursively calling blocks in templates with inheritance + +* 1.15.1 (2014-02-13) * fixed the conversion of the special '0000-00-00 00:00' date * added an error message when trying to import an undefined block from a trait diff --git a/drupal/core/vendor/twig/twig/composer.json b/drupal/core/vendor/twig/twig/composer.json index f1288a56..98b8df0f 100644 --- a/drupal/core/vendor/twig/twig/composer.json +++ b/drupal/core/vendor/twig/twig/composer.json @@ -36,7 +36,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.16-dev" } } } diff --git a/drupal/core/vendor/twig/twig/doc/api.rst b/drupal/core/vendor/twig/twig/doc/api.rst index b00d61ea..77561271 100644 --- a/drupal/core/vendor/twig/twig/doc/api.rst +++ b/drupal/core/vendor/twig/twig/doc/api.rst @@ -166,21 +166,6 @@ Namespaced templates can be accessed via the special $twig->render('@admin/index.html', array()); -``Twig_Loader_String`` -...................... - -``Twig_Loader_String`` loads templates from strings. It's a dummy loader as -the template reference is the template source code:: - - $loader = new Twig_Loader_String(); - $twig = new Twig_Environment($loader); - - echo $twig->render('Hello {{ name }}!', array('name' => 'Fabien')); - -This loader should only be used for unit testing as it has severe limitations: -several tags, like ``extends`` or ``include`` do not make sense to use as the -reference to the template is the template source code itself. - ``Twig_Loader_Array`` ..................... @@ -214,7 +199,7 @@ projects where storing all templates in a single PHP file might make sense. 'base.html' => '{% block content %}{% endblock %}', )); $loader2 = new Twig_Loader_Array(array( - 'index.html' => '{% extends "base.twig" %}{% block content %}Hello {{ name }}{% endblock %}', + 'index.html' => '{% extends "base.html" %}{% block content %}Hello {{ name }}{% endblock %}', 'base.html' => 'Will never be loaded', )); @@ -268,26 +253,6 @@ All loaders implement the ``Twig_LoaderInterface``:: function isFresh($name, $time); } -As an example, here is how the built-in ``Twig_Loader_String`` reads:: - - class Twig_Loader_String implements Twig_LoaderInterface - { - public function getSource($name) - { - return $name; - } - - public function getCacheKey($name) - { - return $name; - } - - public function isFresh($name, $time) - { - return false; - } - } - The ``isFresh()`` method must return ``true`` if the current cached template is still fresh, given the last modification time, or ``false`` otherwise. diff --git a/drupal/core/vendor/twig/twig/doc/deprecated.rst b/drupal/core/vendor/twig/twig/doc/deprecated.rst index 61917a8d..30aaac1b 100644 --- a/drupal/core/vendor/twig/twig/doc/deprecated.rst +++ b/drupal/core/vendor/twig/twig/doc/deprecated.rst @@ -23,8 +23,8 @@ Extensions PEAR ---- -PEAR support will be discontinued in Twig 2.0, and no PEAR packages will be -provided. Use Composer instead. +PEAR support has been discontinued in Twig 1.15.1, and no PEAR packages are +provided anymore. Use Composer instead. Filters ------- @@ -80,6 +80,12 @@ Tests * The ``sameas`` and ``divisibleby`` tests are deprecated in favor of ``same as`` and ``divisible by`` respectively. +Nodes +----- + +* As of Twig 1.x, ``Node::toXml()`` is deprecated and will be removed in Twig + 2.0. + Interfaces ---------- diff --git a/drupal/core/vendor/twig/twig/doc/filters/batch.rst b/drupal/core/vendor/twig/twig/doc/filters/batch.rst index b0b9964e..30dd7823 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/batch.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/batch.rst @@ -2,7 +2,7 @@ ========= .. versionadded:: 1.12.3 - The batch filter was added in Twig 1.12.3. + The ``batch`` filter was added in Twig 1.12.3. The ``batch`` filter "batches" items by returning a list of lists with the given number of items. If you provide a second parameter, it is used to fill diff --git a/drupal/core/vendor/twig/twig/doc/filters/convert_encoding.rst b/drupal/core/vendor/twig/twig/doc/filters/convert_encoding.rst index c417e128..f4ebe580 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/convert_encoding.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/convert_encoding.rst @@ -21,8 +21,8 @@ is the input charset: Arguments --------- -* ``from``: The input charset * ``to``: The output charset +* ``from``: The input charset .. _`iconv`: http://php.net/iconv .. _`mbstring`: http://php.net/mbstring diff --git a/drupal/core/vendor/twig/twig/doc/filters/first.rst b/drupal/core/vendor/twig/twig/doc/filters/first.rst index 4295e833..674c1f9e 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/first.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/first.rst @@ -2,7 +2,7 @@ ========= .. versionadded:: 1.12.2 - The first filter was added in Twig 1.12.2. + The ``first`` filter was added in Twig 1.12.2. The ``first`` filter returns the first "element" of a sequence, a mapping, or a string: diff --git a/drupal/core/vendor/twig/twig/doc/filters/json_encode.rst b/drupal/core/vendor/twig/twig/doc/filters/json_encode.rst index 9821b11e..a39bb476 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/json_encode.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/json_encode.rst @@ -1,7 +1,7 @@ ``json_encode`` =============== -The ``json_encode`` filter returns the JSON representation of a string: +The ``json_encode`` filter returns the JSON representation of a value: .. code-block:: jinja diff --git a/drupal/core/vendor/twig/twig/doc/filters/last.rst b/drupal/core/vendor/twig/twig/doc/filters/last.rst index 723c0b57..345b6573 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/last.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/last.rst @@ -2,7 +2,7 @@ ======== .. versionadded:: 1.12.2 - The last filter was added in Twig 1.12.2. + The ``last`` filter was added in Twig 1.12.2. The ``last`` filter returns the last "element" of a sequence, a mapping, or a string: diff --git a/drupal/core/vendor/twig/twig/doc/filters/length.rst b/drupal/core/vendor/twig/twig/doc/filters/length.rst index 5e0f73a4..1f783b3d 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/length.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/length.rst @@ -1,7 +1,7 @@ ``length`` ========== -The ``length`` filters returns the number of items of a sequence or mapping, or +The ``length`` filter returns the number of items of a sequence or mapping, or the length of a string: .. code-block:: jinja diff --git a/drupal/core/vendor/twig/twig/doc/filters/merge.rst b/drupal/core/vendor/twig/twig/doc/filters/merge.rst index 05a2ae7d..cb8b1b22 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/merge.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/merge.rst @@ -39,3 +39,9 @@ overridden. {% set items = { 'apple': 'unknown' }|merge(items) %} {# items now contains { 'apple': 'fruit', 'orange': 'fruit' } #} + +.. note:: + + Internally, Twig uses the PHP `array_merge`_ function. + +.. _`array_merge`: http://php.net/array_merge diff --git a/drupal/core/vendor/twig/twig/doc/filters/nl2br.rst b/drupal/core/vendor/twig/twig/doc/filters/nl2br.rst index 694c6724..5c923e14 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/nl2br.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/nl2br.rst @@ -2,7 +2,7 @@ ========= .. versionadded:: 1.5 - The nl2br filter was added in Twig 1.5. + The ``nl2br`` filter was added in Twig 1.5. The ``nl2br`` filter inserts HTML line breaks before all newlines in a string: diff --git a/drupal/core/vendor/twig/twig/doc/filters/number_format.rst b/drupal/core/vendor/twig/twig/doc/filters/number_format.rst index 3e60691f..3114e845 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/number_format.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/number_format.rst @@ -2,7 +2,7 @@ ================= .. versionadded:: 1.5 - The number_format filter was added in Twig 1.5 + The ``number_format`` filter was added in Twig 1.5 The ``number_format`` filter formats numbers. It is a wrapper around PHP's `number_format`_ function: diff --git a/drupal/core/vendor/twig/twig/doc/filters/raw.rst b/drupal/core/vendor/twig/twig/doc/filters/raw.rst index a9900c7b..e5e5b12e 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/raw.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/raw.rst @@ -10,3 +10,27 @@ if ``raw`` is the last filter applied to it: {% autoescape %} {{ var|raw }} {# var won't be escaped #} {% endautoescape %} + +.. note:: + + Be careful when using the ``raw`` filter inside expressions: + + .. code-block:: jinja + + {% autoescape %} + {% set hello = 'Hello' %} + {% set hola = 'Hola' %} + + {{ false ? 'Hola' : hello|raw }} + does not render the same as + {{ false ? hola : hello|raw }} + but renders the same as + {{ (false ? hola : hello)|raw }} + {% endautoescape %} + + The first ternary statement is not escaped: ``hello`` is marked as being + safe and Twig does not escape static values (see + :doc:`escape<../tags/autoescape>`). In the second ternary statement, even + if ``hello`` is marked as safe, ``hola`` remains unsafe and so is the whole + expression. The third ternary statement is marked as safe and the result is + not escaped. diff --git a/drupal/core/vendor/twig/twig/doc/filters/slice.rst b/drupal/core/vendor/twig/twig/doc/filters/slice.rst index c76c61c1..a8566641 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/slice.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/slice.rst @@ -2,7 +2,7 @@ =========== .. versionadded:: 1.6 - The slice filter was added in Twig 1.6. + The ``slice`` filter was added in Twig 1.6. The ``slice`` filter extracts a slice of a sequence, a mapping, or a string: @@ -41,7 +41,7 @@ As syntactic sugar, you can also use the ``[]`` notation: {{ '12345'[2:] }} {# will display "345" #} The ``slice`` filter works as the `array_slice`_ PHP function for arrays and -`substr`_ for strings. +`mb_substr`_ for strings with a fallback to `substr`_. If the start is non-negative, the sequence will start at that start in the variable. If start is negative, the sequence will start that far from the end @@ -67,4 +67,5 @@ Arguments .. _`Traversable`: http://php.net/manual/en/class.traversable.php .. _`array_slice`: http://php.net/array_slice +.. _`mb_substr` : http://php.net/mb-substr .. _`substr`: http://php.net/substr diff --git a/drupal/core/vendor/twig/twig/doc/filters/split.rst b/drupal/core/vendor/twig/twig/doc/filters/split.rst index 3db81411..bbc6d798 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/split.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/split.rst @@ -2,15 +2,15 @@ ========= .. versionadded:: 1.10.3 - The split filter was added in Twig 1.10.3. + The ``split`` filter was added in Twig 1.10.3. The ``split`` filter splits a string by the given delimiter and returns a list of strings: .. code-block:: jinja - {{ "one,two,three"|split(',') }} - {# returns ['one', 'two', 'three'] #} + {% set foo = "one,two,three"|split(',') %} + {# foo contains ['one', 'two', 'three'] #} You can also pass a ``limit`` argument: @@ -24,19 +24,19 @@ You can also pass a ``limit`` argument: .. code-block:: jinja - {{ "one,two,three,four,five"|split(',', 3) }} - {# returns ['one', 'two', 'three,four,five'] #} + {% set foo = "one,two,three,four,five"|split(',', 3) %} + {# foo contains ['one', 'two', 'three,four,five'] #} If the ``delimiter`` is an empty string, then value will be split by equal chunks. Length is set by the ``limit`` argument (one character by default). .. code-block:: jinja - {{ "123"|split('') }} - {# returns ['1', '2', '3'] #} + {% set foo = "123"|split('') %} + {# foo contains ['1', '2', '3'] #} - {{ "aabbcc"|split('', 2) }} - {# returns ['aa', 'bb', 'cc'] #} + {% set bar = "aabbcc"|split('', 2) %} + {# bar contains ['aa', 'bb', 'cc'] #} .. note:: diff --git a/drupal/core/vendor/twig/twig/doc/filters/trim.rst b/drupal/core/vendor/twig/twig/doc/filters/trim.rst index 0c5b32ed..4ddb2083 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/trim.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/trim.rst @@ -2,7 +2,7 @@ ======== .. versionadded:: 1.6.2 - The trim filter was added in Twig 1.6.2. + The ``trim`` filter was added in Twig 1.6.2. The ``trim`` filter strips whitespace (or other characters) from the beginning and end of a string: diff --git a/drupal/core/vendor/twig/twig/doc/filters/url_encode.rst b/drupal/core/vendor/twig/twig/doc/filters/url_encode.rst index 7a35ed15..5944e59c 100644 --- a/drupal/core/vendor/twig/twig/doc/filters/url_encode.rst +++ b/drupal/core/vendor/twig/twig/doc/filters/url_encode.rst @@ -4,6 +4,10 @@ .. versionadded:: 1.12.3 Support for encoding an array as query string was added in Twig 1.12.3. +.. versionadded:: 1.16.0 + The ``raw`` argument was removed in Twig 1.16.0. Twig now always encodes + according to RFC 3986. + The ``url_encode`` filter percent encodes a given string as URL segment or an array as query string: @@ -12,7 +16,7 @@ or an array as query string: {{ "path-seg*ment"|url_encode }} {# outputs "path-seg%2Ament" #} - {{ "string with spaces"|url_encode(true) }} + {{ "string with spaces"|url_encode }} {# outputs "string%20with%20spaces" #} {{ {'param': 'value', 'foo': 'bar'}|url_encode }} @@ -21,7 +25,9 @@ or an array as query string: .. note:: Internally, Twig uses the PHP `urlencode`_ (or `rawurlencode`_ if you pass - ``true`` as the first parameter) or the `http_build_query`_ function. + ``true`` as the first parameter) or the `http_build_query`_ function. Note + that as of Twig 1.16.0, ``urlencode`` **always** uses ``rawurlencode`` (the + ``raw`` argument was removed.) .. _`urlencode`: http://php.net/urlencode .. _`rawurlencode`: http://php.net/rawurlencode diff --git a/drupal/core/vendor/twig/twig/doc/functions/date.rst b/drupal/core/vendor/twig/twig/doc/functions/date.rst index 9442c39f..714e08c4 100644 --- a/drupal/core/vendor/twig/twig/doc/functions/date.rst +++ b/drupal/core/vendor/twig/twig/doc/functions/date.rst @@ -15,7 +15,7 @@ Converts an argument to a date to allow date comparison: {# do something #} {% endif %} -The argument must be in a format supported by the `date`_ function. +The argument must be in one of PHP’s supported `date and time formats`_. You can pass a timezone as the second argument: @@ -49,4 +49,4 @@ Arguments * ``date``: The date * ``timezone``: The timezone -.. _`date`: http://www.php.net/date +.. _`date and time formats`: http://php.net/manual/en/datetime.formats.php diff --git a/drupal/core/vendor/twig/twig/doc/functions/dump.rst b/drupal/core/vendor/twig/twig/doc/functions/dump.rst index 54f8d4e1..a231f089 100644 --- a/drupal/core/vendor/twig/twig/doc/functions/dump.rst +++ b/drupal/core/vendor/twig/twig/doc/functions/dump.rst @@ -2,7 +2,7 @@ ======== .. versionadded:: 1.5 - The dump function was added in Twig 1.5. + The ``dump`` function was added in Twig 1.5. The ``dump`` function dumps information about a template variable. This is mostly useful to debug a template that does not behave as expected by diff --git a/drupal/core/vendor/twig/twig/doc/functions/include.rst b/drupal/core/vendor/twig/twig/doc/functions/include.rst index 8feb0f17..33bd56d1 100644 --- a/drupal/core/vendor/twig/twig/doc/functions/include.rst +++ b/drupal/core/vendor/twig/twig/doc/functions/include.rst @@ -2,7 +2,7 @@ =========== .. versionadded:: 1.12 - The include function was added in Twig 1.12. + The ``include`` function was added in Twig 1.12. The ``include`` function returns the rendered content of a template: diff --git a/drupal/core/vendor/twig/twig/doc/functions/max.rst b/drupal/core/vendor/twig/twig/doc/functions/max.rst index bdc5b753..6f3cfc53 100644 --- a/drupal/core/vendor/twig/twig/doc/functions/max.rst +++ b/drupal/core/vendor/twig/twig/doc/functions/max.rst @@ -15,5 +15,6 @@ When called with a mapping, max ignores keys and only compares values: .. code-block:: jinja - {{ max({2: "two", 1: "one", 3: "three", 5: "five", 4: "for"}) }} - {# return "two" #} + {{ max({2: "e", 1: "a", 3: "b", 5: "d", 4: "c"}) }} + {# returns "e" #} + diff --git a/drupal/core/vendor/twig/twig/doc/functions/min.rst b/drupal/core/vendor/twig/twig/doc/functions/min.rst index b924b031..7b6a65e1 100644 --- a/drupal/core/vendor/twig/twig/doc/functions/min.rst +++ b/drupal/core/vendor/twig/twig/doc/functions/min.rst @@ -15,5 +15,6 @@ When called with a mapping, min ignores keys and only compares values: .. code-block:: jinja - {{ min({2: "two", 1: "one", 3: "three", 5: "five", 4: "for"}) }} - {# return "five" #} + {{ min({2: "e", 3: "a", 1: "b", 5: "d", 4: "c"}) }} + {# returns "a" #} + diff --git a/drupal/core/vendor/twig/twig/doc/functions/random.rst b/drupal/core/vendor/twig/twig/doc/functions/random.rst index acbffe55..168e74f8 100644 --- a/drupal/core/vendor/twig/twig/doc/functions/random.rst +++ b/drupal/core/vendor/twig/twig/doc/functions/random.rst @@ -2,7 +2,7 @@ ========== .. versionadded:: 1.5 - The random function was added in Twig 1.5. + The ``random`` function was added in Twig 1.5. .. versionadded:: 1.6 String and integer handling was added in Twig 1.6. diff --git a/drupal/core/vendor/twig/twig/doc/functions/source.rst b/drupal/core/vendor/twig/twig/doc/functions/source.rst index defa5fbc..8ff39c2d 100644 --- a/drupal/core/vendor/twig/twig/doc/functions/source.rst +++ b/drupal/core/vendor/twig/twig/doc/functions/source.rst @@ -2,7 +2,7 @@ ========== .. versionadded:: 1.15 - The source function was added in Twig 1.15. + The ``source`` function was added in Twig 1.15. The ``source`` function returns the content of a template without rendering it: diff --git a/drupal/core/vendor/twig/twig/doc/functions/template_from_string.rst b/drupal/core/vendor/twig/twig/doc/functions/template_from_string.rst index 95d92563..ce6a60dc 100644 --- a/drupal/core/vendor/twig/twig/doc/functions/template_from_string.rst +++ b/drupal/core/vendor/twig/twig/doc/functions/template_from_string.rst @@ -2,7 +2,7 @@ ======================== .. versionadded:: 1.11 - The template_from_string function was added in Twig 1.11. + The ``template_from_string`` function was added in Twig 1.11. The ``template_from_string`` function loads a template from a string: diff --git a/drupal/core/vendor/twig/twig/doc/index.rst b/drupal/core/vendor/twig/twig/doc/index.rst index 3109c730..358bd738 100644 --- a/drupal/core/vendor/twig/twig/doc/index.rst +++ b/drupal/core/vendor/twig/twig/doc/index.rst @@ -5,15 +5,15 @@ Twig :maxdepth: 2 intro + installation templates api advanced internals + deprecated recipes coding_standards tags/index filters/index functions/index tests/index - installation - deprecated diff --git a/drupal/core/vendor/twig/twig/doc/installation.rst b/drupal/core/vendor/twig/twig/doc/installation.rst index 278ef61c..2d19f755 100644 --- a/drupal/core/vendor/twig/twig/doc/installation.rst +++ b/drupal/core/vendor/twig/twig/doc/installation.rst @@ -9,51 +9,39 @@ Installing the Twig PHP package Installing via Composer (recommended) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1. Install Composer in your project: +Install `Composer`_ and run the following command to get the latest version: .. code-block:: bash - curl -s http://getcomposer.org/installer | php - -2. Create a ``composer.json`` file in your project root: - -.. code-block:: javascript - - { - "require": { - "twig/twig": "1.*" - } - } - -3. Install via Composer - -.. code-block:: bash - - php composer.phar install - -.. note:: - If you want to learn more about Composer, the ``composer.json`` file syntax - and its usage, you can read the `online documentation`_. + composer require twig/twig:~1.0 Installing from the tarball release ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1. Download the most recent tarball from the `download page`_ -2. Unpack the tarball -3. Move the files somewhere in your project +2. Verify the integrity of the tarball http://fabien.potencier.org/article/73/signing-project-releases +3. Unpack the tarball +4. Move the files somewhere in your project Installing the development version ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1. Install Git -2. ``git clone git://github.com/fabpot/Twig.git`` +.. code-block:: bash + + git clone git://github.com/fabpot/Twig.git Installing the PEAR package ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -1. Install PEAR -2. ``pear channel-discover pear.twig-project.org`` -3. ``pear install twig/Twig`` (or ``pear install twig/Twig-beta``) +.. note:: + + Using PEAR for installing Twig is deprecated and Twig 1.15.1 was the last + version published on the PEAR channel; use Composer instead. + +.. code-block:: bash + + pear channel-discover pear.twig-project.org + pear install twig/Twig Installing the C extension -------------------------- @@ -61,24 +49,31 @@ Installing the C extension .. versionadded:: 1.4 The C extension was added in Twig 1.4. +.. note:: + The C extension is **optional** but as it brings some nice performance + improvements, you might want to install it in your production environment. + Twig comes with a C extension that enhances the performance of the Twig -runtime engine. +runtime engine; install it like any other PHP extensions: -You can install it via PEAR: +.. code-block:: bash -1. Install PEAR -2. ``pear channel-discover pear.twig-project.org`` -3. ``pear install twig/CTwig`` (or ``pear install twig/CTwig-beta``) + cd ext/twig + phpize + ./configure + make + make install -Or manually like any other PHP extension: +.. note:: -.. code-block:: bash + You can also install the C extension via PEAR (note that this method is + deprecated and newer versions of Twig are not available on the PEAR + channel): + + .. code-block:: bash - $ cd ext/twig - $ phpize - $ ./configure - $ make - $ make install + pear channel-discover pear.twig-project.org + pear install twig/CTwig For Windows: @@ -90,15 +85,15 @@ For Windows: .. tip:: - For Windows ZendServer, TS is not enabled as mentionned in `Zend Server + For Windows ZendServer, ZTS is not enabled as mentioned in `Zend Server FAQ`_. - You have to use `configure --disable-all --disable-zts --enable-cli - --enable-twig=shared` to be able to build the twig C extension for + You have to use ``configure --disable-all --disable-zts --enable-cli + --enable-twig=shared`` to be able to build the twig C extension for ZendServer. The built DLL will be available in - C:\\php-sdk\\phpdev\\vcXX\\x86\\php-source-directory\\Release + ``C:\\php-sdk\\phpdev\\vcXX\\x86\\php-source-directory\\Release`` Finally, enable the extension in your ``php.ini`` configuration file: @@ -113,6 +108,6 @@ PHP code but only provides an optimized version of the ``Twig_Template::getAttribute()`` method. .. _`download page`: https://github.com/fabpot/Twig/tags -.. _`online documentation`: http://getcomposer.org/doc +.. _`Composer`: https://getcomposer.org/download/ .. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild .. _`Zend Server FAQ`: http://www.zend.com/en/products/server/faq#faqD6 diff --git a/drupal/core/vendor/twig/twig/doc/internals.rst b/drupal/core/vendor/twig/twig/doc/internals.rst index 16f425ad..a68796b9 100644 --- a/drupal/core/vendor/twig/twig/doc/internals.rst +++ b/drupal/core/vendor/twig/twig/doc/internals.rst @@ -124,7 +124,7 @@ using):: { // line 1 echo "Hello "; - echo twig_escape_filter($this->env, $this->getContext($context, "name"), "ndex", null, true); + echo twig_escape_filter($this->env, $this->getContext($context, "name"), "html", null, true); } // some more code diff --git a/drupal/core/vendor/twig/twig/doc/intro.rst b/drupal/core/vendor/twig/twig/doc/intro.rst index 9f0cdf02..3a7c1d4e 100644 --- a/drupal/core/vendor/twig/twig/doc/intro.rst +++ b/drupal/core/vendor/twig/twig/doc/intro.rst @@ -33,7 +33,7 @@ The recommended way to install Twig is via Composer: .. code-block:: bash - composer require twig/twig:1.* + composer require "twig/twig:~1.0" .. note:: @@ -50,12 +50,14 @@ This section gives you a brief introduction to the PHP API for Twig. require_once '/path/to/vendor/autoload.php'; - $loader = new Twig_Loader_String(); + $loader = new Twig_Loader_Array( + 'index' => 'Hello {{ name }}!', + ); $twig = new Twig_Environment($loader); - echo $twig->render('Hello {{ name }}!', array('name' => 'Fabien')); + echo $twig->render('index', array('name' => 'Fabien')); -Twig uses a loader (``Twig_Loader_String``) to locate templates, and an +Twig uses a loader (``Twig_Loader_Array``) to locate templates, and an environment (``Twig_Environment``) to store the configuration. The ``render()`` method loads the template passed as a first argument and diff --git a/drupal/core/vendor/twig/twig/doc/recipes.rst b/drupal/core/vendor/twig/twig/doc/recipes.rst index bfdfc0d5..64090d91 100644 --- a/drupal/core/vendor/twig/twig/doc/recipes.rst +++ b/drupal/core/vendor/twig/twig/doc/recipes.rst @@ -242,7 +242,7 @@ does not return ``false``. Validating the Template Syntax ------------------------------ -When template code is providing by a third-party (through a web interface for +When template code is provided by a third-party (through a web interface for instance), it might be interesting to validate the template syntax before saving it. If the template code is stored in a `$template` variable, here is how you can do it:: diff --git a/drupal/core/vendor/twig/twig/doc/tags/autoescape.rst b/drupal/core/vendor/twig/twig/doc/tags/autoescape.rst index c5ff0c2c..4208d1a3 100644 --- a/drupal/core/vendor/twig/twig/doc/tags/autoescape.rst +++ b/drupal/core/vendor/twig/twig/doc/tags/autoescape.rst @@ -65,6 +65,18 @@ Functions returning template data (like :doc:`macros` and Twig is smart enough to not escape an already escaped value by the :doc:`escape<../filters/escape>` filter. +.. note:: + + Twig does not escape static expressions: + + .. code-block:: jinja + + {% set hello = "Hello" %} + {{ hello }} + {{ "world" }} + + Will be rendered "Hello **world**". + .. note:: The chapter :doc:`Twig for Developers<../api>` gives more information diff --git a/drupal/core/vendor/twig/twig/doc/tags/do.rst b/drupal/core/vendor/twig/twig/doc/tags/do.rst index eca63d0a..1c344e30 100644 --- a/drupal/core/vendor/twig/twig/doc/tags/do.rst +++ b/drupal/core/vendor/twig/twig/doc/tags/do.rst @@ -2,7 +2,7 @@ ====== .. versionadded:: 1.5 - The do tag was added in Twig 1.5. + The ``do`` tag was added in Twig 1.5. The ``do`` tag works exactly like the regular variable expression (``{{ ... }}``) just that it doesn't print anything: diff --git a/drupal/core/vendor/twig/twig/doc/tags/extends.rst b/drupal/core/vendor/twig/twig/doc/tags/extends.rst index d962a30f..1ad2b12b 100644 --- a/drupal/core/vendor/twig/twig/doc/tags/extends.rst +++ b/drupal/core/vendor/twig/twig/doc/tags/extends.rst @@ -186,8 +186,8 @@ In this example, the template will extend the "minimum.html" layout template if the ``standalone`` variable evaluates to ``true``, and "base.html" otherwise. -How blocks work? ----------------- +How do blocks work? +------------------- A block provides a way to change how a certain part of a template is rendered but it does not interfere in any way with the logic around it. diff --git a/drupal/core/vendor/twig/twig/doc/tags/if.rst b/drupal/core/vendor/twig/twig/doc/tags/if.rst index d7a1451c..273207d0 100644 --- a/drupal/core/vendor/twig/twig/doc/tags/if.rst +++ b/drupal/core/vendor/twig/twig/doc/tags/if.rst @@ -41,3 +41,20 @@ more complex ``expressions`` there too: {% else %} Kenny looks okay --- so far {% endif %} + +.. note:: + + The rules to determine if an expression is ``true`` or ``false`` are the + same as in PHP; here are the edge cases rules: + + ====================== ==================== + Value Boolean evaluation + ====================== ==================== + empty string false + numeric zero false + whitespace-only string true + empty array false + null false + non-empty array true + object true + ====================== ==================== diff --git a/drupal/core/vendor/twig/twig/doc/tags/use.rst b/drupal/core/vendor/twig/twig/doc/tags/use.rst index e403632d..a2f3af09 100644 --- a/drupal/core/vendor/twig/twig/doc/tags/use.rst +++ b/drupal/core/vendor/twig/twig/doc/tags/use.rst @@ -39,7 +39,8 @@ The ``use`` statement tells Twig to import the blocks defined in .. code-block:: jinja - # blocks.html + {# blocks.html #} + {% block sidebar %}{% endblock %} In this example, the ``use`` statement imports the ``sidebar`` block into the diff --git a/drupal/core/vendor/twig/twig/doc/templates.rst b/drupal/core/vendor/twig/twig/doc/templates.rst index 6d9d6ba4..82b6f0c7 100644 --- a/drupal/core/vendor/twig/twig/doc/templates.rst +++ b/drupal/core/vendor/twig/twig/doc/templates.rst @@ -15,7 +15,7 @@ A template contains **variables** or **expressions**, which get replaced with values when the template is evaluated, and **tags**, which control the logic of the template. -Below is a minimal template that illustrates a few basics. We will cover the +Below is a minimal template that illustrates a few basics. We will cover further details later on: .. code-block:: html+jinja @@ -58,14 +58,15 @@ Many IDEs support syntax highlighting and auto-completion for Twig: * *Komodo* and *Komodo Edit* via the Twig highlight/syntax check mode * *Notepad++* via the `Notepad++ Twig Highlighter`_ * *Emacs* via `web-mode.el`_ +* *Atom* via the `PHP-twig for atom`_ Variables --------- -The application passes variables to the templates you can mess around in the -template. Variables may have attributes or elements on them you can access -too. How a variable looks like heavily depends on the application providing -those. +The application passes variables to the templates for manipulation in the +template. Variables may have attributes or elements you can access, +too. The visual representation of a variable depends heavily on the application providing +it. You can use a dot (``.``) to access attributes of a variable (methods or properties of a PHP object, or items of a PHP array), or the so-called @@ -88,16 +89,16 @@ access the variable attribute: .. note:: It's important to know that the curly braces are *not* part of the - variable but the print statement. If you access variables inside tags - don't put the braces around. + variable but the print statement. When accessing variables inside tags, + don't put the braces around them. -If a variable or attribute does not exist, you will get back a ``null`` value -when the ``strict_variables`` option is set to ``false``, otherwise Twig will -throw an error (see :ref:`environment options`). +If a variable or attribute does not exist, you will receive a ``null`` value +when the ``strict_variables`` option is set to ``false``; alternatively, if ``strict_variables`` +is set, Twig will throw an error (see :ref:`environment options`). .. sidebar:: Implementation - For convenience sake ``foo.bar`` does the following things on the PHP + For convenience's sake ``foo.bar`` does the following things on the PHP layer: * check if ``foo`` is an array and ``bar`` a valid element; @@ -115,7 +116,7 @@ throw an error (see :ref:`environment options`). .. note:: - If you want to get a dynamic attribute on a variable, use the + If you want to access a dynamic attribute of a variable, use the :doc:`attribute` function instead. Global Variables @@ -161,7 +162,7 @@ example will join a list by commas: {{ list|join(', ') }} -To apply a filter on a section of code, wrap it with the +To apply a filter on a section of code, wrap it in the :doc:`filter` tag: .. code-block:: jinja @@ -170,7 +171,7 @@ To apply a filter on a section of code, wrap it with the This text becomes uppercase {% endfilter %} -Go to the :doc:`filters` page to learn more about the built-in +Go to the :doc:`filters` page to learn more about built-in filters. Functions @@ -222,7 +223,7 @@ to change the default value: {# the first argument is the date format, which defaults to the global date format if null is passed #} {{ "now"|date(null, "Europe/Paris") }} - {# or skip the format value by using a named argument for the timezone #} + {# or skip the format value by using a named argument for the time zone #} {{ "now"|date(timezone="Europe/Paris") }} You can also use both positional and named arguments in one call, in which @@ -327,7 +328,7 @@ allows you to build a base "skeleton" template that contains all the common elements of your site and defines **blocks** that child templates can override. -Sounds complicated but is very basic. It's easier to understand it by +Sounds complicated but it is very basic. It's easier to understand it by starting with an example. Let's define a base template, ``base.html``, which defines a simple HTML @@ -692,7 +693,7 @@ string: .. code-block:: jinja - {% if phone matches '{^[\d\.]+$}' %} + {% if phone matches '/^[\\d\\.]+$/' %} {% endif %} Containment Operator @@ -871,3 +872,4 @@ Extension` chapter. .. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig .. _`web-mode.el`: http://web-mode.org/ .. _`regular expressions`: http://php.net/manual/en/pcre.pattern.php +.. _`PHP-twig for atom`: https://github.com/reesef/php-twig diff --git a/drupal/core/vendor/twig/twig/doc/tests/sameas.rst b/drupal/core/vendor/twig/twig/doc/tests/sameas.rst index 6ed56d86..16f904d5 100644 --- a/drupal/core/vendor/twig/twig/doc/tests/sameas.rst +++ b/drupal/core/vendor/twig/twig/doc/tests/sameas.rst @@ -4,8 +4,8 @@ .. versionadded:: 1.14.2 The ``same as`` test was added in Twig 1.14.2 as an alias for ``sameas``. -``same as`` checks if a variable points to the same memory address than -another variable: +``same as`` checks if a variable is the same as another variable. +This is the equivalent to ``===`` in PHP: .. code-block:: jinja diff --git a/drupal/core/vendor/twig/twig/ext/twig/LICENSE b/drupal/core/vendor/twig/twig/ext/twig/LICENSE deleted file mode 100644 index 3384cc55..00000000 --- a/drupal/core/vendor/twig/twig/ext/twig/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Copyright (c) 2009-2013 by the Twig Team, see AUTHORS for more details. - -Some rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/drupal/core/vendor/twig/twig/ext/twig/php_twig.h b/drupal/core/vendor/twig/twig/ext/twig/php_twig.h index 858c0d80..e116b4c2 100644 --- a/drupal/core/vendor/twig/twig/ext/twig/php_twig.h +++ b/drupal/core/vendor/twig/twig/ext/twig/php_twig.h @@ -15,7 +15,7 @@ #ifndef PHP_TWIG_H #define PHP_TWIG_H -#define PHP_TWIG_VERSION "1.15.1" +#define PHP_TWIG_VERSION "1.16.2" #include "php.h" diff --git a/drupal/core/vendor/twig/twig/ext/twig/twig.c b/drupal/core/vendor/twig/twig/ext/twig/twig.c index 5cb923f5..5c482bed 100644 --- a/drupal/core/vendor/twig/twig/ext/twig/twig.c +++ b/drupal/core/vendor/twig/twig/ext/twig/twig.c @@ -830,7 +830,11 @@ PHP_FUNCTION(twig_template_get_attributes) } elseif (is_object($object)) { $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface', $item, get_class($object)); } elseif (is_array($object)) { - $message = sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))); + if (empty($object)) { + $message = sprintf('Key "%s" does not exist as the array is empty', $arrayItem); + } else { + $message = sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))); + } } elseif (Twig_Template::ARRAY_CALL === $type) { $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object); } else { @@ -845,7 +849,11 @@ PHP_FUNCTION(twig_template_get_attributes) } else if (Z_TYPE_P(object) == IS_OBJECT) { TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to access a key \"%s\" on an object of class \"%s\" that does not implement ArrayAccess interface", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); } else if (Z_TYPE_P(object) == IS_ARRAY) { - TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" for array with keys \"%s\" does not exist", item, TWIG_IMPLODE_ARRAY_KEYS(", ", object TSRMLS_CC)); + if (0 == zend_hash_num_elements(Z_ARRVAL_P(object))) { + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" does not exist as the array is empty", item); + } else { + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" for array with keys \"%s\" does not exist", item, TWIG_IMPLODE_ARRAY_KEYS(", ", object TSRMLS_CC)); + } } else { char *type_name = zend_zval_type_name(object); Z_ADDREF_P(object); diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Autoloader.php b/drupal/core/vendor/twig/twig/lib/Twig/Autoloader.php index 0ae11276..42f16f09 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Autoloader.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Autoloader.php @@ -19,7 +19,7 @@ class Twig_Autoloader /** * Registers Twig_Autoloader as an SPL autoloader. * - * @param Boolean $prepend Whether to prepend the autoloader or not. + * @param bool $prepend Whether to prepend the autoloader or not. */ public static function register($prepend = false) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Compiler.php b/drupal/core/vendor/twig/twig/lib/Twig/Compiler.php index bb6b129e..93dc8766 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Compiler.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Compiler.php @@ -66,7 +66,7 @@ public function getSource() * Compiles a node. * * @param Twig_NodeInterface $node The node to compile - * @param integer $indentation The current indentation + * @param int $indentation The current indentation * * @return Twig_Compiler The current compiler instance */ @@ -74,6 +74,7 @@ public function compile(Twig_NodeInterface $node, $indentation = 0) { $this->lastLine = null; $this->source = ''; + $this->debugInfo = array(); $this->sourceOffset = 0; // source code starts at 1 (as we then increment it when we encounter new lines) $this->sourceLine = 1; @@ -181,14 +182,14 @@ public function repr($value) } elseif (is_array($value)) { $this->raw('array('); $first = true; - foreach ($value as $key => $value) { + foreach ($value as $key => $v) { if (!$first) { $this->raw(', '); } $first = false; $this->repr($key); $this->raw(' => '); - $this->repr($value); + $this->repr($v); } $this->raw(')'); } else { @@ -236,7 +237,7 @@ public function getDebugInfo() /** * Indents the generated code. * - * @param integer $step The number of indentation to add + * @param int $step The number of indentation to add * * @return Twig_Compiler The current compiler instance */ @@ -250,7 +251,7 @@ public function indent($step = 1) /** * Outdents the generated code. * - * @param integer $step The number of indentation to remove + * @param int $step The number of indentation to remove * * @return Twig_Compiler The current compiler instance * @@ -267,4 +268,9 @@ public function outdent($step = 1) return $this; } + + public function getVarName() + { + return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false)); + } } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/CompilerInterface.php b/drupal/core/vendor/twig/twig/lib/Twig/CompilerInterface.php index e293ec91..272c7672 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/CompilerInterface.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/CompilerInterface.php @@ -13,7 +13,8 @@ * Interface implemented by compiler classes. * * @author Fabien Potencier - * @deprecated since 1.12 (to be removed in 2.0) + * + * @deprecated since 1.12 (to be removed in 3.0) */ interface Twig_CompilerInterface { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Environment.php b/drupal/core/vendor/twig/twig/lib/Twig/Environment.php index 1fec1a36..17e88ab2 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Environment.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Environment.php @@ -16,7 +16,7 @@ */ class Twig_Environment { - const VERSION = '1.15.1'; + const VERSION = '1.16.2'; protected $charset; protected $loader; @@ -154,7 +154,7 @@ public function disableDebug() /** * Checks if debug mode is enabled. * - * @return Boolean true if debug mode is enabled, false otherwise + * @return bool true if debug mode is enabled, false otherwise */ public function isDebug() { @@ -180,7 +180,7 @@ public function disableAutoReload() /** * Checks if the auto_reload option is enabled. * - * @return Boolean true if auto_reload is enabled, false otherwise + * @return bool true if auto_reload is enabled, false otherwise */ public function isAutoReload() { @@ -206,7 +206,7 @@ public function disableStrictVariables() /** * Checks if the strict_variables option is enabled. * - * @return Boolean true if strict_variables is enabled, false otherwise + * @return bool true if strict_variables is enabled, false otherwise */ public function isStrictVariables() { @@ -256,7 +256,7 @@ public function getCacheFilename($name) * Gets the template class associated with the given string. * * @param string $name The name for which to calculate the template class name - * @param integer $index The index if it is an embedded template + * @param int $index The index if it is an embedded template * * @return string The template class name */ @@ -311,7 +311,7 @@ public function display($name, array $context = array()) * Loads a template by name. * * @param string $name The template name - * @param integer $index The index if it is an embedded template + * @param int $index The index if it is an embedded template * * @return Twig_TemplateInterface A template instance representing the given template name * @@ -355,7 +355,7 @@ public function loadTemplate($name, $index = null) * @param string $name The template name * @param timestamp $time The last modification time of the cached template * - * @return Boolean true if the template is fresh, false otherwise + * @return bool true if the template is fresh, false otherwise */ public function isTemplateFresh($name, $time) { @@ -626,7 +626,7 @@ public function initRuntime() * * @param string $name The extension name * - * @return Boolean Whether the extension is registered or not + * @return bool Whether the extension is registered or not */ public function hasExtension($name) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Error.php b/drupal/core/vendor/twig/twig/lib/Twig/Error.php index 914b3ed3..5b253dd7 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Error.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Error.php @@ -51,7 +51,7 @@ class Twig_Error extends Exception * By default, automatic guessing is enabled. * * @param string $message The error message - * @param integer $lineno The template line where the error occurred + * @param int $lineno The template line where the error occurred * @param string $filename The template file name where the error occurred * @param Exception $previous The previous exception */ @@ -111,7 +111,7 @@ public function setTemplateFile($filename) /** * Gets the template line where the error occurred. * - * @return integer The template line + * @return int The template line */ public function getTemplateLine() { @@ -121,7 +121,7 @@ public function getTemplateLine() /** * Sets the template line where the error occurred. * - * @param integer $lineno The template line + * @param int $lineno The template line */ public function setTemplateLine($lineno) { @@ -229,6 +229,8 @@ protected function guessTemplateInfo() while ($e = array_pop($exceptions)) { $traces = $e->getTrace(); + array_unshift($traces, array('file' => $e->getFile(), 'line' => $e->getLine())); + while ($trace = array_shift($traces)) { if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) { continue; diff --git a/drupal/core/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php b/drupal/core/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php index da05a54e..48df9e1a 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php @@ -13,7 +13,8 @@ * Adds an exists() method for loaders. * * @author Florin Patan - * @deprecated since 1.12 (to be removed in 2.0) + * + * @deprecated since 1.12 (to be removed in 3.0) */ interface Twig_ExistsLoaderInterface { @@ -22,7 +23,7 @@ interface Twig_ExistsLoaderInterface * * @param string $name The name of the template to check if we can load * - * @return Boolean If the template source code is handled by this loader or not + * @return bool If the template source code is handled by this loader or not */ public function exists($name); } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/ExpressionParser.php b/drupal/core/vendor/twig/twig/lib/Twig/ExpressionParser.php index 25f47a15..f685bad8 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/ExpressionParser.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/ExpressionParser.php @@ -318,7 +318,7 @@ public function getFunctionNode($name, $line) throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes)', $line, $this->parser->getFilename()); } - return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : new Twig_Node_Expression_Array(array(), $line), Twig_Template::ANY_CALL, $line); + return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : null, Twig_Template::ANY_CALL, $line); default: if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) { $arguments = new Twig_Node_Expression_Array(array(), $line); @@ -451,8 +451,8 @@ public function parseFilterExpressionRaw($node, $tag = null) /** * Parses arguments. * - * @param Boolean $namedArguments Whether to allow named arguments or not - * @param Boolean $definition Whether we are parsing arguments for a function definition + * @param bool $namedArguments Whether to allow named arguments or not + * @param bool $definition Whether we are parsing arguments for a function definition */ public function parseArguments($namedArguments = false, $definition = false) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Extension/Core.php b/drupal/core/vendor/twig/twig/lib/Twig/Extension/Core.php index 922b5ea9..e71d741d 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Extension/Core.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Extension/Core.php @@ -95,7 +95,7 @@ public function getTimezone() /** * Sets the default format to be used by the number_format filter. * - * @param integer $decimal The number of decimal places to use. + * @param int $decimal The number of decimal places to use. * @param string $decimalPoint The character(s) to use for the decimal point. * @param string $thousandSep The character(s) to use for the thousands separator. */ @@ -173,7 +173,7 @@ public function getFilters() // array helpers new Twig_SimpleFilter('join', 'twig_join_filter'), - new Twig_SimpleFilter('split', 'twig_split_filter'), + new Twig_SimpleFilter('split', 'twig_split_filter', array('needs_environment' => true)), new Twig_SimpleFilter('sort', 'twig_sort_filter'), new Twig_SimpleFilter('merge', 'twig_array_merge'), new Twig_SimpleFilter('batch', 'twig_array_batch'), @@ -298,8 +298,8 @@ public function parseNotTestExpression(Twig_Parser $parser, Twig_NodeInterface $ public function parseTestExpression(Twig_Parser $parser, Twig_NodeInterface $node) { $stream = $parser->getStream(); - $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); - $class = $this->getTestNodeClass($parser, $name, $node->getLine()); + $name = $this->getTestName($parser, $node->getLine()); + $class = $this->getTestNodeClass($parser, $name); $arguments = null; if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) { $arguments = $parser->getExpressionParser()->parseArguments(true); @@ -308,33 +308,41 @@ public function parseTestExpression(Twig_Parser $parser, Twig_NodeInterface $nod return new $class($node, $name, $arguments, $parser->getCurrentToken()->getLine()); } - protected function getTestNodeClass(Twig_Parser $parser, $name, $line) + protected function getTestName(Twig_Parser $parser, $line) { + $stream = $parser->getStream(); + $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue(); $env = $parser->getEnvironment(); $testMap = $env->getTests(); - $testName = null; + if (isset($testMap[$name])) { - $testName = $name; - } elseif ($parser->getStream()->test(Twig_Token::NAME_TYPE)) { + return $name; + } + + if ($stream->test(Twig_Token::NAME_TYPE)) { // try 2-words tests $name = $name.' '.$parser->getCurrentToken()->getValue(); if (isset($testMap[$name])) { $parser->getStream()->next(); - $testName = $name; + return $name; } } - if (null === $testName) { - $message = sprintf('The test "%s" does not exist', $name); - if ($alternatives = $env->computeAlternatives($name, array_keys($env->getTests()))) { - $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); - } - - throw new Twig_Error_Syntax($message, $line, $parser->getFilename()); + $message = sprintf('The test "%s" does not exist', $name); + if ($alternatives = $env->computeAlternatives($name, array_keys($testMap))) { + $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives)); } + throw new Twig_Error_Syntax($message, $line, $parser->getFilename()); + } + + protected function getTestNodeClass(Twig_Parser $parser, $name) + { + $env = $parser->getEnvironment(); + $testMap = $env->getTests(); + if ($testMap[$name] instanceof Twig_SimpleTest) { return $testMap[$name]->getNodeClass(); } @@ -357,7 +365,7 @@ public function getName() * Cycles over a value. * * @param ArrayAccess|array $values An array or an ArrayAccess instance - * @param integer $position The cycle position + * @param int $position The cycle position * * @return string The next value in the cycle */ @@ -377,7 +385,7 @@ function twig_cycle($values, $position) * - a random integer between 0 and the integer parameter * * @param Twig_Environment $env A Twig_Environment instance - * @param Traversable|array|integer|string $values The values to pick a random item from + * @param Traversable|array|int|string $values The values to pick a random item from * * @throws Twig_Error_Runtime When $values is an empty array (does not apply to an empty string which is returned as is). * @@ -436,10 +444,10 @@ function twig_random(Twig_Environment $env, $values = null) * {{ post.published_at|date("m/d/Y") }} * * - * @param Twig_Environment $env A Twig_Environment instance - * @param DateTime|DateInterval|string $date A date - * @param string $format A format - * @param DateTimeZone|string $timezone A timezone + * @param Twig_Environment $env A Twig_Environment instance + * @param DateTime|DateTimeInterface|DateInterval|string $date A date + * @param string|null $format The target format, null to use the default + * @param DateTimeZone|string|null|false $timezone The target timezone, null to use the default, false to leave unchanged * * @return string The formatted date */ @@ -473,9 +481,12 @@ function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $ function twig_date_modify_filter(Twig_Environment $env, $date, $modifier) { $date = twig_date_converter($env, $date, false); - $date->modify($modifier); + $resultDate = $date->modify($modifier); - return $date; + // This is a hack to ensure PHP 5.2 support and support for DateTimeImmutable + // DateTime::modify does not return the modified DateTime object < 5.3.0 + // and DateTimeImmutable does not modify $date. + return null === $resultDate ? $date : $resultDate; } /** @@ -487,32 +498,32 @@ function twig_date_modify_filter(Twig_Environment $env, $date, $modifier) * {% endif %} * * - * @param Twig_Environment $env A Twig_Environment instance - * @param DateTime|string $date A date - * @param DateTimeZone|string $timezone A timezone + * @param Twig_Environment $env A Twig_Environment instance + * @param DateTime|DateTimeInterface|string|null $date A date + * @param DateTimeZone|string|null|false $timezone The target timezone, null to use the default, false to leave unchanged * * @return DateTime A DateTime instance */ function twig_date_converter(Twig_Environment $env, $date = null, $timezone = null) { // determine the timezone - if (!$timezone) { - $defaultTimezone = $env->getExtension('core')->getTimezone(); - } elseif (!$timezone instanceof DateTimeZone) { - $defaultTimezone = new DateTimeZone($timezone); - } else { - $defaultTimezone = $timezone; + if (false !== $timezone) { + if (null === $timezone) { + $timezone = $env->getExtension('core')->getTimezone(); + } elseif (!$timezone instanceof DateTimeZone) { + $timezone = new DateTimeZone($timezone); + } } // immutable dates if ($date instanceof DateTimeImmutable) { - return false !== $timezone ? $date->setTimezone($defaultTimezone) : $date; + return false !== $timezone ? $date->setTimezone($timezone) : $date; } if ($date instanceof DateTime || $date instanceof DateTimeInterface) { $date = clone $date; if (false !== $timezone) { - $date->setTimezone($defaultTimezone); + $date->setTimezone($timezone); } return $date; @@ -523,9 +534,9 @@ function twig_date_converter(Twig_Environment $env, $date = null, $timezone = nu $date = '@'.$date; } - $date = new DateTime($date, $defaultTimezone); + $date = new DateTime($date, $env->getExtension('core')->getTimezone()); if (false !== $timezone) { - $date->setTimezone($defaultTimezone); + $date->setTimezone($timezone); } return $date; @@ -534,11 +545,11 @@ function twig_date_converter(Twig_Environment $env, $date = null, $timezone = nu /** * Rounds a number. * - * @param integer|float $value The value to round - * @param integer|float $precision The rounding precision + * @param int|float $value The value to round + * @param int|float $precision The rounding precision * @param string $method The method to use for rounding * - * @return integer|float The rounded number + * @return int|float The rounded number */ function twig_round($value, $precision = 0, $method = 'common') { @@ -562,7 +573,7 @@ function twig_round($value, $precision = 0, $method = 'common') * * @param Twig_Environment $env A Twig_Environment instance * @param mixed $number A float/int/string of the number to format - * @param integer $decimal The number of decimal points to display. + * @param int $decimal The number of decimal points to display. * @param string $decimalPoint The character(s) to use for the decimal point. * @param string $thousandSep The character(s) to use for the thousands separator. * @@ -587,24 +598,23 @@ function twig_number_format_filter(Twig_Environment $env, $number, $decimal = nu } /** - * URL encodes a string as a path segment or an array as a query string. + * URL encodes (RFC 3986) a string as a path segment or an array as a query string. * * @param string|array $url A URL or an array of query parameters - * @param Boolean $raw true to use rawurlencode() instead of urlencode * * @return string The URL encoded value */ -function twig_urlencode_filter($url, $raw = false) +function twig_urlencode_filter($url) { if (is_array($url)) { - return http_build_query($url, '', '&'); - } + if (defined('PHP_QUERY_RFC3986')) { + return http_build_query($url, '', '&', PHP_QUERY_RFC3986); + } - if ($raw) { - return rawurlencode($url); + return http_build_query($url, '', '&'); } - return urlencode($url); + return rawurlencode($url); } if (version_compare(PHP_VERSION, '5.3.0', '<')) { @@ -612,7 +622,7 @@ function twig_urlencode_filter($url, $raw = false) * JSON encodes a variable. * * @param mixed $value The value to encode. - * @param integer $options Not used on PHP 5.2.x + * @param int $options Not used on PHP 5.2.x * * @return mixed The JSON encoded value */ @@ -631,7 +641,7 @@ function twig_jsonencode_filter($value, $options = 0) * JSON encodes a variable. * * @param mixed $value The value to encode. - * @param integer $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT + * @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT * * @return mixed The JSON encoded value */ @@ -673,7 +683,7 @@ function _twig_markup2string(&$value) function twig_array_merge($arr1, $arr2) { if (!is_array($arr1) || !is_array($arr2)) { - throw new Twig_Error_Runtime('The merge filter only works with arrays or hashes.'); + throw new Twig_Error_Runtime(sprintf('The merge filter only works with arrays or hashes; %s and %s given.', gettype($arr1), gettype($arr2))); } return array_merge($arr1, $arr2); @@ -684,16 +694,24 @@ function twig_array_merge($arr1, $arr2) * * @param Twig_Environment $env A Twig_Environment instance * @param mixed $item A variable - * @param integer $start Start of the slice - * @param integer $length Size of the slice - * @param Boolean $preserveKeys Whether to preserve key or not (when the input is an array) + * @param int $start Start of the slice + * @param int $length Size of the slice + * @param bool $preserveKeys Whether to preserve key or not (when the input is an array) * * @return mixed The sliced variable */ function twig_slice(Twig_Environment $env, $item, $start, $length = null, $preserveKeys = false) { if ($item instanceof Traversable) { - $item = iterator_to_array($item, false); + if ($item instanceof IteratorAggregate) { + $item = $item->getIterator(); + } + + if ($start >= 0 && $length >= 0) { + return iterator_to_array(new LimitIterator($item, $start, $length === null ? -1 : $length), $preserveKeys); + } + + $item = iterator_to_array($item, $preserveKeys); } if (is_array($item)) { @@ -703,10 +721,10 @@ function twig_slice(Twig_Environment $env, $item, $start, $length = null, $prese $item = (string) $item; if (function_exists('mb_get_info') && null !== $charset = $env->getCharset()) { - return mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset); + return (string) mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset); } - return null === $length ? substr($item, $start) : substr($item, $start, $length); + return (string) (null === $length ? substr($item, $start) : substr($item, $start, $length)); } /** @@ -785,17 +803,35 @@ function twig_join_filter($value, $glue = '') * * @param string $value A string * @param string $delimiter The delimiter - * @param integer $limit The limit + * @param int $limit The limit * * @return array The split string as an array */ -function twig_split_filter($value, $delimiter, $limit = null) +function twig_split_filter(Twig_Environment $env, $value, $delimiter, $limit = null) { - if (empty($delimiter)) { + if (!empty($delimiter)) { + return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); + } + + if (!function_exists('mb_get_info') || null === $charset = $env->getCharset()) { return str_split($value, null === $limit ? 1 : $limit); } - return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); + if ($limit <= 1) { + return preg_split('/(? true, 'UTF-8' => true); } else { $htmlspecialcharsCharsets = array( @@ -1192,7 +1228,7 @@ function _twig_escape_html_attr_callback($matches) * @param Twig_Environment $env A Twig_Environment instance * @param mixed $thing A variable * - * @return integer The length of the value + * @return int The length of the value */ function twig_length_filter(Twig_Environment $env, $thing) { @@ -1276,7 +1312,7 @@ function twig_capitalize_string_filter(Twig_Environment $env, $string) * @param Twig_Environment $env A Twig_Environment instance * @param mixed $thing A variable * - * @return integer The length of the value + * @return int The length of the value */ function twig_length_filter(Twig_Environment $env, $thing) { @@ -1332,7 +1368,7 @@ function twig_ensure_traversable($seq) * * @param mixed $value A variable * - * @return Boolean true if the value is empty, false otherwise + * @return bool true if the value is empty, false otherwise */ function twig_test_empty($value) { @@ -1355,7 +1391,7 @@ function twig_test_empty($value) * * @param mixed $value A variable * - * @return Boolean true if the value is traversable + * @return bool true if the value is traversable */ function twig_test_iterable($value) { @@ -1367,9 +1403,9 @@ function twig_test_iterable($value) * * @param string|array $template The template to render or an array of templates to try consecutively * @param array $variables The variables to pass to the template - * @param Boolean $with_context Whether to pass the current context variables or not - * @param Boolean $ignore_missing Whether to ignore missing templates or not - * @param Boolean $sandboxed Whether to sandbox the template or not + * @param bool $with_context Whether to pass the current context variables or not + * @param bool $ignore_missing Whether to ignore missing templates or not + * @param bool $sandboxed Whether to sandbox the template or not * * @return string The rendered template */ @@ -1434,7 +1470,7 @@ function twig_constant($constant, $object = null) * Batches item. * * @param array $items An array of items - * @param integer $size The size of the batch + * @param int $size The size of the batch * @param mixed $fill A value used to fill missing items * * @return array diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Extension/Sandbox.php b/drupal/core/vendor/twig/twig/lib/Twig/Extension/Sandbox.php index c59609f6..c58259c6 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Extension/Sandbox.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Extension/Sandbox.php @@ -93,7 +93,7 @@ public function checkPropertyAllowed($obj, $method) public function ensureToStringAllowed($obj) { - if (is_object($obj)) { + if ($this->isSandboxed() && is_object($obj)) { $this->policy->checkMethodAllowed($obj, '__toString'); } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/LexerInterface.php b/drupal/core/vendor/twig/twig/lib/Twig/LexerInterface.php index dd51caee..24a94787 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/LexerInterface.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/LexerInterface.php @@ -13,7 +13,8 @@ * Interface implemented by lexer classes. * * @author Fabien Potencier - * @deprecated since 1.12 (to be removed in 2.0) + * + * @deprecated since 1.12 (to be removed in 3.0) */ interface Twig_LexerInterface { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Loader/Array.php b/drupal/core/vendor/twig/twig/lib/Twig/Loader/Array.php index ac561048..436edd81 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Loader/Array.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Loader/Array.php @@ -17,6 +17,8 @@ * source code of the template). If you don't want to see your cache grows out of * control, you need to take care of clearing the old cache file by yourself. * + * This loader should only be used for unit testing. + * * @author Fabien Potencier */ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php b/drupal/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php index 2d6170c3..d0ae1cc1 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Loader/Filesystem.php @@ -176,16 +176,7 @@ protected function findTemplate($name) $this->validateName($name); - $namespace = self::MAIN_NAMESPACE; - $shortname = $name; - if (isset($name[0]) && '@' == $name[0]) { - if (false === $pos = strpos($name, '/')) { - throw new Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); - } - - $namespace = substr($name, 1, $pos - 1); - $shortname = substr($name, $pos + 1); - } + list($namespace, $shortname) = $this->parseName($name); if (!isset($this->paths[$namespace])) { throw new Twig_Error_Loader(sprintf('There are no registered paths for namespace "%s".', $namespace)); @@ -200,6 +191,22 @@ protected function findTemplate($name) throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace]))); } + protected function parseName($name, $default = self::MAIN_NAMESPACE) + { + if (isset($name[0]) && '@' == $name[0]) { + if (false === $pos = strpos($name, '/')) { + throw new Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); + } + + $namespace = substr($name, 1, $pos - 1); + $shortname = substr($name, $pos + 1); + + return array($namespace, $shortname); + } + + return array($default, $name); + } + protected function normalizeName($name) { return preg_replace('#/{2,}#', '/', strtr((string) $name, '\\', '/')); diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Loader/String.php b/drupal/core/vendor/twig/twig/lib/Twig/Loader/String.php index 8ad9856c..2099c09c 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Loader/String.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Loader/String.php @@ -12,9 +12,7 @@ /** * Loads a template from a string. * - * This loader should only be used for unit testing as it has many limitations - * (for instance, the include or extends tag does not make any sense for a string - * loader). + * This loader should NEVER be used. It only exists for Twig internal purposes. * * When using this loader with a cache mechanism, you should know that a new cache * key is generated each time a template content "changes" (the cache key being the diff --git a/drupal/core/vendor/twig/twig/lib/Twig/LoaderInterface.php b/drupal/core/vendor/twig/twig/lib/Twig/LoaderInterface.php index 927786d1..4405291f 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/LoaderInterface.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/LoaderInterface.php @@ -44,7 +44,7 @@ public function getCacheKey($name); * @param string $name The template name * @param timestamp $time The last modification time of the cached template * - * @return Boolean true if the template is fresh, false otherwise + * @return bool true if the template is fresh, false otherwise * * @throws Twig_Error_Loader When $name is not found */ diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node.php b/drupal/core/vendor/twig/twig/lib/Twig/Node.php index 931b4635..20af5449 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node.php @@ -30,7 +30,7 @@ class Twig_Node implements Twig_NodeInterface * * @param array $nodes An array of named nodes * @param array $attributes An array of attributes (should not be nodes) - * @param integer $lineno The line number + * @param int $lineno The line number * @param string $tag The tag name associated with the Node */ public function __construct(array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null) @@ -69,6 +69,9 @@ public function __toString() return implode("\n", $repr); } + /** + * @deprecated since 1.16.1 (to be removed in 2.0) + */ public function toXml($asDom = false) { $dom = new DOMDocument('1.0', 'UTF-8'); @@ -121,7 +124,7 @@ public function getNodeTag() * * @param string The attribute name * - * @return Boolean true if the attribute is defined, false otherwise + * @return bool true if the attribute is defined, false otherwise */ public function hasAttribute($name) { @@ -170,7 +173,7 @@ public function removeAttribute($name) * * @param string The node name * - * @return Boolean true if the node with the given name exists, false otherwise + * @return bool true if the node with the given name exists, false otherwise */ public function hasNode($name) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/AutoEscape.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/AutoEscape.php index 8f190e0b..fcabf903 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/AutoEscape.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/AutoEscape.php @@ -30,7 +30,7 @@ public function __construct($value, Twig_NodeInterface $body, $lineno, $tag = 'a /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Block.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Block.php index 50eb67ed..989e4a0c 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Block.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Block.php @@ -25,7 +25,7 @@ public function __construct($name, Twig_NodeInterface $body, $lineno, $tag = nul /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/BlockReference.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/BlockReference.php index 013e369e..a05ea045 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/BlockReference.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/BlockReference.php @@ -25,7 +25,7 @@ public function __construct($name, $lineno, $tag = null) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Do.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Do.php index c528066b..9981bc16 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Do.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Do.php @@ -24,7 +24,7 @@ public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Array.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Array.php index 1da785fe..6cf7ca14 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Array.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Array.php @@ -63,7 +63,7 @@ public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $ke /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php index 2ddea78c..4d5dbdb9 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php @@ -15,7 +15,7 @@ class Twig_Node_Expression_AssignName extends Twig_Node_Expression_Name /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php index 9dd5de2c..5c383d15 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php @@ -19,7 +19,7 @@ public function __construct(Twig_NodeInterface $left, Twig_NodeInterface $right, /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php index 5de6c72d..93b3b96f 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php @@ -12,14 +12,14 @@ class Twig_Node_Expression_Binary_EndsWith extends Twig_Node_Expression_Binary { public function compile(Twig_Compiler $compiler) { + $left = $compiler->getVarName(); + $right = $compiler->getVarName(); $compiler - ->raw('(0 === substr_compare(') + ->raw(sprintf('(is_string($%s = ', $left)) ->subcompile($this->getNode('left')) - ->raw(', ') + ->raw(sprintf(') && is_string($%s = ', $right)) ->subcompile($this->getNode('right')) - ->raw(', -strlen(') - ->subcompile($this->getNode('right')) - ->raw(')))') + ->raw(sprintf(') && (\'\' === $%2$s || $%2$s === substr($%1$s, -strlen($%2$s))))', $left, $right)) ; } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php index 7fbd0556..d3518b55 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php @@ -13,7 +13,7 @@ class Twig_Node_Expression_Binary_FloorDiv extends Twig_Node_Expression_Binary /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php index 788f9377..1d485b61 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php @@ -13,7 +13,7 @@ class Twig_Node_Expression_Binary_In extends Twig_Node_Expression_Binary /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php index f347b7b6..8f215f1c 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php @@ -13,7 +13,7 @@ class Twig_Node_Expression_Binary_NotIn extends Twig_Node_Expression_Binary /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php index b2c59040..6cd3a217 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php @@ -13,7 +13,7 @@ class Twig_Node_Expression_Binary_Power extends Twig_Node_Expression_Binary /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php index bea4f2a6..fc102fed 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php @@ -13,7 +13,7 @@ class Twig_Node_Expression_Binary_Range extends Twig_Node_Expression_Binary /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php index eb8c107c..d2e30d66 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php @@ -12,12 +12,14 @@ class Twig_Node_Expression_Binary_StartsWith extends Twig_Node_Expression_Binary { public function compile(Twig_Compiler $compiler) { + $left = $compiler->getVarName(); + $right = $compiler->getVarName(); $compiler - ->raw('(0 === strpos(') + ->raw(sprintf('(is_string($%s = ', $left)) ->subcompile($this->getNode('left')) - ->raw(', ') + ->raw(sprintf(') && is_string($%s = ', $right)) ->subcompile($this->getNode('right')) - ->raw('))') + ->raw(sprintf(') && (\'\' === $%2$s || 0 === strpos($%1$s, $%2$s)))', $left, $right)) ; } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php index 647196eb..4ddb2cf4 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php @@ -25,7 +25,7 @@ public function __construct(Twig_NodeInterface $name, $asString = false, $lineno /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Call.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Call.php index d019696e..912b837a 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Call.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Call.php @@ -12,10 +12,8 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression { protected function compileCallable(Twig_Compiler $compiler) { - $callable = $this->getAttribute('callable'); - $closingParenthesis = false; - if ($callable) { + if ($this->hasAttribute('callable') && $callable = $this->getAttribute('callable')) { if (is_string($callable)) { $compiler->raw($callable); } elseif (is_array($callable) && $callable[0] instanceof Twig_ExtensionInterface) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php index 00ac6701..db06abb0 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php @@ -24,7 +24,7 @@ public function __construct($name, $lineno, $tag = null) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php index 55d9fcc3..6ce61111 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php @@ -11,7 +11,7 @@ */ class Twig_Node_Expression_GetAttr extends Twig_Node_Expression { - public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression_Array $arguments, $type, $lineno) + public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression $arguments = null, $type, $lineno) { parent::__construct(array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false), $lineno); } @@ -32,20 +32,30 @@ public function compile(Twig_Compiler $compiler) $compiler->raw(', ')->subcompile($this->getNode('attribute')); - if (count($this->getNode('arguments')) || Twig_Template::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { - $compiler->raw(', ')->subcompile($this->getNode('arguments')); - - if (Twig_Template::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { - $compiler->raw(', ')->repr($this->getAttribute('type')); + // only generate optional arguments when needed (to make generated code more readable) + $needFourth = $this->getAttribute('ignore_strict_check'); + $needThird = $needFourth || $this->getAttribute('is_defined_test'); + $needSecond = $needThird || Twig_Template::ANY_CALL !== $this->getAttribute('type'); + $needFirst = $needSecond || null !== $this->getNode('arguments'); + + if ($needFirst) { + if (null !== $this->getNode('arguments')) { + $compiler->raw(', ')->subcompile($this->getNode('arguments')); + } else { + $compiler->raw(', array()'); } + } - if ($this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) { - $compiler->raw(', '.($this->getAttribute('is_defined_test') ? 'true' : 'false')); - } + if ($needSecond) { + $compiler->raw(', ')->repr($this->getAttribute('type')); + } - if ($this->getAttribute('ignore_strict_check')) { - $compiler->raw(', '.($this->getAttribute('ignore_strict_check') ? 'true' : 'false')); - } + if ($needThird) { + $compiler->raw(', ')->repr($this->getAttribute('is_defined_test')); + } + + if ($needFourth) { + $compiler->raw(', ')->repr($this->getAttribute('ignore_strict_check')); } $compiler->raw(')'); diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php index dcf618c0..a22ce038 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php @@ -25,7 +25,7 @@ public function __construct($name, $lineno, $tag = null) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php index 0aceb530..d5bed234 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php @@ -13,7 +13,7 @@ * Checks if a variable is divisible by a number. * *
- *  {% if loop.index is divisibleby(3) %}
+ *  {% if loop.index is divisible by(3) %}
  * 
* * @author Fabien Potencier diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Flush.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Flush.php index 0467ddce..20d6aab4 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Flush.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Flush.php @@ -24,7 +24,7 @@ public function __construct($lineno, $tag) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/For.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/For.php index d1ff371d..c54a23cc 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/For.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/For.php @@ -33,7 +33,7 @@ public function __construct(Twig_Node_Expression_AssignName $keyTarget, Twig_Nod /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/ForLoop.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/ForLoop.php index b8841583..d330283e 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/ForLoop.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/ForLoop.php @@ -24,7 +24,7 @@ public function __construct($lineno, $tag = null) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/If.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/If.php index b42d1075..980274e5 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/If.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/If.php @@ -25,7 +25,7 @@ public function __construct(Twig_NodeInterface $tests, Twig_NodeInterface $else /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Import.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Import.php index 99efc091..23066554 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Import.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Import.php @@ -24,7 +24,7 @@ public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $va /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Include.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Include.php index ed4a3751..06548884 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Include.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Include.php @@ -19,13 +19,13 @@ class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface { public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) { - parent::__construct(array('expr' => $expr, 'variables' => $variables), array('only' => (Boolean) $only, 'ignore_missing' => (Boolean) $ignoreMissing), $lineno, $tag); + parent::__construct(array('expr' => $expr, 'variables' => $variables), array('only' => (bool) $only, 'ignore_missing' => (bool) $ignoreMissing), $lineno, $tag); } /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { @@ -60,40 +60,26 @@ public function compile(Twig_Compiler $compiler) protected function addGetTemplate(Twig_Compiler $compiler) { - if ($this->getNode('expr') instanceof Twig_Node_Expression_Constant) { - $compiler - ->write("\$this->env->loadTemplate(") - ->subcompile($this->getNode('expr')) - ->raw(")") - ; - } else { - $compiler - ->write("\$template = \$this->env->resolveTemplate(") - ->subcompile($this->getNode('expr')) - ->raw(");\n") - ->write('$template') - ; - } + $method = $this->getNode('expr') instanceof Twig_Node_Expression_Constant ? 'loadTemplate' : 'resolveTemplate'; + $compiler + ->write(sprintf('$this->env->%s(', $method)) + ->subcompile($this->getNode('expr')) + ->raw(')') + ; } protected function addTemplateArguments(Twig_Compiler $compiler) { - if (false === $this->getAttribute('only')) { - if (null === $this->getNode('variables')) { - $compiler->raw('$context'); - } else { - $compiler - ->raw('array_merge($context, ') - ->subcompile($this->getNode('variables')) - ->raw(')') - ; - } + if (null === $this->getNode('variables')) { + $compiler->raw(false === $this->getAttribute('only') ? '$context' : 'array()'); + } elseif (false === $this->getAttribute('only')) { + $compiler + ->raw('array_merge($context, ') + ->subcompile($this->getNode('variables')) + ->raw(')') + ; } else { - if (null === $this->getNode('variables')) { - $compiler->raw('array()'); - } else { - $compiler->subcompile($this->getNode('variables')); - } + $compiler->subcompile($this->getNode('variables')); } } } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Macro.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Macro.php index 89910618..ab7e8d25 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Macro.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Macro.php @@ -24,7 +24,7 @@ public function __construct($name, Twig_NodeInterface $body, Twig_NodeInterface /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { @@ -37,7 +37,7 @@ public function compile(Twig_Compiler $compiler) $pos = 0; foreach ($this->getNode('arguments') as $name => $default) { $compiler - ->raw('$_'.$name.' = ') + ->raw('$__'.$name.'__ = ') ->subcompile($default) ; @@ -64,7 +64,7 @@ public function compile(Twig_Compiler $compiler) $compiler ->write('') ->string($name) - ->raw(' => $_'.$name) + ->raw(' => $__'.$name.'__') ->raw(",\n") ; } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Module.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Module.php index 3f801757..9f66b28d 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Module.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Module.php @@ -31,7 +31,7 @@ public function setIndex($index) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Print.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Print.php index b0c41d1d..42635361 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Print.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Print.php @@ -25,7 +25,7 @@ public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Sandbox.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Sandbox.php index 8cf3ed44..8ca772bc 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Sandbox.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Sandbox.php @@ -24,7 +24,7 @@ public function __construct(Twig_NodeInterface $body, $lineno, $tag = null) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php index be1f5daa..410332cc 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/SandboxedModule.php @@ -23,7 +23,7 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions) { - parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename'), $node->getLine(), $node->getNodeTag()); + parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename')); $this->setAttribute('index', $node->getAttribute('index')); @@ -43,17 +43,53 @@ protected function compileDisplayFooter(Twig_Compiler $compiler) { parent::compileDisplayFooter($compiler); + $tags = $filters = $functions = array(); + foreach (array('tags', 'filters', 'functions') as $type) { + foreach ($this->{'used'.ucfirst($type)} as $name => $node) { + if ($node instanceof Twig_Node) { + ${$type}[$name] = $node->getLine(); + } else { + ${$type}[$node] = null; + } + } + } + $compiler ->write("protected function checkSecurity()\n", "{\n") ->indent() + ->write("\$tags = ")->repr(array_filter($tags))->raw(";\n") + ->write("\$filters = ")->repr(array_filter($filters))->raw(";\n") + ->write("\$functions = ")->repr(array_filter($functions))->raw(";\n\n") + ->write("try {\n") + ->indent() ->write("\$this->env->getExtension('sandbox')->checkSecurity(\n") ->indent() - ->write(!$this->usedTags ? "array(),\n" : "array('".implode('\', \'', $this->usedTags)."'),\n") - ->write(!$this->usedFilters ? "array(),\n" : "array('".implode('\', \'', $this->usedFilters)."'),\n") - ->write(!$this->usedFunctions ? "array()\n" : "array('".implode('\', \'', $this->usedFunctions)."')\n") + ->write(!$tags ? "array(),\n" : "array('".implode("', '", array_keys($tags))."'),\n") + ->write(!$filters ? "array(),\n" : "array('".implode("', '", array_keys($filters))."'),\n") + ->write(!$functions ? "array()\n" : "array('".implode("', '", array_keys($functions))."')\n") ->outdent() ->write(");\n") ->outdent() + ->write("} catch (Twig_Sandbox_SecurityError \$e) {\n") + ->indent() + ->write("\$e->setTemplateFile(\$this->getTemplateName());\n\n") + ->write("if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$tags[\$e->getTagName()]);\n") + ->outdent() + ->write("} elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$filters[\$e->getFilterName()]);\n") + ->outdent() + ->write("} elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$functions[\$e->getFunctionName()]);\n") + ->outdent() + ->write("}\n\n") + ->write("throw \$e;\n") + ->outdent() + ->write("}\n") + ->outdent() ->write("}\n\n") ; } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php index 73dfaa96..91872ccc 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php @@ -29,7 +29,7 @@ public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Set.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Set.php index 4c9c16ce..407d1473 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Set.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Set.php @@ -39,7 +39,7 @@ public function __construct($capture, Twig_NodeInterface $names, Twig_NodeInterf /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Spaceless.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Spaceless.php index 7555fa0f..1478c59a 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Spaceless.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Spaceless.php @@ -26,7 +26,7 @@ public function __construct(Twig_NodeInterface $body, $lineno, $tag = 'spaceless /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Node/Text.php b/drupal/core/vendor/twig/twig/lib/Twig/Node/Text.php index 21bdcea1..6863604e 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Node/Text.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Node/Text.php @@ -25,7 +25,7 @@ public function __construct($data, $lineno) /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler) { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/NodeInterface.php b/drupal/core/vendor/twig/twig/lib/Twig/NodeInterface.php index f0ef7258..8077349b 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/NodeInterface.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/NodeInterface.php @@ -13,14 +13,15 @@ * Represents a node in the AST. * * @author Fabien Potencier - * @deprecated since 1.12 (to be removed in 2.0) + * + * @deprecated since 1.12 (to be removed in 3.0) */ interface Twig_NodeInterface extends Countable, IteratorAggregate { /** * Compiles the node to PHP. * - * @param Twig_Compiler A Twig_Compiler instance + * @param Twig_Compiler $compiler A Twig_Compiler instance */ public function compile(Twig_Compiler $compiler); diff --git a/drupal/core/vendor/twig/twig/lib/Twig/NodeTraverser.php b/drupal/core/vendor/twig/twig/lib/Twig/NodeTraverser.php index aacaf293..8178a55c 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/NodeTraverser.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/NodeTraverser.php @@ -70,7 +70,7 @@ public function traverse(Twig_NodeInterface $node) protected function traverseForVisitor(Twig_NodeVisitorInterface $visitor, Twig_NodeInterface $node = null) { if (null === $node) { - return null; + return; } $node = $visitor->enterNode($node, $this->env); diff --git a/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php b/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php index 5bf8eb0c..3cc3312b 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php @@ -28,6 +28,7 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface const OPTIMIZE_VAR_ACCESS = 8; protected $loops = array(); + protected $loopsTargets = array(); protected $optimizers; protected $prependedNodes = array(); protected $inABody = false; @@ -35,7 +36,7 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface /** * Constructor. * - * @param integer $optimizers The optimizer mode + * @param int $optimizers The optimizer mode */ public function __construct($optimizers = -1) { @@ -174,6 +175,8 @@ protected function enterOptimizeFor(Twig_NodeInterface $node, Twig_Environment $ // disable the loop variable by default $node->setAttribute('with_loop', false); array_unshift($this->loops, $node); + array_unshift($this->loopsTargets, $node->getNode('value_target')->getAttribute('name')); + array_unshift($this->loopsTargets, $node->getNode('key_target')->getAttribute('name')); } elseif (!$this->loops) { // we are outside a loop return; @@ -183,9 +186,15 @@ protected function enterOptimizeFor(Twig_NodeInterface $node, Twig_Environment $ // the loop variable is referenced for the current loop elseif ($node instanceof Twig_Node_Expression_Name && 'loop' === $node->getAttribute('name')) { + $node->setAttribute('always_defined', true); $this->addLoopToCurrent(); } + // optimize access to loop targets + elseif ($node instanceof Twig_Node_Expression_Name && in_array($node->getAttribute('name'), $this->loopsTargets)) { + $node->setAttribute('always_defined', true); + } + // block reference elseif ($node instanceof Twig_Node_BlockReference || $node instanceof Twig_Node_Expression_BlockReference) { $this->addLoopToCurrent(); @@ -221,6 +230,8 @@ protected function leaveOptimizeFor(Twig_NodeInterface $node, Twig_Environment $ { if ($node instanceof Twig_Node_For) { array_shift($this->loops); + array_shift($this->loopsTargets); + array_shift($this->loopsTargets); } } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php b/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php index fb27045b..e5e3ff63 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php @@ -40,18 +40,18 @@ public function enterNode(Twig_NodeInterface $node, Twig_Environment $env) return $node; } elseif ($this->inAModule) { // look for tags - if ($node->getNodeTag()) { - $this->tags[] = $node->getNodeTag(); + if ($node->getNodeTag() && !isset($this->tags[$node->getNodeTag()])) { + $this->tags[$node->getNodeTag()] = $node; } // look for filters - if ($node instanceof Twig_Node_Expression_Filter) { - $this->filters[] = $node->getNode('filter')->getAttribute('value'); + if ($node instanceof Twig_Node_Expression_Filter && !isset($this->filters[$node->getNode('filter')->getAttribute('value')])) { + $this->filters[$node->getNode('filter')->getAttribute('value')] = $node; } // look for functions - if ($node instanceof Twig_Node_Expression_Function) { - $this->functions[] = $node->getAttribute('name'); + if ($node instanceof Twig_Node_Expression_Function && !isset($this->functions[$node->getAttribute('name')])) { + $this->functions[$node->getAttribute('name')] = $node; } // wrap print to check __toString() calls @@ -76,7 +76,7 @@ public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env) if ($node instanceof Twig_Node_Module) { $this->inAModule = false; - return new Twig_Node_SandboxedModule($node, array_unique($this->filters), array_unique($this->tags), array_unique($this->functions)); + return new Twig_Node_SandboxedModule($node, $this->filters, $this->tags, $this->functions); } return $node; diff --git a/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php b/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php index f33c13fc..608adedb 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php @@ -41,7 +41,7 @@ public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env); * * Priority should be between -10 and 10 (0 is the default). * - * @return integer The priority level + * @return int The priority level */ public function getPriority(); } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/ParserInterface.php b/drupal/core/vendor/twig/twig/lib/Twig/ParserInterface.php index bfe60a36..8e7cc0a8 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/ParserInterface.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/ParserInterface.php @@ -13,7 +13,8 @@ * Interface implemented by parser classes. * * @author Fabien Potencier - * @deprecated since 1.12 (to be removed in 2.0) + * + * @deprecated since 1.12 (to be removed in 3.0) */ interface Twig_ParserInterface { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php b/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php new file mode 100644 index 00000000..99faba9d --- /dev/null +++ b/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php @@ -0,0 +1,31 @@ + + */ +class Twig_Sandbox_SecurityNotAllowedFilterError extends Twig_Sandbox_SecurityError +{ + private $filterName; + + public function __construct($message, $functionName, $lineno = -1, $filename = null, Exception $previous = null) + { + parent::__construct($message, $lineno, $filename, $previous); + $this->filterName = $functionName; + } + + public function getFilterName() + { + return $this->filterName; + } +} diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php b/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php new file mode 100644 index 00000000..05cf488a --- /dev/null +++ b/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php @@ -0,0 +1,31 @@ + + */ +class Twig_Sandbox_SecurityNotAllowedFunctionError extends Twig_Sandbox_SecurityError +{ + private $functionName; + + public function __construct($message, $functionName, $lineno = -1, $filename = null, Exception $previous = null) + { + parent::__construct($message, $lineno, $filename, $previous); + $this->functionName = $functionName; + } + + public function getFunctionName() + { + return $this->functionName; + } +} diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php b/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php new file mode 100644 index 00000000..b3bb5e8e --- /dev/null +++ b/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php @@ -0,0 +1,31 @@ + + */ +class Twig_Sandbox_SecurityNotAllowedTagError extends Twig_Sandbox_SecurityError +{ + private $tagName; + + public function __construct($message, $tagName, $lineno = -1, $filename = null, Exception $previous = null) + { + parent::__construct($message, $lineno, $filename, $previous); + $this->tagName = $tagName; + } + + public function getTagName() + { + return $this->tagName; + } +} diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php b/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php index 66ee2332..c4dd03df 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php @@ -63,19 +63,19 @@ public function checkSecurity($tags, $filters, $functions) { foreach ($tags as $tag) { if (!in_array($tag, $this->allowedTags)) { - throw new Twig_Sandbox_SecurityError(sprintf('Tag "%s" is not allowed.', $tag)); + throw new Twig_Sandbox_SecurityNotAllowedTagError(sprintf('Tag "%s" is not allowed.', $tag), $tag); } } foreach ($filters as $filter) { if (!in_array($filter, $this->allowedFilters)) { - throw new Twig_Sandbox_SecurityError(sprintf('Filter "%s" is not allowed.', $filter)); + throw new Twig_Sandbox_SecurityNotAllowedFilterError(sprintf('Filter "%s" is not allowed.', $filter), $filter); } } foreach ($functions as $function) { if (!in_array($function, $this->allowedFunctions)) { - throw new Twig_Sandbox_SecurityError(sprintf('Function "%s" is not allowed.', $function)); + throw new Twig_Sandbox_SecurityNotAllowedFunctionError(sprintf('Function "%s" is not allowed.', $function), $function); } } } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Template.php b/drupal/core/vendor/twig/twig/lib/Twig/Template.php index b13df5d3..63910dac 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Template.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Template.php @@ -105,9 +105,9 @@ public function displayParentBlock($name, array $context, array $blocks = array( $name = (string) $name; if (isset($this->traits[$name])) { - $this->traits[$name][0]->displayBlock($name, $context, $blocks); + $this->traits[$name][0]->displayBlock($name, $context, $blocks, false); } elseif (false !== $parent = $this->getParent($context)) { - $parent->displayBlock($name, $context, $blocks); + $parent->displayBlock($name, $context, $blocks, false); } else { throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this->getTemplateName()); } @@ -119,18 +119,18 @@ public function displayParentBlock($name, array $context, array $blocks = array( * This method is for internal use only and should never be called * directly. * - * @param string $name The block name to display - * @param array $context The context - * @param array $blocks The current set of blocks + * @param string $name The block name to display + * @param array $context The context + * @param array $blocks The current set of blocks + * @param bool $useBlocks Whether to use the current set of blocks */ - public function displayBlock($name, array $context, array $blocks = array()) + public function displayBlock($name, array $context, array $blocks = array(), $useBlocks = true) { $name = (string) $name; - if (isset($blocks[$name])) { + if ($useBlocks && isset($blocks[$name])) { $template = $blocks[$name][0]; $block = $blocks[$name][1]; - unset($blocks[$name]); } elseif (isset($this->blocks[$name])) { $template = $this->blocks[$name][0]; $block = $this->blocks[$name][1]; @@ -148,7 +148,7 @@ public function displayBlock($name, array $context, array $blocks = array()) throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getTemplateName(), $e); } } elseif (false !== $parent = $this->getParent($context)) { - $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks)); + $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false); } } @@ -178,16 +178,17 @@ public function renderParentBlock($name, array $context, array $blocks = array() * This method is for internal use only and should never be called * directly. * - * @param string $name The block name to render - * @param array $context The context - * @param array $blocks The current set of blocks + * @param string $name The block name to render + * @param array $context The context + * @param array $blocks The current set of blocks + * @param bool $useBlocks Whether to use the current set of blocks * * @return string The rendered block */ - public function renderBlock($name, array $context, array $blocks = array()) + public function renderBlock($name, array $context, array $blocks = array(), $useBlocks = true) { ob_start(); - $this->displayBlock($name, $context, $blocks); + $this->displayBlock($name, $context, $blocks, $useBlocks); return ob_get_clean(); } @@ -207,7 +208,7 @@ public function renderBlock($name, array $context, array $blocks = array()) * * @param string $name The block name * - * @return Boolean true if the block exists, false otherwise + * @return bool true if the block exists, false otherwise */ public function hasBlock($name) { @@ -249,7 +250,7 @@ public function getBlocks() */ public function display(array $context, array $blocks = array()) { - $this->displayWithErrorHandling($this->env->mergeGlobals($context), $blocks); + $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks)); } /** @@ -315,7 +316,7 @@ abstract protected function doDisplay(array $context, array $blocks = array()); * * @param array $context The context * @param string $item The variable to return from the context - * @param Boolean $ignoreStrictCheck Whether to ignore the strict variable check or not + * @param bool $ignoreStrictCheck Whether to ignore the strict variable check or not * * @return The content of the context variable * @@ -325,7 +326,7 @@ final protected function getContext($context, $item, $ignoreStrictCheck = false) { if (!array_key_exists($item, $context)) { if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; + return; } throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist', $item), -1, $this->getTemplateName()); @@ -341,8 +342,8 @@ final protected function getContext($context, $item, $ignoreStrictCheck = false) * @param mixed $item The item to get from the array or object * @param array $arguments An array of arguments to pass if the item is an object method * @param string $type The type of attribute (@see Twig_Template constants) - * @param Boolean $isDefinedTest Whether this is only a defined check - * @param Boolean $ignoreStrictCheck Whether to ignore the strict attribute check or not + * @param bool $isDefinedTest Whether this is only a defined check + * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not * * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true * @@ -370,7 +371,7 @@ protected function getAttribute($object, $item, array $arguments = array(), $typ } if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; + return; } if ($object instanceof ArrayAccess) { @@ -378,7 +379,11 @@ protected function getAttribute($object, $item, array $arguments = array(), $typ } elseif (is_object($object)) { $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface', $item, get_class($object)); } elseif (is_array($object)) { - $message = sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))); + if (empty($object)) { + $message = sprintf('Key "%s" does not exist as the array is empty', $arrayItem); + } else { + $message = sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))); + } } elseif (Twig_Template::ARRAY_CALL === $type) { $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object); } else { @@ -395,14 +400,12 @@ protected function getAttribute($object, $item, array $arguments = array(), $typ } if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; + return; } throw new Twig_Error_Runtime(sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName()); } - $class = get_class($object); - // object property if (Twig_Template::METHOD_CALL !== $type) { if (isset($object->$item) || array_key_exists((string) $item, $object)) { @@ -418,6 +421,8 @@ protected function getAttribute($object, $item, array $arguments = array(), $typ } } + $class = get_class($object); + // object method if (!isset(self::$cache[$class]['methods'])) { self::$cache[$class]['methods'] = array_change_key_case(array_flip(get_class_methods($object))); @@ -440,7 +445,7 @@ protected function getAttribute($object, $item, array $arguments = array(), $typ } if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; + return; } throw new Twig_Error_Runtime(sprintf('Method "%s" for object "%s" does not exist', $item, get_class($object)), -1, $this->getTemplateName()); @@ -460,7 +465,7 @@ protected function getAttribute($object, $item, array $arguments = array(), $typ $ret = call_user_func_array(array($object, $method), $arguments); } catch (BadMethodCallException $e) { if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) { - return null; + return; } throw $e; } diff --git a/drupal/core/vendor/twig/twig/lib/Twig/TemplateInterface.php b/drupal/core/vendor/twig/twig/lib/Twig/TemplateInterface.php index 879f503e..d178832e 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/TemplateInterface.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/TemplateInterface.php @@ -13,7 +13,8 @@ * Interface implemented by all compiled templates. * * @author Fabien Potencier - * @deprecated since 1.12 (to be removed in 2.0) + * + * @deprecated since 1.12 (to be removed in 3.0) */ interface Twig_TemplateInterface { diff --git a/drupal/core/vendor/twig/twig/lib/Twig/Token.php b/drupal/core/vendor/twig/twig/lib/Twig/Token.php index 4411d7b3..599f9f56 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/Token.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/Token.php @@ -38,9 +38,9 @@ class Twig_Token /** * Constructor. * - * @param integer $type The type of the token + * @param int $type The type of the token * @param string $value The token value - * @param integer $lineno The line position in the source + * @param int $lineno The line position in the source */ public function __construct($type, $value, $lineno) { @@ -67,10 +67,10 @@ public function __toString() * * type and value (or array of possible values) * * just value (or array of possible values) (NAME_TYPE is used as type) * - * @param array|integer $type The type to test + * @param array|int $type The type to test * @param array|string|null $values The token value * - * @return Boolean + * @return bool */ public function test($type, $values = null) { @@ -89,7 +89,7 @@ public function test($type, $values = null) /** * Gets the line. * - * @return integer The source line + * @return int The source line */ public function getLine() { @@ -99,7 +99,7 @@ public function getLine() /** * Gets the token type. * - * @return integer The token type + * @return int The token type */ public function getType() { @@ -119,8 +119,8 @@ public function getValue() /** * Returns the constant representation (internal) of a given type. * - * @param integer $type The type as an integer - * @param Boolean $short Whether to return a short representation or not + * @param int $type The type as an integer + * @param bool $short Whether to return a short representation or not * * @return string The string representation */ @@ -176,7 +176,7 @@ public static function typeToString($type, $short = false) /** * Returns the english representation of a given type. * - * @param integer $type The type as an integer + * @param int $type The type as an integer * * @return string The string representation */ diff --git a/drupal/core/vendor/twig/twig/lib/Twig/TokenStream.php b/drupal/core/vendor/twig/twig/lib/Twig/TokenStream.php index 22f0428f..44440dae 100644 --- a/drupal/core/vendor/twig/twig/lib/Twig/TokenStream.php +++ b/drupal/core/vendor/twig/twig/lib/Twig/TokenStream.php @@ -101,7 +101,7 @@ public function expect($type, $value = null, $message = null) /** * Looks at the next token. * - * @param integer $number + * @param int $number * * @return Twig_Token */ @@ -117,7 +117,7 @@ public function look($number = 1) /** * Tests the current token * - * @return Boolean + * @return bool */ public function test($primary, $secondary = null) { @@ -127,7 +127,7 @@ public function test($primary, $secondary = null) /** * Checks if end of stream was reached * - * @return Boolean + * @return bool */ public function isEOF() { diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php index a5fc8788..b791e57f 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php @@ -48,7 +48,7 @@ public function testGlobals() // globals can be added after calling getGlobals $twig = new Twig_Environment(new Twig_Loader_String()); $twig->addGlobal('foo', 'foo'); - $globals = $twig->getGlobals(); + $twig->getGlobals(); $twig->addGlobal('foo', 'bar'); $globals = $twig->getGlobals(); $this->assertEquals('bar', $globals['foo']); @@ -65,7 +65,7 @@ public function testGlobals() // globals can be modified after extensions init $twig = new Twig_Environment(new Twig_Loader_String()); $twig->addGlobal('foo', 'foo'); - $globals = $twig->getGlobals(); + $twig->getGlobals(); $twig->getFunctions(); $twig->addGlobal('foo', 'bar'); $globals = $twig->getGlobals(); @@ -74,7 +74,7 @@ public function testGlobals() // globals can be modified after extensions and runtime init $twig = new Twig_Environment(new Twig_Loader_String()); $twig->addGlobal('foo', 'foo'); - $globals = $twig->getGlobals(); + $twig->getGlobals(); $twig->getFunctions(); $twig->initRuntime(); $twig->addGlobal('foo', 'bar'); diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php index 5f3da18d..b3b1cb0b 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php @@ -130,6 +130,24 @@ public function testUnknownCustomEscaper() { twig_escape_filter(new Twig_Environment(), 'foo', 'bar'); } + + public function testTwigFirst() + { + $twig = new Twig_Environment(); + $this->assertEquals('a', twig_first($twig, 'abc')); + $this->assertEquals(1, twig_first($twig, array(1, 2, 3))); + $this->assertSame('', twig_first($twig, null)); + $this->assertSame('', twig_first($twig, '')); + } + + public function testTwigLast() + { + $twig = new Twig_Environment(); + $this->assertEquals('c', twig_last($twig, 'abc')); + $this->assertEquals(3, twig_last($twig, array(1, 2, 3))); + $this->assertSame('', twig_last($twig, null)); + $this->assertSame('', twig_last($twig, '')); + } } function foo_escaper_for_test(Twig_Environment $env, $string, $charset) diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php index e4746cb3..fee35a0a 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php @@ -33,13 +33,13 @@ public function setUp() '1_basic9' => '{{ obj.foobar }}{{ obj.fooBar }}', '1_basic' => '{% if obj.foo %}{{ obj.foo|upper }}{% endif %}', '1_layout' => '{% block content %}{% endblock %}', - '1_child' => '{% extends "1_layout" %}{% block content %}{{ "a"|json_encode }}{% endblock %}', + '1_child' => "{% extends \"1_layout\" %}\n{% block content %}\n{{ \"a\"|json_encode }}\n{% endblock %}", ); } /** * @expectedException Twig_Sandbox_SecurityError - * @expectedExceptionMessage Filter "json_encode" is not allowed in "1_child". + * @expectedExceptionMessage Filter "json_encode" is not allowed in "1_child" at line 3. */ public function testSandboxWithInheritance() { @@ -111,6 +111,11 @@ public function testSandboxGloballySet() $this->assertEquals('foo', $twig->loadTemplate('1_basic5')->render(self::$params), 'Sandbox allow some methods'); $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); + $twig = $this->getEnvironment(false, array(), self::$templates); + FooObject::reset(); + $this->assertEquals('foo', $twig->loadTemplate('1_basic5')->render(self::$params), 'Sandbox allows __toString when sandbox disabled'); + $this->assertEquals(1, FooObject::$called['__toString'], 'Sandbox only calls method once'); + $twig = $this->getEnvironment(true, array(), self::$templates, array(), array('upper')); $this->assertEquals('FABIEN', $twig->loadTemplate('1_basic2')->render(self::$params), 'Sandbox allow some filters'); diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php index 8efc948f..36cdd337 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/FileCachingTest.php @@ -32,7 +32,7 @@ public function tearDown() public function testWritingCacheFiles() { $name = 'This is just text.'; - $template = $this->env->loadTemplate($name); + $this->env->loadTemplate($name); $cacheFileName = $this->env->getCacheFilename($name); $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); @@ -42,7 +42,7 @@ public function testWritingCacheFiles() public function testClearingCacheFiles() { $name = 'I will be deleted.'; - $template = $this->env->loadTemplate($name); + $this->env->loadTemplate($name); $cacheFileName = $this->env->getCacheFilename($name); $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test index 026bd52c..6679fbe1 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/undefined_trait.test @@ -6,4 +6,4 @@ Exception for an undefined trait {% block bar %} {% endblock %} --EXCEPTION-- -Twig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig". +Twig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig" at line 2. diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test index 7b56b761..74fe6cab 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/bitwise.test @@ -4,7 +4,7 @@ Twig supports bitwise operations {{ 1 b-and 5 }} {{ 1 b-or 5 }} {{ 1 b-xor 5 }} -{{ (1 and 0 b-or 0) is sameas(1 and (0 b-or 0)) ? 'ok' : 'ko' }} +{{ (1 and 0 b-or 0) is same as(1 and (0 b-or 0)) ? 'ok' : 'ko' }} --DATA-- return array() --EXPECT-- diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test index 14ee5e4d..238dd279 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/divisibleby.test @@ -1,8 +1,6 @@ --TEST-- Twig supports the "divisible by" operator --TEMPLATE-- -{{ 8 is divisibleby(2) ? 'OK' }} -{{ 8 is not divisibleby(3) ? 'OK' }} {{ 8 is divisible by(2) ? 'OK' }} {{ 8 is not divisible by(3) ? 'OK' }} {{ 8 is divisible by (2) ? 'OK' }} @@ -17,5 +15,3 @@ OK OK OK OK -OK -OK diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test index d259d118..9ad5e5e8 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/ends_with.test @@ -4,9 +4,23 @@ Twig supports the "ends with" operator {{ 'foo' ends with 'o' ? 'OK' : 'KO' }} {{ not ('foo' ends with 'f') ? 'OK' : 'KO' }} {{ not ('foo' ends with 'foowaytoolong') ? 'OK' : 'KO' }} +{{ 'foo' ends with '' ? 'OK' : 'KO' }} +{{ '1' ends with true ? 'OK' : 'KO' }} +{{ 1 ends with true ? 'OK' : 'KO' }} +{{ 0 ends with false ? 'OK' : 'KO' }} +{{ '' ends with false ? 'OK' : 'KO' }} +{{ false ends with false ? 'OK' : 'KO' }} +{{ false ends with '' ? 'OK' : 'KO' }} --DATA-- return array() --EXPECT-- OK OK OK +OK +KO +KO +KO +KO +KO +KO diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test index 9e8514fb..601201de 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/sameas.test @@ -1,8 +1,8 @@ --TEST-- Twig supports the "same as" operator --TEMPLATE-- -{{ 1 is sameas(1) ? 'OK' }} -{{ 1 is not sameas(true) ? 'OK' }} +{{ 1 is same as(1) ? 'OK' }} +{{ 1 is not same as(true) ? 'OK' }} {{ 1 is same as(1) ? 'OK' }} {{ 1 is not same as(true) ? 'OK' }} {{ 1 is same as (1) ? 'OK' }} diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test index 1ae4f86e..75d331e9 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/expressions/starts_with.test @@ -7,6 +7,11 @@ Twig supports the "starts with" operator {{ 'foo' starts with 'f' ? 'OK' : 'KO' }} {{ 'foo' starts with 'f' ? 'OK' : 'KO' }} +{{ 'foo' starts with '' ? 'OK' : 'KO' }} +{{ '1' starts with true ? 'OK' : 'KO' }} +{{ '' starts with false ? 'OK' : 'KO' }} +{{ 'a' starts with false ? 'OK' : 'KO' }} +{{ false starts with '' ? 'OK' : 'KO' }} --DATA-- return array() --EXPECT-- @@ -15,3 +20,8 @@ OK OK OK OK +OK +KO +KO +KO +KO diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test similarity index 95% rename from drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.php rename to drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test index 52de39cb..e2ec4beb 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch_float.test @@ -15,17 +15,15 @@
a
b
c
+
d
-
d
e
f
-
-
g
h
-
i
+
i
j
diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test index d40bb04a..d17e5e2f 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date.test @@ -31,6 +31,13 @@ {{ date6|date('e', false) }} {{ date7|date }} +{{ date7|date(timezone='Europe/Paris') }} +{{ date7|date(timezone='Asia/Hong_Kong') }} +{{ date7|date(timezone=false) }} +{{ date7|date(timezone='Indian/Mauritius') }} + +{{ '2010-01-28 15:00:00'|date(timezone="Europe/Paris") }} +{{ '2010-01-28 15:00:00'|date(timezone="Asia/Hong_Kong") }} --DATA-- date_default_timezone_set('Europe/Paris'); return array( @@ -40,7 +47,7 @@ return array( 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(), 'date6' => new DateTime('2010-10-04 13:45', new DateTimeZone('America/New_York')), - 'date7' => '2010-01-28T15:00:00+05:00', + 'date7' => '2010-01-28T15:00:00+04:00', 'timezone1' => new DateTimeZone('America/New_York'), ) --EXPECT-- @@ -73,4 +80,11 @@ January 2, 1964 04:04 Europe/Paris America/New_York -January 28, 2010 11:00 +January 28, 2010 12:00 +January 28, 2010 12:00 +January 28, 2010 19:00 +January 28, 2010 15:00 +January 28, 2010 15:00 + +January 28, 2010 15:00 +January 28, 2010 22:00 diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test index b89ceb30..4e183256 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/date_immutable.test @@ -8,6 +8,7 @@ version_compare(phpversion(), '5.5.0', '>=') {{ date1|date('d/m/Y H:i:s', 'Asia/Hong_Kong') }} {{ date1|date('d/m/Y H:i:s', timezone1) }} {{ date1|date('d/m/Y H:i:s') }} +{{ date1|date_modify('+1 hour')|date('d/m/Y H:i:s') }} {{ date2|date('d/m/Y H:i:s P', 'Europe/Paris') }} {{ date2|date('d/m/Y H:i:s P', 'Asia/Hong_Kong') }} @@ -27,6 +28,7 @@ October 4, 2010 13:45 04/10/2010 19:45:00 04/10/2010 07:45:00 04/10/2010 13:45:00 +04/10/2010 14:45:00 04/10/2010 19:45:00 +02:00 05/10/2010 01:45:00 +08:00 diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test index 0e4404b1..b8d1d66f 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/default.test @@ -2,42 +2,42 @@ "default" filter --TEMPLATE-- Variable: -{{ definedVar |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ zeroVar |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ emptyVar |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ nullVar |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ undefinedVar |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} Array access: -{{ nested.definedVar |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ nested['definedVar'] |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ nested.zeroVar |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ nested.emptyVar |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ nested.nullVar |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ nested.undefinedVar |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ nested['undefinedVar'] |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ undefinedVar.foo |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ nested.definedVar |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ nested['definedVar'] |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ nested.zeroVar |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ nested.emptyVar |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ nested.nullVar |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ nested.undefinedVar |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ nested['undefinedVar'] |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ undefinedVar.foo |default('default') is same as('default') ? 'ok' : 'ko' }} Plain values: -{{ 'defined' |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ 0 |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ '' |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ null |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ 'defined' |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ 0 |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ '' |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ null |default('default') is same as('default') ? 'ok' : 'ko' }} Precedence: {{ 'o' ~ nullVar |default('k') }} {{ 'o' ~ nested.nullVar |default('k') }} Object methods: -{{ object.foo |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ object.getFoo() |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ object.getFoo('a') |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ object.undefinedMethod() |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod('a') |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ object.foo |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ object.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ object.getFoo() |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ object.getFoo('a') |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ object.undefinedMethod() |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ object.undefinedMethod('a') |default('default') is same as('default') ? 'ok' : 'ko' }} Deep nested: -{{ nested.undefinedVar.foo.bar |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ nested.definedArray.0 |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ nested['definedArray'][0] |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ object.self.foo |default('default') is sameas('default') ? 'ko' : 'ok' }} -{{ object.self.undefinedMethod |default('default') is sameas('default') ? 'ok' : 'ko' }} -{{ object.undefinedMethod.self |default('default') is sameas('default') ? 'ok' : 'ko' }} +{{ nested.undefinedVar.foo.bar |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ nested.definedArray.0 |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ nested['definedArray'][0] |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ object.self.foo |default('default') is same as('default') ? 'ko' : 'ok' }} +{{ object.self.undefinedMethod |default('default') is same as('default') ? 'ok' : 'ko' }} +{{ object.undefinedMethod.self |default('default') is same as('default') ? 'ok' : 'ko' }} --DATA-- return array( 'definedVar' => 'defined', diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test index 90f49271..aa54645c 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/first.test @@ -6,6 +6,7 @@ {{ '1234'|first }} {{ arr|first }} {{ 'Ä€é'|first }} +{{ ''|first }} --DATA-- return array('arr' => new ArrayObject(array(1, 2, 3, 4))) --EXPECT-- diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test index 018fdad8..1b8031ee 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/last.test @@ -6,6 +6,7 @@ {{ '1234'|last }} {{ arr|last }} {{ 'Ä€é'|last }} +{{ ''|last }} --DATA-- return array('arr' => new ArrayObject(array(1, 2, 3, 4))) --EXPECT-- diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test index b37ad651..fb36a4eb 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/slice.test @@ -19,6 +19,9 @@ {{ '1234'|slice(1) }} {{ '1234'[1:] }} {{ '1234'[:1] }} + +{{ arr|slice(3)|join('') }} +{{ arr[2:]|join('') }} --DATA-- return array('start' => 1, 'length' => 2, 'arr' => new ArrayObject(array(1, 2, 3, 4))) --EXPECT-- @@ -40,3 +43,6 @@ bc 234 234 1 + +4 +34 \ No newline at end of file diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test index ce8ec9ce..a093ed79 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split.test @@ -5,6 +5,7 @@ {{ foo|split(',')|join('-') }} {{ foo|split(',', 3)|join('-') }} {{ baz|split('')|join('-') }} +{{ baz|split('', 1)|join('-') }} {{ baz|split('', 2)|join('-') }} {{ foo|split(',', -2)|join('-') }} --DATA-- @@ -14,5 +15,6 @@ one-two-three-four-five one-two-three-four-five one-two-three,four,five 1-2-3-4-5 +1-2-3-4-5 12-34-5 one-two-three \ No newline at end of file diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test new file mode 100644 index 00000000..305e162f --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/split_utf8.test @@ -0,0 +1,24 @@ +--TEST-- +"split" filter +--CONDITION-- +function_exists('mb_get_info') +--TEMPLATE-- +{{ "é"|split('', 10)|join('-') }} +{{ foo|split(',')|join('-') }} +{{ foo|split(',', 1)|join('-') }} +{{ foo|split(',', 2)|join('-') }} +{{ foo|split(',', 3)|join('-') }} +{{ baz|split('')|join('-') }} +{{ baz|split('', 1)|join('-') }} +{{ baz|split('', 2)|join('-') }} +--DATA-- +return array('foo' => 'Ä,é,Äほ', 'baz' => 'éÄßごa',) +--EXPECT-- +é +Ä-é-Äほ +Ä,é,Äほ +Ä-é,Äほ +Ä-é-Äほ +é-Ä-ß-ご-a +é-Ä-ß-ご-a +éÄ-ßご-a \ No newline at end of file diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test index de956e7a..8726159d 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode.test @@ -1,12 +1,16 @@ --TEST-- "url_encode" filter +--CONDITION-- +defined('PHP_QUERY_RFC3986') --TEMPLATE-- {{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} {{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} {{ {}|url_encode|default("default") }} +{{ 'spéßi%le%c0d@dspa ce'|url_encode }} --DATA-- return array() --EXPECT-- -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa+ce= -foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa+ce= +foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= +foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= default +sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test new file mode 100644 index 00000000..11800e9c --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/urlencode_deprecated.test @@ -0,0 +1,16 @@ +--TEST-- +"url_encode" filter for PHP < 5.4 and HHVM +--CONDITION-- +defined('PHP_QUERY_RFC3986') +--TEMPLATE-- +{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode }} +{{ {foo: "bar", number: 3, "spéßi%l": "e%c0d@d", "spa ce": ""}|url_encode|raw }} +{{ {}|url_encode|default("default") }} +{{ 'spéßi%le%c0d@dspa ce'|url_encode }} +--DATA-- +return array() +--EXPECT-- +foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= +foo=bar&number=3&sp%C3%A9%C3%9Fi%25l=e%25c0d%40d&spa%20ce= +default +sp%C3%A9%C3%9Fi%25le%25c0d%40dspa%20ce diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test index 472b74d1..71b2038a 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/attribute.test @@ -4,13 +4,15 @@ {{ attribute(obj, method) }} {{ attribute(array, item) }} {{ attribute(obj, "bar", ["a", "b"]) }} +{{ attribute(obj, "bar", arguments) }} {{ attribute(obj, method) is defined ? 'ok' : 'ko' }} {{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }} --DATA-- -return array('obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo', 'nonmethod' => 'xxx') +return array('obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => array('foo' => 'bar'), 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => array('a', 'b')) --EXPECT-- foo bar bar_a-b +bar_a-b ok ko diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test index 788a2ab0..7b9ccaca 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/include/sandbox.test @@ -3,8 +3,11 @@ --TEMPLATE-- {{ include("foo.twig", sandboxed = true) }} --TEMPLATE(foo.twig)-- + + +{{ foo|e }} {{ foo|e }} --DATA-- return array() --EXCEPTION-- -Twig_Sandbox_SecurityError: Filter "e" is not allowed in "index.twig" at line 2. +Twig_Sandbox_SecurityNotAllowedFilterError: Filter "e" is not allowed in "foo.twig" at line 4. diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test new file mode 100644 index 00000000..f39712da --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/recursive_block_with_inheritance.test @@ -0,0 +1,21 @@ +--TEST-- +"block" function recursively called in a parent template +--TEMPLATE-- +{% extends "ordered_menu.twig" %} +{% block label %}"{{ parent() }}"{% endblock %} +{% block list %}{% set class = 'b' %}{{ parent() }}{% endblock %} +--TEMPLATE(ordered_menu.twig)-- +{% extends "menu.twig" %} +{% block list %}{% set class = class|default('a') %}
    {{ block('children') }}
{% endblock %} +--TEMPLATE(menu.twig)-- +{% extends "base.twig" %} +{% block list %}
    {{ block('children') }}
{% endblock %} +{% block children %}{% set currentItem = item %}{% for item in currentItem %}{{ block('item') }}{% endfor %}{% set item = currentItem %}{% endblock %} +{% block item %}
  • {% if item is not iterable %}{{ block('label') }}{% else %}{{ block('list') }}{% endif %}
  • {% endblock %} +{% block label %}{{ item }}{{ block('unknown') }}{% endblock %} +--TEMPLATE(base.twig)-- +{{ block('list') }} +--DATA-- +return array('item' => array('1', '2', array('3.1', array('3.2.1', '3.2.2'), '3.4'))) +--EXPECT-- +
    1. "1"
    2. "2"
      1. "3.1"
        1. "3.2.1"
        2. "3.2.2"
      2. "3.4"
    diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test new file mode 100644 index 00000000..df485783 --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test @@ -0,0 +1,15 @@ +--TEST-- +Exception with bad line number +--TEMPLATE-- +{% block content %} + {{ foo }} + {{ include("foo") }} +{% endblock %} +index +--TEMPLATE(foo)-- +foo +{{ foo.bar }} +--DATA-- +return array('foo' => 'foo'); +--EXCEPTION-- +Twig_Error_Runtime: Impossible to access an attribute ("bar") on a string variable ("foo") in "foo" at line 3 diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test new file mode 100644 index 00000000..269a3057 --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/multi_word_tests.test @@ -0,0 +1,10 @@ +--TEST-- +Twig allows multi-word tests without a custom node class +--TEMPLATE-- +{{ 'foo' is multi word ? 'yes' : 'no' }} +{{ 'foo bar' is multi word ? 'yes' : 'no' }} +--DATA-- +return array() +--EXPECT-- +no +yes diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test new file mode 100644 index 00000000..9a81499a --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr.test @@ -0,0 +1,32 @@ +--TEST-- +block_expr +--TEMPLATE-- +{% extends "base.twig" %} + +{% block element -%} + Element: + {{- parent() -}} +{% endblock %} +--TEMPLATE(base.twig)-- +{% spaceless %} +{% block element -%} +
    + {%- if item.children is defined %} + {%- for item in item.children %} + {{- block('element') -}} + {% endfor %} + {%- endif -%} +
    +{%- endblock %} +{% endspaceless %} +--DATA-- +return array( + 'item' => array( + 'children' => array( + null, + null, + ) + ) +) +--EXPECT-- +Element:
    Element:
    Element:
    diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test new file mode 100644 index 00000000..3e868c0d --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/inheritance/block_expr2.test @@ -0,0 +1,34 @@ +--TEST-- +block_expr2 +--TEMPLATE-- +{% extends "base2.twig" %} + +{% block element -%} + Element: + {{- parent() -}} +{% endblock %} +--TEMPLATE(base2.twig)-- +{% extends "base.twig" %} +--TEMPLATE(base.twig)-- +{% spaceless %} +{% block element -%} +
    + {%- if item.children is defined %} + {%- for item in item.children %} + {{- block('element') -}} + {% endfor %} + {%- endif -%} +
    +{%- endblock %} +{% endspaceless %} +--DATA-- +return array( + 'item' => array( + 'children' => array( + null, + null, + ) + ) +) +--EXPECT-- +Element:
    Element:
    Element:
    diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test new file mode 100644 index 00000000..56794628 --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/macro/super_globals.test @@ -0,0 +1,14 @@ +--TEST-- +Super globals as macro arguments +--TEMPLATE-- +{% import _self as macros %} + +{{ macros.foo('foo') }} + +{% macro foo(GET) %} + {{ GET }} +{% endmacro %} +--DATA-- +return array() +--EXPECT-- +foo diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test new file mode 100644 index 00000000..6368b08d --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance.test @@ -0,0 +1,25 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use "parent.twig" %} + +{{ block('container') }} +--TEMPLATE(parent.twig)-- +{% use "ancestor.twig" %} + +{% block sub_container %} +
    overriden sub_container
    +{% endblock %} +--TEMPLATE(ancestor.twig)-- +{% block container %} +
    {{ block('sub_container') }}
    +{% endblock %} + +{% block sub_container %} +
    sub_container
    +{% endblock %} +--DATA-- +return array() +--EXPECT-- +
    overriden sub_container
    +
    diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test new file mode 100644 index 00000000..114e3015 --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/inheritance2.test @@ -0,0 +1,24 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use "ancestor.twig" %} +{% use "parent.twig" %} + +{{ block('container') }} +--TEMPLATE(parent.twig)-- +{% block sub_container %} +
    overriden sub_container
    +{% endblock %} +--TEMPLATE(ancestor.twig)-- +{% block container %} +
    {{ block('sub_container') }}
    +{% endblock %} + +{% block sub_container %} +
    sub_container
    +{% endblock %} +--DATA-- +return array() +--EXPECT-- +
    overriden sub_container
    +
    diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test new file mode 100644 index 00000000..59db23d9 --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block.test @@ -0,0 +1,24 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use 'file2.html.twig' with foobar as base_base_foobar %} +{% block foobar %} + {{- block('base_base_foobar') -}} + Content of block (second override) +{% endblock foobar %} +--TEMPLATE(file2.html.twig)-- +{% use 'file1.html.twig' with foobar as base_foobar %} +{% block foobar %} + {{- block('base_foobar') -}} + Content of block (first override) +{% endblock foobar %} +--TEMPLATE(file1.html.twig)-- +{% block foobar -%} + Content of block +{% endblock foobar %} +--DATA-- +return array() +--EXPECT-- +Content of block +Content of block (first override) +Content of block (second override) diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test new file mode 100644 index 00000000..d3f302df --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block2.test @@ -0,0 +1,24 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use 'file2.html.twig'%} +{% block foobar %} + {{- parent() -}} + Content of block (second override) +{% endblock foobar %} +--TEMPLATE(file2.html.twig)-- +{% use 'file1.html.twig' %} +{% block foobar %} + {{- parent() -}} + Content of block (first override) +{% endblock foobar %} +--TEMPLATE(file1.html.twig)-- +{% block foobar -%} + Content of block +{% endblock foobar %} +--DATA-- +return array() +--EXPECT-- +Content of block +Content of block (first override) +Content of block (second override) diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test new file mode 100644 index 00000000..95b55a46 --- /dev/null +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/parent_block3.test @@ -0,0 +1,38 @@ +--TEST-- +"use" tag +--TEMPLATE-- +{% use 'file2.html.twig' %} +{% use 'file1.html.twig' with foo %} +{% block foo %} + {{- parent() -}} + Content of foo (second override) +{% endblock foo %} +{% block bar %} + {{- parent() -}} + Content of bar (second override) +{% endblock bar %} +--TEMPLATE(file2.html.twig)-- +{% use 'file1.html.twig' %} +{% block foo %} + {{- parent() -}} + Content of foo (first override) +{% endblock foo %} +{% block bar %} + {{- parent() -}} + Content of bar (first override) +{% endblock bar %} +--TEMPLATE(file1.html.twig)-- +{% block foo -%} + Content of foo +{% endblock foo %} +{% block bar -%} + Content of bar +{% endblock bar %} +--DATA-- +return array() +--EXPECT-- +Content of foo +Content of foo (first override) +Content of foo (second override) +Content of bar +Content of bar (second override) diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php index ea00b024..70f9b806 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php @@ -157,6 +157,13 @@ public function getFunctions() ); } + public function getTests() + { + return array( + new Twig_SimpleTest('multi word', array($this, 'is_multi_word')), + ); + } + public function §Filter($value) { return "§{$value}§"; @@ -210,6 +217,11 @@ public function br() return '
    '; } + public function is_multi_word($value) + { + return false !== strpos($value, ' '); + } + public function getName() { return 'integration_test'; diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php index ab104f4b..c4d70831 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php @@ -46,7 +46,6 @@ protected function countToken($template, $type, $value = null) $stream = $lexer->tokenize($template); $count = 0; - $tokens = array(); while (!$stream->isEOF()) { $token = $stream->next(); if ($type === $token->getType()) { @@ -114,7 +113,7 @@ public function testLongRaw() $template = '{% raw %}'.str_repeat('*', 100000).'{% endraw %}'; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); // should not throw an exception } @@ -124,7 +123,7 @@ public function testLongVar() $template = '{{ '.str_repeat('x', 100000).' }}'; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); // should not throw an exception } @@ -134,17 +133,13 @@ public function testLongBlock() $template = '{% '.str_repeat('x', 100000).' %}'; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); // should not throw an exception } public function testBigNumbers() { - if ('hiphop' === substr(PHP_VERSION, -6)) { - $this->markTestSkipped('hhvm thinks that the number is actually a T_CONSTANT_ENCAPSED_STRING!'); - } - $template = '{{ 922337203685477580700 }}'; $lexer = new Twig_Lexer(new Twig_Environment()); @@ -216,7 +211,7 @@ public function testStringWithUnterminatedInterpolation() $template = '{{ "bar #{x" }}'; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); } public function testStringWithNestedInterpolations() @@ -281,7 +276,7 @@ public function testUnterminatedVariable() '; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); } /** @@ -300,6 +295,6 @@ public function testUnterminatedBlock() '; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); } } diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php index 9519bdf4..7de268c6 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php @@ -23,7 +23,7 @@ public function testGetProperties() $d2 = new DateTime(); $output = $twig->render('{{ d1.date }}{{ d2.date }}', compact('d1', 'd2')); - if ('hiphop' === substr(PHP_VERSION, -6)) { + if (defined('HHVM_VERSION')) { $this->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)'); } diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php index 62fb0d35..76cf5c63 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/GetAttrTest.php @@ -46,7 +46,7 @@ public function getTests() $attr = new Twig_Node_Expression_Constant('bar', 1); $args = new Twig_Node_Expression_Array(array(), 1); $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ANY_CALL, 1); - $tests[] = array($node, sprintf('%s%s, "bar")', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); + $tests[] = array($node, sprintf('%s%s, "bar", array())', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); $node = new Twig_Node_Expression_GetAttr($expr, $attr, $args, Twig_Template::ARRAY_CALL, 1); $tests[] = array($node, sprintf('%s%s, "bar", array(), "array")', $this->getAttributeGetter(), $this->getVariableGetter('foo'))); diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php index e8aa326b..9afecef8 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/IncludeTest.php @@ -59,8 +59,7 @@ public function getTests() $node = new Twig_Node_Include($expr, null, false, false, 1); $tests[] = array($node, <<env->resolveTemplate(((true) ? ("foo") : ("foo"))); -\$template->display(\$context); +\$this->env->resolveTemplate(((true) ? ("foo") : ("foo")))->display(\$context); EOF ); diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php index 4d2f641b..2a77ac7a 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/MacroTest.php @@ -46,11 +46,11 @@ public function getTests() return array( array($node, <<env->mergeGlobals(array( - "foo" => \$_foo, - "bar" => \$_bar, + "foo" => \$__foo__, + "bar" => \$__bar__, )); \$blocks = array(); diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php index 421f2109..bb9ffb78 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/Node/SandboxedModuleTest.php @@ -84,11 +84,29 @@ protected function doDisplay(array \$context, array \$blocks = array()) protected function checkSecurity() { - \$this->env->getExtension('sandbox')->checkSecurity( - array('upper'), - array('for'), - array('cycle') - ); + \$tags = array(); + \$filters = array(); + \$functions = array(); + + try { + \$this->env->getExtension('sandbox')->checkSecurity( + array('upper'), + array('for'), + array('cycle') + ); + } catch (Twig_Sandbox_SecurityError \$e) { + \$e->setTemplateFile(\$this->getTemplateName()); + + if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) { + \$e->setTemplateLine(\$tags[\$e->getTagName()]); + } elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) { + \$e->setTemplateLine(\$filters[\$e->getFilterName()]); + } elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) { + \$e->setTemplateLine(\$functions[\$e->getFunctionName()]); + } + + throw \$e; + } } public function getTemplateName() @@ -143,11 +161,29 @@ protected function doDisplay(array \$context, array \$blocks = array()) protected function checkSecurity() { - \$this->env->getExtension('sandbox')->checkSecurity( - array('upper'), - array('for'), - array('cycle') - ); + \$tags = array(); + \$filters = array(); + \$functions = array(); + + try { + \$this->env->getExtension('sandbox')->checkSecurity( + array('upper'), + array('for'), + array('cycle') + ); + } catch (Twig_Sandbox_SecurityError \$e) { + \$e->setTemplateFile(\$this->getTemplateName()); + + if (\$e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) { + \$e->setTemplateLine(\$tags[\$e->getTagName()]); + } elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) { + \$e->setTemplateLine(\$filters[\$e->getFilterName()]); + } elseif (\$e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) { + \$e->setTemplateLine(\$functions[\$e->getFunctionName()]); + } + + throw \$e; + } } public function getTemplateName() diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php index aa8dafd4..e2f84eee 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/TemplateTest.php @@ -28,6 +28,7 @@ public function testGetAttributeExceptions($template, $message, $useExt) $context = array( 'string' => 'foo', + 'empty_array' => array(), 'array' => array('foo' => 'foo'), 'array_access' => new Twig_TemplateArrayAccessObject(), 'magic_exception' => new Twig_TemplateMagicPropertyObjectWithException(), @@ -46,10 +47,12 @@ public function getAttributeExceptions() { $tests = array( array('{{ string["a"] }}', 'Impossible to access a key ("a") on a string variable ("foo") in "%s" at line 1', false), + array('{{ empty_array["a"] }}', 'Key "a" does not exist as the array is empty in "%s" at line 1', false), array('{{ array["a"] }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1', false), array('{{ array_access["a"] }}', 'Key "a" in object with ArrayAccess of class "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false), array('{{ string.a }}', 'Impossible to access an attribute ("a") on a string variable ("foo") in "%s" at line 1', false), array('{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1', false), + array('{{ empty_array.a }}', 'Key "a" does not exist as the array is empty in "%s" at line 1', false), array('{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1', false), array('{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1', false), array('{{ array_access.a }}', 'Method "a" for object "Twig_TemplateArrayAccessObject" does not exist in "%s" at line 1', false), @@ -368,7 +371,7 @@ public function getGetAttributeTests() $tests = array_merge($tests, array( array(false, null, 42, 'a', array(), $anyType, false, 'Impossible to access an attribute ("a") on a integer variable ("42")'), array(false, null, "string", 'a', array(), $anyType, false, 'Impossible to access an attribute ("a") on a string variable ("string")'), - array(false, null, array(), 'a', array(), $anyType, false, 'Key "a" for array with keys "" does not exist'), + array(false, null, array(), 'a', array(), $anyType, false, 'Key "a" does not exist as the array is empty'), )); // add twig_template_get_attributes tests @@ -585,7 +588,6 @@ public function getZero() public function getNull() { - return null; } public function isBar() diff --git a/drupal/core/vendor/twig/twig/test/Twig/Tests/escapingTest.php b/drupal/core/vendor/twig/twig/test/Twig/Tests/escapingTest.php index 34d2a2db..d581315a 100644 --- a/drupal/core/vendor/twig/twig/test/Twig/Tests/escapingTest.php +++ b/drupal/core/vendor/twig/twig/test/Twig/Tests/escapingTest.php @@ -227,7 +227,7 @@ public function testUnicodeCodepointConversionToUtf8() /** * Convert a Unicode Codepoint to a literal UTF-8 character. * - * @param int Unicode codepoint in hex notation + * @param int $codepoint Unicode codepoint in hex notation * @return string UTF-8 literal string */ protected function codepointToUtf8($codepoint) @@ -301,7 +301,7 @@ public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges() public function testCssEscapingEscapesOwaspRecommendedRanges() { - $immune = array(); // CSS has no exceptions to escaping ranges + // CSS has no exceptions to escaping ranges for ($chr=0; $chr < 0xFF; $chr++) { if ($chr >= 0x30 && $chr <= 0x39 || $chr >= 0x41 && $chr <= 0x5A diff --git a/drupal/themes/contrib/readme.txt b/drupal/themes/contrib/readme.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/drupal/themes/custom/readme.txt b/drupal/themes/custom/readme.txt deleted file mode 100644 index e69de29b..00000000 From f36c465d065f010f878a8e0a0681ec08b96f69fd Mon Sep 17 00:00:00 2001 From: Artyom Miroshnik Date: Sat, 1 Nov 2014 17:36:05 +0200 Subject: [PATCH 2/2] Add theme readme.txt file --- drupal/themes/custom/README.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 drupal/themes/custom/README.txt diff --git a/drupal/themes/custom/README.txt b/drupal/themes/custom/README.txt new file mode 100644 index 00000000..e69de29b