Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

“Copy Files” toggle is ignored when duplicating a page #6885

Open
linusrogge opened this issue Dec 26, 2024 · 1 comment
Open

“Copy Files” toggle is ignored when duplicating a page #6885

linusrogge opened this issue Dec 26, 2024 · 1 comment
Labels
needs: information ❓ Requires more information to proceed needs: replication 🔬 Requires a sample to reproduce the issue

Comments

@linusrogge
Copy link

Description

When duplicating a page with images, I have to option to set a toggle whether to copy these files or not. But no matter what option it is set to, the files are always copied.

Expected behavior
When the toggle is set to false, no files should appear in the duplicated page.

This looks like the problem. Shouldn’t it be if ($files !== false) { …?

// don't copy files
if ($files === false) {
foreach ($this->files() as $file) {
$ignore[] = $file->root();
// append all content files
array_push($ignore, ...$file->storage()->contentFiles('published'));
array_push($ignore, ...$file->storage()->contentFiles('changes'));
}
}

To reproduce

  1. Create a page and upload an image
  2. Click on “Duplicate” and leave “Copy Files” toggle on false
  3. Click duplicate
  4. See copied files

Your setup

Kirby Version
4.5.0 (but has been around before)

Your system (please complete the following information)

  • Device: MacBook Pro
  • OS: macOS Sequoia, Version 15.2 (24C101)
  • Browser: Chrome
@afbora
Copy link
Member

afbora commented Jan 6, 2025

Hello @linusrogge I've tried on starterkit 4.5.0 and it's working great. Do you have plugins?

Also I just wonder that copy and don't copy actions works for you with $files !== false condition?

@afbora afbora added needs: information ❓ Requires more information to proceed needs: replication 🔬 Requires a sample to reproduce the issue labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: information ❓ Requires more information to proceed needs: replication 🔬 Requires a sample to reproduce the issue
Projects
None yet
Development

No branches or pull requests

2 participants