Remove static "Hint:" prefix

Created on 21 January 2025, 4 months ago

Problem/Motivation

Hi and thank you very much for this wonderful module, which is extraordinarily well-designed and flexible.

There's just one little thing I don't really like and think it would be better to remove: The "Hint:" text being output statically as prefix for the password hint.

The point is: If you want to add a "Hint:" prefix, you could simply write that into the password hint. But currently there's no easy way to remove it.

And in our case, it's more disturbing and confusing than helpful.

So would you agree that it could be removed?
An update hook could then add it as prefix of the password hint, if it should be 100% backwards-compatible.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    Thanks for your feedbacks.

    As it is in a template, I would have guessed people would override the template to remove it if needed.

    Ok to remove it, if:
    - there is an update hook
    - let's put "hint:" as default value when configuring the formatter?

  • 🇩🇪Germany Anybody Porta Westfalica

    As it is in a template, I would have guessed people would override the template to remove it if needed.

    Right, as written above I just think it's unnecessarily hard for site owners / managers and has no real benefit. You could simply add the word, if needed, but can't remove it without code currently.

    - there is an update hook

    Sure!

    - let's put "hint:" as default value when configuring the formatter?

    You decide! We can do that, but I'd vote to only do that for existing sites in the update hook and leave it empty. The labels / description should do the job and if it's not enough we could use a #prefix. I don't really see a good reason for that word, but that's just my personal opinion. Please think about it and let me know about your final decision :)

    We'll finish this afterwards.

  • 🇫🇷France Grimreaper France 🇫🇷

    I think this word is a legacy from Protected Node but not sure.

    Ok for existing websites, and empty for new installs.

  • 🇩🇪Germany Anybody Porta Westfalica

    Fine! We'll do that! :)

  • Status changed to Needs work 15 days ago
  • 🇩🇪Germany Grevil

    Should we write the update hook for nodes only? Or should we use other core entities as well (media, taxonomy_term)? As this module works for any filedable entity.

    Since I don't think, we can simply load all fieldable entities who use the "entity_access_password_password" field type.

  • 🇩🇪Germany Grevil

    Current MR now holds the version for updating node only. Note, that this update hook isn't tested yet.

    Need further feedback.

  • Pipeline finished with Success
    15 days ago
    #489252
  • 🇩🇪Germany Anybody Porta Westfalica

    @grevil thanks, that looks exactly as planned. Regrading the entity question: I thinkt here must be a way to get all entity types / bundles that use a certain field type, here: entity_access_password_password

    Those should then be processed, I think. Do you agree?

  • Pipeline finished with Canceled
    14 days ago
    #489926
  • 🇩🇪Germany Grevil

    Yea I agree, this should be it now. I still need to test it though.

    I am wondering if we need to leverage the batch api here... on large sites this could very well reach the memory limit...

  • Pipeline finished with Success
    14 days ago
    #489927
  • 🇩🇪Germany Grevil

    Alright, this works great! Just tested it through adding two differently named password fields on a node bundle and taxonomy bundle and created 1 new entity per bundle.

    The string "Hint: " was prepended as expected on both. Ready for review!

  • 🇩🇪Germany Anybody Porta Westfalica

    Whao this is crazy good @grevil! Thank you! LGTM, let's wait for @grimreaper's feedback!

  • 🇩🇪Germany Grevil

    Thanks! So summarizing this, there are two questions left:

    1. Should we leverage the batch API?
    2. Should we preserve the "changed" date?

    Let's wait for @grimreaper's feedback!

Production build 0.71.5 2024