I’d like to propose that cfinsert and cfupdate get an added attribute “fieldObject” this would allow the form scope to be replace by a structure of keys.
IMHO it would also be fitting to change insert and update tag related functions to dbinsert and dbupdate as the former are ambiguous and generic , the suggested names are more obvious.
the fieldlist attribute could then be used in conjunction with this object to limit fields, so basically the ‘fieldObject’ simply overrides
It would be a quick change, three lines of code (adding the parameter, adding the null reset, and adding a line to write over the form variable by chaing line 238)
Form form = pageContext.formScope();
to
Form form = fieldobject ? fieldObject : pageContext.formScope();
Just realised this has been depreciated, rather than improved ditching the ‘old’ form scope and just allowing any struct. It’s a killer tag/script functionality. (missed the community discussion on this??)
I’d rather see ORM and rest api functionality depreciated (both shouldn’t be core either - should be extensions) before the changed I suggested IN 2016…
Any chance this could be implemented INSTEAD of depreciating the two tags/functions?
Sure removing the reliance on the form scope, and replacing with a fields struct always made sense to me DECADES ago. But instead of removing the tags, how about we just make them the way THEY SHOULD have been done, making the tag super easy to use and giving back the joy of why we chose cfml in the first place.
Speaking of decades ago, that’s how long it’s been since I used either of those tags, along with cfform, cfinput, etc. It’s so much better using cfscript and QueryExecute(). I can’t imagine updates to ancient deprecated tags being anything above absolute lowest priority.
100% agree, but it was a fun exercise and the idea made sense, I’d had the same idea when I wrote the testcases for them in the test suite, which was the first time I’d ever tried them, for all the reasons you describe.
plus they are slow as they have to read the table metadata each time and probably often the get implemented without proper security checks.