I have two com_contact categories and assign different custom fields to these categories in the email form.
This leads to a mess in the frontend. The custom fields do not know to which category
they belong and when switching between the different contact forms,
the fields are alternately assigned to one or the other category.
The issue is located in:
components/com_contact/src/View/Contact/HtmlView.php
The form is displayed before the category is assigned
Line: 136 $this->form = $this->get('Form');
.......
// Add catid for selecting custom fields
$data['catid'] = $item->catid;
Turn around and it works like expected.
Labels |
Added:
No Code Attached Yet
|
@brianteeman If it was that easy for me, I would do that. But it isn't.
I'm sure you are more than capable of doing it. Its really not hard for someone with your skills
Can i work on this issue
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-02-12 11:53:53 |
Closed_By | ⇒ | joomdonation |
@angieradtke Could you please test PR #35763 ? It should address this issue. If it is success, we can backport the change to Joomla 3.10 if required.
@brianteeman thanks for your advice. I always have probs to sync my local branch with my branch om git and and this one with joomla current. The issue is that I not often work on Joomla and my local branch is a lot behind the current Joomla one. So first I have to fetch upstream - and here the chaos starts. I talk to Niels , Hannes etc and they try to help me, but ...
I try with git desktop and my php storm. I remember svn " create patch" and things happen.
Hi Tuan,
your solution is different from mine.
I only change the order of the code in the view.
You are the php coder so I think your solution is the better one. But can you explain me why.
I will test now.
I'm sure they will have told you to always start on a new branch. That way you will never have the issue you refer to. Or for simple pr like this one just do it online as I showed.
@angieradtke In short, the code in view is not needed, so I removed. Normally, view should receive data from model to render/display. For some reasons, here in Contact view, we have strange code to manipulate the data and then pass it back to session for model to use to. It's not right (at least as I understand)
Your solution also solves the problem. But having these lines of code in view is unnecessary (and not right to me, too).
@joomdonation thank you
If you have the solution then please submit a pull request