Views PHP Output Issue

Created on 24 January 2021, over 3 years ago
Updated 12 July 2023, 12 months ago

I am trying to use SpampSpan on a views PHP field (D8/D9) with limited success. I have pulled the user email field and kept it hidden, as I want it to only show if a specific PHP criteria is met. The email field when left visible works properly when the SpamSpan formatter is selected, but it does not apply when I echo the row field in the php field.

If I add the SpamSpan to the PHP code:
echo spamspan("$row->mail");

This outputs:
<span class="spamspan"><span class="u">markymark</span> [at] <span class="d">gmail.com</span></span>

Whether I select a formatter of SpamSpan or plain text, I cannot get this to work. I feel like maybe I am using the output incorrectly with $row->mail, is there another code I should be using that would output the field fully when I select the SpamSpan formatter? $row->mail seems to only output as plain text, even if I select other formatters.

Thanks in advance for any suggestions.

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tyler-durden

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Is this still an issue in 3.x?
    We need tests for such cases to ensure it doesn't happen again. Then we can fix it.

  • Issue was unassigned.
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Sorry, someone using the module like this, should work on it.

  • Status changed to Postponed: needs info 12 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Please retry with latest dev, which has a lot of fixes and tests. If still valid, we should then add a test. But this has no reply since 2Y so the next one should close this...

  • Status changed to Closed: cannot reproduce 12 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    I guess you selected markup to be escaped of views does this for security reasons. Please use the spamspan formatter for email fields instead.

Production build 0.69.0 2024