Problem/Motivation
It is not possible to use the Views Reference Field (both autocomplete/select) without JavaScript enabled as the widgets both require ajax and validate as such. This also prevents much faster Functional Tests.
Steps to reproduce
Try to create a node with a Views Reference Field with either widget with JS disabled
Proposed resolution
Instead of relying on isEmpty() validate that a display ID is selected for a View.
This also means that the field formatters must prevent display if no display ID is selected as isEmpty() is no longer relied on for that.
Remaining tasks
Update the code to work without JS
Add functional tests to cover that
User interface changes
Users without JS can now use the field
API changes
None
Data model changes
None
Issue fork viewsreference-3453893
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
scott_euser commentedPostponed until these prerequisites are merged:
#3161731: Add basic test coverage for the widgets and plugins
#3317635: Coding standards
Comment #4
scott_euser commentedComment #5
scott_euser commented(Ignore the Drupal CI test failures, the tests pass in Gitlab CI as expected, raised here #3453927: Disable Drupal CI)
Comment #6
scott_euser commentedThanks for reviewing; thread 1 resolved, thread 2 showed screenshots of what submitForm() does under the hood which is actually filling in the fields and clicking the button, its more of a helper function to avoid having to repeat that code across tons of tests.
Comment #7
seanbMerged! Thanks again :)
Comment #8
seanb