Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Issue forks
automatic_updates-3242724
Commits
68a786b4
Commit
68a786b4
authored
Apr 03, 2019
by
heddn
Committed by
heddn
Apr 03, 2019
Browse files
Issue
#3045690
by heddn: Handle contrib version that contains core version compatibility
parent
36566220
Changes
2
Hide whitespace changes
Inline
Side-by-side
AutomaticUpdatesPsa.php
View file @
68a786b4
...
...
@@ -78,7 +78,7 @@ class AutomaticUpdatesPsa {
$version_string
=
implode
(
'||'
,
$json
->
secure_versions
);
$psa_constraint
=
$parser
->
parseConstraints
(
$version_string
);
$core_constraint
=
$parser
->
parseConstraints
(
trim
(
VERSION
,
'-dev'
)
);
$core_constraint
=
$parser
->
parseConstraints
(
VERSION
);
if
(
$psa_constraint
->
matches
(
$core_constraint
))
{
$messages
[]
=
t
(
'Drupal Core PSA: <a href="!url">%message</a>'
,
array
(
'%message'
=>
$json
->
title
,
...
...
@@ -96,6 +96,11 @@ class AutomaticUpdatesPsa {
* The JSON object.
*/
protected
static
function
contribParser
(
array
&
$messages
,
$json
)
{
array_walk
(
$json
->
secure_versions
,
function
(
&
$version
)
{
if
(
substr
(
$version
,
0
,
4
)
===
DRUPAL_CORE_COMPATIBILITY
.
'-'
)
{
$version
=
substr
(
$version
,
4
);
}
});
$modules
=
array_keys
(
module_list
());
$themes
=
array_keys
(
list_themes
());
$extensions
=
array_merge
(
$modules
,
$themes
);
...
...
tests/automatic_updates_test.module
View file @
68a786b4
...
...
@@ -62,7 +62,7 @@ function automatic_updates_test_json() {
'project'
=>
'node'
,
'extensions'
=>
array
(
'node'
),
'type'
=>
'module'
,
'secure_versions'
=>
array
(
'7.
22
'
),
'secure_versions'
=>
array
(
'7.
x-7.22'
,
'8.x-8.8.0
'
),
'pubDate'
=>
'Tue, 19 Mar 2019 12:50:00 +0000'
,
);
$feed
[]
=
array
(
...
...
@@ -71,7 +71,7 @@ function automatic_updates_test_json() {
'project'
=>
'Standard Install Profile'
,
'extensions'
=>
array
(
'standard'
),
'type'
=>
'profile'
,
'secure_versions'
=>
array
(
'7.999'
),
'secure_versions'
=>
array
(
'7.
x-7.
999'
),
'pubDate'
=>
'Tue, 19 Mar 2019 12:50:00 +0000'
,
);
$feed
[]
=
array
(
...
...
@@ -80,7 +80,7 @@ function automatic_updates_test_json() {
'project'
=>
'seven'
,
'extensions'
=>
array
(
'seven'
),
'type'
=>
'theme'
,
'secure_versions'
=>
array
(
'7.999'
),
'secure_versions'
=>
array
(
'7.
x-7.
999'
),
'pubDate'
=>
'Tue, 19 Mar 2019 12:50:00 +0000'
,
);
$feed
[]
=
array
(
...
...
@@ -89,7 +89,7 @@ function automatic_updates_test_json() {
'project'
=>
'foobar'
,
'extensions'
=>
array
(
'foobar'
),
'type'
=>
'foobar'
,
'secure_versions'
=>
array
(
'7.
0
'
),
'secure_versions'
=>
array
(
'7.
x-1.2
'
),
'pubDate'
=>
'Tue, 19 Mar 2019 12:50:00 +0000'
,
);
$feed
[]
=
array
(
...
...
@@ -98,7 +98,7 @@ function automatic_updates_test_json() {
'project'
=>
'token'
,
'extensions'
=>
array
(
'token'
),
'type'
=>
'module'
,
'secure_versions'
=>
array
(
'1.5'
),
'secure_versions'
=>
array
(
'
7.x-1.7'
,
'8.x-
1.5'
),
'pubDate'
=>
'Tue, 19 Mar 2019 12:50:00 +0000'
,
);
return
drupal_json_output
(
$feed
);
...
...
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