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

Saving a profile under the name of another profile causes it to be overwritten #70

Closed
MarcMichalsky opened this issue Jun 16, 2023 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@MarcMichalsky
Copy link
Contributor

If you change the name of a profile to that of another, already existing profile, this other profile is overwritten instead of the current profile.

This is probably due to the fact that the storage of the profiles in a database table was implemented later on.

At least at this place the database ID should be used instead of the profile name:

// Verify that a profile with the given name exists.
$profile_name = CRM_Utils_Request::retrieve('name', 'String', $this);
if (!$this->profile = CRM_Twingle_Profile::getProfile($profile_name)) {
$profile_name = NULL;
}

I would be happy to fix this, as this bug indirectly affects the implementation of the Twingle Shop #69.

@bjendres
Copy link
Member

I would be happy to fix this, as this bug indirectly affects the implementation of the Twingle Shop #69.

You'd be very welcome to do so! Just make sure you catch all the cases :)

But even if you change the primary identifier to the ID, we should still make sure profiles cannot have the same name - but that might already be the case anyway...

@bjendres bjendres added the bug Something isn't working label Jun 16, 2023
@bjendres bjendres added this to the 1.5 milestone Jun 16, 2023
@MarcMichalsky
Copy link
Contributor Author

Well, there is already a mechanism to avoid duplicate names.

But you are right, I will include some additional validation for that – and also for the project_ids which should not be defined in more than one profile.

@bjendres
Copy link
Member

I will include some additional validation for that

great.

Just to be sure: you are aware of #42, right?

@MarcMichalsky
Copy link
Contributor Author

Solved in d9e51c6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants