Problem/Motivation
#2800873: Add XML GET REST test coverage, work around XML encoder quirks introduced a new test field: field_rest_test_multivalue. This is fine.
Unfortunately, it did not get the same special treatment as field_rest_test, which got this:
case 'view':
// Never ever allow this field to be viewed: this lets EntityResourceTestBase::testGet() test in a "vanilla" way.
return AccessResult::forbidden();
This prevented that field from showing up in normalizations, which meant that each entity type could still write its own GET test coverage without it needing to be aware of this automatically added field (that is used for testing certain edge cases).
Proposed resolution
Also disallow view access for the field_rest_test_multivalue field.
Remaining tasks
Patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #2
wim leersThis is already negatively impacting other patches/issues, see #2825487-155: Fix normalization of File entities: file entities should expose the file URL as a computed property on the 'uri' base field.
Comment #3
wim leersComment #5
wim leers#3 was on top of another patch. My bad. Rebased, unchanged.
Comment #6
borisson_Nitpicks:
I don't understand why this is a switch, this can be a simple if instead.
80 cols.
Comment #7
wim leersThanks for the review!
Comment #8
wim leersSee #2543726-222: Make $term->parent behave like any other entity reference field, to fix REST and Migrate support and de-customize its Views integration, that issue would also benefit by this.
Comment #9
tedbow@Wim Leers looks good. This will make other tests easier to understand!
Comment #11
tedbowRetesting because #7 got
Errors, so pretty sure unrelated DrupalCI errors.
Comment #13
borisson_Same error as in #11.
Comment #15
wim leersThis is maddening.
Comment #16
webchickVery nice clean-up, and simply applying patterns from elsewhere in core to here.
Committed and pushed to 8.5.x. Thanks!
Comment #18
wim leersYay, was able to do the following rerolls thanks to this: