When using coder to review patch files I have found it sometimes a bit tedious to either type the full file path or to copy and paste the code, and have often thought it would be very useful to have to option to browse and select a file. I have coded this, and it is working (roughly).

I have attached screen grabs of before and after, to illustrate what I am doing. One nice side-effect is that removing the 'or' text exposed a previously unnoticed error where the nice helpful intro paragraph was being discarded due to it having the same array key as the 'or' text.

I will post a patch file, and explain the current issues which need sorting out.

Jonathan

Comments

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new777.95 KB
new2.99 KB

Here is a patch, created from the latest dev release of 18th August and a screen grab highlighting the changes. I borrowed the 'file upload' code from upload.module. The issues which need addresing are:

  1. After selecting the file, you have to run the 'get patch' submit button. It would be better if this could be done in the same main 'submit' button. I tried using a $form['#validate'] or $form['#submit'] to do the extra code but this did not work.
  2. In the original version, the file and the pasted code were both reviewed if you entered both, so I have repeated this functionality - but it may be better to have a specific hierarchy and only process code from one particular input option
  3. The progress bar causes the textarea to shift, and I have catered for this by adding <br clear=both> in the #suffix. But there would be a better way to do this in the coder.css
  4. The file selected should be saved to allow an easy re-run after fixing the faults. Obviously the actual file should not be saved, but just where it came from, but I could not find out how to get that info in php.

I guess it should really be added into the D7 version first but I did not want to do that work if there is no interest in it. Let me know and thanks for reading this far.

Jonathan

[edit on 13 Dec only to correct typos]

klausi’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Coder for Drupal 6 is now frozen and only security fixes will be applied. Feel free to update this issue and reopen against 7.x-2.x or 8.x-2.x.