kll44
It tells us something very clear—and honestly, it’s the breakthrough:
The original Discount Manager Media system is the problem. Not uploads. Not the database. Not WordPress.
Here’s what your test proves:
What works
Uploading images ✅
Saving to database ✅
Loading from database ✅
Rendering previews ✅
What fails (original system)
Media tab inside Discount Manager ❌
Reopen/edit load ❌
Consistent state handling ❌
What that means
The old Media tab was not broken in one place — it was structurally flawed:
Multiple JS layers fighting each other
Tab system interfering with render timing
Possibly two different discount load paths
Fields being set, then overwritten or ignored
Rehydration happening at the wrong time (or not at all)
What your working version proves
By moving to the Edit Images logic inline, you now have:
Single source of truth
Single load path
Single save path
No tab interference
No hidden competing scripts
That’s why it works immediately and consistently.

