SubformState contains 2 abstract methods

Created on 22 March 2023, over 1 year ago
Updated 10 January 2024, 6 months ago

Problem/Motivation

Fatal error: Class Drupal\markdown\BcSupport\SubformState contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Drupal\Core\Form\FormStateInterface::ignoreDestination, Drupal\Core\Form\FormStateInterface::getIgnoreDestination) in /var/www/docroot/modules/contrib/markdown/src/BcSupport/SubformState.php on line 16

Steps to reproduce

After installing markdown module and installing commonMark parser.
If you go to admin/config/content/formats and adds a new format or edits a existing format you will get the fatal error.

Proposed resolution

The SubformState class needs those two functions declared.

  /**
   * {@inheritdoc}
   */
  public function ignoreDestination($status = TRUE) {
    $this->ignoreDestination = $status;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getIgnoreDestination() {
    return $this->ignoreDestination;
  }
πŸ› Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Dan Kolbas

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

Comments & Activities

  • Issue created by @Dan Kolbas
  • @dan-kolbas opened merge request.
  • @dan-kolbas opened merge request.
  • Status changed to Needs work 6 months ago
  • πŸ‡―πŸ‡΅Japan tyler36 Osaka

    MR applies on Drupal 10.2 with Markdown 3.0.1 .

    However, it changes the error message:

    Declaration of Drupal\markdown\BcSupport\SubformState::getIgnoreDestination() must be compatible with Drupal\Core\Form\FormStateInterface::getIgnoreDestination(): bool in /var/www/html/web/modules/contrib/markdown/src/BcSupport/SubformState.php on line 172
    
  • Status changed to Closed: duplicate 6 months ago
  • πŸ‡―πŸ‡΅Japan tyler36 Osaka

    Seem https://www.drupal.org/project/markdown/issues/3409277 πŸ› Subformstate incorrect interface error RTBC is a duplicate but resolves the issue.

    Closing as duplicate. Left a note to 3409277 to consider giving credit here for any work.

Production build 0.69.0 2024