8000 Duplicate page image when copying pages from one locale to another by jonasdekeukelaere · Pull Request #3438 · forkcms/forkcms · GitHub
[go: up one dir, main page]

Skip to content

Duplicate page image when copying pages from one locale to another#3438

Merged
carakas merged 3 commits intoforkcms:masterfrom
jonasdekeukelaere:421-copy-page-image-bug
Aug 2, 2021
Merged

Duplicate page image when copying pages from one locale to another#3438
carakas merged 3 commits intoforkcms:masterfrom
jonasdekeukelaere:421-copy-page-image-bug

Conversation

@jonasdekeukelaere
Copy link
Member

Type

  • Non critical bugfix

Resolves the following issues

When copying pages from one locale to another (with the hidden action /en/pages/copy?from=en&to=nl), the page image will be linked to the same file. Which when you change the image in one of the user template, the other will be broken as the original image gets deleted.

Pull request description

Duplicate the page image when copying pages from one locale to another.

@codecov
Copy link
codecov bot commented Jul 28, 2021

Codecov Report

Merging #3438 (6869178) into master (4b60c18) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3438      +/-   ##
============================================
- Coverage     27.61%   27.59%   -0.02%     
- Complexity     8115     8121       +6     
============================================
  Files           572      572              
  Lines         30975    30992      +17     
============================================
  Hits           8553     8553              
- Misses        22422    22439      +17     
Flag Coverage Δ
functional 23.58% <0.00%> (-0.02%) ⬇️
installer 3.81% <0.00%> (-0.01%) ⬇️
unit 7.55% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Backend/Modules/Pages/Engine/Model.php 19.08% <0.00%> (-0.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b60c18...6869178. Read the comment docs.

$database->update('meta', ['url' => $newUrl], 'id = ?', [$page['meta_id']]);
}

private static function getImage(?string $image, string $metaUrl): ?string
Copy link
Member
< 8000 div data-view-component="true" class="js-comment-hide-on-error flash flash-warn flash-full">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Niet logischer om dit copyImage te noemen? of getCopiedImage

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 6869178

@tijsverkoyen tijsverkoyen requested a review from carakas July 30, 2021 07:54
@carakas carakas merged commit 271ed30 into forkcms:master Aug 2, 2021