When draggi/drop to sortthe order of widgets on the widget page, they would normally change order as
Current behavior
(all plugins disabled) When you drag a widget to a different place it seems to work as expected, until you refresh the page and it seems a duplicate has been created.
If you delete the duplicate it seems to be deleted leaving the original, HOWEVER when you refresh the page the original is also gone.
This happens with Safari, but not Chrome where it behaves normally.
@MrLucky Could you use the browser inspector to find the both the correct and duplicated elements, and then copy and paste the details here, please? (And identify which is the one you consider the correct one.)
Could you also try replacing the current file at ~wp-admin/js/widgets.js with the one Iâm uploading here? You will still need define( 'SCRIPT_DEBUG', true ); in the wp-config.php file.
The previous two bugs you reported were caused by (a) Safari finally fixing a bug and (b) Safari creating a new bug. My research tells me that the bug youâve reported here is another one for which Safari is known.
The source code youâve shown here tells me that Safari is causing the action on drop to be submitted twice. This causes the duplicate widget to be created with the same widget ID (in this case, meta-4) as the original. Because the two widgets share the same ID, deleting one deletes them both.
Could you see what happens if, after moving a widget and getting that duplicate on saving, you leave it alone but switch to another browser? Does the second browser see the duplicate widget?
Thatâs bad news! I was hoping we could just hide it from Safari, but apparently not. Iâm not sure what the best approach to this is now because the obvious way of adding a check to delete the duplicate widget wonât work without deleting the original.
I have had an idea! Letâs try preventing a duplicate call to the database. Could you try replacing the current file at ~wp-admin/js/widgets.js with the one below? You will still need define( 'SCRIPT_DEBUG', true ); in the wp-config.php file.