Compare commits

...
83 Commits
Author SHA1 Message Date
Bachir Soussi Chiadmi 1eb61fe020 fixed js bug Drupal.ajax undefined, fixe #81 2018-01-11 17:09:04 +01:00
Bachir Soussi Chiadmi a11650f2b4 fixed header height 2018-01-02 12:20:33 +01:00
Bachir Soussi Chiadmi f09e9563b2 Merge branch 'advanced-search' 2018-01-02 12:13:16 +01:00
Bachir Soussi Chiadmi c914e7e348 fixed header height 2018-01-02 12:11:58 +01:00
Bachir Soussi Chiadmi b5f3769416 new browser prefix ?? 2018-01-02 12:02:43 +01:00
Bachir Soussi Chiadmi 3133fd480b updated materio_personal_notes feature 2017-12-04 14:05:55 +01:00
Bachir Soussi Chiadmi b20732f9a8 personal note display for viewmode cardfull 2017-11-29 17:14:01 +01:00
Bachir Soussi Chiadmi 8b486ffc60 personal-notes display for card medium and cardfull is ok 2017-11-29 16:40:20 +01:00
Bachir Soussi Chiadmi 7d5bedcb0c personnale notes front ajax is working, remains to improve the display, do it like liked materiaux 2017-11-28 17:02:45 +01:00
Bachir Soussi Chiadmi 268c8b619b added link with query for target node id and prepopulated node form 2017-11-27 15:21:32 +01:00
Bachir Soussi Chiadmi bbeb5f01ac created materio personal notes feature 2017-11-27 12:28:46 +01:00
Bachir Soussi Chiadmi bd1a1de792 first commit of materio personal notes module : just displaying the icon button for now 2017-11-27 12:20:08 +01:00
Bachir Soussi Chiadmi af9630060a improved display of advanced search 2017-11-21 10:44:24 +01:00
Bachir Soussi Chiadmi 383ca8b173 improved display of advanced search 2017-11-21 10:38:27 +01:00
Bachir Soussi Chiadmi afc654c704 improved throbber display in advenced search 2017-11-21 09:58:45 +01:00
Bachir Soussi Chiadmi 106129c27c refined advanced search form display to be more explicite 2017-11-20 17:52:39 +01:00
Bachir Soussi Chiadmi 81810c5af4 fixed loading indicator for both search forms 2017-11-15 13:53:48 +01:00
Bachir Soussi Chiadmi 12c076c349 some comments cleaning 2017-11-07 20:00:55 +01:00
Bachir Soussi Chiadmi 9d45086951 fixed infinite scroll with advenced search 2017-11-06 16:45:40 +01:00
Bachir Soussi Chiadmi 8777adbe2e restored ajax search for filtered search 2017-11-06 16:28:05 +01:00
Bachir Soussi Chiadmi 82a22114d3 fixed one term search bug: no results 2017-11-06 16:20:03 +01:00
Bachir Soussi Chiadmi 098f083b8d fixed page title and performance display for filtered search by tids : displa term names instead of tids 2017-11-06 12:10:56 +01:00
Bachir Soussi Chiadmi e8586eb4da Sorl search based on term tid and scored is functional 2017-11-06 11:47:33 +01:00
Bachir Soussi Chiadmi 1e1a762b9b added settings for advanced search vocabulary choice and hidden terms 2017-10-31 12:47:28 +01:00
Bachir Soussi Chiadmi e9146c29ce handled ajax call for advanced search, handled permissions for advanced form display 2017-10-31 11:08:13 +01:00
Bachir Soussi Chiadmi 042e111bc4 created proper solr call for filtered search 2017-10-30 14:48:23 +01:00
Bachir Soussi Chiadmi 2f56697bb7 tabs interface for search forms is ready 2017-10-30 12:07:21 +01:00
Bachir Soussi Chiadmi 55700094a2 started to mix search form and advanced search form into one unique block, the idea is to switch to one from an other with tabs 2017-10-25 17:01:00 +02:00
Bachir Soussi Chiadmi 9bfbd861ca bugfix 2017-10-11 17:05:20 +02:00
Bachir Soussi Chiadmi 5f26b3e160 bugfix 2017-10-11 14:44:55 +02:00
Bachir Soussi Chiadmi 1b9f8e3ab4 first test of launch a research, read the url args and prepopulate the form, ajax add and remove filter are not working anymore 2017-10-10 16:51:22 +02:00
Bachir Soussi Chiadmi c90cfa63e4 advanced search : all ajax form behaviours are working 2017-10-10 12:43:45 +02:00
Bachir Soussi Chiadmi 7bc3c13ad6 fixed tode module php notice 2017-10-09 16:38:53 +02:00
Bachir Soussi Chiadmi 1ee4e95491 advanced search ajax callback for dynamic form building are almost working + started css 2017-10-09 16:38:18 +02:00
Bachir Soussi Chiadmi bf5f1a63ff updated gulp and bower files 2017-10-09 16:35:06 +02:00
Bachir Soussi Chiadmi 38648c1670 advenced search block is in place, remains to build the whole logic 2017-10-07 20:29:58 +02:00
Bachir Soussi Chiadmi 1d4fcf0d89 Merge branch 'master' into advanced-search 2017-10-07 20:05:52 +02:00
Bachir Soussi Chiadmi 73417de740 updated all features 2017-10-07 20:04:02 +02:00
Bachir Soussi Chiadmi 0edc6fd23a started advenced serch form block 2017-10-07 19:49:22 +02:00
Bachir Soussi Chiadmi abb106d7c2 optmized industriels esport 2017-09-18 16:04:53 +02:00
Bachir Soussi Chiadmi be2da7afe0 added the right export script for industriels users (not companies) 2017-09-18 15:46:40 +02:00
Bachir Soussi Chiadmi 243f5b689c fixed advanced search first rquest bug (bois+translucide) fix #31 2017-09-16 16:52:04 +02:00
Bachir Soussi Chiadmi 301d403887 fixed contactops export bug 2017-09-16 16:14:23 +02:00
Bachir Soussi Chiadmi 08e5ed7202 removed personnal script sync_uplaods from git tree 2017-09-16 16:06:39 +02:00
Bachir Soussi Chiadmi 4ca87255ab added export companies as csv file function 2017-09-16 16:03:43 +02:00
Bachir Soussi Chiadmi 4b2ab455c9 first draft of materio_contactops module : shows company taged materials for a user contactop 2017-07-25 22:32:52 +02:00
Bachir Soussi Chiadmi b9c809d2c7 updated webform, uuid, synonyms modules 2017-07-25 19:28:08 +02:00
Bachir Soussi Chiadmi ed483507e5 security update for smtp module 2017-07-25 19:17:08 +02:00
Bachir Soussi Chiadmi 8feebe3d1e repatched core with https://www.drupal.org/node/1754162#comment-9737269 2017-07-25 19:13:30 +02:00
Bachir Soussi Chiadmi 5c7f02554f updated core to 7.56, secutity update 2017-07-25 19:10:33 +02:00
Bachir Soussi Chiadmi 58161d2b57 fixed render function wrongly removed from industriel newsletter template 2017-07-06 17:46:22 +02:00
Bachir Soussi Chiadmi ce192b080e removed all html from industriel news template 2017-07-06 17:12:45 +02:00
Bachir Soussi Chiadmi aafe1c5460 added new template for industriels newsletter 2017-07-05 22:27:45 +02:00
Bachir Soussi Chiadmi 8539255353 optimzed some php code in admin views 2017-07-05 21:50:49 +02:00
Bachir Soussi Chiadmi 5706aea93b added some missing navigation menu items in admin feature 2017-07-05 21:39:11 +02:00
Bachir Soussi Chiadmi 9369b73118 added new light industriel view and indus. export list for simplenewsletter massive subscription 2017-07-05 21:29:03 +02:00
Bachir Soussi Chiadmi ab9f1d3cc4 added template for industriels simplenewletter 2017-07-05 18:34:56 +02:00
Bachir Soussi Chiadmi 8d0f110c50 fixe contact ops materiaux access, fixe #21 2017-07-04 20:56:25 +02:00
Bachir Soussi Chiadmi cedbce376b updated features 2017-07-04 20:02:56 +02:00
Bachir Soussi Chiadmi 6e2a36fe0c front : imporved location layout in fullcards
fix #6
2017-05-30 12:09:59 +02:00
Bachir Soussi Chiadmi d9f3677b98 applied security views modules updates
didn't repatched view module, keep it in mind, may be necessary
2017-05-24 19:35:05 +02:00
Bachir Soussi Chiadmi 5b82dfb691 repatched core with https://www.drupal.org/node/1754162#comment-9737269 2017-05-24 19:31:16 +02:00
Bachir Soussi Chiadmi 728f8e6d31 updated core to 7.54 2017-05-24 19:27:14 +02:00
Bachir Soussi Chiadmi 9acef9d37e updated ctools, panels, date, diff 2017-05-24 19:22:50 +02:00
Bachir Soussi Chiadmi 542ac42fca updated views_send views_bulk_update views_data_export 2017-05-24 19:09:09 +02:00
Bachir Soussi Chiadmi dbd7b88639 applied security contrib modules updates
didn't repatched view module, keep it in mind, may be necessary
2017-05-24 19:02:39 +02:00
Bachir Soussi Chiadmi 28c7a0965a updated search_api modules as indexation was not working localy
had to be tested in production
2017-05-24 18:57:04 +02:00
Bachir Soussi Chiadmi b5d76ec5e6 fixed home simplenews picture match 2017-05-24 15:28:00 +02:00
Bachir Soussi Chiadmi 83cbcefff9 re-added temporarly translate_perms 2016-12-20 12:22:42 +01:00
Bachir Soussi Chiadmi 0d940c99db updated features 2016-12-20 01:15:04 +01:00
Bachir Soussi Chiadmi 2334eb741b updated features for precedent commit 2016-12-20 00:18:28 +01:00
Bachir Soussi Chiadmi ddc28956c4 added string and field translation table for translators 2016-12-20 00:17:50 +01:00
Bachir Soussi Chiadmi abbcb19838 removed i18n_access from tree 2016-12-19 19:08:09 +01:00
Bachir Soussi Chiadmi 024afdfd3d Merge branch 'master' into translators 2016-12-19 18:15:12 +01:00
Bachir Soussi Chiadmi b9f2b16d24 modules security update
views_send, elysia_cron
2016-12-19 18:10:13 +01:00
Bachir Soussi Chiadmi 3f9ba49255 repatched core user module
language aware tokens
https://www.drupal.org/node/1754162
2016-12-19 17:06:32 +01:00
Bachir Soussi Chiadmi 7563311a19 handled translation links from node edit 2016-12-19 00:39:20 +01:00
Bachir Soussi Chiadmi 669341f1d6 added forgoten materio_translators.install file 2016-12-13 13:01:55 +01:00
Bachir Soussi Chiadmi e24eec56e7 materio translator : Node overview DONE 2016-12-13 12:52:01 +01:00
Bachir Soussi Chiadmi eba58a57bf added the second patch to i18n_access BUT WE WONT USE THIS MODULE! 2016-12-13 12:50:01 +01:00
Bachir Soussi Chiadmi e190f5f47d improved original language on node form display 2016-12-13 12:49:02 +01:00
Bachir Soussi Chiadmi ec6f23e149 patched i18n_access module
https://www.drupal.org/node/2298475#comment-9419835
2016-12-12 16:01:17 +01:00
Bachir Soussi Chiadmi fdd842fe19 rolled back i18n_access to last dev version 2016-12-12 15:58:28 +01:00
997 changed files with 52773 additions and 14698 deletions
+3
View File
@@ -24,3 +24,6 @@ typescript
.directory .directory
*.old_patched *.old_patched
sync_uploads
+39
View File
@@ -1,4 +1,43 @@
Drupal 7.56, 2017-06-21
-----------------------
- Fixed security issues (access bypass). See SA-CORE-2017-003.
Drupal 7.55, 2017-06-07
-----------------------
- Fixed incompatibility with PHP versions 7.0.19 and 7.1.5 due to duplicate
DATE_RFC7231 definition.
- Made Drupal core pass all automated tests on PHP 7.1.
- Allowed services such as Let's Encrypt to work with Drupal on Apache, by
making Drupal's .htaccess file allow access to the .well-known directory
defined by RFC 5785.
- Made new Drupal sites work correctly on Apache 2.4 when the mod_access_compat
Apache module is disabled.
- Fixed Drupal's URL-generating functions to always encode '[' and ']' so that
the URLs will pass HTML5 validation.
- Various additional bug fixes.
- Various API documentation improvements.
- Additional automated test coverage.
Drupal 7.54, 2017-02-01
-----------------------
- Modules are now able to define theme engines (API addition:
https://www.drupal.org/node/2826480).
- Logging of searches can now be disabled (new option in the administrative
interface).
- Added menu tree render structure to (pre-)process hooks for theme_menu_tree()
(API addition: https://www.drupal.org/node/2827134).
- Added new function for determining whether an HTTPS request is being served
(API addition: https://www.drupal.org/node/2824590).
- Fixed incorrect default value for short and medium date formats on the date
type configuration page.
- File validation error message is now removed after subsequent upload of valid
file.
- Numerous bug fixes.
- Numerous API documentation improvements.
- Additional performance improvements.
- Additional automated test coverage.
Drupal 7.53, 2016-12-07 Drupal 7.53, 2016-12-07
----------------------- -----------------------
- Fixed drag and drop support on newer Chrome/IE 11+ versions after 7.51 update - Fixed drag and drop support on newer Chrome/IE 11+ versions after 7.51 update
+18 -3
View File
@@ -8,7 +8,7 @@
/** /**
* The current system version. * The current system version.
*/ */
define('VERSION', '7.53'); define('VERSION', '7.56');
/** /**
* Core API compatibility. * Core API compatibility.
@@ -254,8 +254,13 @@ define('DRUPAL_PHP_FUNCTION_PATTERN', '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
* http://tools.ietf.org/html/rfc7231#section-7.1.1.1 * http://tools.ietf.org/html/rfc7231#section-7.1.1.1
* *
* Example: Sun, 06 Nov 1994 08:49:37 GMT * Example: Sun, 06 Nov 1994 08:49:37 GMT
*
* This constant was introduced in PHP 7.0.19 and PHP 7.1.5 but needs to be
* defined by Drupal for earlier PHP versions.
*/ */
define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T'); if (!defined('DATE_RFC7231')) {
define('DATE_RFC7231', 'D, d M Y H:i:s \G\M\T');
}
/** /**
* Provides a caching wrapper to be used in place of large array structures. * Provides a caching wrapper to be used in place of large array structures.
@@ -718,6 +723,16 @@ function drupal_valid_http_host($host) {
&& preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host); && preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host);
} }
/**
* Checks whether an HTTPS request is being served.
*
* @return bool
* TRUE if the request is HTTPS, FALSE otherwise.
*/
function drupal_is_https() {
return isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
}
/** /**
* Sets the base URL, cookie domain, and session name from configuration. * Sets the base URL, cookie domain, and session name from configuration.
*/ */
@@ -731,7 +746,7 @@ function drupal_settings_initialize() {
if (file_exists(DRUPAL_ROOT . '/' . conf_path() . '/settings.php')) { if (file_exists(DRUPAL_ROOT . '/' . conf_path() . '/settings.php')) {
include_once DRUPAL_ROOT . '/' . conf_path() . '/settings.php'; include_once DRUPAL_ROOT . '/' . conf_path() . '/settings.php';
} }
$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on'; $is_https = drupal_is_https();
if (isset($base_url)) { if (isset($base_url)) {
// Parse fixed base URL from settings.php. // Parse fixed base URL from settings.php.
+12 -2
View File
@@ -122,7 +122,12 @@ function cache_get_multiple(array &$cids, $bin = 'cache') {
* the administrator panel. * the administrator panel.
* - cache_path: Stores the system paths that have an alias. * - cache_path: Stores the system paths that have an alias.
* @param $expire * @param $expire
* (optional) One of the following values: * (optional) Controls the maximum lifetime of this cache entry. Note that
* caches might be subject to clearing at any time, so this setting does not
* guarantee a minimum lifetime. With this in mind, the cache should not be
* used for data that must be kept during a cache clear, like sessions.
*
* Use one of the following values:
* - CACHE_PERMANENT: Indicates that the item should never be removed unless * - CACHE_PERMANENT: Indicates that the item should never be removed unless
* explicitly told to using cache_clear_all() with a cache ID. * explicitly told to using cache_clear_all() with a cache ID.
* - CACHE_TEMPORARY: Indicates that the item should be removed at the next * - CACHE_TEMPORARY: Indicates that the item should be removed at the next
@@ -262,7 +267,12 @@ interface DrupalCacheInterface {
* 1MB in size to be stored by default. When caching large arrays or * 1MB in size to be stored by default. When caching large arrays or
* similar, take care to ensure $data does not exceed this size. * similar, take care to ensure $data does not exceed this size.
* @param $expire * @param $expire
* (optional) One of the following values: * (optional) Controls the maximum lifetime of this cache entry. Note that
* caches might be subject to clearing at any time, so this setting does not
* guarantee a minimum lifetime. With this in mind, the cache should not be
* used for data that must be kept during a cache clear, like sessions.
*
* Use one of the following values:
* - CACHE_PERMANENT: Indicates that the item should never be removed unless * - CACHE_PERMANENT: Indicates that the item should never be removed unless
* explicitly told to using cache_clear_all() with a cache ID. * explicitly told to using cache_clear_all() with a cache ID.
* - CACHE_TEMPORARY: Indicates that the item should be removed at the next * - CACHE_TEMPORARY: Indicates that the item should be removed at the next
+10 -3
View File
@@ -487,7 +487,7 @@ function drupal_http_build_query(array $query, $parent = '') {
$params = array(); $params = array();
foreach ($query as $key => $value) { foreach ($query as $key => $value) {
$key = ($parent ? $parent . '[' . rawurlencode($key) . ']' : rawurlencode($key)); $key = $parent ? $parent . rawurlencode('[' . $key . ']') : rawurlencode($key);
// Recurse into children. // Recurse into children.
if (is_array($value)) { if (is_array($value)) {
@@ -3986,7 +3986,11 @@ function drupal_html_id($id) {
// be merged with content already on the base page. The HTML IDs must be // be merged with content already on the base page. The HTML IDs must be
// unique for the fully merged content. Therefore, initialize $seen_ids to // unique for the fully merged content. Therefore, initialize $seen_ids to
// take into account IDs that are already in use on the base page. // take into account IDs that are already in use on the base page.
$seen_ids_init = &drupal_static(__FUNCTION__ . ':init'); static $drupal_static_fast;
if (!isset($drupal_static_fast['seen_ids_init'])) {
$drupal_static_fast['seen_ids_init'] = &drupal_static(__FUNCTION__ . ':init');
}
$seen_ids_init = &$drupal_static_fast['seen_ids_init'];
if (!isset($seen_ids_init)) { if (!isset($seen_ids_init)) {
// Ideally, Drupal would provide an API to persist state information about // Ideally, Drupal would provide an API to persist state information about
// prior page requests in the database, and we'd be able to add this // prior page requests in the database, and we'd be able to add this
@@ -4031,7 +4035,10 @@ function drupal_html_id($id) {
} }
} }
} }
$seen_ids = &drupal_static(__FUNCTION__, $seen_ids_init); if (!isset($drupal_static_fast['seen_ids'])) {
$drupal_static_fast['seen_ids'] = &drupal_static(__FUNCTION__, $seen_ids_init);
}
$seen_ids = &$drupal_static_fast['seen_ids'];
$id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => '')); $id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
+6 -6
View File
@@ -11,7 +11,7 @@
*/ */
/** /**
* The name by which to obtain a lock for retrive the next insert id. * The name by which to obtain a lock for retrieving the next insert id.
*/ */
define('POSTGRESQL_NEXTID_LOCK', 1000); define('POSTGRESQL_NEXTID_LOCK', 1000);
@@ -55,7 +55,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
$connection_options['pdo'] += array( $connection_options['pdo'] += array(
// Prepared statements are most effective for performance when queries // Prepared statements are most effective for performance when queries
// are recycled (used several times). However, if they are not re-used, // are recycled (used several times). However, if they are not re-used,
// prepared statements become ineffecient. Since most of Drupal's // prepared statements become inefficient. Since most of Drupal's
// prepared queries are not re-used, it should be faster to emulate // prepared queries are not re-used, it should be faster to emulate
// the preparation than to actually ready statements for re-use. If in // the preparation than to actually ready statements for re-use. If in
// doubt, reset to FALSE and measure performance. // doubt, reset to FALSE and measure performance.
@@ -175,14 +175,14 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
} }
/** /**
* Retrive a the next id in a sequence. * Retrieve the next id in a sequence.
* *
* PostgreSQL has built in sequences. We'll use these instead of inserting * PostgreSQL has built in sequences. We'll use these instead of inserting
* and updating a sequences table. * and updating a sequences table.
*/ */
public function nextId($existing = 0) { public function nextId($existing = 0) {
// Retrive the name of the sequence. This information cannot be cached // Retrieve the name of the sequence. This information cannot be cached
// because the prefix may change, for example, like it does in simpletests. // because the prefix may change, for example, like it does in simpletests.
$sequence_name = $this->makeSequenceName('sequences', 'value'); $sequence_name = $this->makeSequenceName('sequences', 'value');
@@ -194,7 +194,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
} }
// PostgreSQL advisory locks are simply locks to be used by an // PostgreSQL advisory locks are simply locks to be used by an
// application such as Drupal. This will prevent other Drupal proccesses // application such as Drupal. This will prevent other Drupal processes
// from altering the sequence while we are. // from altering the sequence while we are.
$this->query("SELECT pg_advisory_lock(" . POSTGRESQL_NEXTID_LOCK . ")"); $this->query("SELECT pg_advisory_lock(" . POSTGRESQL_NEXTID_LOCK . ")");
@@ -209,7 +209,7 @@ class DatabaseConnection_pgsql extends DatabaseConnection {
// Reset the sequence to a higher value than the existing id. // Reset the sequence to a higher value than the existing id.
$this->query("ALTER SEQUENCE " . $sequence_name . " RESTART WITH " . ($existing + 1)); $this->query("ALTER SEQUENCE " . $sequence_name . " RESTART WITH " . ($existing + 1));
// Retrive the next id. We know this will be as high as we want it. // Retrieve the next id. We know this will be as high as we want it.
$id = $this->query("SELECT nextval('" . $sequence_name . "')")->fetchField(); $id = $this->query("SELECT nextval('" . $sequence_name . "')")->fetchField();
$this->query("SELECT pg_advisory_unlock(" . POSTGRESQL_NEXTID_LOCK . ")"); $this->query("SELECT pg_advisory_unlock(" . POSTGRESQL_NEXTID_LOCK . ")");
+1 -1
View File
@@ -165,7 +165,7 @@ class DatabaseTasks_pgsql extends DatabaseTasks {
LANGUAGE \'sql\'' LANGUAGE \'sql\''
); );
// Using || to concatenate in Drupal is not recommeneded because there are // Using || to concatenate in Drupal is not recommended because there are
// database drivers for Drupal that do not support the syntax, however // database drivers for Drupal that do not support the syntax, however
// they do support CONCAT(item1, item2) which we can replicate in // they do support CONCAT(item1, item2) which we can replicate in
// PostgreSQL. PostgreSQL requires the function to be defined for each // PostgreSQL. PostgreSQL requires the function to be defined for each
+2 -2
View File
@@ -80,7 +80,7 @@ class SelectQuery_pgsql extends SelectQuery {
} }
// If a table loads all fields, it can not be added again. It would // If a table loads all fields, it can not be added again. It would
// result in an ambigious alias error because that field would be loaded // result in an ambiguous alias error because that field would be loaded
// twice: Once through table_alias.* and once directly. If the field // twice: Once through table_alias.* and once directly. If the field
// actually belongs to a different table, it must be added manually. // actually belongs to a different table, it must be added manually.
foreach ($this->tables as $table) { foreach ($this->tables as $table) {
@@ -90,7 +90,7 @@ class SelectQuery_pgsql extends SelectQuery {
} }
// If $field contains an characters which are not allowed in a field name // If $field contains an characters which are not allowed in a field name
// it is considered an expression, these can't be handeld automatically // it is considered an expression, these can't be handled automatically
// either. // either.
if ($this->connection->escapeField($field) != $field) { if ($this->connection->escapeField($field) != $field) {
return $return; return $return;
+3 -3
View File
@@ -845,8 +845,8 @@ class DeleteQuery extends Query implements QueryConditionInterface {
/** /**
* Executes the DELETE query. * Executes the DELETE query.
* *
* @return * @return int
* The return value is dependent on the database connection. * The number of rows affected by the delete query.
*/ */
public function execute() { public function execute() {
$values = array(); $values = array();
@@ -1242,7 +1242,7 @@ class UpdateQuery extends Query implements QueryConditionInterface {
* MergeQuery::updateFields() and MergeQuery::insertFields() needs to be called * MergeQuery::updateFields() and MergeQuery::insertFields() needs to be called
* instead. MergeQuery::fields() can also be called which calls both of these * instead. MergeQuery::fields() can also be called which calls both of these
* methods as the common case is to use the same column-value pairs for both * methods as the common case is to use the same column-value pairs for both
* INSERT and UPDATE. However, this is not mandatory. Another convinient * INSERT and UPDATE. However, this is not mandatory. Another convenient
* wrapper is MergeQuery::key() which adds the same column-value pairs to the * wrapper is MergeQuery::key() which adds the same column-value pairs to the
* condition and the INSERT query part. * condition and the INSERT query part.
* *
+4 -1
View File
@@ -164,6 +164,9 @@ require_once dirname(__FILE__) . '/query.inc';
* @see drupal_install_schema() * @see drupal_install_schema()
*/ */
/**
* Base class for database schema definitions.
*/
abstract class DatabaseSchema implements QueryPlaceholderInterface { abstract class DatabaseSchema implements QueryPlaceholderInterface {
protected $connection; protected $connection;
@@ -291,7 +294,7 @@ abstract class DatabaseSchema implements QueryPlaceholderInterface {
protected function buildTableNameCondition($table_name, $operator = '=', $add_prefix = TRUE) { protected function buildTableNameCondition($table_name, $operator = '=', $add_prefix = TRUE) {
$info = $this->connection->getConnectionOptions(); $info = $this->connection->getConnectionOptions();
// Retrive the table name and schema // Retrieve the table name and schema
$table_info = $this->getPrefixInfo($table_name, $add_prefix); $table_info = $this->getPrefixInfo($table_name, $add_prefix);
$condition = new DatabaseCondition('AND'); $condition = new DatabaseCondition('AND');
+6 -7
View File
@@ -99,16 +99,15 @@ class UpdateQuery_sqlite extends UpdateQuery {
/** /**
* SQLite specific implementation of DeleteQuery. * SQLite specific implementation of DeleteQuery.
*
* When the WHERE is omitted from a DELETE statement and the table being deleted
* has no triggers, SQLite uses an optimization to erase the entire table content
* without having to visit each row of the table individually.
*
* Prior to SQLite 3.6.5, SQLite does not return the actual number of rows deleted
* by that optimized "truncate" optimization.
*/ */
class DeleteQuery_sqlite extends DeleteQuery { class DeleteQuery_sqlite extends DeleteQuery {
public function execute() { public function execute() {
// When the WHERE is omitted from a DELETE statement and the table being
// deleted has no triggers, SQLite uses an optimization to erase the entire
// table content without having to visit each row of the table individually.
// Prior to SQLite 3.6.5, SQLite does not return the actual number of rows
// deleted by that optimized "truncate" optimization. But we want to return
// the number of rows affected, so we calculate it directly.
if (!count($this->condition)) { if (!count($this->condition)) {
$total_rows = $this->connection->query('SELECT COUNT(*) FROM {' . $this->connection->escapeTable($this->table) . '}')->fetchField(); $total_rows = $this->connection->query('SELECT COUNT(*) FROM {' . $this->connection->escapeTable($this->table) . '}')->fetchField();
parent::execute(); parent::execute();
+1 -1
View File
@@ -244,7 +244,7 @@ class DatabaseSchema_sqlite extends DatabaseSchema {
// database. So the syntax '...RENAME TO database.table' would fail. // database. So the syntax '...RENAME TO database.table' would fail.
// So we must determine the full table name here rather than surrounding // So we must determine the full table name here rather than surrounding
// the table with curly braces incase the db_prefix contains a reference // the table with curly braces incase the db_prefix contains a reference
// to a database outside of our existsing database. // to a database outside of our existing database.
$info = $this->getPrefixInfo($new_name); $info = $this->getPrefixInfo($new_name);
$this->connection->query('ALTER TABLE {' . $table . '} RENAME TO ' . $info['table']); $this->connection->query('ALTER TABLE {' . $table . '} RENAME TO ' . $info['table']);
+10 -10
View File
@@ -12,11 +12,6 @@ function system_default_date_formats() {
$formats = array(); $formats = array();
// Short date formats. // Short date formats.
$formats[] = array(
'type' => 'short',
'format' => 'Y-m-d H:i',
'locales' => array(),
);
$formats[] = array( $formats[] = array(
'type' => 'short', 'type' => 'short',
'format' => 'm/d/Y - H:i', 'format' => 'm/d/Y - H:i',
@@ -37,6 +32,11 @@ function system_default_date_formats() {
'format' => 'd.m.Y - H:i', 'format' => 'd.m.Y - H:i',
'locales' => array('de-ch', 'de-de', 'de-lu', 'fi-fi', 'fr-ch', 'is-is', 'pl-pl', 'ro-ro', 'ru-ru'), 'locales' => array('de-ch', 'de-de', 'de-lu', 'fi-fi', 'fr-ch', 'is-is', 'pl-pl', 'ro-ro', 'ru-ru'),
); );
$formats[] = array(
'type' => 'short',
'format' => 'Y-m-d H:i',
'locales' => array(),
);
$formats[] = array( $formats[] = array(
'type' => 'short', 'type' => 'short',
'format' => 'm/d/Y - g:ia', 'format' => 'm/d/Y - g:ia',
@@ -84,11 +84,6 @@ function system_default_date_formats() {
); );
// Medium date formats. // Medium date formats.
$formats[] = array(
'type' => 'medium',
'format' => 'D, Y-m-d H:i',
'locales' => array(),
);
$formats[] = array( $formats[] = array(
'type' => 'medium', 'type' => 'medium',
'format' => 'D, m/d/Y - H:i', 'format' => 'D, m/d/Y - H:i',
@@ -104,6 +99,11 @@ function system_default_date_formats() {
'format' => 'D, Y/m/d - H:i', 'format' => 'D, Y/m/d - H:i',
'locales' => array('en-ca', 'fr-ca', 'no-no', 'sv-se'), 'locales' => array('en-ca', 'fr-ca', 'no-no', 'sv-se'),
); );
$formats[] = array(
'type' => 'medium',
'format' => 'D, Y-m-d H:i',
'locales' => array(),
);
$formats[] = array( $formats[] = array(
'type' => 'medium', 'type' => 'medium',
'format' => 'F j, Y - H:i', 'format' => 'F j, Y - H:i',
+3 -3
View File
@@ -66,7 +66,7 @@ function _drupal_error_handler_real($error_level, $message, $filename, $line, $c
_drupal_log_error(array( _drupal_log_error(array(
'%type' => isset($types[$error_level]) ? $severity_msg : 'Unknown error', '%type' => isset($types[$error_level]) ? $severity_msg : 'Unknown error',
// The standard PHP error handler considers that the error messages // The standard PHP error handler considers that the error messages
// are HTML. We mimick this behavior here. // are HTML. We mimic this behavior here.
'!message' => filter_xss_admin($message), '!message' => filter_xss_admin($message),
'%function' => $caller['function'], '%function' => $caller['function'],
'%file' => $caller['file'], '%file' => $caller['file'],
@@ -114,7 +114,7 @@ function _drupal_decode_exception($exception) {
return array( return array(
'%type' => get_class($exception), '%type' => get_class($exception),
// The standard PHP exception handler considers that the exception message // The standard PHP exception handler considers that the exception message
// is plain-text. We mimick this behavior here. // is plain-text. We mimic this behavior here.
'!message' => check_plain($message), '!message' => check_plain($message),
'%function' => $caller['function'], '%function' => $caller['function'],
'%file' => $caller['file'], '%file' => $caller['file'],
@@ -233,7 +233,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
} }
else { else {
// Display the message if the current error reporting level allows this type // Display the message if the current error reporting level allows this type
// of message to be displayed, and unconditionnaly in update.php. // of message to be displayed, and unconditionally in update.php.
if (error_displayable($error)) { if (error_displayable($error)) {
$class = 'error'; $class = 'error';
+26 -3
View File
@@ -535,7 +535,18 @@ SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
EOF; EOF;
if ($private) { if ($private) {
$lines = "Deny from all\n\n" . $lines; $lines = <<<EOF
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
EOF
. "\n\n" . $lines;
} }
return $lines; return $lines;
@@ -889,7 +900,6 @@ function file_valid_uri($uri) {
*/ */
function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXISTS_RENAME) { function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXISTS_RENAME) {
$original_source = $source; $original_source = $source;
$original_destination = $destination;
// Assert that the source file actually exists. // Assert that the source file actually exists.
if (!file_exists($source)) { if (!file_exists($source)) {
@@ -1604,6 +1614,20 @@ function file_save_upload($form_field_name, $validators = array(), $destination
// If we made it this far it's safe to record this file in the database. // If we made it this far it's safe to record this file in the database.
if ($file = file_save($file)) { if ($file = file_save($file)) {
// Track non-public files in the session if they were uploaded by an
// anonymous user. This allows modules such as the File module to only
// grant view access to the specific anonymous user who uploaded the file.
// See file_file_download().
// The 'file_public_schema' variable is used to allow other publicly
// accessible file schemes to be treated the same as the public:// scheme
// provided by Drupal core and to avoid adding unnecessary data to the
// session (and the resulting bypass of the page cache) in those cases. For
// security reasons, only schemes that are completely publicly accessible,
// with no download restrictions, should be added to this variable. See
// file_managed_file_value().
if (!$user->uid && !in_array($destination_scheme, variable_get('file_public_schema', array('public')))) {
$_SESSION['anonymous_allowed_file_ids'][$file->fid] = $file->fid;
}
// Add file to the cache. // Add file to the cache.
$upload_cache[$form_field_name] = $file; $upload_cache[$form_field_name] = $file;
return $file; return $file;
@@ -2553,7 +2577,6 @@ function file_directory_temp() {
* An associative array of headers, as expected by file_transfer(). * An associative array of headers, as expected by file_transfer().
*/ */
function file_get_content_headers($file) { function file_get_content_headers($file) {
$name = mime_header_encode($file->filename);
$type = mime_header_encode($file->filemime); $type = mime_header_encode($file->filemime);
return array( return array(
+2 -2
View File
@@ -1176,7 +1176,7 @@ function drupal_validate_form($form_id, &$form, &$form_state) {
// If the session token was set by drupal_prepare_form(), ensure that it // If the session token was set by drupal_prepare_form(), ensure that it
// matches the current user's session. This is duplicate to code in // matches the current user's session. This is duplicate to code in
// form_builder() but left to protect any custom form handling code. // form_builder() but left to protect any custom form handling code.
if (isset($form['#token'])) { if (!empty($form['#token'])) {
if (!drupal_valid_token($form_state['values']['form_token'], $form['#token']) || !empty($form_state['invalid_token'])) { if (!drupal_valid_token($form_state['values']['form_token'], $form['#token']) || !empty($form_state['invalid_token'])) {
_drupal_invalid_token_set_form_error(); _drupal_invalid_token_set_form_error();
// Stop here and don't run any further validation handlers, because they // Stop here and don't run any further validation handlers, because they
@@ -1837,7 +1837,7 @@ function form_builder($form_id, &$element, &$form_state) {
// If the session token was set by drupal_prepare_form(), ensure that it // If the session token was set by drupal_prepare_form(), ensure that it
// matches the current user's session. // matches the current user's session.
$form_state['invalid_token'] = FALSE; $form_state['invalid_token'] = FALSE;
if (isset($element['#token'])) { if (!empty($element['#token'])) {
if (empty($form_state['input']['form_token']) || !drupal_valid_token($form_state['input']['form_token'], $element['#token'])) { if (empty($form_state['input']['form_token']) || !drupal_valid_token($form_state['input']['form_token'], $element['#token'])) {
// Set an early form error to block certain input processing since that // Set an early form error to block certain input processing since that
// opens the door for CSRF vulnerabilities. // opens the door for CSRF vulnerabilities.
+2 -1
View File
@@ -1606,6 +1606,7 @@ function _menu_tree_data(&$links, $parents, $depth) {
* Implements template_preprocess_HOOK() for theme_menu_tree(). * Implements template_preprocess_HOOK() for theme_menu_tree().
*/ */
function template_preprocess_menu_tree(&$variables) { function template_preprocess_menu_tree(&$variables) {
$variables['#tree'] = $variables['tree'];
$variables['tree'] = $variables['tree']['#children']; $variables['tree'] = $variables['tree']['#children'];
} }
@@ -2682,7 +2683,7 @@ function menu_link_load($mlid) {
} }
/** /**
* Clears the cached cached data for a single named menu. * Clears the cached data for a single named menu.
*/ */
function menu_cache_clear($menu_name = 'navigation') { function menu_cache_clear($menu_name = 'navigation') {
$cache_cleared = &drupal_static(__FUNCTION__, array()); $cache_cleared = &drupal_static(__FUNCTION__, array());
+150 -2
View File
@@ -133,7 +133,7 @@ interface DrupalStreamWrapperInterface extends StreamWrapperInterface {
* @param $uri * @param $uri
* A string containing the URI that should be used for this instance. * A string containing the URI that should be used for this instance.
*/ */
function setUri($uri); public function setUri($uri);
/** /**
* Returns the stream resource URI. * Returns the stream resource URI.
@@ -219,7 +219,6 @@ interface DrupalStreamWrapperInterface extends StreamWrapperInterface {
public function dirname($uri = NULL); public function dirname($uri = NULL);
} }
/** /**
* Drupal stream wrapper base class for local files. * Drupal stream wrapper base class for local files.
* *
@@ -549,6 +548,155 @@ abstract class DrupalLocalStreamWrapper implements DrupalStreamWrapperInterface
return fclose($this->handle); return fclose($this->handle);
} }
/**
* Sets metadata on the stream.
*
* WARNING: Do not call this method directly! It will be called internally by
* PHP itself when one of the following functions is called on a stream URL:
*
* @param string $uri
* A string containing the URI to the file to set metadata on.
* @param int $option
* One of:
* - STREAM_META_TOUCH: The method was called in response to touch().
* - STREAM_META_OWNER_NAME: The method was called in response to chown()
* with string parameter.
* - STREAM_META_OWNER: The method was called in response to chown().
* - STREAM_META_GROUP_NAME: The method was called in response to chgrp().
* - STREAM_META_GROUP: The method was called in response to chgrp().
* - STREAM_META_ACCESS: The method was called in response to chmod().
* @param mixed $value
* If option is:
* - STREAM_META_TOUCH: Array consisting of two arguments of the touch()
* function.
* - STREAM_META_OWNER_NAME or STREAM_META_GROUP_NAME: The name of the owner
* user/group as string.
* - STREAM_META_OWNER or STREAM_META_GROUP: The value of the owner
* user/group as integer.
* - STREAM_META_ACCESS: The argument of the chmod() as integer.
*
* @return bool
* Returns TRUE on success or FALSE on failure. If $option is not
* implemented, FALSE should be returned.
*
* @see touch()
* @see chmod()
* @see chown()
* @see chgrp()
* @link http://php.net/manual/streamwrapper.stream-metadata.php
*/
public function stream_metadata($uri, $option, $value) {
$target = $this->getLocalPath($uri);
$return = FALSE;
switch ($option) {
case STREAM_META_TOUCH:
if (!empty($value)) {
$return = touch($target, $value[0], $value[1]);
}
else {
$return = touch($target);
}
break;
case STREAM_META_OWNER_NAME:
case STREAM_META_OWNER:
$return = chown($target, $value);
break;
case STREAM_META_GROUP_NAME:
case STREAM_META_GROUP:
$return = chgrp($target, $value);
break;
case STREAM_META_ACCESS:
$return = chmod($target, $value);
break;
}
if ($return) {
// For convenience clear the file status cache of the underlying file,
// since metadata operations are often followed by file status checks.
clearstatcache(TRUE, $target);
}
return $return;
}
/**
* Truncate stream.
*
* Will respond to truncation; e.g., through ftruncate().
*
* @param int $new_size
* The new size.
*
* @return bool
* TRUE on success, FALSE otherwise.
*/
public function stream_truncate($new_size) {
return ftruncate($this->handle, $new_size);
}
/**
* Retrieve the underlying stream resource.
*
* This method is called in response to stream_select().
*
* @param int $cast_as
* Can be STREAM_CAST_FOR_SELECT when stream_select() is calling
* stream_cast() or STREAM_CAST_AS_STREAM when stream_cast() is called for
* other uses.
*
* @return resource|false
* The underlying stream resource or FALSE if stream_select() is not
* supported.
*
* @see stream_select()
* @link http://php.net/manual/streamwrapper.stream-cast.php
*/
public function stream_cast($cast_as) {
return $this->handle ? $this->handle : FALSE;
}
/**
* Change stream options.
*
* This method is called to set options on the stream.
*
* Since Windows systems do not allow it and it is not needed for most use
* cases anyway, this method is not supported on local files and will trigger
* an error and return false. If needed, custom subclasses can provide
* OS-specific implementations for advanced use cases.
*
* @param int $option
* One of:
* - STREAM_OPTION_BLOCKING: The method was called in response to
* stream_set_blocking().
* - STREAM_OPTION_READ_TIMEOUT: The method was called in response to
* stream_set_timeout().
* - STREAM_OPTION_WRITE_BUFFER: The method was called in response to
* stream_set_write_buffer().
* @param int $arg1
* If option is:
* - STREAM_OPTION_BLOCKING: The requested blocking mode:
* - 1 means blocking.
* - 0 means not blocking.
* - STREAM_OPTION_READ_TIMEOUT: The timeout in seconds.
* - STREAM_OPTION_WRITE_BUFFER: The buffer mode, STREAM_BUFFER_NONE or
* STREAM_BUFFER_FULL.
* @param int $arg2
* If option is:
* - STREAM_OPTION_BLOCKING: This option is not set.
* - STREAM_OPTION_READ_TIMEOUT: The timeout in microseconds.
* - STREAM_OPTION_WRITE_BUFFER: The requested buffer size.
*
* @return bool
* TRUE on success, FALSE otherwise. If $option is not implemented, FALSE
* should be returned.
*/
public function stream_set_option($option, $arg1, $arg2) {
trigger_error('stream_set_option() not supported for local file based stream wrappers', E_USER_WARNING);
return FALSE;
}
/** /**
* Support for unlink(). * Support for unlink().
* *
+69 -16
View File
@@ -168,23 +168,76 @@ Drupal.checkPlain = function (str) {
Drupal.formatString = function(str, args) { Drupal.formatString = function(str, args) {
// Transform arguments before inserting them. // Transform arguments before inserting them.
for (var key in args) { for (var key in args) {
switch (key.charAt(0)) { if (args.hasOwnProperty(key)) {
// Escaped only. switch (key.charAt(0)) {
case '@': // Escaped only.
args[key] = Drupal.checkPlain(args[key]); case '@':
break; args[key] = Drupal.checkPlain(args[key]);
// Pass-through. break;
case '!': // Pass-through.
break; case '!':
// Escaped and placeholder. break;
case '%': // Escaped and placeholder.
default: default:
args[key] = Drupal.theme('placeholder', args[key]); args[key] = Drupal.theme('placeholder', args[key]);
break; break;
}
} }
str = str.replace(key, args[key]);
} }
return str;
return Drupal.stringReplace(str, args, null);
};
/**
* Replace substring.
*
* The longest keys will be tried first. Once a substring has been replaced,
* its new value will not be searched again.
*
* @param {String} str
* A string with placeholders.
* @param {Object} args
* Key-value pairs.
* @param {Array|null} keys
* Array of keys from the "args". Internal use only.
*
* @return {String}
* Returns the replaced string.
*/
Drupal.stringReplace = function (str, args, keys) {
if (str.length === 0) {
return str;
}
// If the array of keys is not passed then collect the keys from the args.
if (!$.isArray(keys)) {
keys = [];
for (var k in args) {
if (args.hasOwnProperty(k)) {
keys.push(k);
}
}
// Order the keys by the character length. The shortest one is the first.
keys.sort(function (a, b) { return a.length - b.length; });
}
if (keys.length === 0) {
return str;
}
// Take next longest one from the end.
var key = keys.pop();
var fragments = str.split(key);
if (keys.length) {
for (var i = 0; i < fragments.length; i++) {
// Process each fragment with a copy of remaining keys.
fragments[i] = Drupal.stringReplace(fragments[i], args, keys.slice(0));
}
}
return fragments.join(args[key]);
}; };
/** /**
@@ -251,7 +304,7 @@ Drupal.t = function (str, args, options) {
* A translated string. * A translated string.
*/ */
Drupal.formatPlural = function (count, singular, plural, args, options) { Drupal.formatPlural = function (count, singular, plural, args, options) {
var args = args || {}; args = args || {};
args['@count'] = count; args['@count'] = count;
// Determine the index of the plural form. // Determine the index of the plural form.
var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1); var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);
+3 -3
View File
@@ -7,8 +7,8 @@ files[] = aggregator.test
configure = admin/config/services/aggregator/settings configure = admin/config/services/aggregator/settings
stylesheets[all][] = aggregator.css stylesheets[all][] = aggregator.css
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+8
View File
@@ -455,6 +455,14 @@ function aggregator_save_category($edit) {
db_delete('aggregator_category') db_delete('aggregator_category')
->condition('cid', $edit['cid']) ->condition('cid', $edit['cid'])
->execute(); ->execute();
// Remove category from feeds.
db_delete('aggregator_category_feed')
->condition('cid', $edit['cid'])
->execute();
// Remove category from feed items.
db_delete('aggregator_category_item')
->condition('cid', $edit['cid'])
->execute();
// Make sure there is no active block for this category. // Make sure there is no active block for this category.
if (module_exists('block')) { if (module_exists('block')) {
db_delete('block') db_delete('block')
+37 -1
View File
@@ -418,7 +418,7 @@ class CategorizeFeedTestCase extends AggregatorTestCase {
} }
/** /**
* Creates a feed and makes sure you can add more than one category to it. * Creates a feed and makes sure you can add/delete categories to it.
*/ */
function testCategorizeFeed() { function testCategorizeFeed() {
@@ -448,7 +448,31 @@ class CategorizeFeedTestCase extends AggregatorTestCase {
// Assert the feed has two categories. // Assert the feed has two categories.
$this->getFeedCategories($db_feed); $this->getFeedCategories($db_feed);
$this->assertEqual(count($db_feed->categories), 2, 'Feed has 2 categories'); $this->assertEqual(count($db_feed->categories), 2, 'Feed has 2 categories');
// Use aggregator_save_feed() to delete a category.
$category = reset($categories);
aggregator_save_category(array('cid' => $category->cid));
// Assert that category is deleted.
$db_category = db_query("SELECT COUNT(*) FROM {aggregator_category} WHERE cid = :cid", array(':cid' => $category->cid))->fetchField();
$this->assertFalse($db_category, format_string('The category %title has been deleted.', array('%title' => $category->title)));
// Assert that category has been removed from feed.
$categorized_feeds = db_query("SELECT COUNT(*) FROM {aggregator_category_feed} WHERE cid = :cid", array(':cid' => $category->cid))->fetchField();
$this->assertFalse($categorized_feeds, format_string('The category %title has been removed from feed %feed_title.', array('%title' => $category->title, '%feed_title' => $feed['title'])));
// Assert that no broken links (associated with the deleted category)
// appear on one of the other category pages.
$this->createSampleNodes();
$this->drupalGet('admin/config/services/aggregator');
$this->clickLink('update items');
$categories = $this->getCategories();
$category = reset($categories);
$this->drupalGet('aggregator/categories/' . $category->cid);
global $base_path;
$this->assertNoRaw('<a href="' . $base_path . 'aggregator/categories/"></a>,');
} }
} }
/** /**
@@ -685,9 +709,21 @@ class CategorizeFeedItemTestCase extends AggregatorTestCase {
} }
} }
// Delete category from feed items when category is deleted.
$cid = reset($feed->categories);
$categories = $this->getCategories();
$category_title = $categories[$cid]->title;
// Delete category.
aggregator_save_category(array('cid' => $cid));
// Assert category has been removed from feed items.
$categorized_count = db_query("SELECT COUNT(*) FROM {aggregator_category_item} WHERE cid = :cid", array(':cid' => $cid))->fetchField();
$this->assertFalse($categorized_count, format_string('The category %title has been removed from feed items.', array('%title' => $category_title)));
// Delete feed. // Delete feed.
$this->deleteFeed($feed); $this->deleteFeed($feed);
} }
} }
/** /**
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
files[] = block.test files[] = block.test
configure = admin/structure/block configure = admin/structure/block
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+8 -11
View File
@@ -432,23 +432,20 @@ function _block_rehash($theme = NULL) {
drupal_alter('block_info', $current_blocks, $theme, $code_blocks); drupal_alter('block_info', $current_blocks, $theme, $code_blocks);
foreach ($current_blocks as $module => $module_blocks) { foreach ($current_blocks as $module => $module_blocks) {
foreach ($module_blocks as $delta => $block) { foreach ($module_blocks as $delta => $block) {
if (!isset($block['pages'])) { // Make sure certain attributes are set.
// {block}.pages is type 'text', so it cannot have a $block += array(
// default value, and not null, so we need to provide 'pages' => '',
// value if the module did not. 'weight' => 0,
$block['pages'] = ''; 'status' => 0,
} );
// Make sure weight is set. // Check for active blocks in regions that are not available.
if (!isset($block['weight'])) {
$block['weight'] = 0;
}
if (!empty($block['region']) && $block['region'] != BLOCK_REGION_NONE && !isset($regions[$block['region']]) && $block['status'] == 1) { if (!empty($block['region']) && $block['region'] != BLOCK_REGION_NONE && !isset($regions[$block['region']]) && $block['status'] == 1) {
drupal_set_message(t('The block %info was assigned to the invalid region %region and has been disabled.', array('%info' => $block['info'], '%region' => $block['region'])), 'warning'); drupal_set_message(t('The block %info was assigned to the invalid region %region and has been disabled.', array('%info' => $block['info'], '%region' => $block['region'])), 'warning');
// Disabled modules are moved into the BLOCK_REGION_NONE later so no // Disabled modules are moved into the BLOCK_REGION_NONE later so no
// need to move the block to another region. // need to move the block to another region.
$block['status'] = 0; $block['status'] = 0;
} }
// Set region to none if not enabled and make sure status is set. // Set region to none if not enabled.
if (empty($block['status'])) { if (empty($block['status'])) {
$block['status'] = 0; $block['status'] = 0;
$block['region'] = BLOCK_REGION_NONE; $block['region'] = BLOCK_REGION_NONE;
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
@@ -13,8 +13,8 @@ regions[footer] = Footer
regions[highlighted] = Highlighted regions[highlighted] = Highlighted
regions[help] = Help regions[help] = Help
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
files[] = blog.test files[] = blog.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -7,8 +7,8 @@ files[] = book.test
configure = admin/content/book/settings configure = admin/content/book/settings
stylesheets[all][] = book.css stylesheets[all][] = book.css
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
files[] = color.test files[] = color.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+1 -1
View File
@@ -122,7 +122,7 @@ class ColorTestCase extends DrupalWebTestCase {
$edit['palette[bg]'] = $color; $edit['palette[bg]'] = $color;
$this->drupalPost($settings_path, $edit, t('Save configuration')); $this->drupalPost($settings_path, $edit, t('Save configuration'));
if($is_valid) { if ($is_valid) {
$this->assertText('The configuration options have been saved.'); $this->assertText('The configuration options have been saved.');
} }
else { else {
+3 -3
View File
@@ -9,8 +9,8 @@ files[] = comment.test
configure = admin/content/comment configure = admin/content/comment
stylesheets[all][] = comment.css stylesheets[all][] = comment.css
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+8 -2
View File
@@ -11,7 +11,13 @@ class CommentHelperCase extends DrupalWebTestCase {
protected $node; protected $node;
function setUp() { function setUp() {
parent::setUp('comment', 'search'); $modules = func_get_args();
if (isset($modules[0]) && is_array($modules[0])) {
$modules = $modules[0];
}
$modules[] = 'comment';
parent::setUp($modules);
// Create users and test node. // Create users and test node.
$this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer blocks', 'administer actions', 'administer fields')); $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer blocks', 'administer actions', 'administer fields'));
$this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments')); $this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments'));
@@ -1490,7 +1496,7 @@ class CommentNodeAccessTest extends CommentHelperCase {
} }
function setUp() { function setUp() {
DrupalWebTestCase::setUp('comment', 'search', 'node_access_test'); parent::setUp('search', 'node_access_test');
node_access_rebuild(); node_access_rebuild();
// Create users and test node. // Create users and test node.
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
files[] = contact.test files[] = contact.test
configure = admin/structure/contact configure = admin/structure/contact
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+8 -1
View File
@@ -234,7 +234,14 @@ function contact_form_user_profile_form_alter(&$form, &$form_state) {
* Implements hook_user_presave(). * Implements hook_user_presave().
*/ */
function contact_user_presave(&$edit, $account, $category) { function contact_user_presave(&$edit, $account, $category) {
$edit['data']['contact'] = isset($edit['contact']) ? $edit['contact'] : variable_get('contact_default_status', 1); if (isset($edit['contact'])) {
// Set new value.
$edit['data']['contact'] = $edit['contact'];
}
elseif (!isset($account->data['contact'])) {
// Use default if none has been set.
$edit['data']['contact'] = variable_get('contact_default_status', 1);
}
} }
/** /**
+22
View File
@@ -346,6 +346,28 @@ class ContactPersonalTestCase extends DrupalWebTestCase {
$this->drupalGet('user/' . $this->contact_user->uid . '/contact'); $this->drupalGet('user/' . $this->contact_user->uid . '/contact');
$this->assertResponse(200); $this->assertResponse(200);
// Test that users can disable their contact form.
$this->drupalLogin($this->contact_user);
$edit = array('contact' => FALSE);
$this->drupalPost('user/' . $this->contact_user->uid . '/edit', $edit, 'Save');
$this->drupalLogout();
$this->drupalGet('user/' . $this->contact_user->uid . '/contact');
$this->assertResponse(403);
// Test that user's contact status stays disabled when saving.
$contact_user_temp = user_load($this->contact_user->uid, TRUE);
user_save($contact_user_temp);
$this->drupalGet('user/' . $this->contact_user->uid . '/contact');
$this->assertResponse(403);
// Test that users can enable their contact form.
$this->drupalLogin($this->contact_user);
$edit = array('contact' => TRUE);
$this->drupalPost('user/' . $this->contact_user->uid . '/edit', $edit, 'Save');
$this->drupalLogout();
$this->drupalGet('user/' . $this->contact_user->uid . '/contact');
$this->assertResponse(200);
// Revoke the personal contact permission for the anonymous user. // Revoke the personal contact permission for the anonymous user.
user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms')); user_role_revoke_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms'));
$this->drupalGet('user/' . $this->contact_user->uid . '/contact'); $this->drupalGet('user/' . $this->contact_user->uid . '/contact');
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
files[] = contextual.test files[] = contextual.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -7,8 +7,8 @@ files[] = dashboard.test
dependencies[] = block dependencies[] = block
configure = admin/dashboard/customize configure = admin/dashboard/customize
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+1 -1
View File
@@ -420,6 +420,6 @@ function dblog_clear_log_form($form) {
*/ */
function dblog_clear_log_submit() { function dblog_clear_log_submit() {
$_SESSION['dblog_overview_filter'] = array(); $_SESSION['dblog_overview_filter'] = array();
db_delete('watchdog')->execute(); db_truncate('watchdog')->execute();
drupal_set_message(t('Database log cleared.')); drupal_set_message(t('Database log cleared.'));
} }
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
files[] = dblog.test files[] = dblog.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -11,8 +11,8 @@ dependencies[] = field_sql_storage
required = TRUE required = TRUE
stylesheets[all][] = theme/field.css stylesheets[all][] = theme/field.css
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
@@ -7,8 +7,8 @@ dependencies[] = field
files[] = field_sql_storage.test files[] = field_sql_storage.test
required = TRUE required = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -7,8 +7,8 @@ dependencies[] = field
dependencies[] = options dependencies[] = options
files[] = tests/list.test files[] = tests/list.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
@@ -5,8 +5,8 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
dependencies[] = field dependencies[] = field
files[] = number.test files[] = number.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
@@ -164,6 +164,15 @@ function number_field_presave($entity_type, $entity, $field, $instance, $langcod
} }
} }
} }
if ($field['type'] == 'number_float') {
// Remove the decimal point from float values with decimal
// point but no decimal numbers.
foreach ($items as $delta => $item) {
if (isset($item['value'])) {
$items[$delta]['value'] = floatval($item['value']);
}
}
}
} }
/** /**
+46
View File
@@ -152,4 +152,50 @@ class NumberFieldTestCase extends DrupalWebTestCase {
); );
$this->drupalPost(NULL, $edit, t('Save')); $this->drupalPost(NULL, $edit, t('Save'));
} }
/**
* Test number_float field.
*/
function testNumberFloatField() {
$this->field = array(
'field_name' => drupal_strtolower($this->randomName()),
'type' => 'number_float',
'settings' => array(
'precision' => 8, 'scale' => 4, 'decimal_separator' => '.',
)
);
field_create_field($this->field);
$this->instance = array(
'field_name' => $this->field['field_name'],
'entity_type' => 'test_entity',
'bundle' => 'test_bundle',
'widget' => array(
'type' => 'number',
),
'display' => array(
'default' => array(
'type' => 'number_float',
),
),
);
field_create_instance($this->instance);
$langcode = LANGUAGE_NONE;
$value = array(
'9.' => '9',
'.' => '0',
'123.55' => '123.55',
'.55' => '0.55',
'-0.55' => '-0.55',
);
foreach($value as $key => $value) {
$edit = array(
"{$this->field['field_name']}[$langcode][0][value]" => $key,
);
$this->drupalPost('test-entity/add/test-bundle', $edit, t('Save'));
$this->assertNoText("PDOException");
$this->assertRaw($value, 'Correct value is displayed.');
}
}
} }
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
dependencies[] = field dependencies[] = field
files[] = options.test files[] = options.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+22 -6
View File
@@ -23,8 +23,15 @@ class OptionsWidgetsTestCase extends FieldTestCase {
'type' => 'list_integer', 'type' => 'list_integer',
'cardinality' => 1, 'cardinality' => 1,
'settings' => array( 'settings' => array(
// Make sure that 0 works as an option. 'allowed_values' => array(
'allowed_values' => array(0 => 'Zero', 1 => 'One', 2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>', 3 => 'Some HTML encoded markup with &lt; &amp; &gt;'), // Make sure that 0 works as an option.
0 => 'Zero',
1 => 'One',
// Make sure that option text is properly sanitized.
2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>',
// Make sure that HTML entities in option text are not double-encoded.
3 => 'Some HTML encoded markup with &lt; &amp; &gt;',
),
), ),
); );
$this->card_1 = field_create_field($this->card_1); $this->card_1 = field_create_field($this->card_1);
@@ -35,8 +42,13 @@ class OptionsWidgetsTestCase extends FieldTestCase {
'type' => 'list_integer', 'type' => 'list_integer',
'cardinality' => 2, 'cardinality' => 2,
'settings' => array( 'settings' => array(
// Make sure that 0 works as an option. 'allowed_values' => array(
'allowed_values' => array(0 => 'Zero', 1 => 'One', 2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>'), // Make sure that 0 works as an option.
0 => 'Zero',
1 => 'One',
// Make sure that option text is properly sanitized.
2 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>',
),
), ),
); );
$this->card_2 = field_create_field($this->card_2); $this->card_2 = field_create_field($this->card_2);
@@ -47,8 +59,12 @@ class OptionsWidgetsTestCase extends FieldTestCase {
'type' => 'list_boolean', 'type' => 'list_boolean',
'cardinality' => 1, 'cardinality' => 1,
'settings' => array( 'settings' => array(
// Make sure that 0 works as a 'on' value'. 'allowed_values' => array(
'allowed_values' => array(1 => 'Zero', 0 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>'), // Make sure that 1 works as a 'on' value'.
1 => 'Zero',
// Make sure that option text is properly sanitized.
0 => 'Some <script>dangerous</script> & unescaped <strong>markup</strong>',
),
), ),
); );
$this->bool = field_create_field($this->bool); $this->bool = field_create_field($this->bool);
+3 -3
View File
@@ -7,8 +7,8 @@ dependencies[] = field
files[] = text.test files[] = text.test
required = TRUE required = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ files[] = field_test.entity.inc
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+5 -3
View File
@@ -4,8 +4,10 @@
* @file field.tpl.php * @file field.tpl.php
* Default template implementation to display the value of a field. * Default template implementation to display the value of a field.
* *
* This file is not used and is here as a starting point for customization only. * This file is not used by Drupal core, which uses theme functions instead for
* @see theme_field() * performance reasons. The markup is the same, though, so if you want to use
* template files rather than functions to extend field theming, copy this to
* your custom theme. See theme_field() for a discussion of performance.
* *
* Available variables: * Available variables:
* - $items: An array of field values. Use render() to output them. * - $items: An array of field values. Use render() to output them.
@@ -45,7 +47,7 @@
*/ */
?> ?>
<!-- <!--
THIS FILE IS NOT USED AND IS HERE AS A STARTING POINT FOR CUSTOMIZATION ONLY. This file is not used by Drupal core, which uses theme functions instead.
See http://api.drupal.org/api/function/theme_field/7 for details. See http://api.drupal.org/api/function/theme_field/7 for details.
After copying this file to your theme's folder and customizing it, remove this After copying this file to your theme's folder and customizing it, remove this
HTML comment. HTML comment.
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
dependencies[] = field dependencies[] = field
files[] = field_ui.test files[] = field_ui.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
dependencies[] = field dependencies[] = field
files[] = tests/file.test files[] = tests/file.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+6 -4
View File
@@ -146,8 +146,9 @@ function file_file_download($uri, $field_type = 'file') {
// headers for files controlled by other modules. Make an exception for // headers for files controlled by other modules. Make an exception for
// temporary files where the host entity has not yet been saved (for example, // temporary files where the host entity has not yet been saved (for example,
// an image preview on a node/add form) in which case, allow download by the // an image preview on a node/add form) in which case, allow download by the
// file's owner. // file's owner. For anonymous file owners, only the browser session that
if (empty($references) && ($file->status == FILE_STATUS_PERMANENT || $file->uid != $user->uid)) { // uploaded the file should be granted access.
if (empty($references) && ($file->status == FILE_STATUS_PERMANENT || $file->uid != $user->uid || (!$user->uid && empty($_SESSION['anonymous_allowed_file_ids'][$file->fid])))) {
return; return;
} }
@@ -280,9 +281,10 @@ function file_ajax_upload() {
$form['#suffix'] .= '<span class="ajax-new-content"></span>'; $form['#suffix'] .= '<span class="ajax-new-content"></span>';
} }
$output = theme('status_messages') . drupal_render($form); $form['#prefix'] .= theme('status_messages');
$output = drupal_render($form);
$js = drupal_add_js(); $js = drupal_add_js();
$settings = call_user_func_array('array_merge_recursive', $js['settings']['data']); $settings = drupal_array_merge_deep_array($js['settings']['data']);
$commands[] = ajax_command_replace(NULL, $output, $settings); $commands[] = ajax_command_replace(NULL, $output, $settings);
return array('#type' => 'ajax', '#commands' => $commands); return array('#type' => 'ajax', '#commands' => $commands);
+124
View File
@@ -596,6 +596,56 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
$this->doTestTemporaryFileRemovalExploit($victim_uid, $attacker_uid); $this->doTestTemporaryFileRemovalExploit($victim_uid, $attacker_uid);
} }
/**
* Tests validation with the Upload button.
*/
function testWidgetValidation() {
$type_name = 'article';
$field_name = strtolower($this->randomName());
$this->createFileField($field_name, $type_name);
$this->updateFileField($field_name, $type_name, array('file_extensions' => 'txt'));
foreach (array('nojs', 'js') as $type) {
// Create node and prepare files for upload.
$node = $this->drupalCreateNode(array('type' => 'article'));
$nid = $node->nid;
$this->drupalGet("node/$nid/edit");
$test_file_text = $this->getTestFile('text');
$test_file_image = $this->getTestFile('image');
$field = field_info_field($field_name);
$name = 'files[' . $field_name . '_' . LANGUAGE_NONE . '_0]';
// Upload file with incorrect extension, check for validation error.
$edit[$name] = drupal_realpath($test_file_image->uri);
switch ($type) {
case 'nojs':
$this->drupalPost(NULL, $edit, t('Upload'));
break;
case 'js':
$button = $this->xpath('//input[@type="submit" and @value="' . t('Upload') . '"]');
$this->drupalPostAJAX(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value']));
break;
}
$error_message = t('Only files with the following extensions are allowed: %files-allowed.', array('%files-allowed' => 'txt'));
$this->assertRaw($error_message, t('Validation error when file with wrong extension uploaded (JSMode=%type).', array('%type' => $type)));
// Upload file with correct extension, check that error message is removed.
$edit[$name] = drupal_realpath($test_file_text->uri);
switch ($type) {
case 'nojs':
$this->drupalPost(NULL, $edit, t('Upload'));
break;
case 'js':
$button = $this->xpath('//input[@type="submit" and @value="' . t('Upload') . '"]');
$this->drupalPostAJAX(NULL, $edit, array((string) $button[0]['name'] => (string) $button[0]['value']));
break;
}
$this->assertNoRaw($error_message, t('Validation error removed when file with correct extension uploaded (JSMode=%type).', array('%type' => $type)));
}
}
/** /**
* Helper for testing exploiting the temporary file removal using fid. * Helper for testing exploiting the temporary file removal using fid.
* *
@@ -1501,6 +1551,80 @@ class FilePrivateTestCase extends FileFieldTestCase {
$this->assertNoRaw($node_file->filename, 'File without view field access permission does not appear after attempting to attach it to a new node.'); $this->assertNoRaw($node_file->filename, 'File without view field access permission does not appear after attempting to attach it to a new node.');
$this->drupalGet(file_create_url($node_file->uri)); $this->drupalGet(file_create_url($node_file->uri));
$this->assertResponse(403, 'Confirmed that access is denied for the file without view field access permission after attempting to attach it to a new node.'); $this->assertResponse(403, 'Confirmed that access is denied for the file without view field access permission after attempting to attach it to a new node.');
// As an anonymous user, create a temporary file with no references and
// confirm that only the session that uploaded it may view it.
$this->drupalLogout();
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
"create $type_name content",
'access content',
));
$test_file = $this->getTestFile('text');
$this->drupalGet('node/add/' . $type_name);
$edit = array('files[' . $field_name . '_' . LANGUAGE_NONE . '_0]' => drupal_realpath($test_file->uri));
$this->drupalPost(NULL, $edit, t('Upload'));
$files = file_load_multiple(array(), array('uid' => 0));
$this->assertEqual(1, count($files), 'Loaded one anonymous file.');
$file = end($files);
$this->assertNotEqual($file->status, FILE_STATUS_PERMANENT, 'File is temporary.');
$usage = file_usage_list($file);
$this->assertFalse($usage, 'No file usage found.');
$file_url = file_create_url($file->uri);
$this->drupalGet($file_url);
$this->assertResponse(200, 'Confirmed that the anonymous uploader has access to the temporary file.');
// Close the prior connection and remove the session cookie.
$this->curlClose();
$this->cookies = array();
$this->drupalGet($file_url);
$this->assertResponse(403, 'Confirmed that another anonymous user cannot access the temporary file.');
// As an anonymous user, create a permanent file that is referenced by a
// published node and confirm that all anonymous users may view it.
$test_file = $this->getTestFile('text');
$this->drupalGet('node/add/' . $type_name);
$edit = array();
$edit['title'] = $this->randomName();
$edit['files[' . $field_name . '_' . LANGUAGE_NONE . '_0]'] = drupal_realpath($test_file->uri);
$this->drupalPost(NULL, $edit, t('Save'));
$new_node = $this->drupalGetNodeByTitle($edit['title']);
$file = file_load($new_node->{$field_name}[LANGUAGE_NONE][0]['fid']);
$this->assertEqual($file->status, FILE_STATUS_PERMANENT, 'File is permanent.');
$usage = file_usage_list($file);
$this->assertTrue($usage, 'File usage found.');
$file_url = file_create_url($file->uri);
$this->drupalGet($file_url);
$this->assertResponse(200, 'Confirmed that the anonymous uploader has access to the permanent file that is referenced by a published node.');
// Close the prior connection and remove the session cookie.
$this->curlClose();
$this->cookies = array();
$this->drupalGet($file_url);
$this->assertResponse(200, 'Confirmed that another anonymous user also has access to the permanent file that is referenced by a published node.');
// As an anonymous user, create a permanent file that is referenced by an
// unpublished node and confirm that no anonymous users may view it (even
// the session that uploaded the file) because they cannot view the
// unpublished node.
$test_file = $this->getTestFile('text');
$this->drupalGet('node/add/' . $type_name);
$edit = array();
$edit['title'] = $this->randomName();
$edit['files[' . $field_name . '_' . LANGUAGE_NONE . '_0]'] = drupal_realpath($test_file->uri);
$this->drupalPost(NULL, $edit, t('Save'));
$new_node = $this->drupalGetNodeByTitle($edit['title']);
$new_node->status = NODE_NOT_PUBLISHED;
node_save($new_node);
$file = file_load($new_node->{$field_name}[LANGUAGE_NONE][0]['fid']);
$this->assertEqual($file->status, FILE_STATUS_PERMANENT, 'File is permanent.');
$usage = file_usage_list($file);
$this->assertTrue($usage, 'File usage found.');
$file_url = file_create_url($file->uri);
$this->drupalGet($file_url);
$this->assertResponse(403, 'Confirmed that the anonymous uploader cannot access the permanent file when it is referenced by an unpublished node.');
// Close the prior connection and remove the session cookie.
$this->curlClose();
$this->cookies = array();
$this->drupalGet($file_url);
$this->assertResponse(403, 'Confirmed that another anonymous user cannot access the permanent file when it is referenced by an unpublished node.');
} }
} }
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -7,8 +7,8 @@ files[] = filter.test
required = TRUE required = TRUE
configure = admin/config/content/formats configure = admin/config/content/formats
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+1 -1
View File
@@ -1638,7 +1638,7 @@ function _filter_url_escape_comments($match, $escape = NULL) {
// Replace all HTML coments with a '<!-- [hash] -->' placeholder. // Replace all HTML coments with a '<!-- [hash] -->' placeholder.
if ($mode) { if ($mode) {
$content = $match[1]; $content = $match[1];
$hash = md5($content); $hash = hash('sha256', $content);
$comments[$hash] = $content; $comments[$hash] = $content;
return "<!-- $hash -->"; return "<!-- $hash -->";
} }
+3 -3
View File
@@ -9,8 +9,8 @@ files[] = forum.test
configure = admin/structure/forum configure = admin/structure/forum
stylesheets[all][] = forum.css stylesheets[all][] = forum.css
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
files[] = help.test files[] = help.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -7,8 +7,8 @@ dependencies[] = file
files[] = image.test files[] = image.test
configure = admin/config/media/image-styles configure = admin/config/media/image-styles
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
files[] = image_module_test.module files[] = image_module_test.module
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
files[] = locale.test files[] = locale.test
configure = admin/config/regional/language configure = admin/config/regional/language
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -819,7 +819,7 @@ class LocalePluralFormatTest extends DrupalWebTestCase {
* Additional options to pass to the translation import form. * Additional options to pass to the translation import form.
*/ */
function importPoFile($contents, array $options = array()) { function importPoFile($contents, array $options = array()) {
$name = tempnam('temporary://', "po_") . '.po'; $name = drupal_tempnam('temporary://', "po_") . '.po';
file_put_contents($name, $contents); file_put_contents($name, $contents);
$options['files[file]'] = $name; $options['files[file]'] = $name;
$this->drupalPost('admin/config/regional/translate/import', $options, t('Import')); $this->drupalPost('admin/config/regional/translate/import', $options, t('Import'));
@@ -1113,7 +1113,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
* Additional options to pass to the translation import form. * Additional options to pass to the translation import form.
*/ */
function importPoFile($contents, array $options = array()) { function importPoFile($contents, array $options = array()) {
$name = tempnam('temporary://', "po_") . '.po'; $name = drupal_tempnam('temporary://', "po_") . '.po';
file_put_contents($name, $contents); file_put_contents($name, $contents);
$options['files[file]'] = $name; $options['files[file]'] = $name;
$this->drupalPost('admin/config/regional/translate/import', $options, t('Import')); $this->drupalPost('admin/config/regional/translate/import', $options, t('Import'));
@@ -1340,7 +1340,7 @@ class LocaleExportFunctionalTest extends DrupalWebTestCase {
function testExportTranslation() { function testExportTranslation() {
// First import some known translations. // First import some known translations.
// This will also automatically enable the 'fr' language. // This will also automatically enable the 'fr' language.
$name = tempnam('temporary://', "po_") . '.po'; $name = drupal_tempnam('temporary://', "po_") . '.po';
file_put_contents($name, $this->getPoFile()); file_put_contents($name, $this->getPoFile());
$this->drupalPost('admin/config/regional/translate/import', array( $this->drupalPost('admin/config/regional/translate/import', array(
'langcode' => 'fr', 'langcode' => 'fr',
+3 -3
View File
@@ -5,8 +5,8 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
files[] = menu.test files[] = menu.test
configure = admin/structure/menu configure = admin/structure/menu
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -9,8 +9,8 @@ required = TRUE
configure = admin/structure/types configure = admin/structure/types
stylesheets[all][] = node.css stylesheets[all][] = node.css
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ package = Core
core = 7.x core = 7.x
files[] = openid.test files[] = openid.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
dependencies[] = openid dependencies[] = openid
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -4,8 +4,8 @@ package = Core
version = VERSION version = VERSION
core = 7.x core = 7.x
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
files[] = path.test files[] = path.test
configure = admin/config/search/path configure = admin/config/search/path
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
files[] = php.test files[] = php.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
files[] = poll.test files[] = poll.test
stylesheets[all][] = poll.css stylesheets[all][] = poll.css
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -11,8 +11,8 @@ configure = admin/config/people/profile
; See user_system_info_alter(). ; See user_system_info_alter().
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
files[] = rdf.test files[] = rdf.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
hidden = TRUE hidden = TRUE
dependencies[] = blog dependencies[] = blog
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+10
View File
@@ -125,6 +125,16 @@ function search_admin_settings($form) {
'#options' => $module_options, '#options' => $module_options,
'#description' => t('Choose which search module is the default.') '#description' => t('Choose which search module is the default.')
); );
$form['logging'] = array(
'#type' => 'fieldset',
'#title' => t('Logging')
);
$form['logging']['search_logging'] = array(
'#type' => 'checkbox',
'#title' => t('Log searches'),
'#default_value' => variable_get('search_logging', 1),
'#description' => t('If checked, all searches will be logged. Uncheck to skip logging. Logging may affect performance.'),
);
$form['#validate'][] = 'search_admin_settings_validate'; $form['#validate'][] = 'search_admin_settings_validate';
$form['#submit'][] = 'search_admin_settings_submit'; $form['#submit'][] = 'search_admin_settings_submit';
+3 -3
View File
@@ -8,8 +8,8 @@ files[] = search.test
configure = admin/config/search/settings configure = admin/config/search/settings
stylesheets[all][] = search.css stylesheets[all][] = search.css
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+1
View File
@@ -12,6 +12,7 @@ function search_uninstall() {
variable_del('minimum_word_size'); variable_del('minimum_word_size');
variable_del('overlap_cjk'); variable_del('overlap_cjk');
variable_del('search_cron_limit'); variable_del('search_cron_limit');
variable_del('search_logging');
} }
/** /**
+4 -3
View File
@@ -57,9 +57,10 @@ function search_view($module = NULL, $keys = '') {
} }
// Only search if there are keywords or non-empty conditions. // Only search if there are keywords or non-empty conditions.
if ($keys || !empty($conditions)) { if ($keys || !empty($conditions)) {
// Log the search keys. if (variable_get('search_logging', TRUE)) {
watchdog('search', 'Searched %type for %keys.', array('%keys' => $keys, '%type' => $info['title']), WATCHDOG_NOTICE, l(t('results'), 'search/' . $info['path'] . '/' . $keys)); // Log the search keys.
watchdog('search', 'Searched %type for %keys.', array('%keys' => $keys, '%type' => $info['title']), WATCHDOG_NOTICE, l(t('results'), 'search/' . $info['path'] . '/' . $keys));
}
// Collect the search results. // Collect the search results.
$results = search_data($keys, $info['module'], $conditions); $results = search_data($keys, $info['module'], $conditions);
} }
+14 -1
View File
@@ -1453,7 +1453,7 @@ class SearchConfigSettingsForm extends DrupalWebTestCase {
parent::setUp('search', 'search_extra_type'); parent::setUp('search', 'search_extra_type');
// Login as a user that can create and search content. // Login as a user that can create and search content.
$this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks')); $this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports'));
$this->drupalLogin($this->search_user); $this->drupalLogin($this->search_user);
// Add a single piece of content and index it. // Add a single piece of content and index it.
@@ -1502,6 +1502,19 @@ class SearchConfigSettingsForm extends DrupalWebTestCase {
); );
$this->drupalPost('admin/config/search/settings', $edit, t('Save configuration')); $this->drupalPost('admin/config/search/settings', $edit, t('Save configuration'));
$this->assertNoText(t('The configuration options have been saved.'), 'Form does not save with an invalid word length.'); $this->assertNoText(t('The configuration options have been saved.'), 'Form does not save with an invalid word length.');
// Test logging setting. It should be on by default.
$text = $this->randomName(5);
$this->drupalPost('search/node', array('keys' => $text), t('Search'));
$this->drupalGet('admin/reports/dblog');
$this->assertLink('Searched Content for ' . $text . '.', 0, 'Search was logged');
// Turn off logging.
variable_set('search_logging', FALSE);
$text = $this->randomName(5);
$this->drupalPost('search/node', array('keys' => $text), t('Search'));
$this->drupalGet('admin/reports/dblog');
$this->assertNoLink('Searched Content for ' . $text . '.', 'Search was not logged');
} }
/** /**
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -6,8 +6,8 @@ core = 7.x
files[] = shortcut.test files[] = shortcut.test
configure = admin/config/user-interface/shortcut configure = admin/config/user-interface/shortcut
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+35 -9
View File
@@ -39,6 +39,13 @@ abstract class DrupalTestCase {
*/ */
protected $originalFileDirectory = NULL; protected $originalFileDirectory = NULL;
/**
* URL to the verbose output file directory.
*
* @var string
*/
protected $verboseDirectoryUrl;
/** /**
* Time limit for the test. * Time limit for the test.
*/ */
@@ -461,8 +468,11 @@ abstract class DrupalTestCase {
protected function verbose($message) { protected function verbose($message) {
if ($id = simpletest_verbose($message)) { if ($id = simpletest_verbose($message)) {
$class_safe = str_replace('\\', '_', get_class($this)); $class_safe = str_replace('\\', '_', get_class($this));
$url = file_create_url($this->originalFileDirectory . '/simpletest/verbose/' . $class_safe . '-' . $id . '.html'); $url = $this->verboseDirectoryUrl . '/' . $class_safe . '-' . $id . '.html';
$this->error(l(t('Verbose message'), $url, array('attributes' => array('target' => '_blank'))), 'User notice'); // Not using l() to avoid invoking the theme system, so that unit tests
// can use verbose() as well.
$link = '<a href="' . $url . '" target="_blank">' . t('Verbose message') . '</a>';
$this->error($link, 'User notice');
} }
} }
@@ -719,10 +729,17 @@ class DrupalUnitTestCase extends DrupalTestCase {
* method. * method.
*/ */
protected function setUp() { protected function setUp() {
global $conf; global $conf, $language;
// Store necessary current values before switching to the test environment. // Store necessary current values before switching to the test environment.
$this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files'); $this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files');
$this->verboseDirectoryUrl = file_create_url($this->originalFileDirectory . '/simpletest/verbose');
// Set up English language.
$this->originalLanguage = $language;
$this->originalLanguageDefault = variable_get('language_default');
unset($conf['language_default']);
$language = language_default();
// Reset all statics so that test is performed with a clean environment. // Reset all statics so that test is performed with a clean environment.
drupal_static_reset(); drupal_static_reset();
@@ -764,7 +781,7 @@ class DrupalUnitTestCase extends DrupalTestCase {
} }
protected function tearDown() { protected function tearDown() {
global $conf; global $conf, $language;
// Get back to the original connection. // Get back to the original connection.
Database::removeConnection('default'); Database::removeConnection('default');
@@ -775,6 +792,12 @@ class DrupalUnitTestCase extends DrupalTestCase {
if (isset($this->originalModuleList)) { if (isset($this->originalModuleList)) {
module_list(TRUE, FALSE, FALSE, $this->originalModuleList); module_list(TRUE, FALSE, FALSE, $this->originalModuleList);
} }
// Reset language.
$language = $this->originalLanguage;
if ($this->originalLanguageDefault) {
$GLOBALS['conf']['language_default'] = $this->originalLanguageDefault;
}
} }
} }
@@ -1374,12 +1397,14 @@ class DrupalWebTestCase extends DrupalTestCase {
* @see DrupalWebTestCase::tearDown() * @see DrupalWebTestCase::tearDown()
*/ */
protected function prepareEnvironment() { protected function prepareEnvironment() {
global $user, $language, $conf; global $user, $language, $language_url, $conf;
// Store necessary current values before switching to prefixed database. // Store necessary current values before switching to prefixed database.
$this->originalLanguage = $language; $this->originalLanguage = $language;
$this->originalLanguageUrl = $language_url;
$this->originalLanguageDefault = variable_get('language_default'); $this->originalLanguageDefault = variable_get('language_default');
$this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files'); $this->originalFileDirectory = variable_get('file_public_path', conf_path() . '/files');
$this->verboseDirectoryUrl = file_create_url($this->originalFileDirectory . '/simpletest/verbose');
$this->originalProfile = drupal_get_profile(); $this->originalProfile = drupal_get_profile();
$this->originalCleanUrl = variable_get('clean_url', 0); $this->originalCleanUrl = variable_get('clean_url', 0);
$this->originalUser = $user; $this->originalUser = $user;
@@ -1387,7 +1412,7 @@ class DrupalWebTestCase extends DrupalTestCase {
// Set to English to prevent exceptions from utf8_truncate() from t() // Set to English to prevent exceptions from utf8_truncate() from t()
// during install if the current language is not 'en'. // during install if the current language is not 'en'.
// The following array/object conversion is copied from language_default(). // The following array/object conversion is copied from language_default().
$language = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => ''); $language_url = $language = (object) array('language' => 'en', 'name' => 'English', 'native' => 'English', 'direction' => 0, 'enabled' => 1, 'plurals' => 0, 'formula' => '', 'domain' => '', 'prefix' => '', 'weight' => 0, 'javascript' => '');
// Save and clean the shutdown callbacks array because it is static cached // Save and clean the shutdown callbacks array because it is static cached
// and will be changed by the test run. Otherwise it will contain callbacks // and will be changed by the test run. Otherwise it will contain callbacks
@@ -1445,7 +1470,7 @@ class DrupalWebTestCase extends DrupalTestCase {
* @see DrupalWebTestCase::prepareEnvironment() * @see DrupalWebTestCase::prepareEnvironment()
*/ */
protected function setUp() { protected function setUp() {
global $user, $language, $conf; global $user, $language, $language_url, $conf;
// Create the database prefix for this test. // Create the database prefix for this test.
$this->prepareDatabasePrefix(); $this->prepareDatabasePrefix();
@@ -1542,7 +1567,7 @@ class DrupalWebTestCase extends DrupalTestCase {
// Set up English language. // Set up English language.
unset($conf['language_default']); unset($conf['language_default']);
$language = language_default(); $language_url = $language = language_default();
// Use the test mail class instead of the default mail handler class. // Use the test mail class instead of the default mail handler class.
variable_set('mail_system', array('default-system' => 'TestingMailSystem')); variable_set('mail_system', array('default-system' => 'TestingMailSystem'));
@@ -1636,7 +1661,7 @@ class DrupalWebTestCase extends DrupalTestCase {
* and reset the database prefix. * and reset the database prefix.
*/ */
protected function tearDown() { protected function tearDown() {
global $user, $language; global $user, $language, $language_url;
// In case a fatal error occurred that was not in the test process read the // In case a fatal error occurred that was not in the test process read the
// log to pick up any fatal errors. // log to pick up any fatal errors.
@@ -1701,6 +1726,7 @@ class DrupalWebTestCase extends DrupalTestCase {
// Reset language. // Reset language.
$language = $this->originalLanguage; $language = $this->originalLanguage;
$language_url = $this->originalLanguageUrl;
if ($this->originalLanguageDefault) { if ($this->originalLanguageDefault) {
$GLOBALS['conf']['language_default'] = $this->originalLanguageDefault; $GLOBALS['conf']['language_default'] = $this->originalLanguageDefault;
} }
+3 -3
View File
@@ -57,8 +57,8 @@ files[] = tests/upgrade/update.trigger.test
files[] = tests/upgrade/update.field.test files[] = tests/upgrade/update.field.test
files[] = tests/upgrade/update.user.test files[] = tests/upgrade/update.user.test
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
@@ -5,8 +5,8 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+3 -3
View File
@@ -5,8 +5,8 @@ package = Testing
version = VERSION version = VERSION
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
+1 -1
View File
@@ -169,7 +169,7 @@ class CommonURLUnitTest extends DrupalWebTestCase {
$this->assertEqual(drupal_http_build_query(array('a' => ' &#//+%20@۞')), 'a=%20%26%23//%2B%2520%40%DB%9E', 'Value was properly encoded.'); $this->assertEqual(drupal_http_build_query(array('a' => ' &#//+%20@۞')), 'a=%20%26%23//%2B%2520%40%DB%9E', 'Value was properly encoded.');
$this->assertEqual(drupal_http_build_query(array(' &#//+%20@۞' => 'a')), '%20%26%23%2F%2F%2B%2520%40%DB%9E=a', 'Key was properly encoded.'); $this->assertEqual(drupal_http_build_query(array(' &#//+%20@۞' => 'a')), '%20%26%23%2F%2F%2B%2520%40%DB%9E=a', 'Key was properly encoded.');
$this->assertEqual(drupal_http_build_query(array('a' => '1', 'b' => '2', 'c' => '3')), 'a=1&b=2&c=3', 'Multiple values were properly concatenated.'); $this->assertEqual(drupal_http_build_query(array('a' => '1', 'b' => '2', 'c' => '3')), 'a=1&b=2&c=3', 'Multiple values were properly concatenated.');
$this->assertEqual(drupal_http_build_query(array('a' => array('b' => '2', 'c' => '3'), 'd' => 'foo')), 'a[b]=2&a[c]=3&d=foo', 'Nested array was properly encoded.'); $this->assertEqual(drupal_http_build_query(array('a' => array('b' => '2', 'c' => '3'), 'd' => 'foo')), 'a%5Bb%5D=2&a%5Bc%5D=3&d=foo', 'Nested array was properly encoded.');
} }
/** /**
+3 -3
View File
@@ -7,8 +7,8 @@ stylesheets[all][] = common_test.css
stylesheets[print][] = common_test.print.css stylesheets[print][] = common_test.print.css
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"
@@ -5,8 +5,8 @@ version = VERSION
core = 7.x core = 7.x
hidden = TRUE hidden = TRUE
; Information added by Drupal.org packaging script on 2016-12-07 ; Information added by Drupal.org packaging script on 2017-06-21
version = "7.53" version = "7.56"
project = "drupal" project = "drupal"
datestamp = "1481152423" datestamp = "1498069849"

Some files were not shown because too many files have changed in this diff Show More