? ? Pending

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
16 Jul 2019

Pull Request for Issue # .

Summary of Changes

This removes CodeMirror paths from plugin configuration .

Testing Instructions

Save CodeMirror plugin at least once.
Edit files in template manager.

Expected result

CodeMirror appears.

Actual result

Basic text field appears.

Documentation Changes Required

Base path and mode path are now passed to onCodeMirrorBeforeInit as separate arguments. Plugins that used to modify basePath or modePath params will need to be updated from:

public function onCodeMirrorBeforeInit(&$params)
{
	$params->set('basePath', 'path/to/codemirror/');
	$params->set('modePath', 'path/to/modes/%N/%N');
}

to:

public function onCodeMirrorBeforeInit(&$params, &$basePath, &$modePath)
{
	$basePath = 'path/to/codemirror/';
	$modePath = 'path/to/modes/%N/%N';
}

If someone wants to do it, CodeMirror events can be documented here https://docs.joomla.org/Plugin/Events.

avatar SharkyKZ SharkyKZ - open - 16 Jul 2019
avatar SharkyKZ SharkyKZ - change - 16 Jul 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Jul 2019
Category Administration Language & Strings Front End Plugins
avatar richard67
richard67 - comment - 16 Jul 2019

I have tested this item successfully on 46266cb

Worsk as described and fixes the error descibed in this PR.

I don't know if it is a good or a bad idea to make the paths configurable, but this shall someone else decide.

For me it is ok.


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

avatar richard67 richard67 - test_item - 16 Jul 2019 - Tested successfully
avatar SharkyKZ
SharkyKZ - comment - 16 Jul 2019

Here's some background about why hidden path parameters were added in the first place #5863 (comment). To me it doesn't make much sense either.

avatar richard67
richard67 - comment - 16 Jul 2019

Well, hidden is one thing, that might be ok. Visible and so editable (without hacks) is another thing. Not sure if that is good, but who knows, maybe someone has another code mirror instance he wants to use. Anyway, we have so much configurable stuff in the backend, having 1 or 2 things more or less of which 99% of the users will not know what it is good for, that does not make a big difference ;-)

avatar wilsonge
wilsonge - comment - 16 Jul 2019

I think I'd rather keep them hidden please. For no reason other than I don't really see the use case for them to most users so no need to add more params to the interface

avatar richard67
richard67 - comment - 16 Jul 2019

We need more params in backend to fill up the space gained by the new backend template ? (I know, silly joke).

avatar richard67
richard67 - comment - 16 Jul 2019

@SharyKZ The more I think it over, the more I agree with George: They should be still hidden.

avatar richard67
richard67 - comment - 16 Jul 2019

I have not tested this item.


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

avatar richard67
richard67 - comment - 16 Jul 2019

I have not tested this item.


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

avatar richard67 richard67 - test_item - 16 Jul 2019 - Not tested
avatar SharkyKZ
SharkyKZ - comment - 17 Jul 2019

Just changing the default value won't fix the problem though. Old value is already saved on 3.x sites.

We could remove these options from manifest files completely. If anyone's actually using this feature, they should really be using onCodeMirrorBeforeInit event to alter the parameters instead of altering the form with onContentPrepareForm to make the field editable and then modifying the value manually.

avatar SharkyKZ SharkyKZ - change - 17 Jul 2019
Labels Added: ? ?
avatar wilsonge
wilsonge - comment - 4 Aug 2019

We could remove these options from manifest files completely. If anyone's actually using this feature, they should really be using onCodeMirrorBeforeInit event to alter the parameters instead of altering the form with onContentPrepareForm to make the field editable and then modifying the value manually.

If that works using onCodeMirrorBeforeInit to achieve this then I'm happy doing that

avatar joomla-cms-bot joomla-cms-bot - change - 5 Aug 2019
Category Administration Language & Strings Front End Plugins Front End Plugins
avatar SharkyKZ
SharkyKZ - comment - 5 Aug 2019

Fields removed.

If it makes any difference, we could also add class variables for paths to the plugin and pass these to onCodeMirrorBeforeInit instead of modifying hidden params. This way the feature would be less obscure.

