Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Substitutions stopped working after upgrade to CB 2.0.15

  • michaedt
  • michaedt
  • OFFLINE
  • Posts: 63
  • Thanks: 11
  • Karma: 4
8 years 2 months ago - 8 years 1 month ago #284951 by michaedt
I have two website that use substitutions in tabs. Both sites are very similar (substitutions are exactly the same). Here is an example of the code that worked on both sites before upgrading Community Builder (this is only the first part of the code, but the structure is the same for everything else):
Code:
[cb:if viewaccesslevel !includes "6" && user_id="myid"] <h2 class="title">Animals</h2> <p>.....content here... </p> [/cb:if]

I used Akeebabackup to restore one of the sites so that I could compare. I tried again and it stopped working after installing the new CB version.
I'm not sure where to start looking for the solution.

Joomla 3.6.2
One of the sites is www.equitag.com , but you'll need a user account to see what I'm talking about. If you create a free account, you should see content in the "Animals" tab even if you don't have any animals yet.
Last edit: 8 years 1 month ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48456
  • Thanks: 8280
  • Karma: 1443
8 years 2 months ago #284983 by krileon
Did it stop working after restoring from an akeeba backup or after installing 2.0.15? 2.0.15 didn't touch substitutions beyond what was already done in possible nightly builds.

What do you mean by stopped working? Is it displaying the raw text of the substitution or just always hiding the contents of the IF substitution (so always failing the IF check)?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • michaedt
  • michaedt
  • OFFLINE
  • Posts: 63
  • Thanks: 11
  • Karma: 4
8 years 2 months ago #284988 by michaedt
Thank you for your prompt response.
It stopped working after installing 2.0.15. I restored from akeeba backup just to make sure that it wasn't something else. It worked again after restoring, then failed after upgrading to 2.0.15.
It does not display any content (and no raw text), so I assume that the IF check is always failing.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48456
  • Thanks: 8280
  • Karma: 1443
8 years 2 months ago #284994 by krileon
Ok, then yeah the IF check is failing. Please ensure all of CB is up to date. This includes integrations like CB Content Bot, etc..


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: michaedt

Please Log in or Create an account to join the conversation.

  • michaedt
  • michaedt
  • OFFLINE
  • Posts: 63
  • Thanks: 11
  • Karma: 4
8 years 2 months ago #285007 by michaedt
You are a rock star. It was the CB Content Bot. Thank you.
I notice one odd thing that changed. I can no longer publish CB field substitutions inside Regular Labs code. For example, I can no longer use [user_id] inside the following:
Code:
{articles categories="My Category"}{if created_by=[user_id]}{introtext}{/if}{/articles}
If I replace [user_id] with an actual user id, it works.
If I add [user_id] outside of this code, it shows the user id. It simply won't work inside the {article} tags.
I assume that this is an issue with Regular Labs and not CB, but thought I'd post here in case you have ideas. I can post to a new thread if it turns out to be a CB issue.

Please Log in or Create an account to join the conversation.

  • michaedt
  • michaedt
  • OFFLINE
  • Posts: 63
  • Thanks: 11
  • Karma: 4
8 years 2 months ago #285034 by michaedt
I think I figured out the source of the problem, but still need help with the solution. System plugins are run before Content plugins, and Articles Anywhere is a system plugin whereas the CB contentbot is a Content plugin. Thus the moment Articles Anywhere sees the code and interprets the tag, it is still rendered as:
Code:
{if created_by=[user_id]}
So I need to use a different method to push the user_id into the if tag than CB Substitutions. For example, I could use a custom php script to collect the user_id and output inside the {articles} tag. I could do it with Regular Labs Sourcerer, but I'm not sure how to write the PHP to get the user_id. I'll begin my search. Any advice with be appreciated.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum