From @Grimreaper

So, about "'HTML classes' source is deprecated in favor of 'Attributes'.". The problem is https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/src/Plugin/U...

  /**
   * {@inheritdoc}
   */
  public function getPropValue(): mixed {
    // @phpstan-ignore-next-line
    \Drupal::messenger()->addWarning("'HTML classes' source is deprecated in favor of 'Attributes'.");
    return parent::getPropValue();
  }

Messenger is called in getPropValue so when a component is displayed it is triggered. That's why it was displayed when just going on a layout builder page (not form).

I think it would be better to override the constructor and use Drupal API to mark a deprecation.

So it will be logged and detected by tools like rector and/or phpstan

And for settingsForm , instead of the messenger, just use the renderable array:

$form['warning_markup'] = [
  '#theme' => 'status_messages',
  '#message_list' => [
    'warning' => [
      $this->t('It is highly recommended to disable pager if you merge rows.'),
    ],
  ],
];

From @pdureau

Also, add (Deprecated) in plugin label

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

pdureau created an issue. See original summary.

pdureau’s picture

Issue summary: View changes
grimreaper’s picture

  • pdureau committed fd238fef on 2.0.x
    Issue #3495847 by pdureau, grimreaper: Better handling of HTML classes...
pdureau’s picture

Assigned: pdureau » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.