Splitting this off from #609772: Impossible to extend the FileTransfer class system in contrib since that's already a monster patch just trying to fix the contrib extendability problem.
This issue is for the major UI bugs at authorize.php:
A) The form is utterly broken with JS disabled. As in, impossible to use.
B) We don't want the outer "FTP Connection settings" fieldsets. Those are pointless, and making Bojhan and Dries weep over at #613912: Move host and port into a collapsed "Advanced settings" fieldset on the authorize.php connection settings forms
I'll try to fix these ASAP, but #609772: Impossible to extend the FileTransfer class system in contrib is my current priority... (B) is a pretty trivial fix. (A) is more complicated. But, none of *this* stuff actually requires any knowledge of the guts of authorize.php, FileTransfer classes, etc, etc. Anyone with some good FormAPI and JS fu should be able to work on this if someone else wants to assign themselves. ;)
Comment | File | Size | Author |
---|---|---|---|
#24 | 932846-24.fix-authorize-php-no-js-no-nested-fieldset.patch | 3.5 KB | dww |
#24 | 932846-24.fix-authorize-php-no-js-no-nested-fieldset.interdiff.txt | 541 bytes | dww |
#21 | 14-no-js-success.png | 19.19 KB | bfroehle |
#14 | 932846-14.fix-authorize-php-no-js-no-nested-fieldset.patch | 3.5 KB | dww |
#14 | 932846-14.before.png | 44.36 KB | dww |
Comments
Comment #1
dwwFrom what I understand of the intention of the no-JS UI, authorize.php would be a multi-step form by default, where the first page just has the connection type select box and a "Enter connection settings" continue button. 2nd page would be the settings form for the backend selected on page 1. The continue button on page 2 would trigger whatever you're authorizing. In HEAD, the 1st page is properly hidden via CSS, so all you see is the drop down and the 1st button, but that tries to submit the full form which fails validation and you never see page 2 to provides your credentials.
There's currently JS that displays the right settings form based on what you select in the drop down, and it hides the 1st button and just gives you the 2nd on your first page, so you can submit the full form at once, pass validation, and proceed.
Comment #2
bfroehle CreditAttribution: bfroehle commented~Subscribing! :)
Comment #3
bfroehle CreditAttribution: bfroehle commentedMaybe rather than trying to hack in a fix for this, we just simplify to the same mechanism the installer uses when selecting which database to use? (i.e.,
install_settings_form
fromincludes/install.core.inc
)Comment #4
bfroehle CreditAttribution: bfroehle commentedIf you've never installed Drupal without JS enabled, a screenshot of the page is attached to this post.
Comment #5
dwwYeah, that's the basic idea. We just need it to degrade at all. I don't care that much if it's a 2 page form or not. If it's easy to get the 2-page thing working as the code is currently trying to do, great. If not, I'm fine making it a single page that looks bad without JS. So long as it works at all, we're cool. But, we don't want separate fieldsets for each connection type if we can help it, since we don't want nested fieldsets by default.
Comment #6
bfroehle CreditAttribution: bfroehle commentedFound the following errors in the form submission process:
authorize_filetransfer_form($form_state)
is wrong. It should beauthorize_filetransfer_form($form, &$form_state)
instead.>#attributes
class
should be an array, not a string.authorize_filetransfer_form_validate
checks the connection on all stages of form input, not just the final stage (after all connection information has been gathered).Fixing these three problems results in a working non-JS interface.
Attached is a patch, and screenshots of the workflow in a non-JS client. (The final success page is not shown, as it is the same for a JS client). Workflow for JS client is unchanged.
Issues:
drupal_set_message
is probably wrong.Recommendation:
Commit this patch since it restores functionality for non-JS clients. Then downgrade to a normal bug and work out the remaining (visual) kinks.
Comment #7
bfroehle CreditAttribution: bfroehle commentedRedid the warning message to be a form element instead of drupal_set_message:
(The string was not changed).
Visually, the change is shown in the attached image.
Comment #8
bfroehle CreditAttribution: bfroehle commentedwebchick: I think this is ready to go... I've thoroughly tested it at this point on clients with both JS enabled and disabled.
Comment #9
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedTried to install a module with this patch applied, with JS disabled in browser. It worked as explained. Also tried to install a module with JS enabled, and it worked like before. I could see nothing visibly broken.
It could use some cleanup, but at least now it's functional. Cleanup can be done later, in my opinion, as it would be great to have this in before release, to avoid unnecessary frustrations.
Comment #10
dwwAwesome, great work on this! I'm tempted to mark this "needs work" for the unnecessary nested fieldsets, which various UI folks said was a big problem and needed to be fixed before release. At one point, I tried just converting it to type markup, and using a div that the JS could target. That seemed to work, but I hadn't had time to get non-JS working so I didn't want to change it. But, I *think* it'd be really easy to do so again. I'll try to hop on IRC and coordinate with bfroehle to see if we can resolve this quickly. Stay tuned...
Comment #11
dwwHrm, in IRC bfroehle claimed that converting this to #type container required him to change the JS, but in my testing that's not the case. Attached patch works fine with both JS and no-JS, as attached screenies demonstrate. If you change the connection type with JS enabled, it swaps out the other container for you and you get the SSH connection settings (which you can see if you open the advanced settings fieldset and see the default port switch back and forth).
I don't think we need the heading on the container which we had on the fieldset, since I believe it's self-evident given the "Connection method" selector. But if we want to maintain the heading even without the fieldset, it's easy to add a prefix on the containers -- we won't even break any strings. ;)
Comment #12
bfroehle CreditAttribution: bfroehle commentedWorks for me. :) I like the change from 'fieldset' to 'container'. Not so sure about losing the header text --- I think it's okay, the information is certainly there elsewhere.
There might be some complaints that changing from FTP to SSH erases the settings, but this is by-design. (Having the header text there made this change clearer, I think).
Comment #13
dwwOkay, I'll restore the header. We probably need the smallest possible UI change at this point.
Comment #14
dwwOkay, this restores the header. I also noticed that the warning about not having https was changed from an error style to a warning style in #7. To absolutely minimize UI changes at this point, I restored that as an error.
So, here's the (hopefully final) patch, a before screenie (note: no-JS is totally broken before, so the before screenie shows the JS case), and after screenies of both JS and no-JS.
Comment #15
bfroehle CreditAttribution: bfroehle commentedLooks great :). Presenting the WARNING as an error is fine with me, and as dww pointed out, a previous issue.
I like keeping the header. It's not the prettiest at the moment, but I think it leaves the door open for further usability improvements since the string will be available.
Comment #16
bfroehle CreditAttribution: bfroehle commentedOMG status mess up!
Edit: I did actually apply this patch and verify that installation procedure works for both JS enabled and disabled, and the screenshots presented by dww in #14 are correct as well.
Comment #18
bfroehle CreditAttribution: bfroehle commented#14: 932846-14.fix-authorize-php-no-js-no-nested-fieldset.patch queued for re-testing.
Comment #19
bfroehle CreditAttribution: bfroehle commentedSetting to RTBC -- the bot failed because
Comment #20
Bojhan CreditAttribution: Bojhan commentedLooks good, this had UX sign off months ago - so get it in, I'd say
Comment #21
bfroehle CreditAttribution: bfroehle commentedWe're missing the most important screenshot of them all --- successfully installing a module when JS is disabled! :) Good work all!
Comment #22
bfroehle CreditAttribution: bfroehle commentedMissing space after the if. Watch to see if it gets fixed in the actual commit...
Also, maybe should use
'#limit_validation_errors' => array()
, instead of the above, or change the '#submit' on some of the buttons. Or whatever, this will have to do for now.Comment #24
dwwStupid bot. This fixes the missing space. Let's see if we get lucky this time with our fragile, non-deterministic test environment...
Comment #26
bfroehle CreditAttribution: bfroehle commentedTest bot is borked.
Comment #27
webchick#24: 932846-24.fix-authorize-php-no-js-no-nested-fieldset.patch queued for re-testing.
Comment #28
dww@webchick: the bot is now happy. ;)
Comment #29
webchickAwesome work. This is a really great issue to get crossed off the list before 7.0!
Committed to HEAD.