Problem/Motivation

The Diff module can display differences in the rendered display of an entity, and/or the differences in individual fields on the split/unified fields layouts (as configured at /admin/config/content/diff/fields).

The only current diff option for weight fields is "Don't compare" because there's no diff builder plugin that supports weight fields. Since it's often likely that weight fields would not appear in the rendered entity display, there's no easy way to know when/how a weight field has changed.

Steps to reproduce

Visit /admin/config/content/diff/fields and note that the only option for weight fields is "Don't compare."

Proposed resolution

Diff's CoreFieldBuilder plugin already supports integers, so it should work well for weight fields. Implement hook_field_diff_builder_info_alter() to add the weight field type id to core_field_diff_builder's field_types.

CommentFileSizeAuthor
#7 Selection_144.png10.09 KBsumit-k

Issue fork weight-3356615

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justcaldwell created an issue. See original summary.

justcaldwell’s picture

Title: Add support for Diff » Add support for Diff split/unified fields
Issue summary: View changes

justcaldwell’s picture

Title: Add support for Diff split/unified fields » Add support for Diff split/unified field layouts
justcaldwell’s picture

Status: Active » Needs review
justcaldwell’s picture

Issue summary: View changes
sumit-k’s picture

FileSize
10.09 KB

The raised merge request is functioning smoothly. It successfully introduces the 'core field diff' option for the weight field. To provide visual clarity, I have attached a screenshot for your reference.