Attached patches validate if a name already exists prior to updating / inserting rows in the database. This avoids unsightly errors if you attempt to create a support client with a name that already exists, e.g.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

Comments

jeremy’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

Already fixed in 7.x-1.x as part of another patch:
http://drupalcode.org/project/support.git/commit/80bdecd

Needs to be fixed in 6.x-1.x -- re-assigning version.

tinker’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed problem and patch on 6.x-1.x-dev. RTBC in my opinion. Good catch @Jeremy.

tinker’s picture

Status: Reviewed & tested by the community » Needs work

Just hit a snag with the patch when updating an existing client. Need to check if 'clid' is set.

tinker’s picture

Assigned: Unassigned » tinker
Status: Needs work » Needs review
StatusFileSize
new3.46 KB

The previous patches did not check to see if the client is being created or edited. It therefore threw an error when editing an existing client saying the name was taken. The attached patch checks if clid ==0 and only then checks for duplicates in client name and client path. It also limits client path to lowercase alphanumeric, dash, and underscore. This was suggested in the form item description but not implemented. Cleaned up form descriptions to tell users what the limits are before they enter in text.

jeremy’s picture

Status: Needs review » Needs work

Your editor is wrapping long lines -- it should not. This is making it more difficult for me to review your changes.

purencool’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)