
Follow-up to #2587755: AJAX error when using progress bar on file field widget
Problem/Motivation
The file module's FileWidgetAjaxController class is a bit ugly/messy.
Solution
Refactor. Mostly drafted by chx, discussed on IRC (so he should get a credit on commit assuming this gets commited). There was also some discussion on eligibility for commiting into 8; no conclusion was reached but brought up was:
- until/before #2587755: AJAX error when using progress bar on file field widget it didn't work (returned a 500 HTTP response)
- therefore there shouldn't be any disruption
- controllers are not API surface
- Any contrib usage would have had to change the path so probably would have just created a new route and as long as it passed the key to this class it would work with this refactoring.
Comment | File | Size | Author |
---|---|---|---|
#36 | interdiff_34-36.txt | 730 bytes | sahil.goyal |
#36 | 2615678-36.patch | 3.13 KB | sahil.goyal |
#34 | reroll_diff_18-34.txt | 2.86 KB | ravi.shankar |
#34 | 2615678-34.patch | 3.09 KB | ravi.shankar |
#33 | FixWidgetAjaxControl.png | 2.62 MB | rudrakumar188 |
Comments
Comment #2
nickdickinsonwildeComment #3
dawehnerWhile this seems to be a fair refactoring I don't even remotely get why this should be done before the release ... this could totally happy land afterwards
Comment #4
chx CreditAttribution: chx commentedI guess. I can't RTBC because I wrote it :)
Comment #5
dawehnerNitpick: These bits needs one more space of indentation, but this can be also fixed on commit.
Comment #6
nickdickinsonwilde@dawehner: those lines would be my fault (rather than chx's)
Comment #7
xjmLooks like a good cleanup; just a couple coding standards nitpicks for now:
This needs to be a single line of fewer than 80 characters.
No period at the end of an @see.
Do we have test coverage for this? Does #2587755: AJAX error when using progress bar on file field widget add some? Edit: Not yet at least. :)
Comment #8
swentel CreditAttribution: swentel commentedAdditional small things to fix. The other issue has tests now, so no more needed here then.
progess -> progress
progess -> progress
Comment #9
miteshmapAll changes are considered addressed by: @dawehner, @xjm and @swentel
Comment #10
jibranBack to RTBC then.
Comment #12
swentel CreditAttribution: swentel commentedBot hickup
Comment #14
mikemiles86Comment #15
chx CreditAttribution: chx commentedComment #16
lokapujyaretest.
Comment #17
ChuChuNaKu CreditAttribution: ChuChuNaKu as a volunteer commentedComment #18
ChuChuNaKu CreditAttribution: ChuChuNaKu as a volunteer commentedre-rolled patch.
Comment #20
andypostComment #23
lokapujyaSeems to have failed due to the uploadprogress library not being installed. I don't have the library installed locally either.
Comment #33
rudrakumar188 CreditAttribution: rudrakumar188 at Material for Drupal India Association commentedThe patch #18 cannot be applied getting lots of error. Adding screenshot of errors.
Comment #34
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedAdded reroll of patch #18 on Drupal 9.4.x.
Comment #36
sahil.goyal CreditAttribution: sahil.goyal as a volunteer and at Material for Drupal India Association commentedTrying to fix the error and attaching the interadiff file