Loading...
 
Features / Usability

Features / Usability


Plugin Edit removes line breaks in FancyTable

posts: 103 Wales

When I used Plugin Edit to amend a FancyTable, submitting a change causes all line breaks in the table body to be removed.

The PluginEdit shows a field "Rows separated by >> in the header; for the table body, one row per line. Cells separated by | in both cases."

After creating a working FancyTable with table body rows like this:

row 1 cell 1 | row 1 cell 2
row 2 cell 2 | row 2 cell 2

after submitting/inserting the plugin edit tool this changes to:

row 1 cell 1 | row 1 cell 2 row 2 cell 2 | row 2 cell 2

Is this a bug? Can I change an admin preference? Is there a workaround, I tried inserting Wiki end of line code to no avail.

posts: 400

Wasn't able to reproduce this problem using version 5.1, 6.1, 6.4 or the upcoming version 7. What version are you using? Can you post the exact syntax you're using for the fancytable plugin?
Thanks,
lindon

Dominic wrote:

When I used Plugin Edit to amend a FancyTable, submitting a change causes all line breaks in the table body to be removed.

The PluginEdit shows a field "Rows separated by in the header; for the table body, one row per line. Cells separated by | in both cases."

After creating a working FancyTable with table body rows like this:

row 1 cell 1 | row 1 cell 2
row 2 cell 2 | row 2 cell 2

after submitting/inserting the plugin edit tool this changes to:

row 1 cell 1 | row 1 cell 2 row 2 cell 2 | row 2 cell 2

Is this a bug? Can I change an admin preference? Is there a workaround, I tried inserting Wiki end of line code to no avail.


posts: 103 Wales

Hi lindon, thanks for taking the trouble to look at this.

I'm using Tiki 6.3. I've replicated problem on different site running 6.1 also.

Here's the syntax:

Example 1:

header header2
row 1 row 1
row 2 row 2


Example 2:

Here's the syntax as appears immediately after creating a fancytable with pluginhelp in wiki mode:

Product Range Quantities Available Price exc. VAT
Un-haired scratch coat 25kg bags
Haired scratch coat 25kg bags
Fine finish coat 25kg bags
Hair 20kg bags
Synthetic hair 20kg bags
Un-haired scratch coat bulk
Haired scratch coat bulk
Fine finish coat bulk
Hair bulk
Synthetic hair bulk


and here's what it looks like after editing with pluginedit or, interestingly, when viewing 'source' in wysiwyg mode:

Product Range Quantities Available Price exc. VAT
Un-haired scratch coat 25kg bags Haired scratch coat 25kg bags Fine finish coat 25kg bags Hair 20kg bags Synthetic hair 20kg bags Un-haired scratch coat bulk Haired scratch coat bulk Fine finish coat bulk Hair bulk Synthetic hair bulk

posts: 400

Still can't seem to duplicate on 6.1. Tried using the help and plugin edit as you mention and also switched back and forth between wysiwyg and wiki mode.

Perhaps there's a setting messing things up. Does changing the "wiki paragraph formatting" settings at Admin Home > Editing and Plugins help? Or some of the Wysiwyg settings at Admin Home > Wysiwyg? Shouldn't make a difference but I'm running out of ideas! Sorry I'm not more help - perhaps someone else can replicate.
Regards,
lindon

Dominic wrote:

When I used Plugin Edit to amend a FancyTable, submitting a change causes all line breaks in the table body to be removed.

The PluginEdit shows a field "Rows separated by in the header; for the table body, one row per line. Cells separated by | in both cases."

After creating a working FancyTable with table body rows like this:

row 1 cell 1 | row 1 cell 2
row 2 cell 2 | row 2 cell 2

after submitting/inserting the plugin edit tool this changes to:

row 1 cell 1 | row 1 cell 2 row 2 cell 2 | row 2 cell 2

Is this a bug? Can I change an admin preference? Is there a workaround, I tried inserting Wiki end of line code to no avail.


posts: 3 United States

I am having the same problem in Tiki 6.3

One workaround I found is to put 
 at the end of each line. This is the html code for a line feed character. Unfortunately, you have to do this to each line every time you edit the table.

posts: 3 United States

Took me all day, but I finally figured out a fix. it basically automates the workaround I mentioned previously.

Again, this is in Tiki 6.3, but I would venture to guess that this would work in other versions as well.

Line 759 of tiki-jquery.js should look like this:

Copy to clipboard
var blob = '{' + type.toUpperCase() + '(' + params.join(',') + ')}' + (typeof form.content !== 'undefined' ? form.content.value : '') + '{' + type.toUpperCase() + '}';


Add the following code directly above it:

Copy to clipboard
//workaroround for ckEditor if ((typeof form.content !== 'undefined') && (typeof CKEDITOR != 'undefined')) { form.content.value = form.content.value.replace(/(\r\n|[\r\n])/g,'~38~#10;'); } //end workaround
posts: 103 Wales
Thanks, mycroft. I'll give that a go.
posts: 103 Wales

Yes, that workaround worked for me to (putting 
 at the end of each line).

Unfortunatley, if you have more than one table on the same page you're stuck - as editing one (with the workaround) will mess up the other when you "insert".

posts: 103 Wales

Hi mycroft,

I implemented your workaround in above 759 of tiki-jquery.js.

It worked biggrin except I getthe same problem as with the manual workaround:

If you have two or more fancy tables on the same page, when you edit one (which works fine now), the other messes up. Try and edit that one it'll fix it but them the first one messes up again frown

posts: 3 United States

I feel silly that none of us have bothered to mention which web browser we are using. The first patch that I posted seems to work in Firefox 4 and Chrome. I have since seen an additional problem in IE. I have not got this working in IE 7 yet but I have had luck in IE 8 (IE 8 runs in IE7 compatibility mode by default, I believe - I had to manually switch it to IE 8 mode in the debug tools).

So, to get to the point, there is another bug I found that only affects IE.


Line 208 in lib\ckeditor_tiki\plugins\tikiplugin\plugin.js

Change:

Copy to clipboard
ret = $("").html(ret).text(); // decode html entities


To:

Copy to clipboard
return arguments[1];


The Element.innerHTML() function has a know problem of stripping linefeed characters in IE. This function is called in the jQuery .html call above. It turns out that we don't need to decode the html here as ckEditor seems to take care of it somewhere else.


posts: 103 Wales

Ah,yes. I was testing in both Firefox 3.6.13 and Safari 5.0.5

I've continued testing the patch and it appears not to solve the problem in an Article. Here the problem persists,whereas Wiki pages now work (where there's only one fancy table).


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting