-
Notifications
You must be signed in to change notification settings - Fork 5
Duplicating pages with multiple languages causes different page IDs for non-primary languages #2163
Comments
Worth noting that this is an extremely hard to reproduce bug, which has only occurred on our staging environment. The localized pages will have the same ID, but they will differ from the main language.
|
Hey @jackmcdade and @jasonvarga We're having a really rough time with multiple languages - we get a lot of duplicate ID issues and editors only use CP... I don't know how or why it's happening, but we're losing credibility with our client, as they think the system is unstable with these errors, which potentially can force the site to crash. We need this to be resolved once and for all. |
This sadly also occurs when moving pages around. |
Any update on this one? I've got a client site that is having the same issue when reordering or removing pages. Also a site with multiple languages. Let me know what info I can provide to help debug further. |
@nobodyiscertain how much content do they have on their site? We have a patch in place for locking the Stache when pages are being moved around, but Stache still isn't always updated correctly after the reordering - but corruption seems to be prevented with it. diff --git statamic/core/Http/Controllers/PagesController.php statamic/core/Http/Controllers/PagesController.php
index 5b79402..52af909 100644
--- statamic/core/Http/Controllers/PagesController.php
+++ statamic/core/Http/Controllers/PagesController.php
@@ -161,10 +161,20 @@ class PagesController extends CpController
{
$this->authorize('pages:reorder');
- // Grab the JSON payload
- $tree = $this->request->input('pages');
+ // Hang it there, this might take a while!
+ set_time_limit(0);
- $reorderer->reorder($tree);
+ if (app('stache')->lock()->acquire(true)) {
+ // Grab the JSON payload
+ $tree = $this->request->input('pages');
+
+ $reorderer->reorder($tree);
+
+ app('stache')->lock()->release();
+ }
Stache::update(); |
Quite a bit of content, hundreds of pages/collection entries. Does that patch work with lots of content? |
It works a lot better than without the patch, that much I can say. |
Patching core code isn't ideal, but will give it a shot and see how it goes. Thanks for the help! |
Describe the bug
Duplicating a page with multiple languages will cause duplicate IDs error.
When trying to resolve the issue, the non-primary languages with get different IDs than the primary, which will blow up the cache/stache.
To Reproduce
Steps to reproduce the behavior:
Call to a member function in() on null
.Expected behavior
Duplication of pages should work regardless of number of languages.
Screenshots
![stache-explosion](https://user-images.githubusercontent.com/1186125/45098073-8a2dda80-b124-11e8-976f-f00d5574b2ed.png)
Environment details (please complete the following information):
The text was updated successfully, but these errors were encountered: