Update .module file to include README.md

Created on 11 July 2023, over 1 year ago
Updated 30 August 2023, about 1 year ago

Problem/Motivation

The README.md file is not displaying on the Help page (/admin/help/search_api_attachments).

Warning: file_get_contents(/var/www/html/docroot/modules/contrib/search_api_attachments/README.txt): Failed to open stream: No such file or directory in /var/www/html/docroot/modules/contrib/search_api_attachments/search_api_attachments.module on line 69

Steps to reproduce

  • Update module to version 9.0.1
  • Visit /admin/help/search_api_attachments on your site
  • Notice that the README does not load and instead throws a warning about a missing file

Proposed resolution

Update /docroot/modules/contrib/search_api_attachments/search_api_attachments.module to include README.md instead of README.txt.

Change line 69 in search_api_attachments.module to

/**
 * Implements hook_help().
 */
function search_api_attachments_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.search_api_attachments':
      $text = file_get_contents(dirname(__FILE__) . '/README.md');
      if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
        return '<pre>' . $text . '</pre>';
      }
🐛 Bug report
Status

Fixed

Version

9.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024