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
- Create a QR field.
- Enable QR image text checkbox in field display settings.
- Add a token such as "[node:url:path]" to the field value.
- 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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | qrfield-3177511-2.patch | 1.13 KB | greg.1.anderson |
Comments
Comment #2
greg.1.anderson commentedFix 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.
Comment #3
greg.1.anderson commentedNot sure if we actually should do the prefix / suffix thing here, or leave that up to the theme.
Comment #5
borutpiletic commentedPatched without prefix/suffix.
Thank you!
Comment #6
borutpiletic commentedComment #7
borutpiletic commented