Reordering fails with high volume of posts and WPML

Aperta
#19 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

  • #18 di @rmpel — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
php, wordpress
Ambito
backend, databases

Direzione di ricerca

Non vengono indicati file o test. Inizia riproducendo il riordinamento con un volume elevato di post e WPML, quindi traccia il percorso dell’elaborazione in batch e dell’aggiornamento di menu_order; è completato quando lo spostamento di un post a grande distanza mantiene la nuova posizione e il salvataggio non ripristina il valore.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

help wanted needs:engineering type:enhancement

In a situation with more posts than the batch processing does in one go and the multilingual plugin WPML, reordering fails when the new position is more than a few posts away from the original position

In our situation, the post was at menu_order 64 and needed to go to 10. I dragged the post, the menu_order reverted to 64 (no change)
when editing the post en using the menu_order meta box in the right column, change the value 64 to 10, and hit "update post", the value reverted to 64.
when editing the value directly in the database, from 64 to 10, re-opening the edit pane of the post, the value stated 10 and the post was at the correct position. When just hitting "update post" without changing any data on the edit page, the value reverted to 64.

I then proceeded to debugging the plugin, using error_log lines at specific points in the page and noticed that the reordering kept on going even after closing the browser, which made me realise; the reordering is going on still and being very slow.

I have built re-order algorithms lots of times in my long career and applied a series of database queries I thought up years ago;

multiply all order values by 2, even numbers are "current" positions
change the position of the dragged item to an odd number between the two items the item needs to go
renumber all posts starting at 1.
done.

Lingua principale
PHP
Stelle
157
Fork
24
Merge medio
12m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di 10up/simple-page-ordering

Tutte le issue di 10up/simple-page-ordering

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.