Problem/Motivation

CKEditor is not following the changes made in the body rows setting for Drupal 7. The editor area height is fixed, no matter what value you choose for the field's 'rows' setting.

Proposed resolution

Make the editor area height respect the field's rows value.

Remaining tasks

none

User interface changes

Improved editor experience.

API changes

none

Original report by @Gemini Lights

CKEditor is not following the changes made in the body rows setting for Drupal 7.

It's always defaulted to the normal, no matter what value you choose in the "manage fields" of content types.

Is this a bug?

CommentFileSizeAuthor
#29 ckeditor-area-height-1154730-29.patch440 bytesSutharsan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dczepierga’s picture

Status: Active » Postponed (maintainer needs more info)

Pls try to update to last DEV version of CKEditor module...

If it doesn't help, pls write exactly step by step what'd u do...

Greetings

WorldFallz’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

I can confirm this is still a problem with 7.x-1.x-dev.

To reproduce:

1. go to the 'manage fields' tab of any content type and edit the body field (ie for basic page: admin/structure/types/manage/page/fields/body).
2. set the "Rows" setting to anything obviously different than the default (like 50).
3. create a node of that type and note that the size of the body field is unchanged (ie for basic page: node/add/page).

mkesicki’s picture

Status: Postponed (maintainer needs more info) » Needs work

I can confirm this bug with latest DEV version. To reproduce please follow to http://drupal.org/node/1154730#comment-4571232

jrhansen’s picture

Any fix for this yet? The issue is still present with 1.3.

altavis’s picture

For those who just want higher editor area - you can set config.height = 400; in Custom javascript configuration

It's just a workaround.

tanitani’s picture

This is an issue as I need to have the boxes to be 2 rows high to remind my editors to keep it short (I need full HTML therefore single line text fields are not an option, AFAIK) and since there are several boxes on the edit form the large size forces unnecessary scrolling.
BTW, where is the Custom javascript configuration? It probably sets the height across the board, in which case I cannot make use of this method as I need to have larger boxes on other nodes.

Tanks,

Gábor

mkesicki’s picture

Custom JavaScript configuration is in CKEditor's profile settings. Check "advanced settings' section in selected profile configuration. It should be in link similar likehttp://yourDrupalDomain/node#overlay=admin/config/content/ckeditor/edit/Advanced (for "Advanced profile.").

tanitani’s picture

Thank you, however, I am afraid that is not available to me as I am using CKEditor with Wysiwyg, so the settings are different (more limited).
In fact I was wondering about what the benefit might be using Wysiwyg at the time I installed it, but it seemed a good idea based on the reviews...

In fact, would it benefit me if I did away with Wysiwyg??

mkesicki’s picture

@tanitani , hese modules are different and is up to you which one you choose.
In CKEditor module you can easily customize CKEditor's buttons and configure things that are build in CKEditor.

Toby Wild’s picture

Status: Needs work » Active

I am running the latest D7, with CKEditor 7.x-1.6 with CKEditor 3.6.2.

I am having the same issue, I am unable to set the height of a 'Long text and summary' field.

As I require the 'body' field to be full size, but like above, another just needs to be 2 or 3 lines.
I created a separate Text Format called "Small Field Format".
I then created a new CKEditor profile for just that Text Format.
I set custom javascript to "config.height = '300'" just to test things out.
I then select that text format (And therefor that CKEditor profile) when I go to edit, and nothing appears different.

I changed the icons in the toolbar, and they change, so it is using the different CKEditor Profile, but it's ignoring the config.height.

mkesicki’s picture

@Toby Wild please tyr use config.height='300';

Toby Wild’s picture

Status: Active » Closed (fixed)

@michal_cksource
Thanks, that works perfectly. Must have been my syntax in the Javascript Config.

alison’s picture

Hi -- just checking in about this because I'm still dealing with the problem a year later (thank you for the workaround in the meantime, though).

Thanks!

alison’s picture

Version: 7.x-1.x-dev » 7.x-1.12
Status: Closed (fixed) » Active

I think this issue is not fixed.

I appreciate the workaround, but it's still just a workaround -- I really feel like we should be able to control the height of our textareas on a per-field basis.

(Also, less important, but still a problem -- when a textarea's height has been set and it happens to be much different from the height forced for all textareas using the same CKEditor profile, when you "Switch to plain text editor" the height change is very jarring and disruptive. (A similar thing happens when you switch between text formats that use different CKEditor profiles.))

I feel like this didn't happen with the Drupal 6 version? I don't know what changed, on the Drupal side, or on CKEditor's, but a few issue queues support my vague recollection, I think... (#756516: Error in module code and #785310: #rows element not properly called upon, for example)

Mike Serafin’s picture

Also confirming this bug and would like to see a fix.

I don't want to do the JavaScript work around as I need to set the text area height only for a specific content type and don't want to change it across the board.

wwalc’s picture

Patches are welcome :-)

adamtong’s picture

i confirm it is a bug too. please help fix.

