Promoted/Sticky fields are outdated and confusing, find an alternative for them

Created on 21 August 2005, over 19 years ago
Updated 23 August 2024, 7 months ago

The problem

The sticky/promoted fields in core date from 2004, and are only used by the default front page + forum module. Some sites use them as a shortcut when they don't need a full entityqueue/flag solution.

As such they're a (small) usability issue since they're quite redundant and often don't do anything depending on how a site is configured. They're also outdated in the sense that this kind of 'feature-y' field would normally be added by entityqueue/flag or a configurable field.

Proposed solution

A couple of options:

1. Add a 'content flags' (name TBC) module to core, which adds the fields via alters - this would allow them to be entirely removed on sites that don't want them, and would allow them to eventually be moved into contrib.

2. Improve the query performance of configurable fields, possibly via โœจ [META] Add support for JSON field queries in entity queries Active , which would then allow these to be converted to configurable fields without a performance regression for sites that use them.

๐Ÿ“Œ Task
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component
Node systemย  โ†’

Last updated about 10 hours ago

No maintainer
Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany killes@www.drop.org

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium flyke

    Just my two cents: for the love of god, get rid of them both. Please. I beg you.

    Currently, we manage around 30 Drupal projects we've created for clients.
    Only 3 of them implement a blog like funcitonality.
    Literarally none of them use sticky or promoted.
    Yes we had a blog where the client wished for some control to have some blog items on top.
    That means more than one. In the order that he likes, like first node F, then node D, then the rest automatic on date.
    But if your use case is give the client option to set more than 1 node on top of a view, then sticky or promote fields are useless.
    You can add a 'Priority' field with default value set to 0 that you first sort on in the view for example to solve this use case. Or use the node_weight module so client can drag and drop nodes to set the order. But sticky or promoted are useless for having > 1 items on top.

    If its really impossible to replicate this functionality with existing contrib modules (but I think it is) for the few projects that need them, then create a new contrib module that does this so we can remove this from core and those (few) that need it can use contrib modules (or just create a priority field for example and sort on that).

    When I first started going to client meetings many years ago to present a project, those options confused all clients because they were there because its just core, but were not used for anything.
    A beginner mistake to not heavily customize the drupal out of the box (backend) experience for customers if they need access to the backend, for example for content editing.

    So then at first we had a custom module that removed these fields (for client user roles) via form alters I think - and did many other backend adjustments -, then later on we could hide them via the override_node_options module. But those useless (for most projects, not all projects in the world, I know) fields have been a pet peeve of mine for many years now.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    We could move these out to a feature flag module, disable it by default on new installs but enable it on existing sites, and eventually move it out to contrib.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    When this issue was opened we didn't have dynamic base fields, but now that we have hook_entity_base_field_info() it should be possible for a contrib module to provide these fields as-is. Only issue might be compound database indexes to replicate the core ones, but could fall back to the database API + field database schema for that bit.

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland berdir Switzerland

    #24 tells me that people don't don't that you can hide both promote and sticky through the manage form display page, since 8.0. No extra modules or custom code required.

    Removing/moving those fields sounds like a very scary upgrade path issue to me. We know that people don't read and they also don't do backups, so upgrading means that we will drop their data.

    What if we just do a very basic change for now, and that's to have those fields hidden by default. If you want to use them, make them visible, otherwise you likely won't notice that they still exist. That's as simple as removing two method calls in the field definitions and has very limited risk.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada xmacinfo Canada

    What if we just do a very basic change for now, and that's to have those fields hidden by default.

    I vote for this so that I can keep those flags for current sites but hide those for sites I donโ€™t need those.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand john pitcairn

    +1 to #27. Removing them outright would be disastrous.

    I use (or abuse) those fields on some sites, though I usually change their labels to reflect the specific outcome for each site.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium flyke

    +1 to #27: I don't want to be responsible for existing projects to fail after an update. Hiding is a good first step.
    I would still like to see them deprecated and maybe moved to contrib over time. Or maybe sort of disabled for new installs, but I'm guessing thats almost the same as the proposal from #27.

    Side note: I checked and we do actually just hide them in form display now. Still, would be nice if this is default behavior to improve the out of the box content editor experience in case you added a new content type or started a new project and you forgot to do this for the millionth time.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada xmacinfo Canada

    Changing issue title and summary.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada xmacinfo Canada
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    Both of these properties are oddly specific and they make even less sense than they made in 2005 given how websites and uses of Drupal have evolved. I spent a few minutes on a quick PoC to test if we could dynamically delete these from new sites.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada xmacinfo Canada

    Given how websites and uses of Drupal have evolved.

    Do you have some data about this?

    We should hide those flags for new sites. But leave those discoverable to any developers who are asked to implement the sticky and promoted flags.

    โ€ฆtest if we could dynamically delete these from new sites.

    Will a new site developer still be able to add the flags (or one at a time) back?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    From a release manager point of view #33 feels like it is going to cause us pain further down the line - we forever have to support the field tables that may or may not exist. I would prefer that we take this in more definite steps, and figure out how to hive off these fields to a separate module that can be moved to contrib.

    Simply removing them from the form (as per the original intent of this issue) feels like an easier win and the most straightforward next step.

Production build 0.71.5 2024