? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
20 Jan 2019

Pull Request for Issue #23584

Summary of Changes

The variable $hasContent lets display an editor text when editing a module of the type mod_custom or similar

Although the variable works in back-end for all modules where the manifest contains <customContent />, it does not work in frontend when editing a module which contains the same element in its manifest.

The code that makes it works in back-end is in the
/administrator/components/com_modules/views/module/tmpl/edit.php line 24
$hasContent = empty($this->item->module) || isset($this->item->xml->customContent);

In frontend in the file
/components/com_config/view/modules/tmpl/default.php
we have
$hasContent = empty($this->item['module']) || $this->item['module'] === 'custom' || $this->item['module'] === 'mod_custom';
Which means that not all modules which contains <customContent /> in their manifest will display the text editor when edited in frontend.

To solve this issue we have to fetch the manifest of the edited module and check if the element exists in the manifest, same behavior as in back-end.

Therefore this is a BUG and this PR is not a new Feature.

Testing Instructions

Install the following module, enter some text in the editor field in backend and display it in frontend.
mod_customadv.zip

Set Global Config to let edit Modules in frontend. Login and edit the module.

Before patch

The editor will not display. It should be below the Options and Advanced parameters.

After patch

Issue solved. Editor displays.
screen shot 2019-01-20 at 18 48 57

@mino182

avatar infograf768 infograf768 - open - 20 Jan 2019
avatar infograf768 infograf768 - change - 20 Jan 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2019
Category Front End com_config
avatar infograf768 infograf768 - change - 20 Jan 2019
Labels Added: ?
avatar mino182
mino182 - comment - 22 Jan 2019

I have tested this item successfully on 34cbf8d


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

avatar mino182 mino182 - test_item - 22 Jan 2019 - Tested successfully
avatar viocassel
viocassel - comment - 23 Jan 2019

I have tested this item successfully on 34cbf8d


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

avatar viocassel viocassel - test_item - 23 Jan 2019 - Tested successfully
avatar infograf768 infograf768 - change - 23 Jan 2019
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 23 Jan 2019

RTC. Thanks for testing!


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

avatar infograf768
infograf768 - comment - 23 Jan 2019

RTC. Thanks for testing!


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

avatar infograf768
infograf768 - comment - 1 Feb 2019

@HLeithner
As this code has been like this for 10 years +, I suggest you merge this PR and I will propose a specific PR for this where it can be discussed.

avatar HLeithner HLeithner - change - 1 Feb 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-02-01 08:41:13
Closed_By HLeithner
Labels Added: ?
avatar HLeithner HLeithner - close - 1 Feb 2019
avatar HLeithner HLeithner - merge - 1 Feb 2019
avatar HLeithner
HLeithner - comment - 1 Feb 2019

thx please create a new PR with the suggest checks/changes

Add a Comment

Login with GitHub to post a comment