-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Normal
-
None
-
Affects Version/s: None
-
Component/s: Edit system, Editing interface, External links editor, Relationship editor
Automating entity edits with code via a bot account requires quite a bit of extra effort due to the way the form system for submitting edits works.
When submitting an edit, automated or not, the post requires all the entity's data formatted as the form fields the editor interface uses.
In order to obtain these form values, they can relatively easily be scraped by just performing a get request on the edit page, as the form fields are pre-populated with the necessary data. The only issue arises when you get to the relationship editor fields, as they are only injected into the page when actually submitting the edits, until then the data is stored internally, but not in a particularly useful format.
While I could re-create the code used to convert the internal data into the form fields, it would be more simple at that point to just grab the necessary data with the API and just hardcode the conversion between the entity data and the form fields
Here's a potential solution I've come up with:
The relationship/external links editor should always provide the hidden input elements with the associated form names and values
-
- Would require relatively minimal changes to the relationship editor
- Hidden fields could be modified alongside the list elements used for interfacing with the editor
-
-
- Would enable more utility with userscripts as well
- Hidden fields could also just be created once server side and then only updated on edit submission
- Requires minimal code changes
-
There could be changes made to how edit submission is done in the first place, or a separate API could be created, but this is by far the least complicated route and would potentially make it easier for userscripts to interact with the relationship editor