Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Hm, I'd say that this should be a configurable setting, showing all fields by default (as is the current behaviour), as long as the user has permissions to see them according to the role memberships. I agree that this option is desirable on some sites, though.
Any thoughts on the implementation of this? I'm going to look at this for the field formatters if I get time.
I think that the cleanest and most configurable way would be to add field instance settings, but would like to know your thoughts before attempting this myself.
i.e. A fieldset with:
> --- Diff -----------------
[ ] Exclude from diff comparisons
....
For the text fields
Select components to compare:
[ ] Summary (if applicable)
[ ] Content
[ ] Text format (if applicable)
Select rendering options for the text
(*) Raw HTML
( ) Raw text
( ) Rendered HTML (if applicable)
( ) Rendered text (if applicable)
My initial thought was a customizeable setting tick mark for "[Tick] Enforce display of all fields regardless of their display settings (hidden/visible on node view)".
A tick mark should default to "on/enabled", as is the situation now, and then users could choose to remove it to get the effect that kadimi is suggesting in the initial post here.
I am not sure if we are talking about the same thing here, but perhaps I just dont understand the example in #4.
kadimi was referring to the view modes (i.e. admin/structure/types/manage/page/display)
I think that you may be referring to a global level diff configuration or maybe content type configuration?
I'm referring to a field instance setting (admin/structure/types/manage/page/fields/body)
Trying to summarize the options (in 10min without much thought):
Method
Implementation
Cons
Pros
custom view mode
Define new view mode, enabled by default. Generate a formatted field to compare against. Or ignore the formatter settings and just use the visible / hidden values saved.
No generic raw formatters Since raw values are required, improper use of the view mode would be a security concern
Easy Generic (decoupled from specific entities)
Use default (full) view mode
Use the default view mode to decide how to handle the display
Couples the diff display with default display. Complex sites rarely show all fields and this would ignore those fields set to hidden
As above, zero new code for settings
Global
Custom menu callback and handling of fields & entities. Best to restrict at least per entity type.
More code Implementation is coupled to the module No fine grain settings per instance
Singular edit page - both a pro and con
Per bundle
Form alter the content type edit page
As above, but far less code
Easy Config encapsulated per type
Per Instance
Implementing the field hooks to append the new settings
More complex
Minimal code Generic (decoupled from specific entities)
Per Field
As above
As above
As above
I'm going to try and look at finishing off the diff support for all core types tonight, and this is a fundamental decision on how to handle these. (Though it doesn't really hold anything other than testing up)
Comments
Comment #1
kadimi commentedComment #2
Taxoman commentedHm, I'd say that this should be a configurable setting, showing all fields by default (as is the current behaviour), as long as the user has permissions to see them according to the role memberships. I agree that this option is desirable on some sites, though.
Comment #3
Taxoman commentedComment #4
alan d. commentedAny thoughts on the implementation of this? I'm going to look at this for the field formatters if I get time.
I think that the cleanest and most configurable way would be to add field instance settings, but would like to know your thoughts before attempting this myself.
i.e. A fieldset with:
> --- Diff -----------------
[ ] Exclude from diff comparisons
....
For the text fields
Select components to compare:
[ ] Summary (if applicable)
[ ] Content
[ ] Text format (if applicable)
Select rendering options for the text
(*) Raw HTML
( ) Raw text
( ) Rendered HTML (if applicable)
( ) Rendered text (if applicable)
Comment #5
Taxoman commentedMy initial thought was a customizeable setting tick mark for "[Tick] Enforce display of all fields regardless of their display settings (hidden/visible on node view)".
A tick mark should default to "on/enabled", as is the situation now, and then users could choose to remove it to get the effect that kadimi is suggesting in the initial post here.
I am not sure if we are talking about the same thing here, but perhaps I just dont understand the example in #4.
Comment #6
alan d. commentedOK, to paraphrase.
kadimi was referring to the view modes (i.e. admin/structure/types/manage/page/display)
I think that you may be referring to a global level diff configuration or maybe content type configuration?
I'm referring to a field instance setting (admin/structure/types/manage/page/fields/body)
Trying to summarize the options (in 10min without much thought):
Or ignore the formatter settings and just use the visible / hidden values saved.
Since raw values are required, improper use of the view mode would be a security concern
Generic (decoupled from specific entities)
Best to restrict at least per entity type.
Implementation is coupled to the module
No fine grain settings per instance
Config encapsulated per type
Generic (decoupled from specific entities)
I'm going to try and look at finishing off the diff support for all core types tonight, and this is a fundamental decision on how to handle these. (Though it doesn't really hold anything other than testing up)
Comment #7
alan d. commentedActually #1 appears to be a good option, notes in #1347316: Selectable view mode for inline diffs and "Current revision" display view mode.
Some time this weekend I'll clone diff into a sandbox project with the working prototype.
Comment #8
alan d. commentedThis should be resolved with the new branch, 7.x-3.0-alpha1 or 7.x-3.0-dev.
This is still alpha, so test carefully before use on a production site and report any issues back to the queues.