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

[5.3] Customfields: Also look at context when checking uniqueness #44161

Open
wants to merge 1 commit into
base: 5.3-dev
Choose a base branch
from

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Sep 29, 2024

Pull Request for Issue #44154 .

Summary of Changes

Customfields should only be uniquely named per context, so you should be able to have a field test in both articles and users. So far this is prohibited and you can only name a field uniquely system wide. This PR should fix that.

Testing Instructions

Create a customfield with name test in articles and in users.

Actual result BEFORE applying this Pull Request

Creating the second field is denied.

Expected result AFTER applying this Pull Request

Both fields can be saved.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@brianteeman
Copy link
Contributor

The error message needs to be updated as currently it says
COM_FIELDS_ERROR_UNIQUE_NAME="Another Field has the same name (remember it may be a trashed item or it may be already present as a custom field in another extension)."

It can now be simplified and made more consistent with other strings eg
COM_FIELDS_ERROR_UNIQUE_NAME="Another Field has the same name (remember it may be a trashed item)."

@Fedik Fedik added the bug label Sep 30, 2024
@fgsw
Copy link

fgsw commented Oct 2, 2024

I have tested this item ✅ successfully on 58ccfe1

Test same Field name on

  • Content
    • Articles
    • Category
  • Contact
    • Contact
    • Mail
    • Category
  • Users

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

@Quy Quy added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Oct 2, 2024
@BertaOctech
Copy link

I have tested this item ✅ successfully on 58ccfe1

I tried to create a custom field in Content and Users with the same name.
It was not possible until I applied the patch.
Later on I used both the user field and the content field and each one kept its value and appeared in the correct place.


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

@laoneo
Copy link
Member

laoneo commented Oct 5, 2024

@Hackwar can you also change the text in the mentioned string from @brianteeman?

@laoneo laoneo self-assigned this Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug PR-5.3-dev Updates Requested Indicates that this pull request needs an update from the author and should not be tested.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants