InputfieldFile does not abide by noAjax setting when used in Page Edit
Short description of the issue
InputfieldFile has a noAjax setting, described as "Set to true or 1 to disable ajax uploading".
But when InputfieldFile appears in Page Edit, ajax uploading is always used even if noAjax is set to true or 1. This seems to be related to the presence of the #PageIDIndicator element in Page Edit.
In my case I want to add an InputfieldFile to the Page Edit form using a hook and have it work in the form the same way it would in any other PW form besides Page Edit. There will be no corresponding Field object (FieldtypeFile) for this inputfield and any file selected in this inputfield does not need to be saved anywhere. But the forced ajax uploading prevents a file from being selected in the inputfield.
Expected behavior
noAjax disables ajax uploading.
Setup/Environment
- ProcessWire version: 3.0.230
@Toutouwai That noAjax mode was built for situations outside the page editor, like if another Process module needs to provide file uploads, but doesn't have the ajax handler that's built into ProcessPageEdit. I'm not sure that this ajax-disabled mode would work in the page editor, but it could be worth a try. Edit that InputfieldFile.js and InputfieldImage.js files (whichever you need) to force them to use the old/non-ajax method. I think this would be around line 565 of InputfieldFile.js and line 41 of InputfieldImage.js (just add a return false). If you find it still works, let me know, and we can always add a check for the module's noAjax property on the JS side.
@ryancramerdesign, I tried both InputfieldFile and InputfieldImage in Page Edit with the ajax option manually disabled and although there are UI details that could be improved they do both work in that the added files/images get saved to the page after submit.