Problem/Motivation

Fieldblocks won't be displayed when viewing a revision of a entity or during preview mode when viewing a node entity.

Proposed resolution

Refactor \Drupal\fieldblock\Plugin\Block\FieldBlock so it also takes entity revision/preview routes into account.

Remaining tasks

None

User interface changes

Fieldblocks will be displayed on entity revision/preview routes.

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

casey created an issue. See original summary.

casey’s picture

FileSize
3.68 KB
casey’s picture

Status: Active » Needs review
casey’s picture

Assigned: casey » Unassigned
dpacassi’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch, still works with fieldblock 2.0 alpha1 and Drupal 8.4.2.

dpacassi’s picture

I've had to adapt the patch slightly as it didn't work for "node/nid/latest" urls.
Attached is an updated patch (also updated to work with the dev branch) as well as the interdiff.

Sutharsan’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs reroll, Patch does not apply.

+++ b/src/Plugin/Block/FieldBlock.php
@@ -377,8 +377,10 @@
+      $is_latest_route = $route_name == 'entity.node.latest_version';
 

This should also be entity type independent.

nkoporec’s picture

Status: Needs work » Needs review
FileSize
4.07 KB

Created a patch re-roll with fixed issue that @Sutharsan raised.

keshavv’s picture

I tested the patch, #8 will fix the problem. thanks

Sutharsan’s picture

@nkoporec, thanks for the re-roll. Next time please make a separate patch for re-roll and for the change. That way you can provide an interdiff of only the changes which makes it easier to check what you have done. And gives me more confidence that the re-roll does not contain changes.

Sutharsan’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

  • Sutharsan committed 85d12a0 on 8.x-2.x authored by nkoporec
    Issue #2605874 by dpacassi, casey, nkoporec: Display fieldblocks on...
Sutharsan’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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