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

Problem when reordering pages with duplicate slugs #1938

Open
d35k opened this issue May 22, 2018 · 11 comments
Open

Problem when reordering pages with duplicate slugs #1938

d35k opened this issue May 22, 2018 · 11 comments
Assignees

Comments

@d35k
Copy link

@d35k d35k commented May 22, 2018

Describe the bug
Im gettin error while reordering any page in Pages area.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Pages
  2. Reorder any of them.
  3. See error

Expected behavior
I reordered my Contact page. I only did in once time, after that, i cant reordered my pages.

Environment details (please complete the following information):

  • Statamic Version 2.9.X
  • Upgrade
  • OS: Latest Mac OS
  • Browser: Chrome
  • Web Server: Valet
  • PHP Version: 7.1

Error Log

[2018-05-22 16:04:54] production.ERROR: League\Flysystem\FileExistsException: File already exists at path: pages/3.videos/index.md in /Users/g-mac/Projects/blog/statamic/vendor/league/flysystem/src/Filesystem.php:402
Stack trace:
 /Users/g-mac/Projects/blog/statamic/vendor/league/flysystem/src/Filesystem.php(211): League\Flysystem\Filesystem->assertAbsent('pages/3.videos...')
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php(182): League\Flysystem\Filesystem->rename('pages/2.videos...', 'pages/3.videos...')
 /Users/g-mac/Projects/blog/statamic/core/Filesystem/FileAccessor.php(136): Illuminate\Filesystem\FilesystemAdapter->move('pages/2.videos...', 'pages/3.videos...')
 /Users/g-mac/Projects/blog/statamic/core/Filesystem/FolderAccessor.php(241): Statamic\Filesystem\FileAccessor->rename('pages/2.videos...', 'pages/3.videos...')
 /Users/g-mac/Projects/blog/statamic/core/Data/Pages/PageTreeReorderer.php(29): Statamic\Filesystem\FolderAccessor->rename('pages/2.videos', 'pages/3.videos')
 /Users/g-mac/Projects/blog/statamic/core/Http/Controllers/PagesController.php(164): Statamic\Data\Pages\PageTreeReorderer->reorder(Array)
 [internal function]: Statamic\Http\Controllers\PagesController->save(Object(Statamic\Data\Pages\PageTreeReorderer))
/Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(256): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(164): Illuminate\Routing\Controller->callAction('save', Array)
/Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(112): Illuminate\Routing\ControllerDispatcher->call(Object(Statamic\Http\Controllers\PagesController), Object(Illuminate\Routing\Route), 'save')
 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(114): Illuminate\Pipeline\Pipeline->then(Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(68): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(Statamic\Http\Controllers\PagesController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'save')
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'Statamic\\Http\\C...', 'save')
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/Route.php(134): Illuminate\Routing\Route->runWithCustomDispatcher(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(708): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/core/Http/Middleware/CP/Authenticate.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Statamic\Http\Middleware\CP\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/core/Http/Middleware/Outpost.php(48): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Statamic\Http\Middleware\Outpost->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/core/Http/Middleware/CP/Localize.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Statamic\Http\Middleware\CP\Localize->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/core/Http/Middleware/CP/DefaultLocale.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Statamic\Http\Middleware\CP\DefaultLocale->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/core/Http/Middleware/CpEnabled.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Statamic\Http\Middleware\CpEnabled->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(710): Illuminate\Pipeline\Pipeline->then(Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(674): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(236): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/core/Http/Middleware/PersistStache.php(22): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Statamic\Http\Middleware\PersistStache->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
/Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/core/StaticCaching/Middleware/Retrieve.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Statamic\StaticCaching\Middleware\Retrieve->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\Pipeline\Pipeline->then(Object(Closure))
 /Users/g-mac/Projects/blog/statamic/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
 /Users/g-mac/Projects/blog/index.php(155): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
 /Users/g-mac/.composer/vendor/laravel/valet/server.php(147): require('/Users/g-mac/Pr...')
 {main}
@jackmcdade

This comment has been minimized.

Copy link
Member

@jackmcdade jackmcdade commented May 22, 2018

Do you have any unpublished pages?

@d35k

This comment has been minimized.

Copy link
Author

@d35k d35k commented May 22, 2018

No

@jasonvarga

This comment has been minimized.

Copy link
Member

@jasonvarga jasonvarga commented May 22, 2018

(Please surround stack traces in code blocks. Otherwise every line causes a github issue of that number to get referenced.)

@d35k

This comment has been minimized.

Copy link
Author

@d35k d35k commented May 22, 2018

updated

@jackmcdade

This comment has been minimized.

Copy link
Member

@jackmcdade jackmcdade commented May 22, 2018

I can't recreate this - can you share any other info? A screenshot of the browser and error? Or your file structure?

@d35k

This comment has been minimized.

Copy link
Author

@d35k d35k commented May 22, 2018

screenrecord.zip
there it is

@jwbrew

This comment has been minimized.

Copy link

@jwbrew jwbrew commented Aug 17, 2018

We're having the same problem; same exception & trace.

Site & content fully version controlled - happy to share privately with Statamic team if needed

@d35k d35k closed this Jan 14, 2019
@barnabas-szekeres

This comment has been minimized.

Copy link

@barnabas-szekeres barnabas-szekeres commented Jan 28, 2019

Is it possible to reopen this issue? We're also run into this problem :(

League\Flysystem\FileExistsException: File already exists at path: pages/1.mac/8.mac-kiegeszitok/9.nagy-sebessegu-adatkabelek-es-adapterek/12.owc-sabrent-usb-3-0-eloszto/index.md

php please clear:stache command can "solve" the problem. Any idea what can cause this issue?

PS.: I can share the whole file system if it necessary!

@barnabas-szekeres

This comment has been minimized.

Copy link

@barnabas-szekeres barnabas-szekeres commented Jan 28, 2019

Woooho, we found the reproduction process!

The issue comes from creating a page with an existing slug.

Of course the CP prevents you from making a page with an existing slug, both on the same tree level, but if you do this on another level, you can create it (eg. /foo and /bar/foo). After creating both pages, if you move one next to the other (eg. /foo into the /bar folder), there are going to be two folders with the same slugs (/bar/1.foo, /bar/2.foo).

This messes up Stache and no page reordering from then on is going to work.

@jackmcdade should I open a new issue or can we reopen this?

@mirill1

This comment has been minimized.

Copy link

@mirill1 mirill1 commented Feb 18, 2019

Any news on this bug?? @jackmcdade

@anthubbard

This comment has been minimized.

Copy link

@anthubbard anthubbard commented Jun 16, 2019

I have this issue as well, it's affecting a few live sites and I keep having to go in and fix them, could you please look into it?

Thanks.

Ant.

@jackmcdade jackmcdade changed the title 2.9.X Page Reorder Problem Problem when reordering pages with duplicate slugs Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.