Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diff
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
diff
Commits
94ea8a87
Commit
94ea8a87
authored
3 months ago
by
Sascha Grossenbacher
Committed by
Lucas Hedding
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3033455
by berdir, mrossi113, acbramley, olli, heddn: 500 error: Possible infinite loop
parent
5eb752fc
No related branches found
Branches containing commit
No related tags found
1 merge request
!118
Resolve #3033455 "2.x"
Pipeline
#370319
failed
3 months ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Controller/PluginRevisionController.php
+2
-2
2 additions, 2 deletions
src/Controller/PluginRevisionController.php
tests/src/FunctionalJavascript/DiffLocaleTest.php
+7
-0
7 additions, 0 deletions
tests/src/FunctionalJavascript/DiffLocaleTest.php
with
9 additions
and
2 deletions
src/Controller/PluginRevisionController.php
+
2
−
2
View file @
94ea8a87
...
@@ -235,7 +235,7 @@ class PluginRevisionController extends ControllerBase {
...
@@ -235,7 +235,7 @@ class PluginRevisionController extends ControllerBase {
];
];
$i
=
0
;
$i
=
0
;
// Find the previous revision.
// Find the previous revision.
while
(
$left_revision_id
>
$revision_ids
[
$i
])
{
while
(
!
empty
(
$revision_ids
[
$i
])
&&
$left_revision_id
>
$revision_ids
[
$i
])
{
$i
+=
1
;
$i
+=
1
;
}
}
if
(
$i
!=
0
)
{
if
(
$i
!=
0
)
{
...
@@ -250,7 +250,7 @@ class PluginRevisionController extends ControllerBase {
...
@@ -250,7 +250,7 @@ class PluginRevisionController extends ControllerBase {
];
];
// Find the next revision.
// Find the next revision.
$i
=
0
;
$i
=
0
;
while
(
$i
<
$revision
s_count
&&
$right_revision_id
>=
$revision_ids
[
$i
])
{
while
(
!
empty
(
$revision
_ids
[
$i
])
&&
$right_revision_id
>=
$revision_ids
[
$i
])
{
$i
+=
1
;
$i
+=
1
;
}
}
if
(
$revisions_count
!=
$i
&&
$revision_ids
[
$i
-
1
]
!=
$revision_ids
[
$revisions_count
-
1
])
{
if
(
$revisions_count
!=
$i
&&
$revision_ids
[
$i
-
1
]
!=
$revision_ids
[
$revisions_count
-
1
])
{
...
...
This diff is collapsed.
Click to expand it.
tests/src/FunctionalJavascript/DiffLocaleTest.php
+
7
−
0
View file @
94ea8a87
...
@@ -151,6 +151,7 @@ class DiffLocaleTest extends DiffTestBase {
...
@@ -151,6 +151,7 @@ class DiffLocaleTest extends DiffTestBase {
$french_node
->
setTitle
(
'french_revision_2'
);
$french_node
->
setTitle
(
'french_revision_2'
);
$french_node
->
setNewRevision
(
TRUE
);
$french_node
->
setNewRevision
(
TRUE
);
$french_node
->
save
();
$french_node
->
save
();
$revision5
=
$french_node
->
getRevisionId
();
// Compare first two revisions.
// Compare first two revisions.
$this
->
drupalGet
(
'node/'
.
$node
->
id
()
.
'/revisions/view/'
.
$revision1
.
'/'
.
$revision2
.
'/split_fields'
);
$this
->
drupalGet
(
'node/'
.
$node
->
id
()
.
'/revisions/view/'
.
$revision1
.
'/'
.
$revision2
.
'/split_fields'
);
...
@@ -166,6 +167,12 @@ class DiffLocaleTest extends DiffTestBase {
...
@@ -166,6 +167,12 @@ class DiffLocaleTest extends DiffTestBase {
// There shouldn't be other differences in the current language.
// There shouldn't be other differences in the current language.
$this
->
assertSession
()
->
linkNotExists
(
'Next change'
);
$this
->
assertSession
()
->
linkNotExists
(
'Next change'
);
// Attempt to visit with a valid revision but for the wrong language.
$this
->
drupalGet
(
'node/'
.
$node
->
id
()
.
'/revisions/view/'
.
$revision5
.
'/'
.
$revision1
.
'/split_fields'
);
$diffs
=
$this
->
getSession
()
->
getPage
()
->
findAll
(
'xpath'
,
'//span[@class="diffchange"]'
);
$this
->
assertEquals
(
$diffs
[
0
]
->
getText
(),
'english_revision_2'
);
$this
->
assertEquals
(
$diffs
[
1
]
->
getText
(),
'english_revision_0'
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment