Problem/Motivation

When the checkbox "display QR image text" is selected, the resulting display contains the pre-evaluated field string, i.e. the text "[node:url:path]" will be displayed instead of the actual value of the path component to the current node.

Steps to reproduce

  1. Create a QR field.
  2. Enable QR image text checkbox in field display settings.
  3. Add a token such as "[node:url:path]" to the field value.
  4. Use a QR code reader to confirm that the QR code contains the evaluated token value. Observe that the rendered text contains the template value, not the evaluated result.

Proposed resolution

Leverage the computation of the token text done by the QR image service.

Remaining tasks

Commit provided patch with fix.

User interface changes

Rendered result fixed; no other changes.

API changes

This patch is predicated on the QR image service providing #alt text, as done in #3177509: Add alt text to QR code images.

Data model changes

None.

Other Prerequisites

This patch also assumes that the token rendering bug has been fixed, as provided in #3156229: Fix Token rendering for [node:...] and other entity keys

CommentFileSizeAuthor
#2 qrfield-3177511-2.patch1.13 KBgreg.1.anderson

Comments

greg.1.anderson created an issue. See original summary.

greg.1.anderson’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.13 KB

Fix attached.

Note as an additional enhancement, this patch also wraps the QR image text in an element as a service for theming / styling this text.

greg.1.anderson’s picture

Not sure if we actually should do the prefix / suffix thing here, or leave that up to the theme.

borutpiletic’s picture

Patched without prefix/suffix.

Thank you!

borutpiletic’s picture

Status: Needs review » Fixed
borutpiletic’s picture

Status: Fixed » Closed (fixed)