? ? ? Success

User tests: Successful: Unsuccessful:

avatar phproberto
phproberto
15 Oct 2018

Summary of Changes

This is a resubmission of #13018 because I totally abandoned @Spudley which is the worst I could do with a new contributor :( I'm really sorry mate and I hope you get your contribution merged at least 2 years later. I created a custom email rule for the repo notifications and everything is messed there.

This pull request adds the default layout paths to FormField::getLayoutPaths() so developers can inherit them and add any custom layout path required by their extensions.

Before this patch a developer wanting to set custom layout paths had to do something like:

	protected function getLayoutPaths()
	{
		$renderer = new FileLayout('default');

		return array_merge(
		    array(__DIR__ . '/custom-dir'), 
		    $renderer->getDefaultIncludePaths())
	}

After this patch it should be easier like:

	protected function getLayoutPaths()
	{
		return array_merge(
			[__DIR__ . '/custom-dir'],
			parent::getLayoutPaths()
		);
	}

which should be better because:

  • Parent cares about default include paths.
  • Child classes do not have to explicitly create an instance of FileLayout

This also adds unit tests for FormField::getLayoutPaths().

Testing Instructions

Edit any form containing fields (for instance com_content article) and ensure that form fields are shown correctly.

If you want ot test layout paths customisation you can create a field like it's done in the tests:

https://github.com/phproberto/joomla-cms/blob/formfield-layouts/tests/unit/suites/libraries/joomla/form/_testfields/customlayouts.php

avatar phproberto phproberto - open - 15 Oct 2018
avatar phproberto phproberto - change - 15 Oct 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Oct 2018
Category Libraries Unit Tests
avatar phproberto phproberto - change - 15 Oct 2018
The description was changed
avatar phproberto phproberto - edited - 15 Oct 2018
avatar phproberto phproberto - change - 15 Oct 2018
Labels Added: ? ?
avatar chmst
chmst - comment - 19 Feb 2019

I have tested this item successfully on 683cd61

Tested following the testing instructions, on a localhost, xampp, win10, and the testfield.


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

avatar chmst
chmst - comment - 19 Feb 2019

I have tested this item successfully on 683cd61

Tested following the testing instructions, on a localhost, xampp, win10, and the testfield.


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

avatar chmst chmst - test_item - 19 Feb 2019 - Tested successfully
avatar zero-24 zero-24 - test_item - 26 Feb 2019 - Tested successfully
avatar zero-24
zero-24 - comment - 26 Feb 2019

I have tested this item successfully on 4b6c9fc

Working as intended leaving this to @HLeithner for an merge.


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

avatar zero-24 zero-24 - alter_testresult - 26 Feb 2019 - chmst: Tested successfully
avatar Quy Quy - change - 26 Feb 2019
Status Pending Ready to Commit
avatar Quy
Quy - comment - 26 Feb 2019

RTC


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

avatar HLeithner HLeithner - close - 26 Feb 2019
avatar HLeithner HLeithner - merge - 26 Feb 2019
avatar HLeithner HLeithner - change - 26 Feb 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-02-26 13:22:30
Closed_By HLeithner
Labels Added: ?
avatar HLeithner
HLeithner - comment - 26 Feb 2019

thx

avatar Spudley
Spudley - comment - 26 Feb 2019

thank you 😄

Add a Comment

Login with GitHub to post a comment