? ? Success
Referenced as Related to: # 11489 # 14354 # 14835 Duplicate of: # 14508

User tests: Successful: Unsuccessful:

avatar schnuti
schnuti
2 Apr 2017

I think there are some confusions about the computed values of the width and height values for the tinyMCE editor. Personally I categorize this as a bug.

In theory there could be a lot of default settings but this is more simple.

We get the values from user editable system wide parameters (with some funny results like height=750, the tinyMCE default )):

  • tinyMCE editor default values
  • tinyMCE editor settings
  • this overrides the parameters from the form in all components and views.

Article edit
article_is

A second field in article edit as in PR 14520.
article_is2

Article frontend editing.
article frontend

The Joomla editor form field will never get any settings from external sources as default.

My propasal is to set the width hardcoded to 100% (or auto) and the height from:

  • Joomla editor form field default settings
  • the field's settings in the form field XML
  • tinyMCE default setting in the code (if no value available). I'm not quite sure about this.
  • override in a system plug in - onBeforeRender() method

Expected result
article_should

As tinyMCE automatically gets the height values from the hidden textarea field, we don't have to explicit set any values in the tinyMCE options. As well, we don't have to set any editor instance values as in #14520.

If you want a width per field, this has to be added to each editor instance as in PR #14520. As far as I could see there is no automatic loading as with the height.

In this PR I have removed the parameters in the tinyMCE editor, removed the tinyMCE options, added defaults in tinyMCE code and deprecated the language strings. I did not change the legacy part. Width is now overridable with a custom template/layout and height by using a custom system plugin - method onBeforerender().

Test instructions:

  1. Add an extra editor field as in #14520 with height. The original article text field has no expicit value, default 500px height from the form field.

