User tests: Successful: Unsuccessful:
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.
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
When you call the contact via the created link, the email form should be hidden.
The email form still shows up.
N/A
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!
Status | New | ⇒ | Pending |
Category | ⇒ | Front End com_contact |
Labels |
Added:
?
|
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
@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
Makes absolute sense for me...in the current contact implementation it's very bizarre and not consistent...
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
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.
@matrikular please check the conflicts, thanks
Labels |
Added:
?
|
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 |
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.