Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Describe the bug
3/5 pages get deleted, 2/5 (identical) don’t.
Here is the
Desktop (please complete the following information):
There are two issues here. First you shouldn't be echoing anything as this will end up in the response and the json will be broken.
Second: we have a bit of a problem here with a weird behavior of PHP's iterators. The $page->delete() method unsets the element from the parent collection while you are still looping through it. That way the loop will skip some elements.
You can avoid this by looping through the original data array instead.