View Issue Details

IDProjectCategoryView StatusLast Update
0005295OXID eShop (all versions)2.4. Administer productspublic2024-02-07 11:47
Reportermartinwegele Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version4.7.6 / 5.0.6 
Summary0005295: Impossible to use more than one wysiwyg-editor on one page
DescriptionI tried to have another wysiwyg-pro editor in the article-main tab of the admin area. But it did not work.
One obstacle is
if ( $this->_oEditor === null ) {
in oxAdminDetails::_getTextEditor .
But it seems there are more problems because if I reset $this->_oEditor = null; in _generateTextEditor the content of the editor is empty, so there must be something wrong with _getEditValue.
Steps To Reproduce1. Insert
 $this->_aViewData["myeditor"] = $this->_generateTextEditor( "100%", 300, $oArticle, "oxarticles__oxshortdesc", "details.tpl.css");
in admin/article_main.php's render-method.
2. Add an additional Smarty-tag [{ $myeditor }] in /application/views/admin/tpl/article_main.tpl
3. Try to edit a product in the admin area.
4. Insert $this->_oEditor = null; in the first line of oxAdminDetails::_generateTextEditor
5. Try to edit a product in the admin area.
Additional InformationIt seems that _getEditValue is not called at all.
Additionally you will have to modify one line in application\views\admin\tpl\article_main.tpl:
<form name="myedit" id="myedit" action="[{ $oViewConf->getSelfLink() }]" method="post" onSubmit="return copyLongDesc( 'oxarticles__oxlongdesc' );" style="padding: 0px;margin: 0px;height:0px;">
TagsWYSIWYG
ThemeNot defined
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Relationships

has duplicate 0006177 resolvedSven Brunk Article_Main::_getEditValue($oObject, $sField) always returns OXLONGDESC, ignoring $sField 

Activities

martinwegele

2013-09-05 15:19

reporter   ~0009033

http://article.gmane.org/gmane.comp.php.oxid.general/2418

QA

2023-11-23 18:27

administrator   ~0015914

@Sven Brunk: It's still not possible by just copying the code from the original entry. Furthermore, the original code will not work with the current shop code, since the following method will be called to get the content for the editor:
    protected function getEditValue($object, $fieldName)
    {
        return $object ? $object->getLongDescription()->getRawValue() : '';
    }
It ignores the parameter $field (@param string $field object field which content is passed to editor) by always loading the longdesc. The example from this bug entry tried to load oxshortdesc. The logical next step would be to write a module to overwrite this method, but the method (\OxidEsales\EshopCommunity\Application\Controller\Admin\AdminDetailsController::getEditValue) contains this note in the description: * @deprecated method will be removed in v7.0.

Conclusion: Currently it's unclear how to get a second editor working or if that requirement is supported by the framework anyway.

-MK