Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
section_library
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
section_library
Commits
b0443624
Commit
b0443624
authored
4 years ago
by
Mahmoud Zayed
Browse files
Options
Downloads
Patches
Plain Diff
Fix delta issue.
parent
ac3a3579
Branches
Branches containing commit
Tags
1.0.0-beta1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/DeepCloningTrait.php
+5
-6
5 additions, 6 deletions
src/DeepCloningTrait.php
with
5 additions
and
6 deletions
src/DeepCloningTrait.php
+
5
−
6
View file @
b0443624
...
...
@@ -75,7 +75,6 @@ trait DeepCloningTrait {
* The modefied section object.
*/
protected
function
cloneAndReplaceSectionComponents
(
$section
)
{
$delta
=
0
;
foreach
(
$section
->
getComponents
()
as
$uuid
=>
$component
)
{
$component_array
=
$component
->
toArray
();
$configuration
=
$component_array
[
'configuration'
];
...
...
@@ -95,15 +94,15 @@ trait DeepCloningTrait {
$new_revision_id
=
$duplicate_entity
->
getRevisionId
();
$configuration
[
'block_revision_id'
]
=
$new_revision_id
;
}
// Remove old component.
$section
->
removeComponent
(
$uuid
);
$new_component
->
setWeight
(
$component
->
getWeight
());
$new_component
->
setConfiguration
(
$configuration
);
// Insert the new component.
$section
->
insertComponent
(
$delta
,
$new_component
);
$delta
++
;
// Insert the new component after the old one.
$section
->
insertAfterComponent
(
$uuid
,
$new_component
);
// Then remove old component.
$section
->
removeComponent
(
$uuid
);
}
return
$section
;
...
...
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