avatar SharkyKZ SharkyKZ - change - 15 Aug 2019
Labels Removed: ?
avatar SharkyKZ SharkyKZ - change - 3 Oct 2019
The description was changed
avatar SharkyKZ SharkyKZ - edited - 3 Oct 2019
avatar SharkyKZ SharkyKZ - change - 3 Oct 2019
The description was changed
avatar SharkyKZ SharkyKZ - edited - 3 Oct 2019
avatar brianteeman
brianteeman - comment - 3 Oct 2019

This PR solves the issue from #26455 when joomla is in a subdirectory.

Definitely needs something to update the params on upgrade though and do we still need this code

$basePath = $params->get('basePath', 'media/vendor/codemirror/');
$modePath = $params->get('modePath', 'media/vendor/codemirror/mode/%N/%N');

avatar JazParkyn JazParkyn - test_item - 19 Oct 2019 - Tested successfully
avatar JazParkyn
JazParkyn - comment - 19 Oct 2019

I have tested this item successfully on 851f9e2


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

avatar anibalsanchez anibalsanchez - test_item - 3 Nov 2019 - Tested successfully
avatar anibalsanchez
anibalsanchez - comment - 3 Nov 2019

I have tested this item successfully on 851f9e2

Test OK


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

avatar Quy Quy - change - 3 Nov 2019
Status Pending Ready to Commit
avatar Quy
Quy - comment - 3 Nov 2019

RTC


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

avatar Quy Quy - change - 3 Nov 2019
Labels Added: ?
avatar HLeithner
HLeithner - comment - 5 Dec 2019

The cleanup for updates in onCodeMirrorBeforeInit missing as suggested or?

@wilsonge would you like to merge it anyway? it seams to solve 2 issues.

avatar SharkyKZ
SharkyKZ - comment - 6 Dec 2019

@HLeithner are you asking about not requiring 3.x users to save plugin configuration?

avatar HLeithner
HLeithner - comment - 6 Dec 2019

@SharkyKZ after Upgrading from 3.10 to 4.0 it would wouldn't be realistic to request the site owner to go the "each" (we maybe find more of such things) plugin and click save.

I'm reference to this comment

Just changing the default value won't fix the problem though. Old value is already saved on 3.x sites.

Or is this solve when we remove the parameters from the xml file?

avatar SharkyKZ SharkyKZ - change - 6 Dec 2019
Status Ready to Commit Pending
avatar SharkyKZ
SharkyKZ - comment - 6 Dec 2019

No, it's not solved. Will have to implement #25591 (comment) to solve upgrades.

avatar HLeithner
HLeithner - comment - 6 Dec 2019

good that was my request, if you have time for it ;-)

avatar SharkyKZ SharkyKZ - change - 6 Dec 2019
Labels Removed: ?
avatar SharkyKZ SharkyKZ - change - 6 Dec 2019
The description was changed
avatar SharkyKZ SharkyKZ - edited - 6 Dec 2019
avatar SharkyKZ
SharkyKZ - comment - 6 Dec 2019

PR and description updated. @richard67 @JazParkyn @anibalsanchez please test again.

avatar richard67 richard67 - test_item - 7 Dec 2019 - Tested successfully
avatar richard67
richard67 - comment - 7 Dec 2019

I have tested this item successfully on 14aaae5


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

avatar alikon alikon - test_item - 15 Dec 2019 - Tested successfully
avatar alikon
alikon - comment - 15 Dec 2019

I have tested this item successfully on 14aaae5


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

avatar alikon
alikon - comment - 15 Dec 2019

I have tested this item successfully on 14aaae5


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

avatar alikon alikon - change - 15 Dec 2019
Status Pending Ready to Commit
avatar alikon
alikon - comment - 15 Dec 2019

RTC


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

avatar SharkyKZ SharkyKZ - change - 15 Dec 2019
Labels Added: ?
avatar wilsonge wilsonge - change - 25 Jan 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-01-25 23:49:52
Closed_By wilsonge
avatar wilsonge wilsonge - close - 25 Jan 2020
avatar wilsonge wilsonge - merge - 25 Jan 2020
avatar wilsonge
wilsonge - comment - 25 Jan 2020

Thanks! Adding a docs required tag for this one

Add a Comment

Login with GitHub to post a comment