Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Using multiple editors with editor-xtd buttons on a single page outputs erratic string #18519

Closed
avjoomla opened this issue Nov 7, 2017 · 12 comments

Comments

@avjoomla
Copy link
Contributor

avjoomla commented Nov 7, 2017

Steps to reproduce the issue

On Joomla! 4.0 dev
open administrator/components/com_content/forms/article.xml
add second editor field

<field
				name="articletext2"
				type="editor"
				label="COM_CONTENT_FIELD_ARTICLETEXT_LABEL"
				filter="JComponentHelper::filterText"
				buttons="true"
		/>

open administrator/components/com_content/tmpl/article/edit.php
add code to display the additional field after

<fieldset class="adminform">
					<?php echo $this->form->getInput('articletext2'); ?>
                </fieldset>

for example after

<fieldset class="adminform">
					<?php echo $this->form->getInput('articletext'); ?>
				</fieldset>

Go to administration of the website, create a new article

Expected result

the second editor field looks exactly like the first

Actual result

Under the second editor field you can find an erratic string
Joomla\CMS\Object\CMSObjectJoomla\CMS\Object\CMSObjectJoomla\CMS\Object\CMSObjectJoomla\CMS\Object\CMSObjectJoomla\CMS\Object\CMSObjectJoomla\CMS\Object\CMSObjectJoomla\CMS\Object\CMSObject

Status

Category *
Editor

Featured
No
Access

Language

Tags

Select Some Options
Version Note
This issue

System information (as much as possible)

Php 7.1.7 on local Xampp on windows 7
Joomla! 4.0.0-dev Development [ Amani ] 31-March-2017 23:59 GMT
(Hopefully the latest version. I downloaded this morning from Github and no matter which options I choose for the Joomla! Update component, I already get the message that I have the latest version).

Additional comments

I'm pretty sure, that the problem is related to the editor buttons, which are created as objects of class Joomla\CMS\Object\CMSObjectJoomla. It looks to me, that the erratic string has as many repetitions of this class as the first editor has buttons. When I add a third or forth editor, the string grows even longer.

@joomla-cms-bot joomla-cms-bot changed the title Using multiple editors with editor-xtd buttons on a single page outputs erratic string on Joomla! 4.0 dev [4.0] Using multiple editors with editor-xtd buttons on a single page outputs erratic string Nov 7, 2017
@ghost
Copy link

ghost commented Nov 9, 2017

@mbabker should this be added to Projects?


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

@OctavianC
Copy link
Contributor

Seems related to my MR #19454
Changing this line:
https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Editor/Editor.php#L313
To

$plugin = clone \JPluginHelper::getPlugin('editors', $this->_name);

Might solve this.

@avjoomla
Copy link
Contributor Author

Hi,
sadly it does not.
Regards,
Aicha

@mavrosxristoforos
Copy link

I can confirm this issue. The $results from this line https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Editor/Editor.php#L199 are correct the first time, including only a HTML string to show the editor, but each consecutive time they also contain a few objects (Joomla\CMS\Object\CMSObject) (7 in my case) that quite interestingly are some of the buttons of the editor: Module, Menu, Contact, Article, Image, Page Break and Read more...

There's a loop right after this line, that builds a string $return.
If that is changed to only return $results["result"][0] it does work, but I'm not sure that this is a proper solution...

@joeforjoomla
Copy link
Contributor

Issue confirmed too...

@Quy
Copy link
Contributor

Quy commented Jun 7, 2018

Duplicate of #20679 ?


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

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/18519

@ghost
Copy link

ghost commented Jun 7, 2018

closed in favor of #20679.


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

@astridx
Copy link
Contributor

astridx commented Jun 24, 2018

@franz-wohlkoenig I made a mistake. This issue is not solved with the PR to this issue #20679. Can you please reopen this issue again?

@joomla-cms-bot
Copy link

Set to "open" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/18519

@ghost
Copy link

ghost commented Jun 25, 2018

Reopened as stated above.

@brianteeman
Copy link
Contributor

I can no longer replicate this issue - can only assume it has been resolved elsewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants