change description property name to lowercase (UC is not allowed in OXID), fix HTML entity encode

This commit is contained in:
Daniel Seifert 2024-11-18 15:58:13 +01:00
parent 20d9dd83a6
commit f2dbf59717
5 changed files with 14 additions and 11 deletions

View File

@ -47,7 +47,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
}
}
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, "oxmanufacturers__D3DESCRIPTION", "list.tpl.css");
$this->_aViewData["editor"] = $this->generateTextEditor("100%", 280, $oManufacturer, "oxmanufacturers__d3description", "list.tpl.css");
return "d3manufacturerlongdesc.tpl";
}
@ -110,7 +110,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
*/
public function d3GetLongdescParamValue() :string
{
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__D3DESCRIPTION'];
return (string) $aParams = Registry::getRequest()->getRequestEscapedParameter("editval")['oxmanufacturers__d3description'];
}
/**

View File

@ -10,5 +10,5 @@ class Constants
public const OXID_MODULE_ID = 'd3manufacturerinformation';
// Tables and Database
public const D3_OXMANUFACTURERS_LONGDESC_FIELDNAME = 'D3DESCRIPTION';
public const D3_OXMANUFACTURERS_LONGDESC_FIELDNAME = 'd3description';
}

View File

@ -25,7 +25,7 @@
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
</form>
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__D3DESCRIPTION' );" style="padding: 0px;margin: 0px;height:0px;">
<form name="myedit" id="myedit" action="[{$oViewConf->getSelfLink()}]" method="post" onSubmit="copyLongDesc( 'oxmanufacturers__d3description' );" style="padding: 0;margin: 0;height:0;">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="d3manufacturerinfolongdesc">
<input type="hidden" name="fnc" value="">
@ -33,7 +33,7 @@
<input type="hidden" name="voxid" value="[{$oxid}]">
<input type="hidden" name="editval[oxmanufacturers__oxid]" value="[{$oxid}]">
<input type="hidden" name="catlang" value="[{$catlang}]">
<input type="hidden" name="editval[oxmanufacturers__D3DESCRIPTION]" value="">
<input type="hidden" name="editval[oxmanufacturers__d3description]" value="">
[{include file="include/category_text_editor.tpl"}]
</form>

View File

@ -3,12 +3,13 @@
[{assign var="oConfig" value=$oViewConf->getConfig()}]
[{assign var="oManufacturer" value=$oView->getManufacturer()}]
[{assign var="sShopURL" value=$oConfig->getConfigParam('sShopURL')}]
[{assign var="description" value=$oManufacturer->d3GetLongdesc()}]
[{if $oManufacturer && $oConfig->getConfigParam('d3manufacturerinformation_showManufacturertextOnDetailsPage') && $oManufacturer->d3GetLongdesc()}]
[{if $oManufacturer && $oConfig->getConfigParam('d3manufacturerinformation_showManufacturertextOnDetailsPage') && $description->value}]
[{capture append="tabs"}]<a href="#manufacturertab" data-toggle="tab">[{oxmultilang ident="MANUFACTURER"}]</a>[{/capture}]
[{capture append="tabsContent"}]
<div id="manufacturertab" class="tab-pane[{if $blFirstTab}] active[{/if}]">
[{oxeval var=$oManufacturer->d3GetLongdesc()}]
[{oxeval var=$description}]
</div>
[{assign var="blFirstTab" value=false}]
[{/capture}]

View File

@ -7,6 +7,7 @@ namespace D3\ManufacturerInformation\Modules\Application\Model;
use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Core\Registry;
class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
@ -30,10 +31,11 @@ class D3ManufacturerLongDesc extends D3ManufacturerLongDesc_parent
}
/**
* @return string
* @return Field
*/
public function d3GetLongdesc(): string
public function d3GetLongdesc(): Field
{
return $this->getFieldData(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
$longName = $this->getCoreTableName().'__'.strtolower(Constants::D3_OXMANUFACTURERS_LONGDESC_FIELDNAME);
return $this->$longName;
}
}