- Issue created by @coaston
- 🇮🇳India sidharth_soman Bangalore
I've added a config form for plugging in your custom message. You can find it at /admin/config/allow_only_one/settings.
Apply the patch and let me know if it works fine.
- Status changed to Needs review
over 1 year ago 2:55pm 1 August 2023 - 🇸🇰Slovakia coaston
hi #sidharth_soman,
First of all - thank you for your effort and help, much appreciated.I just tested and everything works as expected.
- 🇮🇳India sidharth_soman Bangalore
Thanks for the feedback!
It just occurred to me that it would be more useful to add a menu link under the configuration tab in the toolbar so that the user can access the form through the UI. I'm attaching a patch for it.
- 🇸🇰Slovakia coaston
Thank you, make sense. And not sure if it is is too difficult to implement but message for bundle would be also fine so there is a different one for other conent types or taxonomies, but not necessary.
- Status changed to Needs work
about 1 month ago 9:37pm 23 October 2024 - 🇺🇸United States swirt Florida
I am sorry it has taken me so long to get to reviewing this.
I have a couple concerns after reviewing patch #5
- The setting link does not appear when on /admin/config
- The setting link does not appear on the module listing on the /admin/modules page
- The new setting does not have any support for tokens, so if you opt for custom message, you lose the ability to output a link to the existing content or output the list of fields that are making up check for a duplicate.
Where I would like to see this go is a setting within the field configuration that lets you customize the message that appears before the link and field list
So the default would look like this
There is existing content: {entity title with link} , with identical values for the following field(s): Title {not case sensitive}, Category.
But adding a custom message would look more like this:
A news item with a title and category that you selected already exist. Please alter either the title or the category. Here is the the existing news item that is preventing you from saving yours: {entity title with link} , with identical values for the following field(s): Title {not case sensitive}, Category.
By having the setting ride with the field instance, it would be possible to customize the message for each use.
A nice-to-have would be to have a token for the link to the existing item and a token for the list of fields.