Scott Anderson

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • Scott Anderson
    Participant

    Thanks Nico. I just ran the update and tested it out, and it looks like the problem is fixed. I also reviewed the source code of the updated version and saw essentially my same code edit (the more efficient version) in place.

    Thanks to the team for all of the great work on these plugins!

    in reply to: Suggested change to tribe_get_related_posts() function #1223068
    Scott Anderson
    Participant

    Thanks!

    Scott Anderson
    Participant

    Hi George,

    Thanks for your reply. I’m not entirely sure what’s going on with the client site. For troubleshooting I set up a partial mirror of the client’s site — that is, I set up a new WordPress site and installed the client’s custom theme and all of their plugins, but for time and logistics reasons I did not copy over all of their content. On my mirror site I could not replicate the issue. (My staging server is also running a different version of PHP than the client’s live server, which might be a factor.)

    Anyway, I went back to the client site and did confirm that the problem was specifically happening only on RSVP-only events, and narrowed it down to this one line of code.

    I would make the suggestion that it would be worth considering adding this change to the plugin even if you’re not able to replicate the problem, because as written it’s assuming that an external (WooCommerce) function is always going to return an object, which in some cases it may not.

    (I should also note that as I wrote it in my original post, the code is not efficient — it’s calling the WooCommerce function twice unnecessarily. I’ve modified my own version to assign its value to a variable and then return the variable in the ternary statement, rather than calling the function again.)

    • This reply was modified 7 years, 3 months ago by Scott Anderson. Reason: Added an additional comment
    Scott Anderson
    Participant

    I found that if I turn on Global Stock and switch Global Stock Mode from “Independent” to either of the other options, I’m able to get it to work properly. I can probably work around the issue this way, but it still seems to me that it’s either a bug or I do not understand how “Independent” is supposed to work.

    Scott Anderson
    Participant

    Makes sense. Thanks for the quick reply! I’ll open a new ticket in the appropriate category for the other issue.

Viewing 5 posts - 1 through 5 (of 5 total)