Problem/Motivation

After #3223211: Deprecate node_mark the only use of MARK_READ MARK_NEW and MARK_UPDATED is the history module. We don't need these constants in core's theme.inc file. History can handle these constants internally.

RESPONSIVE_PRIORITY_LOW and RESPONSIVE_PRIORITY_MEDIUM are used for rendering tables so should be constants on the Table render element.

Proposed resolution

Deprecate constants
Replace responsive usages

Remaining tasks

Review

User interface changes

None

Introduced terminology

None

API changes

MARK_* constants deprecated
New enum in history module

Data model changes

None

Release notes snippet

Issue fork drupal-3514191

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:

Comments

acbramley created an issue. See original summary.

berdir’s picture

the constants are passed to the mark template. They are defined by it and that's why they are in theme.inc. both node and history module are just using them, not owning them.

That makes BC really challenging with an enum and moving it, we'd need completely deprecate and replace the theme hook, but that would break anyone using it.

acbramley’s picture

the constants are passed to the mark template

Oh gosh I didn't realise that, I hadn't done a full grep for the constants just a CTRL+Click in PHPStorm to find usages of it.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

nicxvan’s picture

Am I missing something or is this still true?

I only see:

      'mark' => [
        'variables' => [
          'status' => MARK_NEW,
        ],
      ],

Then direct checks in the template.

catch’s picture

No you're right, we're still defining the 'mark' theme hook in ThemeCommonElements.

I think we need an issue against history module to move the theme hook over there (where it could use an enum if it wants), and we could keep this for deprecating the constants and theme hook. Going to be for removal in Drupal 13 at this point.

nicxvan’s picture

nicxvan’s picture

Title: Move MARK_* constants from theme.inc into Enum in History module » Deprecate MARK_* and RESPONSIVE_PRIORITY_* constants
Issue summary: View changes
Status: Active » Needs review

Not sure if the responsive constants ended up in the right place.

nicxvan’s picture

nicxvan’s picture

Failures look random, they passed on the previous run.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

@nicxcan posted about this in #needs-review-queue channel so decided to give it a look.

First nice find that it was no longer used!

Pretty basic review.
I applied the MR locally
Did searches for RESPONSIVE_PRIORITY_MEDIUM (25 matches) and RESPONSIVE_PRIORITY_LOW (28 matches) and just verified they were using Table:: now and the ones that weren't were around the deprecation

Did the same for MARK_READ but found some twig template mark.html.twig

Assume these templates need to be deprecated as well?

nicxvan’s picture

Status: Needs work » Needs review

The templates are deprecated by the hook, I asked @catch about the process yesterday on slack but forgot to mention it.

The theme hook deprecation will trigger for the templates.

smustgrave’s picture

Could we add a todo in the template so it’ll get picked up when we searches deprecations. Just afraid in a few years may forget

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!