? ? ? Pending

User tests: Successful: Unsuccessful:

avatar rdeutz
rdeutz
26 Mar 2017

Pull Request for Issue #11934 .

Summary of Changes

Check if the cut is within a tag

Testing Instructions

see #11934 or #12612

avatar rdeutz rdeutz - open - 26 Mar 2017
avatar rdeutz rdeutz - change - 26 Mar 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Mar 2017
Category Libraries Unit Tests
avatar mbabker
mbabker - comment - 26 Mar 2017

I think there was a reason the truncateComplex method was added and truncate wasn't made this "smart". But considering how long ago that was, don't ask me why anymore.

avatar rdeutz
rdeutz - comment - 26 Mar 2017

whatever it is a bug, I think the first time I have found it was 5 years ago.

avatar mbabker
mbabker - comment - 26 Mar 2017

I'm just going to go with "meh, whatever, fix it". I tried to find where that was added and all I came up with was a couple of wordy and not really helpful PRs.

avatar zero-24 zero-24 - test_item - 29 Mar 2017 - Tested successfully
avatar zero-24
zero-24 - comment - 29 Mar 2017

I have tested this item successfully on acb901d

Works.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14907.

avatar zero-24
zero-24 - comment - 29 Mar 2017

Before the patch
screen shot 2017-03-29 at 13 11 09

after the patch
screen shot 2017-03-29 at 13 10 48


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14907.

avatar laoneo
laoneo - comment - 29 Mar 2017

When I add the following unit test data

'HTML allowed, split allowed' => array(
	'<div class="test"><p>whatever it is a bug.</p></div>',
	20,
	true,
	true,
	'<div class="test"><p>whatever</p></div>...',
),

then it fails. As soon as I remove the class="test" code from the div then it works.

avatar rdeutz
rdeutz - comment - 29 Mar 2017
<div class="test"><p>whatever it is a bug.</p></div>
1234567890123456789012345678901234567890123456789012
0000000001111111111222222222233333333334444444444555
...................|
<div class="test"><
<div class="test">
<div class="test"></div>

Your split is within the "<p>" Tag, then the "<" will be removed and the div will be closed. So my guess is that your Test result should be

<div class="test"></div>...

Haven't tested it

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 29 Mar 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 29 Mar 2017

I have tested this item successfully on acb901d

Followed Test Instructions #12612 got with or -out PR:


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14907.

avatar franz-wohlkoenig franz-wohlkoenig - change - 29 Mar 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 29 Mar 2017

RTC after two successful testes.

avatar laoneo laoneo - test_item - 30 Mar 2017 - Tested unsuccessfully
avatar laoneo
laoneo - comment - 30 Mar 2017

I have tested this item ? unsuccessfully on acb901d

Please see my previous comment.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14907.

avatar laoneo
laoneo - comment - 30 Mar 2017

@rdeutz when I remove class="test" from the unit test data, then it shows <div><p>whatever</p></div>.... As far as I understood it, the class attribute should not be counted, or should it?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 Mar 2017

@laoneo remove RTC?

avatar laoneo
laoneo - comment - 30 Mar 2017

I would remove it, if Robert thinks my unit test data is invalid and it works as expected, then we can set it back to RTC. But for me it is not fixed for now.

avatar franz-wohlkoenig franz-wohlkoenig - change - 30 Mar 2017
Status Ready to Commit Pending
avatar rdeutz
rdeutz - comment - 30 Mar 2017

@laoneo, yes you are wrong anything counts.

avatar rdeutz rdeutz - change - 30 Mar 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-03-30 07:49:04
Closed_By rdeutz
avatar rdeutz rdeutz - close - 30 Mar 2017
avatar rdeutz rdeutz - change - 30 Mar 2017
Status Closed New
Closed_Date 2017-03-30 07:49:04
Closed_By rdeutz
Labels Added: ? ?
avatar rdeutz rdeutz - change - 30 Mar 2017
Status New Pending
avatar rdeutz rdeutz - reopen - 30 Mar 2017
avatar rdeutz
rdeutz - comment - 30 Mar 2017

ups pressed the wrong button

avatar laoneo
laoneo - comment - 30 Mar 2017

ok, then try this data

'HTML allowed, split allowed' => array(
	'<div class="test"><p>whatever it is a bug.</p></div>',
	25,
	true,
	true,
	'<div class="test"><p>what</p></div>...',
),

it should show <div class="test"><p>what</p></div>... or as it gets splited after 25 charachters?

avatar rdeutz
rdeutz - comment - 30 Mar 2017

it gets split and then open tags getting closed, so should be something you wrote, not 100% sure if it is "wha", "what" or "whate"

avatar laoneo
laoneo - comment - 30 Mar 2017

Unit test does look
image

avatar rdeutz
rdeutz - comment - 30 Mar 2017

ok, I will look into it, does it work without the patch?

avatar laoneo
laoneo - comment - 30 Mar 2017

same result without the patch

avatar rdeutz
rdeutz - comment - 30 Mar 2017

ok, then it is another bug. Can you open an issue for the new bug?

avatar laoneo
laoneo - comment - 30 Mar 2017

I guess it will be then the same as #11934, just with another unit test data.

avatar degobbis degobbis - test_item - 30 Mar 2017 - Tested successfully
avatar degobbis
degobbis - comment - 30 Mar 2017

I have tested this item successfully on acb901d

Thanks @rdeutz
Nice work!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14907.

avatar jeckodevelopment jeckodevelopment - change - 30 Mar 2017
Status Pending Ready to Commit
Labels
avatar jeckodevelopment
jeckodevelopment - comment - 30 Mar 2017

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14907.

avatar zero-24
zero-24 - comment - 30 Mar 2017

@rdeutz @laoneo do you want to move this to another issue or should this PR be expanded?

As it works for the case @degobbis and me had.

avatar rdeutz
rdeutz - comment - 30 Mar 2017

lets merge this one to get one problem solved, I looked into it a bit more and I've found some other issues but because it is unit tested I can work on it later.

avatar rdeutz rdeutz - edited - 30 Mar 2017
avatar laoneo
laoneo - comment - 30 Mar 2017

I will open a new issue for my other unit test.

avatar wilsonge wilsonge - change - 31 Mar 2017
Title
fix a bug when truncate spilts within a tag
fix a bug when truncate splits within a tag
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-03-31 08:11:39
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 31 Mar 2017
avatar wilsonge wilsonge - merge - 31 Mar 2017

Add a Comment

Login with GitHub to post a comment