In the article form XML administrator/components/com_content/models/forms/article.xml add one more editor element (somewhere after line
<fieldset name="basic" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">)

<field name="text2" type="editor" hide="menu,module,contact" label="Text2" description="" filter="JComponentHelper::filterText" buttons="true" height="250"/>

  1. Check the result without adding the patch. Play with the tinyMCE editor settings a bit. Go to the tab(s) advanced in tinyMCE and modify Width and Height to what a user could enter. e.g. width 50%, height=200.
    Have a look to the new second field in article edit, backend categories and frontend article edit/creation as well.

  2. Apply this patch.
    There are no settings so just reload the article edit page and .
    Check and compare the results.

@Fedik Is it easy to add the width if !100% as in PR 14520? The width could then be set in the form field. Needed?

Related
#14917
#14835

avatar schnuti schnuti - open - 2 Apr 2017
avatar schnuti schnuti - change - 2 Apr 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Apr 2017
Category Administration Language & Strings Front End Plugins
avatar Fedik
Fedik - comment - 2 Apr 2017

Is it easy to add the width if !100% as in PR 14520?

sorry, not very understood your question,
14520 already merged

avatar schnuti
schnuti - comment - 2 Apr 2017

@Fedik
I wrote - as in. That is handle the width in the same way.
Edit: and add the width to the editor instance if the value is not 100% - this is default.

avatar schnuti schnuti - edited - 2 Apr 2017
avatar schnuti schnuti - change - 2 Apr 2017
The description was changed
avatar schnuti schnuti - edited - 2 Apr 2017
avatar schnuti schnuti - change - 2 Apr 2017
The description was changed
avatar schnuti schnuti - edited - 2 Apr 2017
avatar AlexRed AlexRed - test_item - 2 Apr 2017 - Tested successfully
avatar AlexRed
AlexRed - comment - 2 Apr 2017

I have tested this item successfully on 122caac

Patch ok for me.
Thanks 😃


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15059.

avatar schnuti
schnuti - comment - 2 Apr 2017

@AlexRed
Thanks for testing.
Do you as I, think, it should go into 3.7.0? I guess it's harder to remove the parameters later on. It's late!

avatar AlexRed
AlexRed - comment - 2 Apr 2017

yes, also I hope we can solve the tinyMCE width problem in 3.7.0 or 3.7.1

avatar schnuti schnuti - change - 4 Apr 2017
The description was changed
Labels Added: ? ?
8a2f338 4 Apr 2017 avatar schnuti Typo
avatar schnuti schnuti - edited - 4 Apr 2017
avatar schnuti
schnuti - comment - 4 Apr 2017

@brianteeman I've reverted the language change and added a remark

avatar schnuti
schnuti - comment - 5 Apr 2017

I can't think of any situation where a width <> 100% (see images above) is needed. If you know one, I've now tested a solution using Fediks editor instances that works fine.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 Apr 2017

I have tested this item 🔴 unsuccessfully on 8a2f338

Error on "Articles: Edit" in Backend:
bildschirmfoto 2017-04-30 um 08 48 37

System information

3.7.1-dev
macOS Sierra, 10.12.4
Firefox 53 (64-bit)

MAMP 4.1.1

  • PHP 7.0.15
  • MySQLi 5.6.35

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15059.
avatar franz-wohlkoenig franz-wohlkoenig - test_item - 30 Apr 2017 - Tested unsuccessfully
avatar schnuti
schnuti - comment - 30 Apr 2017

@franz-wohlkoenig
Could you please check if you have the JS file in the directory.
media/editors/tinymce/plugins/jdragdrop/plugin-min.js
It has obviously bin moved to media/editors/tinymce/js/plugins/dragdrop/plugin-min.js

As far as I can see this PR has nothing to do with this javascript loading error.
Related? #15057

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 Apr 2017

media/editors/tinymce/plugins/jdragdrop/plugin-min.js

jdragdrop/plugin-min.js doesn't exist.

media/editors/tinymce/js/plugins/dragdrop/plugin-min.js

Folder exist.

avatar schnuti
schnuti - comment - 30 Apr 2017

@franz-wohlkoenig
Do you really find it on your instance? Do you override the tinyMCE settings? (personally I love it!)
As I said "This PR do not change anything regarding Javascript""

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 30 Apr 2017

Do you really find it on your instance?

bildschirmfoto 2017-04-30 um 11 28 34

Do you override the tinyMCE settings?

Clean Install of latest nightly Build. After applied PR got Error described in Comment

avatar schnuti
schnuti - comment - 30 Apr 2017

@franz-wohlkoenig
That's as far I go, I have my solution - override-. I do NOT need this patch.
By!

avatar schnuti
schnuti - comment - 30 Apr 2017

@franz-wohlkoenig
I have to apologize! There are no conflicts above - but there should be,
My PR overrides somehow #15057 that moves the js to an "external" path.
I get no differences with staging.
How can I fix that? New PR?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 1 May 2017

@schnuti sorry, don't know how to fix, maybe @Bakual can help?

avatar schnuti
schnuti - comment - 1 May 2017

As I understand this should not be possible.
As I said - when I compare with JoomlaCMS/staging I get " Able to merge." and an update is not possible!
My guess for now is that the PatchTester is the problem copying the old PHP file to the test system and that a commit to Joomla staging would work.
But I would need some advise.

avatar Bakual
Bakual - comment - 1 May 2017

Yep, Patchtester can cause some funny results if the PR branch doesn't have conflicts but is outdated neverthless. Because it copies the files instead of merging the changes.
You can merge (or rebase) the staging branch into your PR branch to fix that issue.

avatar schnuti schnuti - change - 2 May 2017
The description was changed
avatar schnuti
schnuti - comment - 2 May 2017

@Bakual
Thanks for the hint. I found a way to merge the staging changes into the PR branch using the GitHub web interface.
@franz-wohlkoenig
Could you give it another try. I've tested and it works for me using the PatchTester.
Thanks for testing and finding the problem in the first place!

avatar brianteeman brianteeman - change - 8 Jun 2017
Milestone Added:
avatar brianteeman brianteeman - change - 8 Jun 2017
Milestone Added:
avatar brianteeman brianteeman - change - 8 Jun 2017
Milestone Removed:
avatar brianteeman brianteeman - change - 8 Jun 2017
Milestone Removed:
avatar schnuti schnuti - change - 23 Jun 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-06-23 11:28:42
Closed_By schnuti
avatar schnuti schnuti - close - 23 Jun 2017

Add a Comment

Login with GitHub to post a comment