Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

HTMLEditor fields invisible/disappeared after moving Silverstripe [SOLVED]


Go to End


8 Posts   1823 Views

Avatar
Alek

Community Member, 8 Posts

17 August 2012 at 7:54pm

Edited: 17/08/2012 11:48pm

Hi All,

I posted this query yesterday in http://www.silverstripe.org/dataobjectmanager-module-forum/show/12159 but realised it's probably the wrong area for this... I really hope someone can help soon as I am under some time constraints...

Basically, after moving everything from my local PC to my dev server, my HTMLeditor boxes have disappeared from within the pages in the admin section of silverstripe. They seem to be hidden by CSS?

I am using SS 3.0.0. This looks like some kind of JS conflict or something..

Can anyone help? I'd prefer not to have to do a clean install or any upgrades at the moment. Is there a simple fix for this?

Thanks.

Avatar
Alek

Community Member, 8 Posts

17 August 2012 at 9:48pm

Just tried upgrading to 3.0.1rc3
Didn't work either... :(

Anyone have any ideas at all please?

Avatar
DesignerX.com.au

Community Member, 107 Posts

17 August 2012 at 11:05pm

Hi , you will need to use new HtmlEditorField() .. give it a try & let us know how it goes for you :)

Avatar
Alek

Community Member, 8 Posts

17 August 2012 at 11:45pm

Thanks for replying!

I'm not a php/mysql noob but I'm not too familiar with the SS structure just yet. I haven't really done much coding on it at all in fact, most of the work has been templating as the core system is pretty much how we need it.

Could you point me in the right area as to where and how I should be using the aforementioned HtmlEditorField() ? :)

Many thanks again.

Avatar
DesignerX.com.au

Community Member, 107 Posts

17 August 2012 at 11:52pm

Hi:
you can use HtmlEditorField() to replace SimpleHTMLField "I think" .. basically you can use HtmlEditorField() with any HTMLText field type, for example:
if you have static $db = array( 'Discription' => 'HTMLText' ); you can use new HtmlEditorField('Discription); in the getCMSField function .. If you have custom page types or still using old modules , you will need to re-check the code and/or download the latest module version .

What is the name & type of the page that has this error ? & if you can post the .php code used for this page type ( http://www.ssbits.com/ )

Avatar
Alek

Community Member, 8 Posts

18 August 2012 at 2:09am

Edited: 18/08/2012 2:10am

I haven't really messed with much there so I'm not sure... I just added another field but this seems to have no effect (I also tried a clean install on this server and it has the same problem). This is the code you mentioned in my SiteTree.php:

static $db = array(
"URLSegment" => "Varchar(255)",
"Title" => "Varchar(255)",
"MenuTitle" => "Varchar(100)",
"Content" => "HTMLText",
"IntroColumn" => "HTMLText",
"MetaTitle" => "Varchar(255)",
"MetaDescription" => "Text",
"MetaKeywords" => "Varchar(255)",
"ExtraMeta" => "HTMLText",
"ShowInMenus" => "Boolean",
"ShowInSearch" => "Boolean",
"Sort" => "Int",
"HasBrokenFile" => "Boolean",
"HasBrokenLink" => "Boolean",
"ReportClass" => "Varchar",
"CanViewType" => "Enum('Anyone, LoggedInUsers, OnlyTheseUsers, Inherit', 'Inherit')",
"CanEditType" => "Enum('LoggedInUsers, OnlyTheseUsers, Inherit', 'Inherit')",
);

I'm not quite sure how to implement your solution with a multi-array like that?

The only other bit of code I added in SiteTree.php is
$fields->addFieldToTab("Root.IntroColumn", new HTMLEditorField('IntroColumn','Intro Column Content'));
just before 'return $fields;' in the getCMSFields function

I cannot even find SimpleHTMLField in there.. Remember this is SS 3.0.0 so maybe that's been changed already?

The problem happens when I try to edit pages. I cannot see the htmleditor. It is simply not there. e.g. http://dev/silverstripesite/index.php/admin/pages/edit/show/7

Please see the attachment.

Thank you for your help so far. I hope I can sort this out otherwise we cannot use silverstripe. :(

Attached Files
Avatar
DesignerX.com.au

Community Member, 107 Posts

18 August 2012 at 3:18am

Hi:
- try to upgrade to SS3.0.1 -stable
- I am using SS3.0.1 now & I dont get problem like this, so most likely its because you using an older/unstable SS release or some files are missing/corrupt when uploading through FTP (this happens to me sometimes )..
re-check & upload the latest SS release & let me know how it goes ;)
GL

Avatar
Alek

Community Member, 8 Posts

20 August 2012 at 7:41pm

Edited: 20/08/2012 7:43pm

Ouch. Panic over. I actually tried what you suggested, but eventually found the problem!

In the end, it was a problem with the .htaccess file! I managed to find out by debugging the javascript and the clue was that 'tinymce' was simply not being loaded at all because the script was looking for it in the wrong place. When I migrated the installation to the other server, the RewriteBase parameter in .htaccess was incorrect, so I changed it. The site worked as normal, all except tinymce, so I thought there was some other problem at that point. Only after the debugging did I look back at the .htaccess and realise that I had an error in the RewriteBase - I had included the server hostname as a prefix!!! Duh....

Anyway, I changed the RewriteBase to what it should be, and everything works as normal and tinymce started to appear again. Sorry for the goose chase! But thank you very much for guiding me through DesignerX - a good few karma points for you there. :)

Cheers.