Thank you.

Andrei.Sapeshko’s picture

Рossible solution.
http://drupal.org/node/2000712

Kristen Pol’s picture

Anyone have a workaround when using wysiwyg+ckeditor? Can I pass in the:

use config.height='300';

somewhere?

I didn't see any custom settings that would be passed along to ckeditor from wysiwyg. I have lots of text areas that I'd like a lot smaller. I'd even be okay with making all text areas smallish for now and they can expand the height for body text when needed.

Kristen Pol’s picture

Anonymous’s picture

Definitely experiencing this problem with WYSIWYG Module and CKeditor 4.3 installed. PS: For those of you wanting 4.3 here is a link to instructions to fix the install error:

http://www.webopius.com/content/717/how-to-get-ckeditor-4-x-working-with...

Agogo’s picture

Issue summary: View changes

<note>
This comment was NOT, in fact, authored by alisonjo2786, but rather, by Agogo. No idea what's going on (see #23 and #24 below), but, here we are...
</note>

I just found a better workaround for this and thought I should share it. It tries to match the size of the textarea CKEditor is implemented on.

Insert this line inside the modules config file (ckeditor.config.js)
config.height = eval(this.element.$.rows*40) + 'px';

If it doesnt match the size in the browser you use - try to change the number 40 to something a bit smaller or larger.

Agogo’s picture

Ehm... That last comment was added by me "Agogo" but it says it's posted from "alisonjo2786"? wtf?

alison’s picture

Ummmm yeah I was just thinking the same thing ("wtf?")..... I wasn't even logged in to Drupal.org on February 7, 2014!

It says I can edit the comment (since it thinks I was the author) -- I can add a note that Agogo is the real author as a really weak band-aid...

samwillc’s picture

#5 worked for me. Thanks @altavis.

I didn't try #22 so can't comment on that.

mrogers’s picture

Had been struggling with this -- can confirm that #22 works well for me.

rcodina’s picture

#5 worked for me too. Thanks!

admin/config/content/ckeditor/edit/Full + Advanced options + Custom JavaScript configuration
admin/config/content/ckeditor/edit/Advanced + Advanced options + Custom JavaScript configuration

config.height = 400;

Ronino’s picture

#22 is great, thank you! I put it into a custom config file in a module to not have to alter the ckeditor module and adapted it a bit to more reflect the height of the original textarea:

CKEDITOR.editorConfig = function(config) {
  // Make CKEditor's edit area as high as the textarea would be.
  config.height = this.element.$.rows * 20 + 'px';
}

Then I set the file in each profile's "Custom JavaScript configuration" field:

config.customConfig = '../../../custom/my_ckeditor/js/ckeditor.config.local.js';

Sutharsan’s picture

Version: 7.x-1.12 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Needs review
FileSize
440 bytes

Made a patch out of #20 and #28. I've added a condition in case the rows value is not set. Not sure if this is possible, but it would cause the editor to disappear.

Sutharsan’s picture

mengi’s picture

Patch is #29 works great. Thanks for the patch!

From #30 it seems like there are duplicate issues.

Gemini Lights’s picture

Tested patch #29 is working. Thank you Sutharsan.

Sutharsan’s picture

@mengi, @Gemini Lights, can you set this issue "Reviewed and tested by the community"?

Gemini Lights’s picture

Status: Needs review » Reviewed & tested by the community
ayalon’s picture

Thanks! Works as expected. Reviewed #22. Can be commited.

DamienMcKenna’s picture

  • jcisio committed 24e805a on 7.x-1.x authored by Sutharsan
    Issue #1154730 by Sutharsan: CKEditor not following body rows setting...
jcisio’s picture

Status: Reviewed & tested by the community » Fixed

Ok, 20 is reasonably good enough for line height, even it depends on the editor content CSS. Thanks for the patch. Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

UksusoFF’s picture

Component: User interface » Code
Status: Closed (fixed) » Active

This is partially broken on latest dev-version. Works only on node/add page, but not on node/*/edit

jcisio’s picture

Status: Active » Closed (fixed)

I don't think the last comment is related to this fixed issue.

marcoka’s picture

well the last comment is true :)

markus_petrux’s picture

It also happens here as well. That js snippet I added to the file ckeditor.config.js in our theme folder, which is loaded and works, but editor height is still fixed. The code is executed, but changes here to config.height seem to be ignored.

We're using CKEditor library 4.5.7 ...the problem is related to the module or library?

So what can we do now? ...reopen here? ...create a separate issue?

markus_petrux’s picture

Status: Closed (fixed) » Active

Any idea on why setting the height in ckeditor.config.js (*) is ignored?

(*) the one in our theme folder, which is actually loaded and runs when CKEditor is activated.

marcoka’s picture

I also tried adding that setting to the config page on the ui /admin/config/content/ckeditor/edit/Full
Height doesnt change and is way to small, meaning i have to scale it on node edit.

ckeditor 4.5.6

Francewhoa’s picture

Francewhoa’s picture