? ? Pending

User tests: Successful: Unsuccessful:

avatar matrikular
matrikular
2 May 2017

Summary of Changes

The parameter cascade / priority for almost all(?) entities in Joomla! works in the same way. In short, the order is (should be) as follows: menu item > entity > category > component / global.

This seems not to be the case for com_contact, where a contact item, even if it was assigned to a menu item, overrules the menu items parameters.

Testing Instructions

Create a contact item, assign a user to it and / or give it a "valid" email address. Also make sure to set the "Contact Form" option in the "Form" tab of that view to "Show".

Next, create a menu item for the single contact and set "Contact Form" in the "Mail Options" tab to "Hide"

Now head over to the com_contact options and click the set "Form" tab. There, set "Contact Form" in the "Form" tab to "Hide".

In Short:
"Contact Form" Option

  • component (global): "Hide"
  • contact item: "Show"
  • menu item: "Hide"

Expected result

When you call the contact via the created link, the email form should be hidden.

Actual result

The email form still shows up.

Documentation Changes Required

N/A

Caveat

While fixing the merge priority for the contact item params, I've tried to add as few lines as possible and as much as needed. The focus of this PR was to fix the behavior (bug) where a single contact item (linked) overrules the menu settings, which it should not.

If there is a bug that shows in another scenario, e.g. where either a category of contacts or [you name it] does not work as expected*, it will still be broken even after this patch and must be addressed in a different / new PR. From what I grasped while strolling through the code, there is a good chance that a few other things are broken in com_contact.

That said, apart from the default layout, I've also changed the value of the custom fields layout params variable because it seemed to be affected by the bug as well.

*adhere to the params cascade / priority

Big thanks to Benjamin for lending me a second pair of eyes!

avatar matrikular matrikular - open - 2 May 2017
avatar matrikular matrikular - change - 2 May 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 May 2017
Category Front End com_contact
avatar matrikular matrikular - change - 2 May 2017
Labels Added: ?
avatar chmst
chmst - comment - 2 May 2017

I have tested this item successfully on 2bdbc52


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

avatar chmst chmst - test_item - 2 May 2017 - Tested successfully
avatar Bakual
Bakual - comment - 2 May 2017

Actually I think it's only com_content which has that special behavior when the menu item is specific to the view/id shown. I know this has raised issues in the past because it is a quite confusing behavior and people don't understand it.

Honestly I think we should consider changing that com_content behavior to a more easy to understand one (item always overrides menu always overrides global) in J4. Eg like it is in com_contact currently.

But that's my personal opinion ?

avatar bembelimen
bembelimen - comment - 2 May 2017

@Bakual could you tell an example of the "better" behavior? I personal think, the com_content behavior is the most logic one...With this behavior it's possible to define individual parameters everytime I need it: - I have two menu items which link to one article, I can define the parameters once in the article or individual for every menu entry

  • I have a category link, so I can define the parameter once in the category (menu item) or individual in the article params

Makes absolute sense for me...in the current contact implementation it's very bizarre and not consistent...

avatar bembelimen
bembelimen - comment - 2 May 2017

I have tested this item successfully on 2bdbc52


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

avatar bembelimen bembelimen - test_item - 2 May 2017 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 3 May 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 May 2017

RTC after two successful tests.

avatar Bakual
Bakual - comment - 3 May 2017

I personal think, the com_content behavior is the most logic one

Myself, I understand the logic just fine. But I had to explain it multiple times here because users didn't get it and in some issues there were even discussions around it. So I think it isn't the most intuitive behaviour we have there.
The issue is mainly that the behavior is different if the active view/id matches the menuitem or not. If it matches, the menuitem takes precedence over the item params. If it is not an exact match, then the item params take precedence over the menuitem params.

I have two menu items which link to one article, I can define the parameters once in the article or individual for every menu entry

Yep, that's the reason for the current code. So you can style the same article different when accessed by two different menu items. However ideally, you should only have one menuitem (=URL) for that article anyway.

I have a category link, so I can define the parameter once in the category (menu item) or individual in the article params

That would work with the simpler "Article -> Menuitem -> Global" structure.

But as said it's just a personal opinion we should imho consider for J4.

avatar rdeutz
rdeutz - comment - 22 May 2017

@matrikular please check the conflicts, thanks

avatar matrikular matrikular - change - 22 May 2017
Labels Added: ?
avatar rdeutz rdeutz - change - 22 May 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-05-22 22:02:26
Closed_By rdeutz
avatar rdeutz rdeutz - close - 22 May 2017
avatar rdeutz rdeutz - merge - 22 May 2017
avatar matrikular matrikular - change - 16 Jul 2020
The description was changed
avatar matrikular matrikular - edited - 16 Jul 2020

Add a Comment

Login with GitHub to post a comment