Welcome to Geeklog, Anonymous Tuesday, December 24 2024 @ 08:31 pm EST

Geeklog Forums

Bug in static pages/FCK and plaintext/html/adveditor mode


Status: offline

jeffhare

Forum User
Junior
Registered: 12/04/03
Posts: 24
thoughtful
Dirk, Blaine, Joe, anyone??

The BUG?
There appears to be a bug in static pages (gl1.4.1) when the advanced editor is enabled which removes the ability to edit static page content as "plaintext". With advanced editor enabled, your only options to edit a static page are "HTML Formatted" and "Advanced Editor".

Surely this should be "Advanced Editor" and "Plain Text" instead??

Details
There are certain static pages on my site that really need the FCK advanced editor, so I enabled the advanced editor. Works fine.

Other static pages on my site contain & execute PHP. These really need to be postmode of "plaintext", which isn't an option.

The static pages get stored in the database as "html" or "adveditor" only now, whereas prior to enabling the advanced editor, static pages were getting created with "plaintext" and "html" postmodes.

Touching the postmode dropdown, reformats all the PHP code / contents as if it were html. There's no going back, just "Cancel" as an option.

Has anyone fixed this? If not, could someone point in the direction of the easiest fix?

BTW, to help see the postmode of each static page, I added the following column to the end of the $header_arr array in the function liststaticpages() (file: ...public_html/admin/plugins/staticpages/index.php)
Text Formatted Code
 array('text' => mode, 'field' => 'postmode', 'sort' => true)

 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
I looked at the code and I think you are out of luck. Whoever converted the staticpages to use the advanced editor just completely removed all trace of the plaintext editor. You will need to modify the PHP, the template files and the javascript in order to handle plaintext in static pages.

I don't really use the advanced editor much myself. But I would think the HTML editor would work for static pages.
 Quote

Status: offline

jeffhare

Forum User
Junior
Registered: 12/04/03
Posts: 24
Thanks, that's what I saw when I worked my way through the PHP. I guess it didn't have any unit tests... Smile

I haven't proven that the HTML editor works 100% of the time. It seems to as long as you don't ever touch the postmode dropdown. If you do, it linewraps all the code. And if it ever insists on coming up in the advanced editor, you're hosed.

:banghead:
 Quote

All times are EST. The time is now 08:31 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content