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

[2011-04-19] Bug in AjaxUniqueTextField #1399

Closed
silverstripe-issues opened this issue Apr 3, 2013 · 1 comment
Closed

[2011-04-19] Bug in AjaxUniqueTextField #1399

silverstripe-issues opened this issue Apr 3, 2013 · 1 comment

Comments

@silverstripe-issues
Copy link

created by: Simon
created at: 2011-04-19
original ticket: http://open.silverstripe.org/ticket/6604


The AjaxUniqueTextField.php does not keep in mind its current page/object. If you want to change a value on a page or dataobject, it will return an error, even though the value is unique.

I've added the check on current ID, so it'll ignore itself. This way, the check is actually on if it is unique.

http://sspaste.com/paste/show/4dad640063ad0

In this little change, the $this->ID needs to be in the AjaxUniqueTextField call at position 5.
Becoming:
new AjaxUniqueTextField($name, $title, $restrictedField, $restrictedTable, $id, $value, $maxLength, $validationURL, $restrictedRegex)

It could probably be done better, but it works.

@wilr
Copy link
Member

wilr commented Jan 12, 2014

AjaxUniqueTextField has been killed off.

@wilr wilr closed this as completed Jan 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants