- Issue created by @Grevil
As stated by @Anybody in 🐛 Issues when creating homebox presets / other people's homeboxes Fixed :
[...]
I'm not really sure the context parameter is the best possible solution.
I'm a bit more in favor of using inheritance and two different form classes inheritng from the base class.
That's typically the better polymorphysm pattern instead of if's that tend to grow by time and code becomes ugly.Furthermore, in the current implementation you have to ensure the context parameter is always present, which is also a sign of improvable design. In that case two separate same-based routes / URLs could do the job better without edge-cases like
unexpected value for context
missing context
which for routes the system would handle itself by design (404)
Meaning, instead of passing a context in "HomeboxForm", we should have a "HomeboxFormBase" with two deriving Forms called "HomeboxFormPreset" and "HomeboxFormUser" instead. This way, it is way easier for us to separate the Form logic, and we have a cleaner seperation between the two.
Fix the issue.
Active
3.0
Code