Community Builder substitutions messing up Fabrik validations

boyjah

Member
I added a Display field to a Fabrik form that is used to display data from Community Builder. The field shows the correct information, but something about the Community Builder substitutions syntax is causing problems for validation mechanism (validation = field not empty) when editing the form.

The text, including Community Builder code that is in the "Default" box for the display field is:

Screen Shot 2020-12-29 at 17.34.12.png

(I have to include a screenshot of this code as when included as text, I continuously get a server error when trying to post this topic, so there is definitely something in there that Fabrik does not like)

The correct data shows up for the above, but now on the rest of the form, the required field validation goes from this:
Screen Shot 2020-12-29 at 16.05.27.png

To this:

Screen Shot 2020-12-29 at 16.11.12.png

The validation function shows that way for the rest of the page on all required items.

Any ideas as to what is the issue and how I can correct this?
 
Confirmed. Plus:
- It's also validations of form fields before the display element which are getting screwed up.
- It's not caused by the Japanese characters, it's going wrong with "ASCII only", too.
- Eval-ing the display text and escaping all sorts of characters and quotes doesn't help either.
- No JS error thrown.

Still searching for the cause...
 
Must be something wrong with the combo of CB(Subs) substitutions and the Fabrik form's content plugin handling.

In the meantime this workaround should work:

In the display element, set "Eval" to "yes".
In the "Default" field enter your expression as PHP like this:
Code:
return 'From ' . JHTML::_('content.prepare', '[cbsubs:subscriptions user="#displayedOrMe" plan="2" output="signup_date" /]') . ' JAPANESE to ' . JHTML::_('content.prepare', '[cbsubs:subscriptions user="#displayedOrMe" plan="2" output="expiry_date" /]') . ' JAPANESE';
You can now leave the form's processing of Joomla plugins on or turn it back off - it shouldn't matter either way.
 
Perfect! You are my new Code Warrior Savior Hero!

Implementing your suggestion solved the problem and taught me something new about Joomla coding and I am very grateful. I would also like to say that many of your other posts for other users have also been very helpful to me as well. I was having a similar problem with an article that included Fabrik placeholders and CB placeholders, where the CB ones would function but the Fabrik ones would only work if I removed the CB placeholders. The CB placeholders were in a php code, so I was able to solve it using the global $_CB_framework; work around you had posted about elsewhere.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top