Discussion Forums  >  Self Hosted Control Panels

Replies: 5    Views: 207

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
07/09/15 07:00 AM (8 years ago)

'Escaped' characters in email body text CP field do not stick

I'm working on an app that uses email body text that is stored in the control panel. No problem with that. However, in order to add some line feeds in the email text, I've added a few instances of . I can save it, the app picks it up and all is OK. So Far, so good. The problem is that when I go back into the CP to edit the body text, all the backslashes have disappeared, leaving instance of nr in the text (instead of ), which is a problem. My current work-around is to save all the body text in a separate text file on my PC and copy and paste it whenever I edit that control panel. It's a bit sub-optimal and error prone. Any idea's what I can do? I am self hosted. TIA, Alan
 
krompa
Lost but trying
Profile
Posts: 257
Reg: Jun 14, 2013
Bristol
8,820
like
07/09/15 09:51 AM (8 years ago)
You could manually add the text in the relevant .java file _ thus overriding the CP. Which plugin are you using?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
07/10/15 02:06 AM (8 years ago)
Hi @Krompa, long time no hear. It's an apple app, but your idea still applies and I'll keep it in my back pocket. Really, I'd like to be able to just manage the text in the control panel.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
07/12/15 05:44 AM (8 years ago)
From reading questions on stack overflow I'm thinking this is some kind of mysql/php issue. I've tried encapsulating backslashes in single quotes, double quotes, adding multiple slashes. I can save from the CP which presumably saves to the sql database and produces json separately. The string is saved in the json and my app can read it. The problem is when the control panel retrieves the string from the database, the backslashes are no longer there. All I'm really trying to do is add a carriage return and line feed into the email body text to format it. Hrrmph.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
07/12/15 09:12 AM (8 years ago)
Your workaround to replace rather than edit is what I have been using all these years.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
07/12/15 10:15 AM (8 years ago)
Good to know Niraj, thanks. Alan
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.