• I have this on a page:

    [pass field=”white_player”][if user_field=”id” value=”{FIELD}”][field title-link]
     
    [/if][/pass]

    When both the white_player field (which is a custom field in a topic) and the user id is 452 for example, then this link is displayed. But when both of them are 404, then it is not displayed. This is a major problem for me (since I have a user whose id is 404) which took quite a while to track down. Do you have a fix for this?

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hmm, how strange – only this specific user ID, 404, is not working? I’ll check to see if I can find anything that could be causing this.

    Could you try this line to see if the field is displaying the correct value?

    [pass field="white_player"]{FIELD}[/pass] should equal [user id]

    If it displays 404 (and others), then I can check the other shortcodes.

    Thread Starter lenningrl

    (@lenningrl)

    That’s the only user ID that I’ve seen with the problem. All of the others seem to be working ok.

    For the user and record in question, for the code you give I get this display:

    404 should equal 404

    But my original code still fails for that case.

    Thread Starter lenningrl

    (@lenningrl)

    Plugin Author Eliot Akira

    (@miyarakira)

    OK, I’m looking into this, to see what I can find.

    In the meantime, could you tell me the output of this?

    [pass field="white_player"]
      [if user_field="id" value="{FIELD}"]
        [field title-link]
      [else]
        [user id] is not equal to {FIELD}
      [/if]
    [/pass]
    Thread Starter lenningrl

    (@lenningrl)

    For the case we are looking at, here’s the output copied directly:

    404 is not equal to 404

    Note: I have both white_player and black_player fields in the code and black_player is the one that isn’t working right now in this case, so I’ve substituted that field in your code.

    Plugin Author Eliot Akira

    (@miyarakira)

    Thanks for pointing this out. I found an issue with how the parameters are checked, and there was indeed a conflict when the parameter value is 404 exactly. I fixed [if] and other shortcodes to eliminate this possibility. Please try the most recent plugin update.

    Thread Starter lenningrl

    (@lenningrl)

    At a glance it looks like this fixes it! Thanks so much, Eliot! I very much appreciate how responsive you’ve been with this problem. And your plug-in is very useful. I’ll be adding a positive review for this plugin.

    Plugin Author Eliot Akira

    (@miyarakira)

    I’m glad you told me of this issue, because it affected several shortcodes, and this bug was not easy to find – it only happened in rare cases. That’s good to hear that it’s working now.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘User 404’ is closed to new replies.