#2353867: [META] Expose Title and other base fields in Manage Display will introduce the "normal" mechanism for managing display of title and other base fields. In particular #3036862: Expose Title and other base fields in Manage Display in Drupal Core will create a GUI option to enable the normal mechanism.
This purpose of this issue is to deprecate the old specialist non-standard way. At the point of writing, we haven't even invented the new way yet so this issue is planning ahead and guessing somewhat. However it's likely that it would involve
- Warning in the status page if the GUI option is still set to the old specialist non-standard way.
- Deprecate all the specific items that will be removed in #3015623: [PP-many] Remove outdated code relating to "Expose Title in Manage Display"
We can use the Twig deprecated tag to deprecate templates.
Comments
Comment #2
adamps commentedComment #3
adamps commentedComment #7
jonathanshawW don't need the GUI option, but we have the entity type setting
enable_base_field_custom_preprocess_skippingwe have introduced (see change record).To remind us, the essence of the fix so far is to use a preprocess approach like this:
The essence of this is that preprocessing is skipped only if a flag is set AND isDisplayConfigurable is set (neither of which are set by default currently).
A deprecation strategy was proposed by @plach in [#2923701-283):
Our normal deprecation strategy would be to use
@trigger_error($message, E_USER_DEPRECATED)whenever custom preprocessing happens.Comment #8
adamps commentedI believe this issue will be extremely simple: we will add a
trigger_errorto all the branches of code that we intend to remove. The complexity comes in the other issues.1. & 2. Already done.
3. Is the only part that relates to this issue. Basically I agree, however the description at the top of this comment is more precise.
4. Is a comment relating to #3033301: Add formatters and other mechanisms as alternative to base fields directly in entity templates, suggesting to use layout builder and it would be useful if you post it there.
5. Is #3015623: [PP-many] Remove outdated code relating to "Expose Title in Manage Display"
Comment #12
anna d commentedAny ideas on continuing work on this issue?
I found that a user:id (node author) cache tag is added to every node. However, the author display is disabled, and a small investigation led me to template_preprocess_node().
This is unclear to me because $submitted_configurable is FALSE in my case (the date and UID fields are not displayed in the view display). As a result, the condition if (!$skip_custom_preprocessing || !$submitted_configurable) is always TRUE.
Additionally, I would separate the date and UID in this case. If only the date is needed, the author (and consequently, the user cache tags) is still added.
Comment #13
catchThat comment suggests that $submitted_configurable needs to be TRUE in order for that logic to be skipped, that might be the specific problem you're seeing?
I think we need to add a 'computed' (extra) field for 'submitted', once we have that, we can deprecate adding it directly in templates.
Adding another related issue.
Comment #14
anna d commentedYes, and this is not clear to me.
$submitted_configurable = $node->getFieldDefinition('created')->isDisplayConfigurable('view') || $node->getFieldDefinition('uid')->isDisplayConfigurable('view');
The Created On (date) and Created By (uid) fields are not configured to be displayed. However, I need to display them in order to avoid adding a related author cache tag. Is that correct?
Comment #15
catchYou need to alter the field definitions to allow them to be displayed (or install the manage fields module which does this), they don't actually need to be displayed.
All of this logic is in desperate need of updating but several of the issues around it are stalled.
Comment #16
adamps commentedUnfortunately yes😃. #3470497: Add a tag select list in string Formatter is the likely next step, and it was moving well. But now the next step is a quite complex update hook.
@catch is there any chance of any funding being available? It probably wouldn't take a huge number of hours to make real progress on the whole META area. Unfortunately it's often too much to do for free.
Comment #17
catch@adamps there is still no way to get direct funding for core development except via individual employers.
The two routes I can think of would be:
1. If there's a demonstrated need for Drupal CMS, then a company might sponsor work via the starshot contribution credits system.
2.Experience Builder must need to control where 'submitted' gets placed in an entity layout at some point, possibly before it can have a stable release, so will hit this problem soon. Likely the same for the title.
Even if not funding, those would be two potential ways to get extra reviewers.
For me personally I think that 'submitted' would be the best place to focus short term efforts rather than title (which I assume #3470497: Add a tag select list in string Formatter is blocking) because it is a bit more self-contained.
Comment #18
adamps commentedThanks @catch. Let's hope that someone needs this issue enough to be willing to fund it.
The sequence of events as I understand it is described in #2353867: [META] Expose Title and other base fields in Manage Display.
It proposes we next work on phase B stage 1 which is covered by issue #3033301: Add formatters and other mechanisms as alternative to base fields directly in entity templates. That will involve #3470497: Add a tag select list in string Formatter as the solution for 'title', and it seems quite close to completion. The equivalent for 'submitted' is more complex, however working code does exists in "Manage Display" contrib; it doesn't have its own Core issue yet as far as I know.
Comment #19
ressaThanks so much for working on this, having "Title", "Authored on", etc. directly available under Display would be such a great feature.
We could consider adding a new header "Funding" in the Issue Summary of important Drupal core issues such as #2353867: [META] Expose Title and other base fields in Manage Display, with a text like this?
It has previously been seen to work, to gently make the users aware, that this great software needs real humans to spend time building it, for example in #3247389: Plan for stable release.