Loss of guessed link using icon list view

georgie

Member
Hello

I would use an icon to replace an email field in list.

But when I set the icon option, in list view settings to this element, I loose the guessed link, which was nice (emailto:).

Can it be improved?

Thanks
 
Rooo, sad, I did other test without success.

A link element works with an icon, but my field elements just add "#" at the URL...

I will try others tests, and a Git update...
 
Last edited:
Doubt github will help, I haven't changed anything in that code for quite a while.

Are you using the "static icon" setting?

-- hugh
 
Hi

Yes I use a "static icon".

I note no change after a Git update indeed.

In addition I note that on another website, with a new Joomla/new Fabrik, on another server/other host, I have also a problem when I use in the same time "Guess link" and "Icon" on an email field:

Code:
Warning: DOMDocument::loadXML(): error parsing attribute name in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): attributes construct error in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): Couldn't find end of Start Tag a line 7 in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): error parsing attribute name in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): attributes construct error in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): Couldn't find end of Start Tag a line 7 in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): error parsing attribute name in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): attributes construct error in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): Couldn't find end of Start Tag a line 7 in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): error parsing attribute name in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): attributes construct error in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): Couldn't find end of Start Tag a line 7 in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

Warning: DOMDocument::loadXML(): StartTag: invalid element name in Entity, line: 7 in /home/me/public_html/demo-booking.com/components/com_fabrik/models/element.php on line 636

What do you think please?
 
Hmm. Something in that element value is blowing up loadXML(). It seems to think there's a closing A tag missing. You'll have to do some debugging for me.

Install JDump:

https://extensions.joomla.org/extension/j-dump

... amd enable the plugin.

Edit ./components/com_fabrik/models/element.php, and around line at 634, dump $data out before and after it's modified, so the code looks like this ...

Code:
                        dump($data, 'Data before');
                        $data = html_entity_decode($data);
                        $data = preg_replace('/&(?!\S+;)/', '&', $data);
                        dump($data, 'Data after');
                        $html->loadXML($data);

Reload the list, and you should get a popup with that dumped data in it. You may have to enable popups for that page. Paste an example or two here.

-- hugh
 
Hello

OK, I have now something like this:

jdump.jpg


But....
 
Which site is this?

none of those strings should cause any problem. And as the error is showing, it's having issues with an "a" tag (like <a href="...">...</a>), which your debug output isn't showing.

-- hugh
 
Hello

I have updated "my Fabrik website", with a super access and FTP.
I work on this test website, but I have many websites with this problem, even as this website yet new.

Thanks in advance!
 
Ah hah.

The problem seems to be that when "guess link type" is enabled, your emails are getting cloaked, so the text being fed to replaceDataWithIcons() is ...

