Problem/Motivation

On #2393339: [META] Make sure Views base fields are using Field API for formatting, and do not lose functionality, we are updating all base entity fields in entity views data so that they are using Field API for formatting rather than using generic Views handlers.

This issue is about two handlers in the Block Content module:
- 'block_content', used in block_content_field_data.id and block_contenta_field_data.info
- 'block_content_type', used in block_content_field_data.type

Proposed resolution

Change these to use the Field API formatter 'field' instead of the custom formatters. Should also be able to remove the custom formatters from the code base completely.

Remaining tasks

Make a patch.

User interface changes

None.

API changes

Not really.

Comments

larowlan’s picture

Will pick at this next week

larowlan’s picture

Status: Active » Needs review
StatusFileSize
new12.78 KB

or maybe today

Status: Needs review » Needs work

The last submitted patch, 2: block-content-views-2456707.1.patch, failed testing.

jhodgdon’s picture

As in comments on the other similar issues you're working on, in the ViewsData class you should just be able to get rid of this type of line (which will say "don't override this from the defaults provided by EntityViewsData base class):

    $data['block_content_field_data']['id']['field']['id'] = 'block_content';

And then if the views configs have links, you'll need to do something similar to what I suggested on #2456713-7: Custom taxonomy field views handler needs to be replaced with generic Field API handler.

We might also need to deal with the block content type field on a separate issue. Actually there are similar problems with Node. We probably need to write a field-entity-aware dedicated Bundle plugin... I think we discussed that at some point. Maybe we should remove 'type' from this patch and file a separate issue?

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new12.87 KB
new2.01 KB
+++ b/core/modules/block_content/src/BlockContentViewsData.php
@@ -21,12 +21,15 @@ public function getViewsData() {
+    $data['block_content_field_data']['info']['field']['field_name'] = 'id';
...
+    $data['block_content_field_data']['info']['field']['field_name'] = 'info';
...
+    $data['block_content_field_data']['type']['field']['field_name'] = 'type';

So yeah, we should be able to skip them.

Let's fix the test failures quickly.

dawehner’s picture

StatusFileSize
new15.39 KB
new2.52 KB

This wasn't everything.

jibran’s picture

RTBC if green.
/me wonders who added so many redundant views plugins oh wait it was @jibran ;-)

The last submitted patch, 5: 2456707-5.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 6: 2456707-6.patch, failed testing.

jibran queued 6: 2456707-6.patch for re-testing.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community

It is green

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

This issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed b568a4d and pushed to 8.0.x. Thanks!

  • alexpott committed b568a4d on 8.0.x
    Issue #2456707 by dawehner, larowlan: Block Content views field handlers...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.