? ? Pending

User tests: Successful: 2 ceford, laoneo Unsuccessful: 0

avatar Denitz
Denitz
7 Oct 2020

Summary of Changes

Joomla 4 code is mostly prioritised to load layouts and their xml files from /components/com_component/tmpl folder but not from /components/com_component/views/xxxx/tmpl.

But when editing the menu item, the Joomla3-style /components/com_component/views/xxxx/tmpl/layout.xml is still loaded instead of Joomla4-style /components/com_component/tmpl/xxxx/layout.xml.

Same for "componentlayout" field.

Testing Instructions

Try to edit menu items of a component which as Joomla3-style /views folder and Joomla4-style /tmpl folder.

Actual result BEFORE applying this Pull Request

See that Joomla3-style layouts are loaded.

Expected result AFTER applying this Pull Request

Joomla4-style layouts are loaded.

Documentation Changes Required

No.

9b54861 7 Oct 2020 avatar Denitz fix
avatar Denitz Denitz - open - 7 Oct 2020
avatar Denitz Denitz - change - 7 Oct 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Oct 2020
Category Administration com_menus Libraries
avatar ceford ceford - test_item - 8 Oct 2020 - Tested successfully
avatar ceford
ceford - comment - 8 Oct 2020

I have tested this item successfully on 9b54861

Tricky! I added a Joomla 3 style tmpl structure to com_contacts and added this to the default xml files for both cases:

  	<field
  	name="test"
  	type="text"
  	label="Test in J4 style"
  	default="test"
  	/>

With J3 or J4 as appropriate.
Without the patch the field appeared with the J3 label in the Details tab immediately beneath the Menu Item Type field.
With the patch the field appeared with the J4 label in the Details tab immediately beneath the Menu Item Type field. QED!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30983.
avatar laoneo
laoneo - comment - 8 Oct 2020

@Denitz do you have then some views in /tmpl and some in /views/$view/tmpl in the same installation package?

avatar Denitz
Denitz - comment - 8 Oct 2020

@laoneo Yes, I have a component which is expected to work on both J3 and J4.

Hence, it has J3-style /views/xxx/tmpl/xxx.[xml|php] and J4-style /tmpl/xxx/xxx.[xml|php] layouts.

J3 loads as usual via /views/xxx/tmpl/xxx.[xml|php] but J4 should prioritize its new /tmpl/xxx/xxx.[xml|php].

It's the usual task: we already separated the J4 code in /src, only layouts are left. The HtmlView in J4 already prioritises /tmpl/$viewName as the primary template folder. This patch is just the final step.

avatar laoneo
laoneo - comment - 8 Oct 2020

Ok, I'm using the same layout files for both versions in DPCalendar but it is legit to have different layout files per Joomla major.

avatar Denitz
Denitz - comment - 8 Oct 2020

@HLeithner Please check again, Allon has accepted this. Sorry for being so impatient, just want to see this PR merged in the nightly build to continue working on J4-specific layouts.

avatar HLeithner
HLeithner - comment - 8 Oct 2020

Needs a second test

avatar laoneo laoneo - test_item - 11 Oct 2020 - Tested successfully
avatar laoneo
laoneo - comment - 11 Oct 2020

I have tested this item successfully on 9b54861


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

avatar richard67 richard67 - change - 11 Oct 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 11 Oct 2020

RTC


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

avatar richard67 richard67 - change - 11 Oct 2020
Labels Added: ? ?
avatar HLeithner HLeithner - change - 11 Oct 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-10-11 18:18:31
Closed_By HLeithner
Labels
avatar HLeithner HLeithner - close - 11 Oct 2020
avatar HLeithner HLeithner - merge - 11 Oct 2020
avatar HLeithner
HLeithner - comment - 11 Oct 2020

Thanks

Add a Comment

Login with GitHub to post a comment