By pietergr on Monday, 12 March 2018
Replies 12
Likes 0
Views 1K
Votes 0
Hi I am on Version : 3.4.46 Stable and using an url dynamic import iCal.
I noticed the location getting imported with "\n" in the line instead of real </br>
This also shows in the events page. Sample: http://cadet.nl/nl/kalender/evenementdetail/50/25/training-de-kaag

As it used to work before, is there something changed between versions? Is it something I missed myself?

Tx,

Pieter
edit the file components/com_jevents/libraries/iCalEventDetail.php and at line c. 177 add this code

if (strpos($this->location, '\n'))
{
$this->location = str_replace('\n', '<br>', $this->location);
}

just after

$this->processField("location","");
·
Friday, 16 March 2018 09:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Pieter,

Is this importing events into JEvents and then using Managed Locations to match locations on import?

Many thanks
Tony
·
Monday, 12 March 2018 14:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Tony,

Thank you for your message.
No I am not using "managed locactions" The locations are coming from the remote .ics

I did some more investigation on this so I can clarify a bit more.

That same .ics is/can be updated with calendar entries from a variety of app. Dektop apps, phone apps and on. In the .ics file sometime the location is entered manually, sometimes it is entered using the address book in the local calendar app.

The first works ok.. for example if someone types "Miss Daisy, London" it is in the .ics file as "Miss Daisy\, London"
(note the escaped comma)
In the second situation the address in the locations field is populated by a concatenated set of fields from the local address book. In the .ics file this would then show as "Miss Daisy\nLondon". See the \n escaped line break.

The odd thing is it can handle "\," allright but "\n" is showing...

\n as a meta character in an import file seems not translated into a <br />

I hope that explains a bit more.
If you need me to check some more let me know.

Tx,

Pieter
·
Monday, 12 March 2018 15:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Can you give us the ICS source URL so we can run some tests?
·
Tuesday, 13 March 2018 10:24
·
0 Likes
·
0 Votes
·
0 Comments
·
I put it in the privat section...
·
Tuesday, 13 March 2018 10:54
·
0 Likes
·
0 Votes
·
0 Comments
·
I can solve it by adding this to my custom.js


$(function() {
$(".jev_evdt_location").html($(".jev_evdt_location").html().replace(/\\n/g, "<br />"));
});


But I'd rather have it done in the php rendered output (or maybe even in the import already).
If I want to solve that in the output where can I find the .php file to override in my template/html/ folder?


Tx,


Pieter
·
Wednesday, 14 March 2018 11:13
·
0 Likes
·
0 Votes
·
0 Comments
·
No, sorry, it did not work as expected... unfortunately...
·
Friday, 16 March 2018 22:50
·
0 Likes
·
0 Votes
·
0 Comments
·
What did it do? It worked when I tested it with your data on my server

p.s. sorry I was ill at the end of last week and then my partner was (so I had to look after her and our young family alone so was away from my desk).
·
Wednesday, 21 March 2018 12:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Oh wait..... I think it is my bad then... it is something that happens on import... I figured it was on output...
Soon as I have access I will test again....

Hope everyone is better and healthy now... the big flue-wave that struck Europe.... we, me and my family, had our turn mid February... when on skiing holidays...

Anyway.. no rush... I will let you know soonest!
·
Wednesday, 21 March 2018 12:59
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Geraint,

Indeed, my mistake I assumed it to happen on joomla output not when importing the data... it works indeed! Thumbs up!
Will this be added to the next version or do I need to keep track when updating?

Tx,

Pieter
·
Wednesday, 21 March 2018 19:14
·
0 Likes
·
0 Votes
·
0 Comments
·
It is included in the next release
·
Thursday, 22 March 2018 15:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Awesome!, Thank you very much for your help!
·
Friday, 23 March 2018 09:33
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post