Forums / General Questions / Problem with CK Editor and manufacturers description

Problem with CK Editor and manufacturers description

Views: 551

Results 1 to 4 of 4
3 Aug 2016, 9:57 AM
#1
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Problem with CK Editor and manufacturers description

Firstly I realise there are threads for both CK Editor and Manufacturers Description, however I was unsure where to put this as I think it applies to both.

I installed both Manufacturers Description/About which is also using (an adjustment to the code in order to make it easier to write in HTML tags) CK Editor a while back on Zen Cart 1.5.3, then upgraded it to 1.5.4 and everything was fine. Since I upgraded to 1.5.5 it caused an issue and neither worked properly.

So I reworked the PHP code for manufacturers description/about and managed to get that to work again with a few minor adjustments, still it wasn't firing up CK Editor though. I then found CK Editor has since been upgraded for 1.5.5 so I re-installed that, called the editor and it worked. See screenshot.

My problem is that when update is clicked on CK Editor the page goes blank and nothing updates.

In the error logs I get this:

[02-Aug-2016 22:08:51 UTC] Request URI: /MYADMIN/manufacturers.php?page=1&mID=57&action=save, IP address: 00.00.00.000
#1 header() called at [/home/MYWEBSITE/public_html/MYADMIN/includes/functions/general.php:26]
#2 zen_redirect() called at [/home/MYWEBSITE/public_html/MYADMIN/manufacturers.php:87]

[02-Aug-2016 22:08:51 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/MYWEBSITE/public_html/MYADMIN/includes/ckeditor.php:22) in /home/MYWEBSITE/public_html/MYADMIN/includes/functions/general.php on line 26

I’ve had a look at both line numbers but am not sure what to change or if it is in these files at all.

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

12 Aug 2016, 5:03 PM
#2
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Problem with CK Editor and manufacturers description

Just wondered if anybody could give me any ideas on this one please?

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

14 Aug 2016, 6:42 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Problem with CK Editor and manufacturers description

Nick1973:

Firstly I realise there are threads for both CK Editor and Manufacturers Description, however I was unsure where to put this as I think it applies to both.
Probably applies to the Mfg-Description plugin, not CKEditor. Here's why I think that:

a) "Headers already sent" means "you're requested a page-redirect, but redirects aren't allowed when anything's been output to the screen, and we detect some page-content and/or headers, so we can't do the redirect".

b) If indeed the problem is happening when you click Save, then CKEditor shouldn't even be doing anything to output to the screen before the submitted data is processed/saved. Redirects usually happen AFTER saving the submitted data.

c) Your line numbers for manufacturers.php and ckeditor.php don't match up with anything that would be triggering requisite redirects or outputting "first output" to the screen. So that means you'll have to figure out those bits on your own, or post your actual files (or use the plugin's files instead of whatever you've changed) ... ie: we can't help you if we can't compare apples with apples, but you've got oranges.

Nick1973:

In the error logs I get this:

[02-Aug-2016 22:08:51 UTC] Request URI: /MYADMIN/manufacturers.php?page=1&mID=57&action=save, IP address: 00.00.00.000
#1 header() called at [/home/MYWEBSITE/public_html/MYADMIN/includes/functions/general.php:26]
#2 zen_redirect() called at [/home/MYWEBSITE/public_html/MYADMIN/manufacturers.php:87]

[02-Aug-2016 22:08:51 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/MYWEBSITE/public_html/MYADMIN/includes/ckeditor.php:22) in /home/MYWEBSITE/public_html/MYADMIN/includes/functions/general.php on line 26

  • action=save triggers a save to database (zen_db_perform()) followed by a zen_redirect() (which calls header() ) to redisplay the page in normal (not edit) mode
  • the header() call fails because something in the manufacturers.php file, which occurs before line 87, is triggering ckeditor to output instructions to the browser

Chances are whatever you did to add CKEditor support to the page was done incorrectly, most likely simply putting the code into the file way too early. If you look at other pages where it's made available you'll see that it's done after the <doctype html> content is output.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.