SOLVED: Required field shows " opts='{"formTip":true,"position":"top-left","trigger":"hover","notice

boyjah

Member
After recent updates all required fields on all forms are showing strange code and hovering shows blank box.

" opts='{"formTip":true,"position":"top-left","trigger":"hover","notice":true,"heading":""}'>

I have tried turning on and off or modifying settings for everything I can find regarding validations and tooltips but no success.

Joomla = 3.8.1
Fabrik = 3.8
Template = Protostar standard Joomla template

Screen Shot 2017-11-07 at 00.52.00.png
 
Did you clear Joomla and Browser cache?
Do you have a link?
Are you using a custom form template?
 
Looking at one of your pages, the problem is that the tip title isn't HTML encoded. It should look something like this:

Code:
        <label for="fab_main_test___name" class="fabrikLabel control-label fabrikTip" title="&lt;ul class=&quot;validation-notices&quot; style=&quot;list-style:none&quot;&gt;&lt;li&gt;&lt;i data-isicon=&quot;true&quot; class=&quot;icon-eye-open notempty&quot; &gt;&lt;/i&gt; Pflichtfeld&lt;/li&gt;&lt;/ul&gt;" opts='{"formTip":true,"position":"top-left","trigger":"hover","notice":true,"heading":"Hinweis"}'>

... woth everything in the title="..." being HTML encoded, but your looks like this:

Code:
        <label for="y2vfp_fab_contactus___contactusname" class="fabrikLabel control-label fabrikTip" title="<ul class="validation-notices" style="list-style:none"><li><i data-isicon="true" class="icon-star notempty" ></i> This is a required field</li></ul>" opts='{"formTip":true,"position":"top-left","trigger":"hover","notice":true,"heading":""}'>

The encoding should happen here:

https://github.com/Fabrik/fabrik/blob/master/components/com_fabrik/models/element.php#L1917

Can you check your file, components/com_fabrik/models/element.php, and make sure those lines match against the github copy?

-- hugh
 
Thank you so much for your reply. I confirmed that my file element.php was the same on line 1917 but just to make sure I also tried replacing the contents of my file with the contents of the github file. No change. I also tried reinstalling FABRIK 3.8 but still the same. I always empty all cache, logout of Joomla and quit browser after making such changes. Using standard issue form template.
 
Last edited:
Can you unblock the backend account you gave us in your My Sites?

I just did some debugging (using the ftp account), and the tip is correctly html encoded during the rendering, so I need to figure out what could possibly be converting it back to html after Fabrik has finished rendering it.

-- hugh
 
Well, I'm glad it's not live.

I disabled the ContentBuilder system plugin, and now the front end white screens, as does the backend Plugin manager, so I can't re-enable it.

You'll have to use phpMyAdmin (or whatever) and tweak the #__extensions table row for it, and set 'enabled' back to 1.

-- hugh
 
Last edited:
BTW, the reason I disabled it is ...

As far as I can tell, those tooltips are correctly HTML encoded throughout the Fabrik rendering process. But, in the payload in the browser, they have been converted back to non-encoded markup (so &lt; is back to being a <, etc). I've never seen this happen on any other site, and nobody else is reporting this issue.

So ... something, somewhere must be un-encoding the body of the page before it gets sent to the browser. Which would have to be a system plugin, running on something like the onAfterRender hook. And as I've never seen this happen before, it's probably a plugin I've never seen before, which "does something" with page content. I've never seen ContentBuilder before, and by the name, I'm guessing it does something with content. So it seemed like the most likely candidate.

But ... if we can't disable that plugin without the system crashing, it's going to be hard to prove my theory. Although the fact that it does somehow manage to crash the system when disabled kinda makes me even more suspicious, as it seems to indicate the ContentBuilder code does Impolite Things.

-- hugh
 
I restored the site from backup. ContentBuilder was the list building part of BreezingForms (the package I tried before I found Fabrik). I uninstalled all ContentBuilder and BreezingForms extensions from the site. I also uninstalled ChronoForms and its associated ChronoConnectivity (the other form builder that I tested). They are all gone! But the issue remains. BUT, here is something noteworthy that I discovered: The errors do not show up on one of my Fabrik forms! If you look at the Japanese version of the contact form (formid=21), it has the same required fields as the English version (formid=19) but no weird code showing.
 
Ah HAH!

OK, it's the "Content - Community Builder" content plugin.

The only difference between 19 and 21 is that in form 21, you had "Process Joomla Plugins" (in the Options tab) set to "Detail View only", and on 19 it was "Form and Detail View". I turned that off in 19, and the tips worked. So I started disabling non-core content plugins, and the problem goes away when that CB content plugin is disabled.

So the CB content plugin is doing something naughty. A content plugin should never modify anything on the page outside it's own {whatever}...{/whatever}.

-- hugh
 
Yup, and there it is, line 151 in ...

./plugins/content/cbcontentbot/cbcontentbot.php

Code:
        $row->text                    =    $this->substituteText( htmlspecialchars_decode( $row->text, ENT_COMPAT ), $cbUser, $extra, $hasRaw );

... that htmlspecialchars_decode() is decoding all encoded HTML back into HTML.

-- hugh
 
You are a genius and you are my HERO! Thank you!

And to answer your earlier question, WWOOF is an organic farmstay exchange program that facillitates volunteers from around the world going to Japan to do volunteer work on organic farms in exchange for room and meals and an incomparable introduction to the local culture. Best and cheapest way to see new worlds! Most countries have such a system. I handle Japan and China.
 
That is awesomely cool! As both Japan and China are on my Bucket List to visit, if I was younger and hadn't had major back and neck surgery ...

BTW, one thing that puzzles me is that the CB plugin shouldn't get as far as running that line of code, unless it finds a {cb} tag in the content.

Are you outputting that tag as part of your form?

-- hugh
 
I've gone through all of my forms and I cannot find any instance where I have incorporated a {cb} tag. Disabling Community Builder cbcontentbot plugin does indeed fix the problem though. The only connection between any of my forms and Community Builder that I can think of is that I am using the Community Builder profile tab plugin for Fabrik, though disabling it has no effect on the problem...

I also use an extension called Articles Anywhere, which is used on 2 forms, but disabling it does not solve the issue. Only disabling the Community Builder contentbot fixes it.
 
Thank you so much for your attention to this. I only need to have Process Joomla Plugins enabled for the 2 forms where I use Articles Anywhere to include article text in my forms. Unless there is another way, native to Fabrik, that allows me to include the text of an article as part of my form? Forms 22 and 23 incorporate the text from our Terms of Service page with an Agree or Disagree form at the end. If I can include the TOS text in the form without using Articles Anywhere, that would be ideal.
 
Nope, nothing native to Fabrik. I did think about it a while back, but as there are existing solutions (like Articles Anywhere), it seemed like reinventing the wheel.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top