Code:
&lt;span&gt;&lt;span id="cloak1a282a55585597def3a2489027d5146e"&gt;This email address is being protected from spambots. You need JavaScript enabled to view it.&lt;/span&gt;&lt;script type='text/javascript'&gt;<br>
                document.getElementById('cloak1a282a55585597def3a2489027d5146e').innerHTML = '';<br>
                var prefix = '&amp;#109;a' + 'i&amp;#108;' + '&amp;#116;o';<br>
                var path = 'hr' + 'ef' + '=';<br>
                var addy1a282a55585597def3a2489027d5146e = '&amp;#97;l&amp;#105;ch&amp;#97;d&amp;#97;d' + '&amp;#64;';<br>
                addy1a282a55585597def3a2489027d5146e = addy1a282a55585597def3a2489027d5146e + 'h&amp;#111;tm&amp;#97;&amp;#105;l' + '&amp;#46;' + 'c&amp;#111;m';<br>
                var addy_text1a282a55585597def3a2489027d5146e = '&amp;#97;l&amp;#105;ch&amp;#97;d&amp;#97;d' + '&amp;#64;' + 'h&amp;#111;tm&amp;#97;&amp;#105;l' + '&amp;#46;' + 'c&amp;#111;m';document.getElementById('cloak1a282a55585597def3a2489027d5146e').innerHTML += '&lt;a ' + path + ''' + prefix + ':' + addy1a282a55585597def3a2489027d5146e + ''&gt;'+addy_text1a282a55585597def3a2489027d5146e+'&lt;\/a&gt;';<br>
        &lt;/script&gt;&lt;/span&gt;

... which for various reasons is blowing up the loadXml().

What I can't work out is why if I turn your emailcloak plugin off, it still does it.

Also, not entirely sure what the data is getting run through cloaking, I wouldn't expect that to happen till after the list is rendered.

-- hugh
 
Humm interesting...

Just a suggestion: Fabrik would not have had his own cloaking system in the past, which would have been abandoned, but here persistent?
:p
 
Hi

Yes indeed, it seems to be a good direction! Thanks, and thanks to Email Protector!
Icon does not lost his link now.

But I have now a new error when I edit with the the great inline list plugin:
Code:
Warning: Declaration of PlgFabrik_ElementDate::autoCompleteFilter($default, $v, $labelValue, $normal, $container) should be compatible with PlgFabrik_Element::autoCompleteFilter($default, $v, $labelValue = NULL, $normal = true) in /home/hgapps94/public_html/v2/plugins/fabrik_element/date/date.php on line 0

It appears in the field during the edit.

And after edit, another error in the field:
Code:
Warning: json_decode() expects parameter 1 to be string, array given in /home/hgapps94/public_html/v2/components/com_fabrik/models/group.php on line 1513
Warning: array_diff(): Argument #1 is not an array in /home/hgapps94/public_html/v2/components/com_fabrik/models/group.php on line 1470

Please what do you think about?
 
Last edited:
Looks like your code is not up to date. The date element code for getAutoComplete got changed at the same time as the main element model. But it looks like you only updated the date element. Do a fill github update and try again.


Sent from my HTC 10 using Tapatalk
 
Hi

Indeed it is better after full update, thanks ! o_O

First error about "PlgFabrik_ElementDate" on list has vanished.

But I have always two errors with inline plugin, after edit a record, in the field edited.
This only with error reporting, and edit works OK, so it is not very important for me (unless you tell me that yes):
Code:
Warning: json_decode() expects parameter 1 to be string, array given in /home/hgapps94/public_html/v2/components/com_fabrik/models/group.php on line 1513

Warning: array_diff(): Argument #1 is not an array in /home/hgapps94/public_html/v2/components/com_fabrik/models/group.php on line 1470

I have delete caches, websites front, back, my browser and host.

Thanks for following!
 
As per the wiki, the inline edit plugin is deprecated, we're not providing support for it any more. It's "as is":

NOTE - this plugin is provided "as-is", and we will not be doing any more development or bug fixing of it in the 3.x versions of Fabrik. Please test the functionality you need, before committing any app design to rely on using it. It works for simple use cases, but may not work as expected for "complex" usage, involving menu pre-filtering, element ACL's, joins (as mentioned above), non-trivial form plugins (such as PayPal), etc.

More importantly, it looks like the code throwing those warnings is in the repeat group deletion code, which means you list probably has repeat groups. Again, as per the wiki:

IMPORTANT NOTE - until this notice is removed, do not use the inline edit plugin if you have repeated groups / list joins on your form. We recently discovered an issue in Fabrik 3.1/2 which may result in loss of data if this plugin is used on lists with repeated groups.

-- hugh
 
Ouch! Thanks but it is a bad new for me. Indeed this plugin is great and efficient, it renders many important services, in particular on "big lists" a little slow: users does not need to enter in a record.

In addition, indeed, I use it for in some complex lists (join and ACL on filters).

Please note that in the past, I had some problems with this plugin, but solved (I hope...) after many checks (changing ACL, unpublished unused element, tests...).

Please, it will be a plugin replacement in the future?

I will re-check my app concerned.
 
It just turned into too much of a time sink. We put something like 500 hours work into it, and there's still some intractable problems (like the repeat join issue).

I can probably fix basic, simpler issues that may arise with it, but things like the issue you hit with the repeat join ... that's a week's work (on top of my usual 60 hours workload) of refactoring a lot of core code, and then a month of testing every use case of joins.

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

Thank you.

Members online

Back
Top