Problem:
Inline Form Errors is not at all compatible with Quick Edit.
- The actual error messages are lost because once the form submission is validated, the form is not there anymore and inline form errors would display the error on the form that is not there.
- The anchor links to the form are not needed and not working, because the form is not there anymore.
Solution:
During the UX discussion of 22 november 2016 it was agreed that for Inline Form Errors it is enough to disable IFE while in Quick Edit. Because, by default, the errors are already near the problematic fields. And this is similar to how IFE works. Also it means quick edit works as it did without enabling Inline Form Errors.
The solution in this issue is a fix that could get into 8.3 + durable tests.
Next steps:
- Create a more generic way to disable IFE: #2856950: Add a possibility to disable inline form errors for a complete form
- NOT IFE specific but worth calling out here: make Quick Edit errors accessible: #2831546: Move Quick Edit error messages inside dialog
Before this patch with Quick Edit and Inline Form Errors enabled:
After this patch with Quick Edit and Inline Form Errors enabled (also same if disabled):
Comments
Comment #2
dmsmidtComment #3
marcvangendIs there a design or UX guideline for how we want this to be? I rather like how in one of your screenshots, the error message ends up inside the quick edit dialog. I think it's a nice way to keep the underlying page as wysiwyg as can be, and be less dependent on front end theming.
Comment #4
samuel.sirois CreditAttribution: samuel.sirois commentedRunning this on 8.3.x : this is what I can see :
Which seems better that what was found originally when this issue was opened.
Jumping on what @marcvangend said at #3, here is a patch that moves the error message inside the quick edit box.
See patch 2828092-error-message-inside-quickedit-box.patch
Comment #5
dmsmidt@s.d.sirois, thank you for that first patch. Could you please reupload it to #2831546: Move Quick Edit error messages inside dialog (see description for explanation).
Comment #6
dmsmidtComment #7
dmsmidtThis patch disables IFE for quick edit forms.
Comment #8
dmsmidtFix typo.
Comment #10
dmsmidt- Fix existing test,
- Improve inline doc,
- Add new test to make sure normal errors are shown for quick edit forms (added test only patch: should fail)
Comment #13
dmsmidtSorry for the mess, wrong upload.
Comment #14
dmsmidtComment #15
samuel.sirois CreditAttribution: samuel.sirois commentedI am sorry for my lack of feedback on this issue. I'll make sure to double-check my account's settings in order to receive email notifications (which I obviously didn't receive).
@dmsmidt Do you need me to upload the patch as-is to #2831546 or do you wish me to make some modifications first ?
Comment #16
dmsmidtI guess it needs some modification, but just reupload it for context and review.
If you'd like you can review the new patch here.
Comment #17
samuel.sirois CreditAttribution: samuel.sirois commentedReviewed 2828092-10-ife_quick_edit.patch and behaviour looks like the expected one.
Of course, rises #2831546 that needs to be fixed.
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedI've applied this patch to an 8.3.x instance on simplytest.me with partial success (and complete success on the cases I was able to reproduce).
An inline form error appears inside the dialog box if I try to assign a non-existent author, for example:
Here, the user "Foo" doesn't exist, and the error notification shows up right above the Quickedit input form. It's visible, and doesn't have the (unnecessary) anchor.
I also get the desired behaviour when setting an empty (invalid) title field:
I can't reproduce the behaviour shown when editing an image's alt text, though; Quickedit just doesn't let me modify that.
Comment #19
dmsmidt@all, thanks for testing.
@jules. Do you mean, by "partial success", that everything you tested worked, but that you couldn't test it for images?
For images it works like in this gif.
Comment #20
dmsmidtComment #21
Anonymous (not verified) CreditAttribution: Anonymous as a volunteer commented@dmsmidt that's what I meant, sorry about the ambiguity.
I can't recreate the behaviour on drag-and-drop in Drupal 8 with Firefox 50.1.0; instead, the image just gets loaded into the browser as a local location, and is simply displayed as a normal image. Because of time constraints, I won't be able to provide updates anymore.
Comment #22
xjmAccording to feedback from the product and UX team on #2504847: [meta] Roadmap for stabilizing Inline Form Errors module (IFE), disabling IFE for Quick Edit is an acceptable workaround. However, we should also consider a postponed followup issue to better integrate Quick Edit and IFE. That followup issue would not be a blocker for IFE, just a future task for better user experience.
Thanks everyone!
Comment #23
dmsmidt@xjm, this is the follow up: #2831546: Move Quick Edit error messages inside dialog, people are already looking into it.
Anyone wants to review this further (it is confirmed working in #17), or can we RTBC this soon?
Comment #24
Wim LeersThis should update the IS with before/after screenshots. Because the screenshots currently show a solution that doesn't match the proposed solution.
Comment #25
Wim Leers===
This is the sort of thing that really needs a functional test, not a unit test. A unit test doesn't give enough guarantees here, because it's only the integration of many things (form system, Quick Edit, user interactions) that can prove this works as intended.
Comment #27
tstoecklerI was wondering whether it wouldn't be nicer to have a sort of
$form['#disable_inline_form_errors'] = TRUE
flag or something like that. That way Quickedit could set that on its form, but it would also allow contrib modules that run into similar issues to do the same. And it wouldn't introduce any knowledge about Quickedit in inline_form_errors.Comment #28
dmsmidt@tstoeckler this is sort of proposed in #2848319: Find a way to make it easier to hide Inline Form Error messages on child elements, but I fear that if we make that a blocker of this, it will take ages again.
We also should consider not making it to easy to disable IFE, we want contrib to be accessible as well.
I hope we can do this in two steps, so first fix it like this, and then make the solution more pretty. But I may be biased about this ;-)
Comment #29
tstoecklerNo, that's absolutely legitimate. Nice that there's already a follow-up for that.
Comment #30
dmsmidtReroll against 8.4.x.
Comment #31
mgiffordComment #32
dmsmidtActually also still needs work. Functional test is needed.
Furthermore I was rethinking #27, and the followup I mentioned in #28 doesn't really cover the case. It will only prevent bubbling of error messages to child elements. But doesn't help with disabling IFE for a form altogether.
So maybe we should try an alternative (cleaner) approach. Indeed we could add a property to a $form element to disable IFE.
Then we would need to change Quick Edit as well.
Comment #33
tim.plunkettAlready has the "Needs tests" tag
For whoever does write the test, please use BrowserTestBase or JavascriptTestBase, and not WebTestBase.
Comment #34
dmsmidtWorking on a functional test.
Comment #35
dmsmidtI've a test prepared, however I suddenly can't run functional tests anymore locally (multiple machines which worked before).
Offtopic
If any genius can get me up to speed again, please reach out to me I've already lost hours.
I've tried PhantomJS 2.1.1 and PhantomJS 1.9.2, PHP 7.1 and 5.6, Drupal 8.2 and 8.4.
The error I get: "An unexpected error occurred while starting Mink", is due problems in JavascriptTestBase->initMink().
After some debugging I see a ServerException thrown in Zumba\GastonJS\Browser\BrowserBase::command():
JavascriptTestBase->tearDown() kicks in oké, I see the commands running in PhantomJS.
Comment #36
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commented@dmsmidt - Can you upload your test anyway? I'm travelling at DrupalCamp Iceland just now, but I can probably find time to try running your test,
Comment #37
dmsmidtFinally got my test suite working. Some networking error I think (See: https://github.com/ariya/phantomjs/issues/14272).
Here is a tests only patch with the existing unit test and the new functional test (should fail).
Comment #38
dmsmidtAnd the (quick) fix with tests all in one patch.
Comment #41
dmsmidtThe unit test didn't work anymore with recent changes in core. Here is a new version, with some coding standards cleanup.
Comment #42
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedTest failure for patch #38:
I think we need to declare
#array_parents
inFormErrorHandlerTest::testDisplayErrorMessagesNotInlineQuickEdit()
, like we do in the other tests in the same class?Comment #43
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedOoops, we're both online at the same time. Let's se if htat failure persists with #41
Comment #44
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedPatch #41 has:
Does contextual need to be here? I is a dependency of quickedit so would be enabled anyway.
Comment #45
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedThis patch:
#array_parents => []
to the test form inFormErrorHandlerQuickEditTest.php::testDisplayErrorMessagesNotInlineQuickEdit()
Comment #46
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedScheduling test against 8.3.x for good measure too.
Comment #47
dmsmidtWoop green!
I think it would be great if we can get this committed to 8.3 and 8.4.
We can do a follow up about what I mentioned in #32.
It proposes a data model addition for 8.4, to disable IFE on a form altogether (should be possible in exotic cases like Quick Edit).
If that than gets in, we can then cleanup the approach in this patch (remove the quick edit specific part in IFE).
Comment #48
dmsmidtComment #49
mgiffordI think we should have before/after shots for this.
Comment #50
dmsmidtUpdated the issue with before/after.
Is it just me, or is our error messages styling gone for QE in 8.4.x?
Anyhow, with or without IFE the output is now the same. Which is what we aim for in this issue!
Comment #51
dmsmidtComment #52
DamienMcKennaDoes this still need an issue summary update?
Comment #53
dmsmidt@damien, well the summary is short, but says all. Removing the tag.
Comment #54
SKAUGHTi've added an email field to basic article type
after activation 'Quick Edit' contextual link and then going down and clicking on Email filed. the phrase 'email ->gfdghfd' ( gfdghfd is the node title.) remains inplace, then the field will not validate.
i've rerun this without IFE enabled, and it produces the same error. so, there seems to be some other break with Edit. still, I'm noting this manual test.
Comment #55
dmsmidt@SKAUGHT, so that problem seems unrelated to this issue. I've also seen some strange things happening with QE.
Can you confirm the goal of this patch at least is met?
Comment #56
SKAUGHTyes. the patch does make Edit and IFE work together. The IFE message appeared without an inner hash link, as expected.
Comment #57
tstoecklerAwesome, so it seems there is nothing left here, right? Patch still looks good to me.
Comment #58
catchI think it's OK for the patch to go in like this, but inline_form_errors should eventually be not-a-module whereas quickedit is going to stay one. So I think we need a follow-up to remove the hard-coded dependency.
Was going to suggest a .yml file with a list of form IDs, then we just check in_array()/isset() rather than hard-coding knowledge of other module's forms here. Or a custom $form['#property'] to check would be more lightweight.
#2848319: Find a way to make it easier to hide Inline Form Error messages on child elements was suggested as the issue for that, but not sure that's about this issue at all? Looks like it was talking about other bugs which are already fixed, might just need re-scoping though.
Might just need an issue summary update but it's not clear to me what the next steps are here.
Comment #59
dmsmidtWe all totally agree we don't want module specific exceptions in the IFE module.
@catch in #32 and #47 I explained the next step, I created a follow up issue and added that to the issue summary.
As I don't see that you found any new problems with the patch, I'm putting this back to RTBC.
Comment #60
xjmThanks everyone! Great to see this RTBC. +1 for the followup; I agree with the goal of hotfixing this for 8.3.x and then coming up with a resilient and complete fix in 8.4.x. I've added the new followup to the overall roadmap as well.
I think this issue needs both usability and product manager signoff, given that it's the primary product concern for IFE and affects product integrity. Leaving at RTBC, because the product team join weekly usability meetings where they could review this as a group. I will let them know about the issue.
Comment #61
xjmOh, since IFE is still alpha (though close to beta I think), we can also make this change during 8.3.x's RC.
Comment #63
xjmAlso, for what it's worth, the solution in this patch looks like an acceptable hotfix to me so long as we address the followup later (probably before we mark IFE beta, although I put it under RC on the roadmap). So if the product team agrees, I think we are on track for 8.3.0 with this fix!
Comment #65
xjmIt says tests failed but they did not; setting back to RTBC and retesting.
Comment #66
yoroy CreditAttribution: yoroy at Roy Scholten commentedI reviewed and compared situations with and without the patch. Ran into confusing behaviour of Quick Edit as captured in #2671202: [regression] Text field's label is duplicated in the value when edited & saved using Quick Edit but that's QE's problem. Updated the issue summary a bit. IFE's part in showing sane error messages in Quick Edit scenarios seems to be covered here. Thanks @dmsmidt.
Comment #67
xjmThanks @yoroy!
Since @yoroy was also involved in the usability and product review that prioritized this hotfix originally, I think that's sufficient signoff here and I overdid it with both tags. :)
Comment #68
xjm@catch's review in #58 has also been addressed with #2856950: Add a possibility to disable inline form errors for a complete form.
It looks like #25.1 was never addressed though (using
===
). Let's fix that and then get this in!Comment #69
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #70
dmsmidt@gaurav, thanks but that interdiff looks a bit scary, you've removed the test. Could you please look at it again.
Comment #71
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #72
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #73
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commented#72 is good. I made an interdiff 45-72 locally to confirm it.
Using
===
was the only outstanding issue in #68, so back to RTBC.Comment #74
Gábor HojtsyTested the patch and Drupal 8.3.0 RC1 without the patch. Looks like a clear improvement and also in line with what we discussed to be done at the UX meeting. Quick Edit is not changed when enabling Inline Form Errors because Quick Edit already displays errors near where the error is. Quick Edit itself needs to be made more accessible but IFE cannot help with that since the premise of displaying the error on the form element is not possible given Quick Edit removes the form element when you submit the form by definition.
Looks good from a product manager standpoint.
Updated screenshots.
Ps. this is my first Product Manager review. In reference to https://groups.drupal.org/node/516400
Comment #75
Gábor HojtsyComment #76
alexpottCommitted and pushed ade9d78 to 8.4.x and f9925e7 to 8.3.x. Thanks!
All the feedback has been addressed and followups filed. Nice work everyone.
Comment #79
dmsmidtThanks all! And @Gábor congratz, big win for us all.
Comment #80
xjmI think we should mention this in the release notes, for two reasons:
Comment #81
kattekrab CreditAttribution: kattekrab as a volunteer commentedSo exciting to see this green :)
Congratulations and gratitude to all of you! Great effort.
Comment #83
rajeevku CreditAttribution: rajeevku commentedComment #84
rajeevku CreditAttribution: rajeevku commentedI am still not getting errors , printed alongside quick edit.
Comment #85
rajeevku CreditAttribution: rajeevku commentedComment #86
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commented@rajeevku - we closed this issue before 8.3.0 was released, and the 8.4.0 release is expected soon. If you can reproduce you problem with 8.4.0-beta1, can you provide more detail in a new issue please?
Restoring previous tags - I'll still use these to find old accessibility issues after closing them.