Rephrase the deprecation notice that is raised when calling the label() method of a view without an explicit label

Created on 27 September 2023, 9 months ago
Updated 20 October 2023, 8 months ago

Problem/Motivation

In πŸ“Œ Views should require a label, rather than falling back to an unhelpful ID RTBC , we made it a deprecated behavior for a view to not have an explicit label (previously, the View::label() method would fall back to the ID). @effulgentsia raised the following concern on commit:

I feel like either that [deprecation] message should be moved to happen when the view is saved or the message text should be word-smithed to make a bit more sense in the context of it getting triggered here rather than during the save operation.

(See #3380480-24: Views should require a label, rather than falling back to an unhelpful ID β†’ .)

Steps to reproduce

Have a view without a explicit label -- you'll have to create one programmatically, since it can't be done in the UI -- and call the label() method on it.

Proposed resolution

Change the wording to be clearer, or move the deprecation to View::preSave().

Remaining tasks

Figure out what to do, and do it.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None will be necessary for a change like this.

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated 2 minutes ago

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

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

Comments & Activities

  • Issue created by @phenaproxima
  • πŸ‡ΊπŸ‡ΈUnited States effulgentsia

    Thanks for opening this. First question: what are the pros/cons of triggering the deprecation when label() is called vs. when the view is saved?

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    My $0.02:

    The main pro is that you'll know sooner if you have an invalid view; label() is more likely to be called in the normal course of things than preSave(), especially for views that don't change frequently.

    The main con is that label() is a strange place to put the deprecation, because indeed, you really shouldn't be able to save a view without a label.

    To me, the conclusion is that both places should trigger the deprecation, with slightly different wording in each.

  • Assigned to effulgentsia
  • Status changed to Needs review 9 months ago
  • πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    The main pro is that you'll know sooner if you have an invalid view

    +1

  • Status changed to Active 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Moving to active as consensus seems to be this is a good task to have.

Production build 0.69.0 2024