CiviMRF / cmrf_core

Drupal Core for CMRF
GNU Affero General Public License v3.0
2 stars 6 forks source link

[Views integration] Only request fields needed by the view by defining the return API option #49

Closed jensschuppe closed 3 years ago

jensschuppe commented 3 years ago

Currently, the return API option is set to the empty array in the 8.x code, causing every request returning the complete API entity with all fields.

https://github.com/CiviMRF/cmrf_core/blob/e3e3c9dfc4e4bb78c97580fd26abd22233df1db9/cmrf_views/src/Plugin/views/query/API.php#L170-L171

The returnoption should be explicitly set to fields actually needed for the view.

The 7.x code does this already:

https://github.com/CiviMRF/cmrf_core/blob/a1a9cd49e9f1ffa6a962d80d0c3bf44583e9248e/cmrf_views/cmrf_views_plugin_query_civimrf.inc#L41-L45

jensschuppe commented 3 years ago

Will be released with 2.0.0.