I asked this question today which, based on the comments I now suspect is an XY question. A good solution to X was put to me in the comments which solves my problem, but Y remains largely unresolved. I see a few options:
1. Edit the question to ask X. Accept an answer that addresses X.
This would make all the current answers irrelevant. It might just be easier to ask a new question about X.
2. Vote to close the question.
I'm not terribly sure what I'd close it for though. None of the options really fit.
3. Accept an answer that resolves Y.
Surely this would just encourage bad practices for anyone visiting the question later.
4. Post an answer that explains why Y is the wrong solution and how X can be solved. Accept my own answer.
This seems like an alright solution, but going outside the scope of the original question feels dirty.
5. Delete the question
If I found myself in this situation, there's bound to be someone else asking this. I feel like there could be some value for someone.
What exactly is the right thing to do here?