Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] [3.9] com_contact - custom fields- category #36956

Closed
angieradtke opened this issue Feb 7, 2022 · 12 comments
Closed

[4.0] [3.9] com_contact - custom fields- category #36956

angieradtke opened this issue Feb 7, 2022 · 12 comments

Comments

@angieradtke
Copy link
Contributor

Steps to reproduce the issue

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.

@brianteeman
Copy link
Contributor

If you have the solution then please submit a pull request

@angieradtke
Copy link
Contributor Author

angieradtke commented Feb 7, 2022

@brianteeman If it was that easy for me, I would do that. But it isn't.

@brianteeman
Copy link
Contributor

I'm sure you are more than capable of doing it. Its really not hard for someone with your skills

@joomdonation
Copy link
Contributor

I made PR #35763 sometime ago to fix the issue with Joomla 4. It had some unsuccessful test but I could not see it myself. I will try to look at it again one more time.

@brianteeman
Copy link
Contributor

It is very easy and you should learn

angie

@prakhar3062
Copy link
Contributor

Can i work on this issue

@joomdonation
Copy link
Contributor

@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.

@angieradtke
Copy link
Contributor Author

@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.

@angieradtke
Copy link
Contributor Author

angieradtke commented Feb 13, 2022

@joomdonation

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.

@brianteeman
Copy link
Contributor

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.

@joomdonation
Copy link
Contributor

@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).

@angieradtke
Copy link
Contributor Author

@joomdonation thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants