? Success

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
7 Aug 2015

Issue

As explained in #7649, currently we are required to have a metadata.xml present in the view folder and that file needs to have a title specified.
But that title isn't used for anything, the menumanager (items view) only uses the title from the layout.
If the metadata.xml isn't present, the menumanager will not show the layout title but instead shows the name (as it appears in the URL!) of the view.
See picture for what I mean
menumanager

Solution

This PR proposes to make the whole file optional and as well the title attribute. If the title is specified and it is a translated string, it assumes that the developer wants to show the view title in the menu manager. The following table tries to show what changed. View and Layout column refers to if the file is present and contains a title.

View Layout Before After
X X Component » Layout Component » View » Layout
X - Component Component » View
- X Component » Untranslated Viewname (URL) Component » Layout
- - Component » Untranslated Viewname (URL) Component » Untranslated Viewname (URL)

Backward Compatibility

As you see in the above table, there is some difference in behavior. Hopefully you all agree that it makes more sense now :smile:
To avoid showing now untranslated view strings (remember, those are currently required to be in the view metadata,xml!), I added a check into that part which only shows the view title if the string is in the language file.
You can test this easily with menu items from com_content. All metadata.xml files from this extension contain an untranslated title there. So those should not show up after the PR is applied.

Testing

After applying patch, there should be no difference for most extensions.
The only core extension which will have a difference is com_wrapper. Instead of "Wrapper » Iframe Wrapper" it will now show "Wrapper » Wrapper » Iframe Wrapper".
Com_content should behave the same because the view title isn't translated.
To test, you can delete the metadata.xml of a given view and see if something changes. For the wrapper, the view should vanish and only the layout show. For com_content menuitems there should be no change.
If you delete both the xml for the layout (usually default.xml) and the view (metadata.xml) you will see that untranslated viewname from the URL.

avatar Bakual Bakual - open - 7 Aug 2015
avatar Bakual Bakual - change - 7 Aug 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Aug 2015
Labels Added: ?
avatar brianteeman
brianteeman - comment - 7 Aug 2015

Excuse me for being thick but what is the benefit of showing
wrapper-wrapper-iframewrapper

avatar Bakual
Bakual - comment - 8 Aug 2015

Excuse me for being thick but what is the benefit of showing wrapper-wrapper-iframewrapper

There is no benefit here. It could easily be removed by removing the title from the metadata.xml.
It was there before and because it is actually translated (but never was shown before) it now shows up.
I left it there so it's easier to test the PR. I can remove it in another PR.

avatar zero-24 zero-24 - change - 9 Aug 2015
Easy No Yes
avatar zero-24 zero-24 - change - 9 Aug 2015
Category Libraries
avatar piotr-cz
piotr-cz - comment - 13 Aug 2015

I was always super confused about this file.
And even more about the metadata.xml file straight in some component directories.

avatar Bakual
Bakual - comment - 13 Aug 2015

I was always super confused about this file.
And even more about the metadata.xml file straight in some component directories.

It's actually a nice feature. That metadata.xml can contain parameters for a view instead of adding it to the layout files. In my own component I use that to avoid having to copy-paste each parameter for each layout (my layout files are just showing the same data in different layouts).

As for the metadata.xml in the component directory, that one is useless in that case. However it could be used to specify parameters which then would be used component wide (if no view or layout xml is found).

avatar piotr-cz
piotr-cz - comment - 14 Aug 2015

I'd vote for removal of components metadata.xml file if it's not doing anything ATM. At least for me it's confusing and I spent some time to reverse-engineer Joomla code to find out what is it for (nothing).

Ony when there is some functionality implemented, I'd reintroduce it again.

avatar Bakual
Bakual - comment - 14 Aug 2015

Feel free to propose a PR which removes the (empty) component metadata.xml from core where present. It's not in the scope of this PR. :)
It's just useless if there are no params defined in it, like the one you linked. If you have params, the code currently supports it.

avatar Harmageddon Harmageddon - test_item - 28 Sep 2015 - Tested successfully
avatar Harmageddon
Harmageddon - comment - 28 Sep 2015

I have tested this item :white_check_mark: successfully on

Edit: The Issues tool cut my comment...
Tested with the "All Frontend Views" menu from the testing sample data as well as with an own component that has no metadata.xml files. Looks fine to me.


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

avatar zero-24
zero-24 - comment - 15 Oct 2015

@Bakual can you sync to fix the conflicts here?

avatar joomla-cms-bot
joomla-cms-bot - comment - 15 Oct 2015

This PR has received new commits.

CC: @Harmageddon


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

avatar Bakual
Bakual - comment - 15 Oct 2015

@zero-24 As you wish :smile:

avatar zero-24 zero-24 - test_item - 15 Oct 2015 - Tested successfully
avatar zero-24
zero-24 - comment - 15 Oct 2015

I have tested this item :white_check_mark: successfully on 806c549

I can confirm that the behavior for com_wrapper is changed. ;)


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

avatar Harmageddon Harmageddon - test_item - 15 Oct 2015 - Tested successfully
avatar Harmageddon
Harmageddon - comment - 15 Oct 2015

I have tested this item :white_check_mark: successfully on 806c549

Tested again as before.


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

avatar zero-24 zero-24 - change - 15 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 15 Oct 2015
Milestone Added:
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 15 Oct 2015

RTC. thanks


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

avatar joomla-cms-bot joomla-cms-bot - change - 15 Oct 2015
Labels Added: ?
avatar rdeutz rdeutz - change - 17 Oct 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-10-17 10:16:47
Closed_By rdeutz
avatar rdeutz rdeutz - close - 17 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - close - 17 Oct 2015
avatar rdeutz rdeutz - reference | b630787 - 17 Oct 15
avatar rdeutz rdeutz - merge - 17 Oct 2015
avatar rdeutz rdeutz - close - 17 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - change - 17 Oct 2015
Labels Removed: ?
avatar Bakual Bakual - head_ref_deleted - 17 Oct 2015
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone

Add a Comment

Login with GitHub to post a comment