Skip to content

Problem: Markdown not rendered in Related descriptions / Related materials link lists (ISAD/RAD) #2383

Open

Description

@PeteVox

Current Behavior

Steps to reproduce the behavior

  1. Ensure Markdown is enabled.
  2. Create an archival description (ISAD or RAD template) with a title containing Markdown, e.g.
    The Author, *The Book of Books ... A comprehensive list of all books ever written* (London: The Author, 2026).
  3. Create a second description (containing anything), then link the first (main) description to it in Related descriptions (ISAD) or Related materials (RAD).
  4. View the second description in the interface.

Observed result

  • In the Related descriptions (ISAD) or Related materials (RAD) list, the first description's title is shown with literal asterisks - Markdown is not transformed.
    Affected template
    apps/qubit/modules/informationobject/templates/_relatedMaterialDescriptions.php
    The partial builds link text using $item->object->__toString() / $item->subject->__toString() and passes it directly to link_to(), bypassing render_title() / render_value_inline().
    Both ISAD and RAD include this partial:
  • plugins/sfIsadPlugin/modules/sfIsadPlugin/templates/indexSuccess.php
  • plugins/sfRadPlugin/modules/sfRadPlugin/templates/indexSuccess.php

Expected Behavior

Linked titles in the Related descriptions (ISAD) and Related materials (RAD) lists should be rendered consistently with titles elsewhere in AtoM when Markdown is enabled - i.e. *text* should appear as italics, not as literal asterisks.

This should match the behaviour already used in other templates, e.g. ISAD file list:
link_to(render_title($item), [$item, 'module' => 'informationobject'])

Possible Solution

Update apps/qubit/modules/informationobject/templates/_relatedMaterialDescriptions.php so the title portion of each link uses render_title() (which calls render_value_inline() and QubitMarkdown::parse()), instead of __toString().

Reference code, level of description, and publication status suffix remain plain text - only the linked description title needs Markdown rendering.

Updated partial:

<div class="field <?php echo render_b5_show_field_css_classes(); ?>">
  <?php if ('rad' == $template) { ?>
    <?php echo render_b5_show_label(__('Related materials')); ?>
  <?php } else { ?>
    <?php echo render_b5_show_label(__('Related descriptions')); ?>
  <?php } ?>
  <div class="<?php echo render_b5_show_value_css_classes(); ?>">
    <ul class="<?php echo render_b5_show_list_css_classes(); ?>">
      <?php foreach ($resource->relationsRelatedBysubjectId as $item) { ?>
          <?php if (isset($item->type) && QubitTerm::RELATED_MATERIAL_DESCRIPTIONS_ID == $item->getTypeId()) { ?>
            <?php if ($sf_user->isAuthenticated() || QubitTerm::PUBLICATION_STATUS_PUBLISHED_ID == $item->object->getPublicationStatus()->statusId) { ?>
              <?php
                $related = $item->object;
                $linkContent = '';
                if (isset($related->levelOfDescription) || isset($related->identifier)) {
                  if (isset($related->levelOfDescription)) {
                    $linkContent .= $related->levelOfDescription;
                  }
                  if (isset($related->identifier)) {
                    $linkContent .= (isset($related->levelOfDescription) ? ' ' : '').$related->referenceCode;
                  }
                  $linkContent .= ' - ';
                }
                $linkContent .= render_title($related);
                if (QubitTerm::PUBLICATION_STATUS_DRAFT_ID == $related->getPublicationStatus()->statusId) {
                  $linkContent .= " ({$related->getPublicationStatus()})";
                }
              ?>
              <li><?php echo link_to($linkContent, [$related, 'module' => 'informationobject']); ?></li>
            <?php } ?>
          <?php } ?>
        <?php } ?>
        <?php foreach ($resource->relationsRelatedByobjectId as $item) { ?>
          <?php if (isset($item->type) && QubitTerm::RELATED_MATERIAL_DESCRIPTIONS_ID == $item->getTypeId()) { ?>
            <?php if ($sf_user->isAuthenticated() || QubitTerm::PUBLICATION_STATUS_PUBLISHED_ID == $item->subject->getPublicationStatus()->statusId) { ?>
              <?php
                $related = $item->subject;
                $linkContent = '';
                if (isset($related->levelOfDescription) || isset($related->identifier)) {
                  if (isset($related->levelOfDescription)) {
                    $linkContent .= $related->levelOfDescription;
                  }
                  if (isset($related->identifier)) {
                    $linkContent .= (isset($related->levelOfDescription) ? ' ' : '').$related->referenceCode;
                  }
                  $linkContent .= ' - ';
                }
                $linkContent .= render_title($related);
                if (QubitTerm::PUBLICATION_STATUS_DRAFT_ID == $related->getPublicationStatus()->statusId) {
                  $linkContent .= " ({$related->getPublicationStatus()})";
                }
              ?>
              <li><?php echo link_to($linkContent, [$related, 'module' => 'informationobject']); ?></li>
            <?php } ?>
          <?php } ?>
        <?php } ?>
    </ul>
  </div>
</div>

Note: render_title() returns HTML (e.g. <em>). This is the same pattern used successfully in fileListSuccess.php and other templates with link_to(render_title(...)).

Context and Notes

No workaround is available without a code change.

Version used

AtoM 2.10.1

Operating System and version

No response

Default installation culture

No response

PHP version

No response

Contact details

No response

Activity

  1. added
    Type: bugA flaw in the code that causes the software to produce an incorrect or unexpected result.
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugA flaw in the code that causes the software to produce an incorrect or unexpected result.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions