Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
9858e188
Commit
9858e188
authored
Oct 13, 2012
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1798796
by LinL, alexpott: Convert javascript_parsed() variable to use state system.
parent
91fec4d2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
9 deletions
+18
-9
core/includes/common.inc
core/includes/common.inc
+1
-1
core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
...es/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
+1
-1
core/modules/locale/locale.install
core/modules/locale/locale.install
+1
-1
core/modules/locale/locale.module
core/modules/locale/locale.module
+6
-6
core/modules/system/system.install
core/modules/system/system.install
+9
-0
No files found.
core/includes/common.inc
View file @
9858e188
...
...
@@ -4774,7 +4774,7 @@ function drupal_build_js_cache($files) {
* Deletes old cached JavaScript files and variables.
*/
function
drupal_clear_js_cache
()
{
variable_del
(
'
javascript_parsed'
);
state
()
->
delete
(
'system.
javascript_parsed'
);
variable_del
(
'drupal_js_cache_files'
);
file_scan_directory
(
'public://js'
,
'/.*/'
,
array
(
'callback'
=>
'drupal_delete_file_if_stale'
));
}
...
...
core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
View file @
9858e188
...
...
@@ -130,7 +130,7 @@ function testUninstallProcess() {
$this
->
assertFalse
(
variable_get
(
'language_negotiation_session_param'
,
FALSE
),
t
(
'Visit language negotiation method settings cleared.'
));
// Check JavaScript parsed.
$javascript_parsed_count
=
count
(
variable_get
(
'javascript_parsed'
,
array
()
));
$javascript_parsed_count
=
count
(
state
()
->
get
(
'system.javascript_parsed'
)
?:
array
(
));
$this
->
assertEqual
(
$javascript_parsed_count
,
0
,
t
(
'JavaScript parsed count: %count'
,
array
(
'%count'
=>
$javascript_parsed_count
)));
// Check JavaScript translations directory.
...
...
core/modules/locale/locale.install
View file @
9858e188
...
...
@@ -28,7 +28,7 @@ function locale_uninstall() {
// Clear variables.
variable_del
(
'locale_cache_strings'
);
variable_del
(
'locale_js_directory'
);
variable_del
(
'
javascript_parsed'
);
state
()
->
delete
(
'system.
javascript_parsed'
);
variable_del
(
'locale_cache_length'
);
variable_del
(
'locale_translation_plurals'
);
variable_del
(
'locale_translation_javascript'
);
...
...
core/modules/locale/locale.module
View file @
9858e188
...
...
@@ -473,7 +473,7 @@ function locale_js_alter(&$javascript) {
$language_interface
=
language
(
LANGUAGE_TYPE_INTERFACE
);
$dir
=
'public://'
.
variable_get
(
'locale_js_directory'
,
'languages'
);
$parsed
=
variable_get
(
'javascript_parsed'
,
array
()
);
$parsed
=
state
()
->
get
(
'system.javascript_parsed'
)
?:
array
(
);
$files
=
$new_files
=
FALSE
;
foreach
(
$javascript
as
$item
)
{
...
...
@@ -506,12 +506,12 @@ function locale_js_alter(&$javascript) {
unset
(
$parsed
[
'refresh:'
.
$language_interface
->
langcode
]);
}
// Store any changes after refresh was attempted.
variable_set
(
'
javascript_parsed'
,
$parsed
);
state
()
->
set
(
'system.
javascript_parsed'
,
$parsed
);
}
// If no refresh was attempted, but we have new source files, we need
// to store them too. This occurs if current page is in English.
elseif
(
$new_files
)
{
variable_set
(
'
javascript_parsed'
,
$parsed
);
state
()
->
set
(
'system.
javascript_parsed'
,
$parsed
);
}
// Add the translation JavaScript file to the page.
...
...
@@ -895,10 +895,10 @@ function _locale_parse_js_file($filepath) {
* The language code for which the file needs to be refreshed.
*
* @return
* New content of the 'javascript_parsed' variable.
* New content of the '
system.
javascript_parsed' variable.
*/
function
_locale_invalidate_js
(
$langcode
=
NULL
)
{
$parsed
=
variable_get
(
'javascript_parsed'
,
array
()
);
$parsed
=
state
()
->
get
(
'system.javascript_parsed'
)
?:
array
(
);
if
(
empty
(
$langcode
))
{
// Invalidate all languages.
...
...
@@ -912,7 +912,7 @@ function _locale_invalidate_js($langcode = NULL) {
$parsed
[
'refresh:'
.
$langcode
]
=
'waiting'
;
}
variable_set
(
'
javascript_parsed'
,
$parsed
);
state
()
->
set
(
'system.
javascript_parsed'
,
$parsed
);
return
$parsed
;
}
...
...
core/modules/system/system.install
View file @
9858e188
...
...
@@ -2145,6 +2145,15 @@ function system_update_8026() {
}
}
/**
* Cleans up javascript_parsed variable.
*
* @ingroup system_upgrade
*/
function
system_update_8027
()
{
update_variable_del
(
'javascript_parsed'
);
}
/**
* @} End of "defgroup updates-7.x-to-8.x".
* The next series of updates should start at 9000.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment